Mercurial > hg > nginx
annotate src/event/quic/ngx_event_quic_connection.h @ 9250:55a5a40dccde
Reordered checks for Content-Length and Transfer-Encoding.
This ensures that r->headers_in.content_length_n is not set when both
Content-Length and Transfer-Encoding headers are present, making it slightly
safer to use complex processing for 400 (Bad Request) errors.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 27 Apr 2024 18:16:27 +0300 |
parents | 6c8595b77e66 |
children |
rev | line source |
---|---|
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
1 /* |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
2 * Copyright (C) Nginx, Inc. |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
3 */ |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
4 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
5 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
6 #ifndef _NGX_EVENT_QUIC_CONNECTION_H_INCLUDED_ |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
7 #define _NGX_EVENT_QUIC_CONNECTION_H_INCLUDED_ |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
8 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
9 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
10 #include <ngx_config.h> |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
11 #include <ngx_core.h> |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
12 #include <ngx_event.h> |
8747 | 13 |
8764
0bd1dd39a08b
QUIC: fixed build with NGX_QUIC_DEBUG_ALLOC enabled.
Vladimir Homutov <vl@nginx.com>
parents:
8763
diff
changeset
|
14 |
0bd1dd39a08b
QUIC: fixed build with NGX_QUIC_DEBUG_ALLOC enabled.
Vladimir Homutov <vl@nginx.com>
parents:
8763
diff
changeset
|
15 /* #define NGX_QUIC_DEBUG_PACKETS */ /* dump packet contents */ |
0bd1dd39a08b
QUIC: fixed build with NGX_QUIC_DEBUG_ALLOC enabled.
Vladimir Homutov <vl@nginx.com>
parents:
8763
diff
changeset
|
16 /* #define NGX_QUIC_DEBUG_FRAMES */ /* dump frames contents */ |
0bd1dd39a08b
QUIC: fixed build with NGX_QUIC_DEBUG_ALLOC enabled.
Vladimir Homutov <vl@nginx.com>
parents:
8763
diff
changeset
|
17 /* #define NGX_QUIC_DEBUG_ALLOC */ /* log frames and bufs alloc */ |
0bd1dd39a08b
QUIC: fixed build with NGX_QUIC_DEBUG_ALLOC enabled.
Vladimir Homutov <vl@nginx.com>
parents:
8763
diff
changeset
|
18 /* #define NGX_QUIC_DEBUG_CRYPTO */ |
0bd1dd39a08b
QUIC: fixed build with NGX_QUIC_DEBUG_ALLOC enabled.
Vladimir Homutov <vl@nginx.com>
parents:
8763
diff
changeset
|
19 |
8755
b4e6b7049984
QUIC: normalize header inclusion.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8754
diff
changeset
|
20 typedef struct ngx_quic_connection_s ngx_quic_connection_t; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
21 typedef struct ngx_quic_server_id_s ngx_quic_server_id_t; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
22 typedef struct ngx_quic_client_id_s ngx_quic_client_id_t; |
8755
b4e6b7049984
QUIC: normalize header inclusion.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8754
diff
changeset
|
23 typedef struct ngx_quic_send_ctx_s ngx_quic_send_ctx_t; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
24 typedef struct ngx_quic_socket_s ngx_quic_socket_t; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
25 typedef struct ngx_quic_path_s ngx_quic_path_t; |
8755
b4e6b7049984
QUIC: normalize header inclusion.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8754
diff
changeset
|
26 typedef struct ngx_quic_keys_s ngx_quic_keys_t; |
b4e6b7049984
QUIC: normalize header inclusion.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8754
diff
changeset
|
27 |
9080
7da4791e0264
QUIC: OpenSSL compatibility layer.
Roman Arutyunyan <arut@nginx.com>
parents:
9017
diff
changeset
|
28 #if (NGX_QUIC_OPENSSL_COMPAT) |
7da4791e0264
QUIC: OpenSSL compatibility layer.
Roman Arutyunyan <arut@nginx.com>
parents:
9017
diff
changeset
|
29 #include <ngx_event_quic_openssl_compat.h> |
7da4791e0264
QUIC: OpenSSL compatibility layer.
Roman Arutyunyan <arut@nginx.com>
parents:
9017
diff
changeset
|
30 #endif |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
31 #include <ngx_event_quic_transport.h> |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
32 #include <ngx_event_quic_protection.h> |
8749
660c4a2f95f3
QUIC: separate files for frames related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8748
diff
changeset
|
33 #include <ngx_event_quic_frames.h> |
8747 | 34 #include <ngx_event_quic_migration.h> |
8748
e0cb1e58ca13
QUIC: separate files for connection id related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8747
diff
changeset
|
35 #include <ngx_event_quic_connid.h> |
8750
41807e581de9
QUIC: separate files for stream related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8749
diff
changeset
|
36 #include <ngx_event_quic_streams.h> |
8753
46161c610919
QUIC: separate files for SSL library interfaces.
Vladimir Homutov <vl@nginx.com>
parents:
8752
diff
changeset
|
37 #include <ngx_event_quic_ssl.h> |
8752
e19723c40d28
QUIC: separate files for tokens related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8751
diff
changeset
|
38 #include <ngx_event_quic_tokens.h> |
8751
bc910a5ec737
QUIC: separate files for output and ack related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8750
diff
changeset
|
39 #include <ngx_event_quic_ack.h> |
bc910a5ec737
QUIC: separate files for output and ack related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8750
diff
changeset
|
40 #include <ngx_event_quic_output.h> |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
41 #include <ngx_event_quic_socket.h> |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
42 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
43 |
8797
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8792
diff
changeset
|
44 /* RFC 9002, 6.2.2. Handshakes and New Paths: kInitialRtt */ |
8747 | 45 #define NGX_QUIC_INITIAL_RTT 333 /* ms */ |
46 | |
8748
e0cb1e58ca13
QUIC: separate files for connection id related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8747
diff
changeset
|
47 #define NGX_QUIC_UNSET_PN (uint64_t) -1 |
8747 | 48 |
49 #define NGX_QUIC_SEND_CTX_LAST (NGX_QUIC_ENCRYPTION_LAST - 1) | |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
50 |
8737
76f476ce4d31
QUIC: distinct files for connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8736
diff
changeset
|
51 /* 0-RTT and 1-RTT data exist in the same packet number space, |
76f476ce4d31
QUIC: distinct files for connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8736
diff
changeset
|
52 * so we have 3 packet number spaces: |
76f476ce4d31
QUIC: distinct files for connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8736
diff
changeset
|
53 * |
76f476ce4d31
QUIC: distinct files for connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8736
diff
changeset
|
54 * 0 - Initial |
76f476ce4d31
QUIC: distinct files for connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8736
diff
changeset
|
55 * 1 - Handshake |
76f476ce4d31
QUIC: distinct files for connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8736
diff
changeset
|
56 * 2 - 0-RTT and 1-RTT |
76f476ce4d31
QUIC: distinct files for connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8736
diff
changeset
|
57 */ |
76f476ce4d31
QUIC: distinct files for connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8736
diff
changeset
|
58 #define ngx_quic_get_send_ctx(qc, level) \ |
76f476ce4d31
QUIC: distinct files for connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8736
diff
changeset
|
59 ((level) == ssl_encryption_initial) ? &((qc)->send_ctx[0]) \ |
76f476ce4d31
QUIC: distinct files for connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8736
diff
changeset
|
60 : (((level) == ssl_encryption_handshake) ? &((qc)->send_ctx[1]) \ |
76f476ce4d31
QUIC: distinct files for connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8736
diff
changeset
|
61 : &((qc)->send_ctx[2])) |
76f476ce4d31
QUIC: distinct files for connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8736
diff
changeset
|
62 |
8747 | 63 #define ngx_quic_get_connection(c) \ |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
64 (((c)->udp) ? (((ngx_quic_socket_t *)((c)->udp))->quic) : NULL) |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
65 |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
66 #define ngx_quic_get_socket(c) ((ngx_quic_socket_t *)((c)->udp)) |
8747 | 67 |
9195
ff452f283aa9
QUIC: reset RTT estimator for the new path.
Sergey Kandaurov <pluknet@nginx.com>
parents:
9194
diff
changeset
|
68 #define ngx_quic_init_rtt(qc) \ |
ff452f283aa9
QUIC: reset RTT estimator for the new path.
Sergey Kandaurov <pluknet@nginx.com>
parents:
9194
diff
changeset
|
69 (qc)->avg_rtt = NGX_QUIC_INITIAL_RTT; \ |
ff452f283aa9
QUIC: reset RTT estimator for the new path.
Sergey Kandaurov <pluknet@nginx.com>
parents:
9194
diff
changeset
|
70 (qc)->rttvar = NGX_QUIC_INITIAL_RTT / 2; \ |
ff452f283aa9
QUIC: reset RTT estimator for the new path.
Sergey Kandaurov <pluknet@nginx.com>
parents:
9194
diff
changeset
|
71 (qc)->min_rtt = NGX_TIMER_INFINITE; \ |
ff452f283aa9
QUIC: reset RTT estimator for the new path.
Sergey Kandaurov <pluknet@nginx.com>
parents:
9194
diff
changeset
|
72 (qc)->first_rtt = NGX_TIMER_INFINITE; \ |
ff452f283aa9
QUIC: reset RTT estimator for the new path.
Sergey Kandaurov <pluknet@nginx.com>
parents:
9194
diff
changeset
|
73 (qc)->latest_rtt = 0; |
ff452f283aa9
QUIC: reset RTT estimator for the new path.
Sergey Kandaurov <pluknet@nginx.com>
parents:
9194
diff
changeset
|
74 |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
75 |
9147
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
76 typedef enum { |
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
77 NGX_QUIC_PATH_IDLE = 0, |
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
78 NGX_QUIC_PATH_VALIDATING, |
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
79 NGX_QUIC_PATH_WAITING, |
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
80 NGX_QUIC_PATH_MTUD |
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
81 } ngx_quic_path_state_e; |
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
82 |
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
83 |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
84 struct ngx_quic_client_id_s { |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
85 ngx_queue_t queue; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
86 uint64_t seqnum; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
87 size_t len; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
88 u_char id[NGX_QUIC_CID_LEN_MAX]; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
89 u_char sr_token[NGX_QUIC_SR_TOKEN_LEN]; |
8971
1e2f4e9c8195
QUIC: reworked migration handling.
Vladimir Homutov <vl@nginx.com>
parents:
8950
diff
changeset
|
90 ngx_uint_t used; /* unsigned used:1; */ |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
91 }; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
92 |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
93 |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
94 struct ngx_quic_server_id_s { |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
95 uint64_t seqnum; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
96 size_t len; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
97 u_char id[NGX_QUIC_CID_LEN_MAX]; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
98 }; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
99 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
100 |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
101 struct ngx_quic_path_s { |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
102 ngx_queue_t queue; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
103 struct sockaddr *sockaddr; |
8971
1e2f4e9c8195
QUIC: reworked migration handling.
Vladimir Homutov <vl@nginx.com>
parents:
8950
diff
changeset
|
104 ngx_sockaddr_t sa; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
105 socklen_t socklen; |
8971
1e2f4e9c8195
QUIC: reworked migration handling.
Vladimir Homutov <vl@nginx.com>
parents:
8950
diff
changeset
|
106 ngx_quic_client_id_t *cid; |
9147
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
107 ngx_quic_path_state_e state; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
108 ngx_msec_t expires; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
109 ngx_uint_t tries; |
8971
1e2f4e9c8195
QUIC: reworked migration handling.
Vladimir Homutov <vl@nginx.com>
parents:
8950
diff
changeset
|
110 ngx_uint_t tag; |
9147
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
111 size_t mtu; |
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
112 size_t mtud; |
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
113 size_t max_mtu; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
114 off_t sent; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
115 off_t received; |
9189
fcec773dd249
QUIC: avoid partial expansion of PATH_CHALLENGE/PATH_RESPONSE.
Roman Arutyunyan <arut@nginx.com>
parents:
9152
diff
changeset
|
116 u_char challenge[2][8]; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
117 uint64_t seqnum; |
9147
58afcd72446f
QUIC: path MTU discovery.
Roman Arutyunyan <arut@nginx.com>
parents:
9144
diff
changeset
|
118 uint64_t mtu_pnum[NGX_QUIC_PATH_RETRIES]; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
119 ngx_str_t addr_text; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
120 u_char text[NGX_SOCKADDR_STRLEN]; |
9194
a6f79f044de5
QUIC: path revalidation after expansion failure.
Roman Arutyunyan <arut@nginx.com>
parents:
9189
diff
changeset
|
121 unsigned validated:1; |
a6f79f044de5
QUIC: path revalidation after expansion failure.
Roman Arutyunyan <arut@nginx.com>
parents:
9189
diff
changeset
|
122 unsigned mtu_unvalidated:1; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
123 }; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
124 |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
125 |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
126 struct ngx_quic_socket_s { |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
127 ngx_udp_connection_t udp; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
128 ngx_quic_connection_t *quic; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
129 ngx_queue_t queue; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
130 ngx_quic_server_id_t sid; |
9017
c2f5d79cde64
QUIC: separate UDP framework for QUIC.
Roman Arutyunyan <arut@nginx.com>
parents:
9011
diff
changeset
|
131 ngx_sockaddr_t sockaddr; |
c2f5d79cde64
QUIC: separate UDP framework for QUIC.
Roman Arutyunyan <arut@nginx.com>
parents:
9011
diff
changeset
|
132 socklen_t socklen; |
8971
1e2f4e9c8195
QUIC: reworked migration handling.
Vladimir Homutov <vl@nginx.com>
parents:
8950
diff
changeset
|
133 ngx_uint_t used; /* unsigned used:1; */ |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
134 }; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
135 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
136 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
137 typedef struct { |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
138 ngx_rbtree_t tree; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
139 ngx_rbtree_node_t sentinel; |
9010 | 140 |
8827
fe919fd63b0b
QUIC: client certificate validation with OCSP.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8822
diff
changeset
|
141 ngx_queue_t uninitialized; |
9010 | 142 ngx_queue_t free; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
143 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
144 uint64_t sent; |
8791
af33d1ef1c3c
QUIC: stream flow control refactored.
Roman Arutyunyan <arut@nginx.com>
parents:
8782
diff
changeset
|
145 uint64_t recv_offset; |
af33d1ef1c3c
QUIC: stream flow control refactored.
Roman Arutyunyan <arut@nginx.com>
parents:
8782
diff
changeset
|
146 uint64_t recv_window; |
af33d1ef1c3c
QUIC: stream flow control refactored.
Roman Arutyunyan <arut@nginx.com>
parents:
8782
diff
changeset
|
147 uint64_t recv_last; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
148 uint64_t recv_max_data; |
9010 | 149 uint64_t send_offset; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
150 uint64_t send_max_data; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
151 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
152 uint64_t server_max_streams_uni; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
153 uint64_t server_max_streams_bidi; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
154 uint64_t server_streams_uni; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
155 uint64_t server_streams_bidi; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
156 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
157 uint64_t client_max_streams_uni; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
158 uint64_t client_max_streams_bidi; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
159 uint64_t client_streams_uni; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
160 uint64_t client_streams_bidi; |
8827
fe919fd63b0b
QUIC: client certificate validation with OCSP.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8822
diff
changeset
|
161 |
fe919fd63b0b
QUIC: client certificate validation with OCSP.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8822
diff
changeset
|
162 ngx_uint_t initialized; |
fe919fd63b0b
QUIC: client certificate validation with OCSP.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8822
diff
changeset
|
163 /* unsigned initialized:1; */ |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
164 } ngx_quic_streams_t; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
165 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
166 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
167 typedef struct { |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
168 size_t in_flight; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
169 size_t window; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
170 size_t ssthresh; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
171 ngx_msec_t recovery_start; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
172 } ngx_quic_congestion_t; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
173 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
174 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
175 /* |
8797
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8792
diff
changeset
|
176 * RFC 9000, 12.3. Packet Numbers |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
177 * |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
178 * Conceptually, a packet number space is the context in which a packet |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
179 * can be processed and acknowledged. Initial packets can only be sent |
8797
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8792
diff
changeset
|
180 * with Initial packet protection keys and acknowledged in packets that |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
181 * are also Initial packets. |
8797
4715f3e669f1
QUIC: updated specification references.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8792
diff
changeset
|
182 */ |
8751
bc910a5ec737
QUIC: separate files for output and ack related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8750
diff
changeset
|
183 struct ngx_quic_send_ctx_s { |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
184 enum ssl_encryption_level_t level; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
185 |
9011
f9c788f3f5cc
QUIC: ngx_quic_buffer_t object.
Roman Arutyunyan <arut@nginx.com>
parents:
9010
diff
changeset
|
186 ngx_quic_buffer_t crypto; |
8782
b3f6ad181df4
QUIC: refactored CRYPTO and STREAM buffer ordering.
Roman Arutyunyan <arut@nginx.com>
parents:
8764
diff
changeset
|
187 uint64_t crypto_sent; |
b3f6ad181df4
QUIC: refactored CRYPTO and STREAM buffer ordering.
Roman Arutyunyan <arut@nginx.com>
parents:
8764
diff
changeset
|
188 |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
189 uint64_t pnum; /* to be sent */ |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
190 uint64_t largest_ack; /* received from peer */ |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
191 uint64_t largest_pn; /* received from peer */ |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
192 |
8822
ad046179eb91
QUIC: handle EAGAIN properly on UDP sockets.
Vladimir Homutov <vl@nginx.com>
parents:
8797
diff
changeset
|
193 ngx_queue_t frames; /* generated frames */ |
ad046179eb91
QUIC: handle EAGAIN properly on UDP sockets.
Vladimir Homutov <vl@nginx.com>
parents:
8797
diff
changeset
|
194 ngx_queue_t sending; /* frames assigned to pkt */ |
ad046179eb91
QUIC: handle EAGAIN properly on UDP sockets.
Vladimir Homutov <vl@nginx.com>
parents:
8797
diff
changeset
|
195 ngx_queue_t sent; /* frames waiting ACK */ |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
196 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
197 uint64_t pending_ack; /* non sent ack-eliciting */ |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
198 uint64_t largest_range; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
199 uint64_t first_range; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
200 ngx_msec_t largest_received; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
201 ngx_msec_t ack_delay_start; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
202 ngx_uint_t nranges; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
203 ngx_quic_ack_range_t ranges[NGX_QUIC_MAX_RANGES]; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
204 ngx_uint_t send_ack; |
8751
bc910a5ec737
QUIC: separate files for output and ack related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8750
diff
changeset
|
205 }; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
206 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
207 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
208 struct ngx_quic_connection_s { |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
209 uint32_t version; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
210 |
8971
1e2f4e9c8195
QUIC: reworked migration handling.
Vladimir Homutov <vl@nginx.com>
parents:
8950
diff
changeset
|
211 ngx_quic_path_t *path; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
212 |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
213 ngx_queue_t sockets; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
214 ngx_queue_t paths; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
215 ngx_queue_t client_ids; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
216 ngx_queue_t free_sockets; |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
217 ngx_queue_t free_paths; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
218 ngx_queue_t free_client_ids; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
219 |
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
220 ngx_uint_t nsockets; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
221 ngx_uint_t nclient_ids; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
222 uint64_t max_retired_seqnum; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
223 uint64_t client_seqnum; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
224 uint64_t server_seqnum; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
225 uint64_t path_seqnum; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
226 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
227 ngx_quic_tp_t tp; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
228 ngx_quic_tp_t ctp; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
229 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
230 ngx_quic_send_ctx_t send_ctx[NGX_QUIC_SEND_CTX_LAST]; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
231 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
232 ngx_quic_keys_t *keys; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
233 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
234 ngx_quic_conf_t *conf; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
235 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
236 ngx_event_t push; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
237 ngx_event_t pto; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
238 ngx_event_t close; |
8763
4117aa7fa38e
QUIC: connection migration.
Vladimir Homutov <vl@nginx.com>
parents:
8755
diff
changeset
|
239 ngx_event_t path_validation; |
9152
2880f60a80c3
QUIC: posted generating TLS Key Update next keys.
Sergey Kandaurov <pluknet@nginx.com>
parents:
9147
diff
changeset
|
240 ngx_event_t key_update; |
2880f60a80c3
QUIC: posted generating TLS Key Update next keys.
Sergey Kandaurov <pluknet@nginx.com>
parents:
9147
diff
changeset
|
241 |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
242 ngx_msec_t last_cc; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
243 |
8792
004172345bdc
QUIC: persistent congestion calculation.
Vladimir Homutov <vl@nginx.com>
parents:
8791
diff
changeset
|
244 ngx_msec_t first_rtt; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
245 ngx_msec_t latest_rtt; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
246 ngx_msec_t avg_rtt; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
247 ngx_msec_t min_rtt; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
248 ngx_msec_t rttvar; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
249 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
250 ngx_uint_t pto_count; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
251 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
252 ngx_queue_t free_frames; |
8950
fb811b6c76ee
QUIC: refactored buffer allocation, spliting and freeing.
Roman Arutyunyan <arut@nginx.com>
parents:
8940
diff
changeset
|
253 ngx_buf_t *free_bufs; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
254 ngx_buf_t *free_shadow_bufs; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
255 |
8883
404de224517e
QUIC: limited the total number of frames.
Roman Arutyunyan <arut@nginx.com>
parents:
8882
diff
changeset
|
256 ngx_uint_t nframes; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
257 #ifdef NGX_QUIC_DEBUG_ALLOC |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
258 ngx_uint_t nbufs; |
8950
fb811b6c76ee
QUIC: refactored buffer allocation, spliting and freeing.
Roman Arutyunyan <arut@nginx.com>
parents:
8940
diff
changeset
|
259 ngx_uint_t nshadowbufs; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
260 #endif |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
261 |
9080
7da4791e0264
QUIC: OpenSSL compatibility layer.
Roman Arutyunyan <arut@nginx.com>
parents:
9017
diff
changeset
|
262 #if (NGX_QUIC_OPENSSL_COMPAT) |
7da4791e0264
QUIC: OpenSSL compatibility layer.
Roman Arutyunyan <arut@nginx.com>
parents:
9017
diff
changeset
|
263 ngx_quic_compat_t *compat; |
7da4791e0264
QUIC: OpenSSL compatibility layer.
Roman Arutyunyan <arut@nginx.com>
parents:
9017
diff
changeset
|
264 #endif |
7da4791e0264
QUIC: OpenSSL compatibility layer.
Roman Arutyunyan <arut@nginx.com>
parents:
9017
diff
changeset
|
265 |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
266 ngx_quic_streams_t streams; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
267 ngx_quic_congestion_t congestion; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
268 |
9196
6c8595b77e66
QUIC: path aware in-flight bytes accounting.
Sergey Kandaurov <pluknet@nginx.com>
parents:
9195
diff
changeset
|
269 uint64_t rst_pnum; /* first on validated path */ |
6c8595b77e66
QUIC: path aware in-flight bytes accounting.
Sergey Kandaurov <pluknet@nginx.com>
parents:
9195
diff
changeset
|
270 |
8882
6204120cf37f
QUIC: traffic-based flood detection.
Roman Arutyunyan <arut@nginx.com>
parents:
8827
diff
changeset
|
271 off_t received; |
6204120cf37f
QUIC: traffic-based flood detection.
Roman Arutyunyan <arut@nginx.com>
parents:
8827
diff
changeset
|
272 |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
273 ngx_uint_t error; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
274 enum ssl_encryption_level_t error_level; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
275 ngx_uint_t error_ftype; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
276 const char *error_reason; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
277 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
278 ngx_uint_t shutdown_code; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
279 const char *shutdown_reason; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
280 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
281 unsigned error_app:1; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
282 unsigned send_timer_set:1; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
283 unsigned closing:1; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
284 unsigned shutdown:1; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
285 unsigned draining:1; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
286 unsigned key_phase:1; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
287 unsigned validated:1; |
8897
1d7bf9778328
QUIC: converted client_tp_done to bitfield.
Vladimir Homutov <vl@nginx.com>
parents:
8883
diff
changeset
|
288 unsigned client_tp_done:1; |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
289 }; |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
290 |
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
291 |
8753
46161c610919
QUIC: separate files for SSL library interfaces.
Vladimir Homutov <vl@nginx.com>
parents:
8752
diff
changeset
|
292 ngx_int_t ngx_quic_apply_transport_params(ngx_connection_t *c, |
46161c610919
QUIC: separate files for SSL library interfaces.
Vladimir Homutov <vl@nginx.com>
parents:
8752
diff
changeset
|
293 ngx_quic_tp_t *ctp); |
46161c610919
QUIC: separate files for SSL library interfaces.
Vladimir Homutov <vl@nginx.com>
parents:
8752
diff
changeset
|
294 void ngx_quic_discard_ctx(ngx_connection_t *c, |
46161c610919
QUIC: separate files for SSL library interfaces.
Vladimir Homutov <vl@nginx.com>
parents:
8752
diff
changeset
|
295 enum ssl_encryption_level_t level); |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
296 void ngx_quic_close_connection(ngx_connection_t *c, ngx_int_t rc); |
8751
bc910a5ec737
QUIC: separate files for output and ack related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8750
diff
changeset
|
297 void ngx_quic_shutdown_quic(ngx_connection_t *c); |
8736
714e9af983de
QUIC: separate header for ngx_quic_connection_t.
Vladimir Homutov <vl@nginx.com>
parents:
diff
changeset
|
298 |
8751
bc910a5ec737
QUIC: separate files for output and ack related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8750
diff
changeset
|
299 #if (NGX_DEBUG) |
bc910a5ec737
QUIC: separate files for output and ack related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8750
diff
changeset
|
300 void ngx_quic_connstate_dbg(ngx_connection_t *c); |
bc910a5ec737
QUIC: separate files for output and ack related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8750
diff
changeset
|
301 #else |
bc910a5ec737
QUIC: separate files for output and ack related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8750
diff
changeset
|
302 #define ngx_quic_connstate_dbg(c) |
bc910a5ec737
QUIC: separate files for output and ack related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8750
diff
changeset
|
303 #endif |
bc910a5ec737
QUIC: separate files for output and ack related processing.
Vladimir Homutov <vl@nginx.com>
parents:
8750
diff
changeset
|
304 |
8747 | 305 #endif /* _NGX_EVENT_QUIC_CONNECTION_H_INCLUDED_ */ |