comparison src/http/ngx_http.c @ 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 c2f5d79cde64
children 0af598651e33
comparison
equal deleted inserted replaced
9046:7da4791e0264 9047:c851a2ed5ce8
1240 #if (NGX_HTTP_V2) 1240 #if (NGX_HTTP_V2)
1241 ngx_uint_t http2; 1241 ngx_uint_t http2;
1242 #endif 1242 #endif
1243 #if (NGX_HTTP_V3) 1243 #if (NGX_HTTP_V3)
1244 ngx_uint_t http3; 1244 ngx_uint_t http3;
1245 ngx_uint_t quic;
1245 #endif 1246 #endif
1246 1247
1247 /* 1248 /*
1248 * we cannot compare whole sockaddr struct's as kernel 1249 * we cannot compare whole sockaddr struct's as kernel
1249 * may fill some fields in inherited sockaddr struct's 1250 * may fill some fields in inherited sockaddr struct's
1278 #if (NGX_HTTP_V2) 1279 #if (NGX_HTTP_V2)
1279 http2 = lsopt->http2 || addr[i].opt.http2; 1280 http2 = lsopt->http2 || addr[i].opt.http2;
1280 #endif 1281 #endif
1281 #if (NGX_HTTP_V3) 1282 #if (NGX_HTTP_V3)
1282 http3 = lsopt->http3 || addr[i].opt.http3; 1283 http3 = lsopt->http3 || addr[i].opt.http3;
1284 quic = lsopt->quic || addr[i].opt.quic;
1283 #endif 1285 #endif
1284 1286
1285 if (lsopt->set) { 1287 if (lsopt->set) {
1286 1288
1287 if (addr[i].opt.set) { 1289 if (addr[i].opt.set) {
1317 #if (NGX_HTTP_V2) 1319 #if (NGX_HTTP_V2)
1318 addr[i].opt.http2 = http2; 1320 addr[i].opt.http2 = http2;
1319 #endif 1321 #endif
1320 #if (NGX_HTTP_V3) 1322 #if (NGX_HTTP_V3)
1321 addr[i].opt.http3 = http3; 1323 addr[i].opt.http3 = http3;
1324 addr[i].opt.quic = quic;
1322 #endif 1325 #endif
1323 1326
1324 return NGX_OK; 1327 return NGX_OK;
1325 } 1328 }
1326 1329
1821 1824
1822 ls->wildcard = addr->opt.wildcard; 1825 ls->wildcard = addr->opt.wildcard;
1823 1826
1824 #if (NGX_HTTP_V3) 1827 #if (NGX_HTTP_V3)
1825 1828
1826 ls->quic = addr->opt.http3; 1829 ls->quic = addr->opt.quic;
1827 1830
1828 if (ls->quic) { 1831 if (ls->quic) {
1829 ngx_rbtree_init(&ls->rbtree, &ls->sentinel, 1832 ngx_rbtree_init(&ls->rbtree, &ls->sentinel,
1830 ngx_quic_rbtree_insert_value); 1833 ngx_quic_rbtree_insert_value);
1831 } 1834 }
1864 #if (NGX_HTTP_V2) 1867 #if (NGX_HTTP_V2)
1865 addrs[i].conf.http2 = addr[i].opt.http2; 1868 addrs[i].conf.http2 = addr[i].opt.http2;
1866 #endif 1869 #endif
1867 #if (NGX_HTTP_V3) 1870 #if (NGX_HTTP_V3)
1868 addrs[i].conf.http3 = addr[i].opt.http3; 1871 addrs[i].conf.http3 = addr[i].opt.http3;
1872 addrs[i].conf.quic = addr[i].opt.quic;
1869 #endif 1873 #endif
1870 addrs[i].conf.proxy_protocol = addr[i].opt.proxy_protocol; 1874 addrs[i].conf.proxy_protocol = addr[i].opt.proxy_protocol;
1871 1875
1872 if (addr[i].hash.buckets == NULL 1876 if (addr[i].hash.buckets == NULL
1873 && (addr[i].wc_head == NULL 1877 && (addr[i].wc_head == NULL
1932 #if (NGX_HTTP_V2) 1936 #if (NGX_HTTP_V2)
1933 addrs6[i].conf.http2 = addr[i].opt.http2; 1937 addrs6[i].conf.http2 = addr[i].opt.http2;
1934 #endif 1938 #endif
1935 #if (NGX_HTTP_V3) 1939 #if (NGX_HTTP_V3)
1936 addrs6[i].conf.http3 = addr[i].opt.http3; 1940 addrs6[i].conf.http3 = addr[i].opt.http3;
1941 addrs6[i].conf.quic = addr[i].opt.quic;
1937 #endif 1942 #endif
1938 addrs6[i].conf.proxy_protocol = addr[i].opt.proxy_protocol; 1943 addrs6[i].conf.proxy_protocol = addr[i].opt.proxy_protocol;
1939 1944
1940 if (addr[i].hash.buckets == NULL 1945 if (addr[i].hash.buckets == NULL
1941 && (addr[i].wc_head == NULL 1946 && (addr[i].wc_head == NULL