Mercurial > hg > nginx-quic
comparison src/http/ngx_http.c @ 8710:33226ac61076 quic
HTTP/3: merged ngx_http_quic_module into ngx_http_v3_module.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Mon, 06 Dec 2021 13:02:36 +0300 |
parents | 61d0fa67b55e |
children | be08b858086a |
comparison
equal
deleted
inserted
replaced
8709:9680f0badc95 | 8710:33226ac61076 |
---|---|
1235 ngx_uint_t i, default_server, proxy_protocol; | 1235 ngx_uint_t i, default_server, proxy_protocol; |
1236 ngx_http_conf_addr_t *addr; | 1236 ngx_http_conf_addr_t *addr; |
1237 #if (NGX_HTTP_SSL) | 1237 #if (NGX_HTTP_SSL) |
1238 ngx_uint_t ssl; | 1238 ngx_uint_t ssl; |
1239 #endif | 1239 #endif |
1240 #if (NGX_HTTP_QUIC) | |
1241 ngx_uint_t quic; | |
1242 #endif | |
1243 #if (NGX_HTTP_V2) | 1240 #if (NGX_HTTP_V2) |
1244 ngx_uint_t http2; | 1241 ngx_uint_t http2; |
1245 #endif | 1242 #endif |
1246 #if (NGX_HTTP_V3) | 1243 #if (NGX_HTTP_V3) |
1244 ngx_uint_t quic; | |
1247 ngx_uint_t http3; | 1245 ngx_uint_t http3; |
1248 #endif | 1246 #endif |
1249 | 1247 |
1250 /* | 1248 /* |
1251 * we cannot compare whole sockaddr struct's as kernel | 1249 * we cannot compare whole sockaddr struct's as kernel |
1276 proxy_protocol = lsopt->proxy_protocol || addr[i].opt.proxy_protocol; | 1274 proxy_protocol = lsopt->proxy_protocol || addr[i].opt.proxy_protocol; |
1277 | 1275 |
1278 #if (NGX_HTTP_SSL) | 1276 #if (NGX_HTTP_SSL) |
1279 ssl = lsopt->ssl || addr[i].opt.ssl; | 1277 ssl = lsopt->ssl || addr[i].opt.ssl; |
1280 #endif | 1278 #endif |
1281 #if (NGX_HTTP_QUIC) | |
1282 quic = lsopt->quic || addr[i].opt.quic; | |
1283 #endif | |
1284 #if (NGX_HTTP_V2) | 1279 #if (NGX_HTTP_V2) |
1285 http2 = lsopt->http2 || addr[i].opt.http2; | 1280 http2 = lsopt->http2 || addr[i].opt.http2; |
1286 #endif | 1281 #endif |
1287 #if (NGX_HTTP_V3) | 1282 #if (NGX_HTTP_V3) |
1283 quic = lsopt->quic || addr[i].opt.quic; | |
1288 http3 = lsopt->http3 || addr[i].opt.http3; | 1284 http3 = lsopt->http3 || addr[i].opt.http3; |
1289 #endif | 1285 #endif |
1290 | 1286 |
1291 if (lsopt->set) { | 1287 if (lsopt->set) { |
1292 | 1288 |
1318 addr[i].opt.default_server = default_server; | 1314 addr[i].opt.default_server = default_server; |
1319 addr[i].opt.proxy_protocol = proxy_protocol; | 1315 addr[i].opt.proxy_protocol = proxy_protocol; |
1320 #if (NGX_HTTP_SSL) | 1316 #if (NGX_HTTP_SSL) |
1321 addr[i].opt.ssl = ssl; | 1317 addr[i].opt.ssl = ssl; |
1322 #endif | 1318 #endif |
1323 #if (NGX_HTTP_QUIC) | |
1324 addr[i].opt.quic = quic; | |
1325 #endif | |
1326 #if (NGX_HTTP_V2) | 1319 #if (NGX_HTTP_V2) |
1327 addr[i].opt.http2 = http2; | 1320 addr[i].opt.http2 = http2; |
1328 #endif | 1321 #endif |
1329 #if (NGX_HTTP_V3) | 1322 #if (NGX_HTTP_V3) |
1323 addr[i].opt.quic = quic; | |
1330 addr[i].opt.http3 = http3; | 1324 addr[i].opt.http3 = http3; |
1331 #endif | 1325 #endif |
1332 | 1326 |
1333 return NGX_OK; | 1327 return NGX_OK; |
1334 } | 1328 } |
1369 &lsopt->addr_text); | 1363 &lsopt->addr_text); |
1370 } | 1364 } |
1371 | 1365 |
1372 #endif | 1366 #endif |
1373 | 1367 |
1374 #if (NGX_HTTP_QUIC && !defined NGX_QUIC) | 1368 #if (NGX_HTTP_V3 && !defined NGX_QUIC) |
1375 | 1369 |
1376 if (lsopt->quic) { | 1370 if (lsopt->quic) { |
1377 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, | 1371 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, |
1378 "nginx was built with OpenSSL that lacks QUIC " | 1372 "nginx was built with OpenSSL that lacks QUIC " |
1379 "support, QUIC is not enabled for %V", | 1373 "support, QUIC is not enabled for %V", |
1839 ls->reuseport = addr->opt.reuseport; | 1833 ls->reuseport = addr->opt.reuseport; |
1840 #endif | 1834 #endif |
1841 | 1835 |
1842 ls->wildcard = addr->opt.wildcard; | 1836 ls->wildcard = addr->opt.wildcard; |
1843 | 1837 |
1844 #if (NGX_HTTP_QUIC) | 1838 #if (NGX_HTTP_V3) |
1845 ls->quic = addr->opt.quic; | 1839 ls->quic = addr->opt.quic; |
1846 #endif | 1840 #endif |
1847 | 1841 |
1848 return ls; | 1842 return ls; |
1849 } | 1843 } |
1872 addrs[i].addr = sin->sin_addr.s_addr; | 1866 addrs[i].addr = sin->sin_addr.s_addr; |
1873 addrs[i].conf.default_server = addr[i].default_server; | 1867 addrs[i].conf.default_server = addr[i].default_server; |
1874 #if (NGX_HTTP_SSL) | 1868 #if (NGX_HTTP_SSL) |
1875 addrs[i].conf.ssl = addr[i].opt.ssl; | 1869 addrs[i].conf.ssl = addr[i].opt.ssl; |
1876 #endif | 1870 #endif |
1877 #if (NGX_HTTP_QUIC) | |
1878 addrs[i].conf.quic = addr[i].opt.quic; | |
1879 #endif | |
1880 #if (NGX_HTTP_V2) | 1871 #if (NGX_HTTP_V2) |
1881 addrs[i].conf.http2 = addr[i].opt.http2; | 1872 addrs[i].conf.http2 = addr[i].opt.http2; |
1882 #endif | 1873 #endif |
1883 #if (NGX_HTTP_V3) | 1874 #if (NGX_HTTP_V3) |
1875 addrs[i].conf.quic = addr[i].opt.quic; | |
1884 addrs[i].conf.http3 = addr[i].opt.http3; | 1876 addrs[i].conf.http3 = addr[i].opt.http3; |
1885 #endif | 1877 #endif |
1886 addrs[i].conf.proxy_protocol = addr[i].opt.proxy_protocol; | 1878 addrs[i].conf.proxy_protocol = addr[i].opt.proxy_protocol; |
1887 | 1879 |
1888 if (addr[i].hash.buckets == NULL | 1880 if (addr[i].hash.buckets == NULL |
1943 addrs6[i].addr6 = sin6->sin6_addr; | 1935 addrs6[i].addr6 = sin6->sin6_addr; |
1944 addrs6[i].conf.default_server = addr[i].default_server; | 1936 addrs6[i].conf.default_server = addr[i].default_server; |
1945 #if (NGX_HTTP_SSL) | 1937 #if (NGX_HTTP_SSL) |
1946 addrs6[i].conf.ssl = addr[i].opt.ssl; | 1938 addrs6[i].conf.ssl = addr[i].opt.ssl; |
1947 #endif | 1939 #endif |
1948 #if (NGX_HTTP_QUIC) | |
1949 addrs6[i].conf.quic = addr[i].opt.quic; | |
1950 #endif | |
1951 #if (NGX_HTTP_V2) | 1940 #if (NGX_HTTP_V2) |
1952 addrs6[i].conf.http2 = addr[i].opt.http2; | 1941 addrs6[i].conf.http2 = addr[i].opt.http2; |
1953 #endif | 1942 #endif |
1954 #if (NGX_HTTP_V3) | 1943 #if (NGX_HTTP_V3) |
1944 addrs6[i].conf.quic = addr[i].opt.quic; | |
1955 addrs6[i].conf.http3 = addr[i].opt.http3; | 1945 addrs6[i].conf.http3 = addr[i].opt.http3; |
1956 #endif | 1946 #endif |
1957 addrs6[i].conf.proxy_protocol = addr[i].opt.proxy_protocol; | 1947 addrs6[i].conf.proxy_protocol = addr[i].opt.proxy_protocol; |
1958 | 1948 |
1959 if (addr[i].hash.buckets == NULL | 1949 if (addr[i].hash.buckets == NULL |