Mercurial > hg > nginx-quic
annotate src/http/v3/ngx_http_v3.h @ 8387:76f476ce4d31 quic
QUIC: distinct files for connection migration.
The connection migration-related code from quic.c with dependencies is moved
into separate file.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Wed, 31 Mar 2021 14:57:15 +0300 |
parents | 98c4020f1c9a |
children | cc3e9c131d79 |
rev | line source |
---|---|
7681 | 1 |
2 /* | |
3 * Copyright (C) Roman Arutyunyan | |
4 * Copyright (C) Nginx, Inc. | |
5 */ | |
6 | |
7 | |
8 #ifndef _NGX_HTTP_V3_H_INCLUDED_ | |
9 #define _NGX_HTTP_V3_H_INCLUDED_ | |
10 | |
11 | |
12 #include <ngx_config.h> | |
13 #include <ngx_core.h> | |
14 #include <ngx_http.h> | |
7692
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
15 #include <ngx_http_v3_parse.h> |
7681 | 16 |
17 | |
8196
e0947c952d43
QUIC: multiple versions support in ALPN.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8015
diff
changeset
|
18 #define NGX_HTTP_V3_ALPN_ADVERTISE "\x02h3" |
e0947c952d43
QUIC: multiple versions support in ALPN.
Sergey Kandaurov <pluknet@nginx.com>
parents:
8015
diff
changeset
|
19 #define NGX_HTTP_V3_ALPN_DRAFT_FMT "\x05h3-%02uD" |
7681 | 20 |
7692
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
21 #define NGX_HTTP_V3_VARLEN_INT_LEN 4 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
22 #define NGX_HTTP_V3_PREFIX_INT_LEN 11 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
23 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
24 #define NGX_HTTP_V3_STREAM_CONTROL 0x00 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
25 #define NGX_HTTP_V3_STREAM_PUSH 0x01 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
26 #define NGX_HTTP_V3_STREAM_ENCODER 0x02 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
27 #define NGX_HTTP_V3_STREAM_DECODER 0x03 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
28 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
29 #define NGX_HTTP_V3_FRAME_DATA 0x00 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
30 #define NGX_HTTP_V3_FRAME_HEADERS 0x01 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
31 #define NGX_HTTP_V3_FRAME_CANCEL_PUSH 0x03 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
32 #define NGX_HTTP_V3_FRAME_SETTINGS 0x04 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
33 #define NGX_HTTP_V3_FRAME_PUSH_PROMISE 0x05 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
34 #define NGX_HTTP_V3_FRAME_GOAWAY 0x07 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
35 #define NGX_HTTP_V3_FRAME_MAX_PUSH_ID 0x0d |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
36 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
37 #define NGX_HTTP_V3_PARAM_MAX_TABLE_CAPACITY 0x01 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
38 #define NGX_HTTP_V3_PARAM_MAX_HEADER_LIST_SIZE 0x06 |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
39 #define NGX_HTTP_V3_PARAM_BLOCKED_STREAMS 0x07 |
7681 | 40 |
7749
dadbc66e9fca
Simplifed handling HTTP/3 streams.
Roman Arutyunyan <arut@nginx.com>
parents:
7735
diff
changeset
|
41 #define NGX_HTTP_V3_STREAM_CLIENT_CONTROL 0 |
dadbc66e9fca
Simplifed handling HTTP/3 streams.
Roman Arutyunyan <arut@nginx.com>
parents:
7735
diff
changeset
|
42 #define NGX_HTTP_V3_STREAM_SERVER_CONTROL 1 |
dadbc66e9fca
Simplifed handling HTTP/3 streams.
Roman Arutyunyan <arut@nginx.com>
parents:
7735
diff
changeset
|
43 #define NGX_HTTP_V3_STREAM_CLIENT_ENCODER 2 |
dadbc66e9fca
Simplifed handling HTTP/3 streams.
Roman Arutyunyan <arut@nginx.com>
parents:
7735
diff
changeset
|
44 #define NGX_HTTP_V3_STREAM_SERVER_ENCODER 3 |
dadbc66e9fca
Simplifed handling HTTP/3 streams.
Roman Arutyunyan <arut@nginx.com>
parents:
7735
diff
changeset
|
45 #define NGX_HTTP_V3_STREAM_CLIENT_DECODER 4 |
dadbc66e9fca
Simplifed handling HTTP/3 streams.
Roman Arutyunyan <arut@nginx.com>
parents:
7735
diff
changeset
|
46 #define NGX_HTTP_V3_STREAM_SERVER_DECODER 5 |
dadbc66e9fca
Simplifed handling HTTP/3 streams.
Roman Arutyunyan <arut@nginx.com>
parents:
7735
diff
changeset
|
47 #define NGX_HTTP_V3_MAX_KNOWN_STREAM 6 |
dadbc66e9fca
Simplifed handling HTTP/3 streams.
Roman Arutyunyan <arut@nginx.com>
parents:
7735
diff
changeset
|
48 |
7951
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
49 #define NGX_HTTP_V3_DEFAULT_MAX_TABLE_CAPACITY 16384 |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
50 #define NGX_HTTP_V3_DEFAULT_MAX_BLOCKED_STREAMS 16 |
8015 | 51 #define NGX_HTTP_V3_DEFAULT_MAX_CONCURRENT_PUSHES 10 |
7681 | 52 |
7954
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
53 /* HTTP/3 errors */ |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
54 #define NGX_HTTP_V3_ERR_NO_ERROR 0x100 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
55 #define NGX_HTTP_V3_ERR_GENERAL_PROTOCOL_ERROR 0x101 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
56 #define NGX_HTTP_V3_ERR_INTERNAL_ERROR 0x102 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
57 #define NGX_HTTP_V3_ERR_STREAM_CREATION_ERROR 0x103 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
58 #define NGX_HTTP_V3_ERR_CLOSED_CRITICAL_STREAM 0x104 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
59 #define NGX_HTTP_V3_ERR_FRAME_UNEXPECTED 0x105 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
60 #define NGX_HTTP_V3_ERR_FRAME_ERROR 0x106 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
61 #define NGX_HTTP_V3_ERR_EXCESSIVE_LOAD 0x107 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
62 #define NGX_HTTP_V3_ERR_ID_ERROR 0x108 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
63 #define NGX_HTTP_V3_ERR_SETTINGS_ERROR 0x109 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
64 #define NGX_HTTP_V3_ERR_MISSING_SETTINGS 0x10a |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
65 #define NGX_HTTP_V3_ERR_REQUEST_REJECTED 0x10b |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
66 #define NGX_HTTP_V3_ERR_REQUEST_CANCELLED 0x10c |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
67 #define NGX_HTTP_V3_ERR_REQUEST_INCOMPLETE 0x10d |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
68 #define NGX_HTTP_V3_ERR_CONNECT_ERROR 0x10f |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
69 #define NGX_HTTP_V3_ERR_VERSION_FALLBACK 0x110 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
70 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
71 /* QPACK errors */ |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
72 #define NGX_HTTP_V3_ERR_DECOMPRESSION_FAILED 0x200 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
73 #define NGX_HTTP_V3_ERR_ENCODER_STREAM_ERROR 0x201 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
74 #define NGX_HTTP_V3_ERR_DECODER_STREAM_ERROR 0x202 |
1ed698947172
HTTP/3: error code definitions for HTTP/3 and QPACK.
Roman Arutyunyan <arut@nginx.com>
parents:
7951
diff
changeset
|
75 |
7681 | 76 |
8360
98c4020f1c9a
HTTP/3: keepalive timeout.
Roman Arutyunyan <arut@nginx.com>
parents:
8359
diff
changeset
|
77 #define ngx_http_v3_get_module_loc_conf(c, module) \ |
98c4020f1c9a
HTTP/3: keepalive timeout.
Roman Arutyunyan <arut@nginx.com>
parents:
8359
diff
changeset
|
78 ngx_http_get_module_loc_conf( \ |
98c4020f1c9a
HTTP/3: keepalive timeout.
Roman Arutyunyan <arut@nginx.com>
parents:
8359
diff
changeset
|
79 ((ngx_http_v3_connection_t *) c->quic->parent->data)->hc.conf_ctx, \ |
98c4020f1c9a
HTTP/3: keepalive timeout.
Roman Arutyunyan <arut@nginx.com>
parents:
8359
diff
changeset
|
80 module) |
98c4020f1c9a
HTTP/3: keepalive timeout.
Roman Arutyunyan <arut@nginx.com>
parents:
8359
diff
changeset
|
81 |
7948
c8cabb5d45f5
HTTP/3: introduced ngx_http_v3_get_module_srv_conf() macro.
Roman Arutyunyan <arut@nginx.com>
parents:
7883
diff
changeset
|
82 #define ngx_http_v3_get_module_srv_conf(c, module) \ |
c8cabb5d45f5
HTTP/3: introduced ngx_http_v3_get_module_srv_conf() macro.
Roman Arutyunyan <arut@nginx.com>
parents:
7883
diff
changeset
|
83 ngx_http_get_module_srv_conf( \ |
8200
279ad36f2f4b
QUIC: renamed c->qs to c->quic.
Roman Arutyunyan <arut@nginx.com>
parents:
8196
diff
changeset
|
84 ((ngx_http_v3_connection_t *) c->quic->parent->data)->hc.conf_ctx, \ |
279ad36f2f4b
QUIC: renamed c->qs to c->quic.
Roman Arutyunyan <arut@nginx.com>
parents:
8196
diff
changeset
|
85 module) |
7948
c8cabb5d45f5
HTTP/3: introduced ngx_http_v3_get_module_srv_conf() macro.
Roman Arutyunyan <arut@nginx.com>
parents:
7883
diff
changeset
|
86 |
7955
72f9ff4e0a88
HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.
Roman Arutyunyan <arut@nginx.com>
parents:
7954
diff
changeset
|
87 #define ngx_http_v3_finalize_connection(c, code, reason) \ |
8200
279ad36f2f4b
QUIC: renamed c->qs to c->quic.
Roman Arutyunyan <arut@nginx.com>
parents:
8196
diff
changeset
|
88 ngx_quic_finalize_connection(c->quic->parent, code, reason) |
7955
72f9ff4e0a88
HTTP/3: close QUIC connection with HTTP/QPACK errors when needed.
Roman Arutyunyan <arut@nginx.com>
parents:
7954
diff
changeset
|
89 |
8359
fc64ab301bad
QUIC: connection shutdown.
Roman Arutyunyan <arut@nginx.com>
parents:
8358
diff
changeset
|
90 #define ngx_http_v3_shutdown_connection(c, code, reason) \ |
fc64ab301bad
QUIC: connection shutdown.
Roman Arutyunyan <arut@nginx.com>
parents:
8358
diff
changeset
|
91 ngx_quic_shutdown_connection(c->quic->parent, code, reason) |
fc64ab301bad
QUIC: connection shutdown.
Roman Arutyunyan <arut@nginx.com>
parents:
8358
diff
changeset
|
92 |
7948
c8cabb5d45f5
HTTP/3: introduced ngx_http_v3_get_module_srv_conf() macro.
Roman Arutyunyan <arut@nginx.com>
parents:
7883
diff
changeset
|
93 |
7681 | 94 typedef struct { |
7951
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
95 ngx_quic_tp_t quic; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
96 size_t max_table_capacity; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
97 ngx_uint_t max_blocked_streams; |
8015 | 98 ngx_uint_t max_concurrent_pushes; |
7951
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
99 } ngx_http_v3_srv_conf_t; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
100 |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
101 |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
102 typedef struct { |
8015 | 103 ngx_flag_t push_preload; |
104 ngx_flag_t push; | |
105 ngx_array_t *pushes; | |
106 } ngx_http_v3_loc_conf_t; | |
107 | |
108 | |
8318
3057bae4dba7
HTTP/3: introduced ngx_http_v3_parse_t structure.
Roman Arutyunyan <arut@nginx.com>
parents:
8317
diff
changeset
|
109 struct ngx_http_v3_parse_s { |
8319
ffcaf0aad9f2
HTTP/3: limited client header size.
Roman Arutyunyan <arut@nginx.com>
parents:
8318
diff
changeset
|
110 size_t header_limit; |
8318
3057bae4dba7
HTTP/3: introduced ngx_http_v3_parse_t structure.
Roman Arutyunyan <arut@nginx.com>
parents:
8317
diff
changeset
|
111 ngx_http_v3_parse_headers_t headers; |
3057bae4dba7
HTTP/3: introduced ngx_http_v3_parse_t structure.
Roman Arutyunyan <arut@nginx.com>
parents:
8317
diff
changeset
|
112 ngx_http_v3_parse_data_t body; |
3057bae4dba7
HTTP/3: introduced ngx_http_v3_parse_t structure.
Roman Arutyunyan <arut@nginx.com>
parents:
8317
diff
changeset
|
113 }; |
3057bae4dba7
HTTP/3: introduced ngx_http_v3_parse_t structure.
Roman Arutyunyan <arut@nginx.com>
parents:
8317
diff
changeset
|
114 |
3057bae4dba7
HTTP/3: introduced ngx_http_v3_parse_t structure.
Roman Arutyunyan <arut@nginx.com>
parents:
8317
diff
changeset
|
115 |
8015 | 116 typedef struct { |
7951
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
117 ngx_str_t name; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
118 ngx_str_t value; |
7681 | 119 } ngx_http_v3_header_t; |
120 | |
121 | |
7951
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
122 typedef struct { |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
123 ngx_http_v3_header_t **elts; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
124 ngx_uint_t nelts; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
125 ngx_uint_t base; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
126 size_t size; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
127 size_t capacity; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
128 } ngx_http_v3_dynamic_table_t; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
129 |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
130 |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
131 typedef struct { |
8274 | 132 /* the http connection must be first */ |
7951
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
133 ngx_http_connection_t hc; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
134 ngx_http_v3_dynamic_table_t table; |
8015 | 135 |
8360
98c4020f1c9a
HTTP/3: keepalive timeout.
Roman Arutyunyan <arut@nginx.com>
parents:
8359
diff
changeset
|
136 ngx_event_t keepalive; |
98c4020f1c9a
HTTP/3: keepalive timeout.
Roman Arutyunyan <arut@nginx.com>
parents:
8359
diff
changeset
|
137 ngx_uint_t nrequests; |
98c4020f1c9a
HTTP/3: keepalive timeout.
Roman Arutyunyan <arut@nginx.com>
parents:
8359
diff
changeset
|
138 |
7951
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
139 ngx_queue_t blocked; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
140 ngx_uint_t nblocked; |
8015 | 141 |
142 ngx_queue_t pushing; | |
143 ngx_uint_t npushing; | |
144 uint64_t next_push_id; | |
145 uint64_t max_push_id; | |
146 | |
7951
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
147 ngx_connection_t *known_streams[NGX_HTTP_V3_MAX_KNOWN_STREAM]; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
148 } ngx_http_v3_connection_t; |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
149 |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
150 |
8272
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8237
diff
changeset
|
151 void ngx_http_v3_init(ngx_connection_t *c); |
8282
6bd8ed493b85
HTTP/3: refactored request body parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8274
diff
changeset
|
152 ngx_int_t ngx_http_v3_read_request_body(ngx_http_request_t *r); |
6bd8ed493b85
HTTP/3: refactored request body parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8274
diff
changeset
|
153 ngx_int_t ngx_http_v3_read_unbuffered_request_body(ngx_http_request_t *r); |
7681 | 154 |
155 uintptr_t ngx_http_v3_encode_varlen_int(u_char *p, uint64_t value); | |
156 uintptr_t ngx_http_v3_encode_prefix_int(u_char *p, uint64_t value, | |
157 ngx_uint_t prefix); | |
158 | |
8006
79125ef2e39f
HTTP/3: header encoding functions.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
159 uintptr_t ngx_http_v3_encode_header_block_prefix(u_char *p, |
79125ef2e39f
HTTP/3: header encoding functions.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
160 ngx_uint_t insert_count, ngx_uint_t sign, ngx_uint_t delta_base); |
79125ef2e39f
HTTP/3: header encoding functions.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
161 uintptr_t ngx_http_v3_encode_header_ri(u_char *p, ngx_uint_t dynamic, |
79125ef2e39f
HTTP/3: header encoding functions.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
162 ngx_uint_t index); |
79125ef2e39f
HTTP/3: header encoding functions.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
163 uintptr_t ngx_http_v3_encode_header_lri(u_char *p, ngx_uint_t dynamic, |
79125ef2e39f
HTTP/3: header encoding functions.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
164 ngx_uint_t index, u_char *data, size_t len); |
79125ef2e39f
HTTP/3: header encoding functions.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
165 uintptr_t ngx_http_v3_encode_header_l(u_char *p, ngx_str_t *name, |
79125ef2e39f
HTTP/3: header encoding functions.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
166 ngx_str_t *value); |
79125ef2e39f
HTTP/3: header encoding functions.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
167 uintptr_t ngx_http_v3_encode_header_pbi(u_char *p, ngx_uint_t index); |
79125ef2e39f
HTTP/3: header encoding functions.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
168 uintptr_t ngx_http_v3_encode_header_lpbi(u_char *p, ngx_uint_t index, |
79125ef2e39f
HTTP/3: header encoding functions.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
169 u_char *data, size_t len); |
79125ef2e39f
HTTP/3: header encoding functions.
Roman Arutyunyan <arut@nginx.com>
parents:
7999
diff
changeset
|
170 |
8272
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8237
diff
changeset
|
171 ngx_int_t ngx_http_v3_init_session(ngx_connection_t *c); |
e1eb7f4ca9f1
HTTP/3: refactored request parser.
Roman Arutyunyan <arut@nginx.com>
parents:
8237
diff
changeset
|
172 void ngx_http_v3_init_uni_stream(ngx_connection_t *c); |
8015 | 173 ngx_connection_t *ngx_http_v3_create_push_stream(ngx_connection_t *c, |
174 uint64_t push_id); | |
8358
265062a99043
HTTP/3: send GOAWAY when last request is accepted.
Roman Arutyunyan <arut@nginx.com>
parents:
8319
diff
changeset
|
175 ngx_int_t ngx_http_v3_send_goaway(ngx_connection_t *c, uint64_t id); |
7681 | 176 ngx_int_t ngx_http_v3_ref_insert(ngx_connection_t *c, ngx_uint_t dynamic, |
177 ngx_uint_t index, ngx_str_t *value); | |
178 ngx_int_t ngx_http_v3_insert(ngx_connection_t *c, ngx_str_t *name, | |
179 ngx_str_t *value); | |
180 ngx_int_t ngx_http_v3_set_capacity(ngx_connection_t *c, ngx_uint_t capacity); | |
181 ngx_int_t ngx_http_v3_duplicate(ngx_connection_t *c, ngx_uint_t index); | |
182 ngx_int_t ngx_http_v3_ack_header(ngx_connection_t *c, ngx_uint_t stream_id); | |
183 ngx_int_t ngx_http_v3_cancel_stream(ngx_connection_t *c, ngx_uint_t stream_id); | |
184 ngx_int_t ngx_http_v3_inc_insert_count(ngx_connection_t *c, ngx_uint_t inc); | |
7951
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
185 ngx_int_t ngx_http_v3_lookup_static(ngx_connection_t *c, ngx_uint_t index, |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
186 ngx_str_t *name, ngx_str_t *value); |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
187 ngx_int_t ngx_http_v3_lookup(ngx_connection_t *c, ngx_uint_t index, |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
188 ngx_str_t *name, ngx_str_t *value); |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
189 ngx_int_t ngx_http_v3_decode_insert_count(ngx_connection_t *c, |
c9538aef3211
HTTP/3: refactored dynamic table implementation.
Roman Arutyunyan <arut@nginx.com>
parents:
7949
diff
changeset
|
190 ngx_uint_t *insert_count); |
7681 | 191 ngx_int_t ngx_http_v3_check_insert_count(ngx_connection_t *c, |
192 ngx_uint_t insert_count); | |
7692
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
193 ngx_int_t ngx_http_v3_set_param(ngx_connection_t *c, uint64_t id, |
268f4389130d
Refactored HTTP/3 parser.
Roman Arutyunyan <arut@nginx.com>
parents:
7681
diff
changeset
|
194 uint64_t value); |
8015 | 195 ngx_int_t ngx_http_v3_set_max_push_id(ngx_connection_t *c, |
196 uint64_t max_push_id); | |
197 ngx_int_t ngx_http_v3_cancel_push(ngx_connection_t *c, uint64_t push_id); | |
7681 | 198 |
199 ngx_int_t ngx_http_v3_client_ref_insert(ngx_connection_t *c, ngx_uint_t dynamic, | |
200 ngx_uint_t index, ngx_str_t *value); | |
201 ngx_int_t ngx_http_v3_client_insert(ngx_connection_t *c, ngx_str_t *name, | |
202 ngx_str_t *value); | |
203 ngx_int_t ngx_http_v3_client_set_capacity(ngx_connection_t *c, | |
204 ngx_uint_t capacity); | |
205 ngx_int_t ngx_http_v3_client_duplicate(ngx_connection_t *c, ngx_uint_t index); | |
206 ngx_int_t ngx_http_v3_client_ack_header(ngx_connection_t *c, | |
207 ngx_uint_t stream_id); | |
208 ngx_int_t ngx_http_v3_client_cancel_stream(ngx_connection_t *c, | |
209 ngx_uint_t stream_id); | |
210 ngx_int_t ngx_http_v3_client_inc_insert_count(ngx_connection_t *c, | |
211 ngx_uint_t inc); | |
212 | |
213 | |
214 extern ngx_module_t ngx_http_v3_module; | |
215 | |
216 | |
217 #endif /* _NGX_HTTP_V3_H_INCLUDED_ */ |