comparison src/http/v3/ngx_http_v3.h @ 9047:c851a2ed5ce8 quic

HTTP/3: "quic" parameter of "listen" directive. Now "listen" directve has a new "quic" parameter which enables QUIC protocol for the address. Further, to enable HTTP/3, a new directive "http3" is introduced. The hq-interop protocol is enabled by "http3_hq" as before. Now application protocol is chosen by ALPN. Previously used "http3" parameter of "listen" is deprecated.
author Roman Arutyunyan <arut@nginx.com>
date Mon, 27 Feb 2023 14:00:56 +0400
parents b0c2234aaa9f
children 7d67fe09bcad
comparison
equal deleted inserted replaced
9046:7da4791e0264 9047:c851a2ed5ce8
19 #include <ngx_http_v3_table.h> 19 #include <ngx_http_v3_table.h>
20 20
21 21
22 #define NGX_HTTP_V3_ALPN_PROTO "\x02h3" 22 #define NGX_HTTP_V3_ALPN_PROTO "\x02h3"
23 #define NGX_HTTP_V3_HQ_ALPN_PROTO "\x0Ahq-interop" 23 #define NGX_HTTP_V3_HQ_ALPN_PROTO "\x0Ahq-interop"
24 #define NGX_HTTP_V3_HQ_PROTO "hq-interop"
24 25
25 #define NGX_HTTP_V3_VARLEN_INT_LEN 4 26 #define NGX_HTTP_V3_VARLEN_INT_LEN 4
26 #define NGX_HTTP_V3_PREFIX_INT_LEN 11 27 #define NGX_HTTP_V3_PREFIX_INT_LEN 11
27 28
28 #define NGX_HTTP_V3_STREAM_CONTROL 0x00 29 #define NGX_HTTP_V3_STREAM_CONTROL 0x00
99 ngx_quic_shutdown_connection((c)->quic ? (c)->quic->parent : (c), \ 100 ngx_quic_shutdown_connection((c)->quic ? (c)->quic->parent : (c), \
100 code, reason) 101 code, reason)
101 102
102 103
103 typedef struct { 104 typedef struct {
105 ngx_flag_t enable;
106 ngx_flag_t enable_hq;
104 size_t max_table_capacity; 107 size_t max_table_capacity;
105 ngx_uint_t max_blocked_streams; 108 ngx_uint_t max_blocked_streams;
106 ngx_uint_t max_concurrent_pushes; 109 ngx_uint_t max_concurrent_pushes;
107 ngx_uint_t max_concurrent_streams; 110 ngx_uint_t max_concurrent_streams;
108 #if (NGX_HTTP_V3_HQ)
109 ngx_flag_t hq;
110 #endif
111 ngx_quic_conf_t quic; 111 ngx_quic_conf_t quic;
112 } ngx_http_v3_srv_conf_t; 112 } ngx_http_v3_srv_conf_t;
113 113
114 114
115 typedef struct { 115 typedef struct {
145 145
146 off_t total_bytes; 146 off_t total_bytes;
147 off_t payload_bytes; 147 off_t payload_bytes;
148 148
149 unsigned goaway:1; 149 unsigned goaway:1;
150 #if (NGX_HTTP_V3_HQ)
151 unsigned hq:1; 150 unsigned hq:1;
152 #endif
153 151
154 ngx_connection_t *known_streams[NGX_HTTP_V3_MAX_KNOWN_STREAM]; 152 ngx_connection_t *known_streams[NGX_HTTP_V3_MAX_KNOWN_STREAM];
155 }; 153 };
156 154
157 155