comparison src/http/ngx_http.c @ 6246:257b51c37c5a

The HTTP/2 implementation (RFC 7240, 7241). The SPDY support is removed, as it's incompatible with the new module.
author Valentin Bartenev <vbart@nginx.com>
date Fri, 11 Sep 2015 20:13:06 +0300
parents 78c06e5e1d76
children ceeb1edb3018
comparison
equal deleted inserted replaced
6245:3cf25d33886a 6246:257b51c37c5a
1231 struct sockaddr_un *saun; 1231 struct sockaddr_un *saun;
1232 #endif 1232 #endif
1233 #if (NGX_HTTP_SSL) 1233 #if (NGX_HTTP_SSL)
1234 ngx_uint_t ssl; 1234 ngx_uint_t ssl;
1235 #endif 1235 #endif
1236 #if (NGX_HTTP_SPDY) 1236 #if (NGX_HTTP_V2)
1237 ngx_uint_t spdy; 1237 ngx_uint_t http2;
1238 #endif 1238 #endif
1239 1239
1240 /* 1240 /*
1241 * we cannot compare whole sockaddr struct's as kernel 1241 * we cannot compare whole sockaddr struct's as kernel
1242 * may fill some fields in inherited sockaddr struct's 1242 * may fill some fields in inherited sockaddr struct's
1288 proxy_protocol = lsopt->proxy_protocol || addr[i].opt.proxy_protocol; 1288 proxy_protocol = lsopt->proxy_protocol || addr[i].opt.proxy_protocol;
1289 1289
1290 #if (NGX_HTTP_SSL) 1290 #if (NGX_HTTP_SSL)
1291 ssl = lsopt->ssl || addr[i].opt.ssl; 1291 ssl = lsopt->ssl || addr[i].opt.ssl;
1292 #endif 1292 #endif
1293 #if (NGX_HTTP_SPDY) 1293 #if (NGX_HTTP_V2)
1294 spdy = lsopt->spdy || addr[i].opt.spdy; 1294 http2 = lsopt->http2 || addr[i].opt.http2;
1295 #endif 1295 #endif
1296 1296
1297 if (lsopt->set) { 1297 if (lsopt->set) {
1298 1298
1299 if (addr[i].opt.set) { 1299 if (addr[i].opt.set) {
1322 addr[i].opt.default_server = default_server; 1322 addr[i].opt.default_server = default_server;
1323 addr[i].opt.proxy_protocol = proxy_protocol; 1323 addr[i].opt.proxy_protocol = proxy_protocol;
1324 #if (NGX_HTTP_SSL) 1324 #if (NGX_HTTP_SSL)
1325 addr[i].opt.ssl = ssl; 1325 addr[i].opt.ssl = ssl;
1326 #endif 1326 #endif
1327 #if (NGX_HTTP_SPDY) 1327 #if (NGX_HTTP_V2)
1328 addr[i].opt.spdy = spdy; 1328 addr[i].opt.http2 = http2;
1329 #endif 1329 #endif
1330 1330
1331 return NGX_OK; 1331 return NGX_OK;
1332 } 1332 }
1333 1333
1355 { 1355 {
1356 return NGX_ERROR; 1356 return NGX_ERROR;
1357 } 1357 }
1358 } 1358 }
1359 1359
1360 #if (NGX_HTTP_SPDY && NGX_HTTP_SSL \ 1360 #if (NGX_HTTP_V2 && NGX_HTTP_SSL \
1361 && !defined TLSEXT_TYPE_application_layer_protocol_negotiation \ 1361 && !defined TLSEXT_TYPE_application_layer_protocol_negotiation \
1362 && !defined TLSEXT_TYPE_next_proto_neg) 1362 && !defined TLSEXT_TYPE_next_proto_neg)
1363 if (lsopt->spdy && lsopt->ssl) { 1363
1364 if (lsopt->http2 && lsopt->ssl) {
1364 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, 1365 ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
1365 "nginx was built without OpenSSL ALPN or NPN " 1366 "nginx was built with OpenSSL that lacks ALPN "
1366 "support, SPDY is not enabled for %s", lsopt->addr); 1367 "and NPN support, HTTP/2 is not enabled for %s",
1367 } 1368 lsopt->addr);
1369 }
1370
1368 #endif 1371 #endif
1369 1372
1370 addr = ngx_array_push(&port->addrs); 1373 addr = ngx_array_push(&port->addrs);
1371 if (addr == NULL) { 1374 if (addr == NULL) {
1372 return NGX_ERROR; 1375 return NGX_ERROR;
1854 addrs[i].addr = sin->sin_addr.s_addr; 1857 addrs[i].addr = sin->sin_addr.s_addr;
1855 addrs[i].conf.default_server = addr[i].default_server; 1858 addrs[i].conf.default_server = addr[i].default_server;
1856 #if (NGX_HTTP_SSL) 1859 #if (NGX_HTTP_SSL)
1857 addrs[i].conf.ssl = addr[i].opt.ssl; 1860 addrs[i].conf.ssl = addr[i].opt.ssl;
1858 #endif 1861 #endif
1859 #if (NGX_HTTP_SPDY) 1862 #if (NGX_HTTP_V2)
1860 addrs[i].conf.spdy = addr[i].opt.spdy; 1863 addrs[i].conf.http2 = addr[i].opt.http2;
1861 #endif 1864 #endif
1862 addrs[i].conf.proxy_protocol = addr[i].opt.proxy_protocol; 1865 addrs[i].conf.proxy_protocol = addr[i].opt.proxy_protocol;
1863 1866
1864 if (addr[i].hash.buckets == NULL 1867 if (addr[i].hash.buckets == NULL
1865 && (addr[i].wc_head == NULL 1868 && (addr[i].wc_head == NULL
1919 addrs6[i].addr6 = sin6->sin6_addr; 1922 addrs6[i].addr6 = sin6->sin6_addr;
1920 addrs6[i].conf.default_server = addr[i].default_server; 1923 addrs6[i].conf.default_server = addr[i].default_server;
1921 #if (NGX_HTTP_SSL) 1924 #if (NGX_HTTP_SSL)
1922 addrs6[i].conf.ssl = addr[i].opt.ssl; 1925 addrs6[i].conf.ssl = addr[i].opt.ssl;
1923 #endif 1926 #endif
1924 #if (NGX_HTTP_SPDY) 1927 #if (NGX_HTTP_V2)
1925 addrs6[i].conf.spdy = addr[i].opt.spdy; 1928 addrs6[i].conf.http2 = addr[i].opt.http2;
1926 #endif 1929 #endif
1927 1930
1928 if (addr[i].hash.buckets == NULL 1931 if (addr[i].hash.buckets == NULL
1929 && (addr[i].wc_head == NULL 1932 && (addr[i].wc_head == NULL
1930 || addr[i].wc_head->hash.buckets == NULL) 1933 || addr[i].wc_head->hash.buckets == NULL)