Mercurial > hg > nginx
comparison src/http/ngx_http.c @ 8167:5d91389e0fd3 quic
Initial QUIC support in http.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 28 Feb 2020 13:09:51 +0300 |
parents | 7999d3fbb765 |
children | cb149fa03367 |
comparison
equal
deleted
inserted
replaced
8166:7999d3fbb765 | 8167:5d91389e0fd3 |
---|---|
1201 ngx_uint_t ssl; | 1201 ngx_uint_t ssl; |
1202 #endif | 1202 #endif |
1203 #if (NGX_HTTP_V2) | 1203 #if (NGX_HTTP_V2) |
1204 ngx_uint_t http2; | 1204 ngx_uint_t http2; |
1205 #endif | 1205 #endif |
1206 #if (NGX_HTTP_SSL) | |
1207 ngx_uint_t http3; | |
1208 #endif | |
1206 | 1209 |
1207 /* | 1210 /* |
1208 * we cannot compare whole sockaddr struct's as kernel | 1211 * we cannot compare whole sockaddr struct's as kernel |
1209 * may fill some fields in inherited sockaddr struct's | 1212 * may fill some fields in inherited sockaddr struct's |
1210 */ | 1213 */ |
1236 ssl = lsopt->ssl || addr[i].opt.ssl; | 1239 ssl = lsopt->ssl || addr[i].opt.ssl; |
1237 #endif | 1240 #endif |
1238 #if (NGX_HTTP_V2) | 1241 #if (NGX_HTTP_V2) |
1239 http2 = lsopt->http2 || addr[i].opt.http2; | 1242 http2 = lsopt->http2 || addr[i].opt.http2; |
1240 #endif | 1243 #endif |
1244 #if (NGX_HTTP_SSL) | |
1245 http3 = lsopt->http3 || addr[i].opt.http3; | |
1246 #endif | |
1241 | 1247 |
1242 if (lsopt->set) { | 1248 if (lsopt->set) { |
1243 | 1249 |
1244 if (addr[i].opt.set) { | 1250 if (addr[i].opt.set) { |
1245 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | 1251 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, |
1271 #if (NGX_HTTP_SSL) | 1277 #if (NGX_HTTP_SSL) |
1272 addr[i].opt.ssl = ssl; | 1278 addr[i].opt.ssl = ssl; |
1273 #endif | 1279 #endif |
1274 #if (NGX_HTTP_V2) | 1280 #if (NGX_HTTP_V2) |
1275 addr[i].opt.http2 = http2; | 1281 addr[i].opt.http2 = http2; |
1282 #endif | |
1283 #if (NGX_HTTP_SSL) | |
1284 addr[i].opt.http3 = http3; | |
1276 #endif | 1285 #endif |
1277 | 1286 |
1278 return NGX_OK; | 1287 return NGX_OK; |
1279 } | 1288 } |
1280 | 1289 |
1310 | 1319 |
1311 if (lsopt->http2 && lsopt->ssl) { | 1320 if (lsopt->http2 && lsopt->ssl) { |
1312 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, | 1321 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, |
1313 "nginx was built with OpenSSL that lacks ALPN " | 1322 "nginx was built with OpenSSL that lacks ALPN " |
1314 "and NPN support, HTTP/2 is not enabled for %V", | 1323 "and NPN support, HTTP/2 is not enabled for %V", |
1324 &lsopt->addr_text); | |
1325 } | |
1326 | |
1327 #endif | |
1328 | |
1329 #if (NGX_HTTP_SSL && !defined NGX_OPENSSL_QUIC) | |
1330 | |
1331 if (lsopt->http3) { | |
1332 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, | |
1333 "nginx was built with OpenSSL that lacks QUIC " | |
1334 "support, HTTP/3 is not enabled for %V", | |
1315 &lsopt->addr_text); | 1335 &lsopt->addr_text); |
1316 } | 1336 } |
1317 | 1337 |
1318 #endif | 1338 #endif |
1319 | 1339 |
1805 addrs[i].conf.ssl = addr[i].opt.ssl; | 1825 addrs[i].conf.ssl = addr[i].opt.ssl; |
1806 #endif | 1826 #endif |
1807 #if (NGX_HTTP_V2) | 1827 #if (NGX_HTTP_V2) |
1808 addrs[i].conf.http2 = addr[i].opt.http2; | 1828 addrs[i].conf.http2 = addr[i].opt.http2; |
1809 #endif | 1829 #endif |
1830 #if (NGX_HTTP_SSL) | |
1831 addrs[i].conf.http3 = addr[i].opt.http3; | |
1832 #endif | |
1810 addrs[i].conf.proxy_protocol = addr[i].opt.proxy_protocol; | 1833 addrs[i].conf.proxy_protocol = addr[i].opt.proxy_protocol; |
1811 | 1834 |
1812 if (addr[i].hash.buckets == NULL | 1835 if (addr[i].hash.buckets == NULL |
1813 && (addr[i].wc_head == NULL | 1836 && (addr[i].wc_head == NULL |
1814 || addr[i].wc_head->hash.buckets == NULL) | 1837 || addr[i].wc_head->hash.buckets == NULL) |
1870 addrs6[i].conf.ssl = addr[i].opt.ssl; | 1893 addrs6[i].conf.ssl = addr[i].opt.ssl; |
1871 #endif | 1894 #endif |
1872 #if (NGX_HTTP_V2) | 1895 #if (NGX_HTTP_V2) |
1873 addrs6[i].conf.http2 = addr[i].opt.http2; | 1896 addrs6[i].conf.http2 = addr[i].opt.http2; |
1874 #endif | 1897 #endif |
1898 #if (NGX_HTTP_SSL) | |
1899 addrs6[i].conf.http3 = addr[i].opt.http3; | |
1900 #endif | |
1875 addrs6[i].conf.proxy_protocol = addr[i].opt.proxy_protocol; | 1901 addrs6[i].conf.proxy_protocol = addr[i].opt.proxy_protocol; |
1876 | 1902 |
1877 if (addr[i].hash.buckets == NULL | 1903 if (addr[i].hash.buckets == NULL |
1878 && (addr[i].wc_head == NULL | 1904 && (addr[i].wc_head == NULL |
1879 || addr[i].wc_head->hash.buckets == NULL) | 1905 || addr[i].wc_head->hash.buckets == NULL) |