aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http.c')
-rw-r--r--src/http/ngx_http.c54
1 files changed, 53 insertions, 1 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index e1d3d0034..215881ca3 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -1163,7 +1163,10 @@ ngx_http_add_listen(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
port = cmcf->ports->elts;
for (i = 0; i < cmcf->ports->nelts; i++) {
- if (p != port[i].port || sa->sa_family != port[i].family) {
+ if (p != port[i].port
+ || lsopt->type != port[i].type
+ || sa->sa_family != port[i].family)
+ {
continue;
}
@@ -1180,6 +1183,7 @@ ngx_http_add_listen(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
}
port->family = sa->sa_family;
+ port->type = lsopt->type;
port->port = p;
port->addrs.elts = NULL;
@@ -1196,9 +1200,15 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
#if (NGX_HTTP_SSL)
ngx_uint_t ssl;
#endif
+#if (NGX_HTTP_QUIC)
+ ngx_uint_t quic;
+#endif
#if (NGX_HTTP_V2)
ngx_uint_t http2;
#endif
+#if (NGX_HTTP_V3)
+ ngx_uint_t http3;
+#endif
/*
* we cannot compare whole sockaddr struct's as kernel
@@ -1231,9 +1241,15 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
#if (NGX_HTTP_SSL)
ssl = lsopt->ssl || addr[i].opt.ssl;
#endif
+#if (NGX_HTTP_QUIC)
+ quic = lsopt->quic || addr[i].opt.quic;
+#endif
#if (NGX_HTTP_V2)
http2 = lsopt->http2 || addr[i].opt.http2;
#endif
+#if (NGX_HTTP_V3)
+ http3 = lsopt->http3 || addr[i].opt.http3;
+#endif
if (lsopt->set) {
@@ -1267,9 +1283,15 @@ ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
#if (NGX_HTTP_SSL)
addr[i].opt.ssl = ssl;
#endif
+#if (NGX_HTTP_QUIC)
+ addr[i].opt.quic = quic;
+#endif
#if (NGX_HTTP_V2)
addr[i].opt.http2 = http2;
#endif
+#if (NGX_HTTP_V3)
+ addr[i].opt.http3 = http3;
+#endif
return NGX_OK;
}
@@ -1313,6 +1335,17 @@ ngx_http_add_address(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
#endif
+#if (NGX_HTTP_QUIC && !defined NGX_OPENSSL_QUIC)
+
+ if (lsopt->quic) {
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
+ "nginx was built with OpenSSL that lacks QUIC "
+ "support, QUIC is not enabled for %V",
+ &lsopt->addr_text);
+ }
+
+#endif
+
addr = ngx_array_push(&port->addrs);
if (addr == NULL) {
return NGX_ERROR;
@@ -1734,6 +1767,7 @@ ngx_http_add_listening(ngx_conf_t *cf, ngx_http_conf_addr_t *addr)
}
#endif
+ ls->type = addr->opt.type;
ls->backlog = addr->opt.backlog;
ls->rcvbuf = addr->opt.rcvbuf;
ls->sndbuf = addr->opt.sndbuf;
@@ -1769,6 +1803,12 @@ ngx_http_add_listening(ngx_conf_t *cf, ngx_http_conf_addr_t *addr)
ls->reuseport = addr->opt.reuseport;
#endif
+ ls->wildcard = addr->opt.wildcard;
+
+#if (NGX_HTTP_QUIC)
+ ls->quic = addr->opt.quic;
+#endif
+
return ls;
}
@@ -1798,9 +1838,15 @@ ngx_http_add_addrs(ngx_conf_t *cf, ngx_http_port_t *hport,
#if (NGX_HTTP_SSL)
addrs[i].conf.ssl = addr[i].opt.ssl;
#endif
+#if (NGX_HTTP_QUIC)
+ addrs[i].conf.quic = addr[i].opt.quic;
+#endif
#if (NGX_HTTP_V2)
addrs[i].conf.http2 = addr[i].opt.http2;
#endif
+#if (NGX_HTTP_V3)
+ addrs[i].conf.http3 = addr[i].opt.http3;
+#endif
addrs[i].conf.proxy_protocol = addr[i].opt.proxy_protocol;
if (addr[i].hash.buckets == NULL
@@ -1863,9 +1909,15 @@ ngx_http_add_addrs6(ngx_conf_t *cf, ngx_http_port_t *hport,
#if (NGX_HTTP_SSL)
addrs6[i].conf.ssl = addr[i].opt.ssl;
#endif
+#if (NGX_HTTP_QUIC)
+ addrs6[i].conf.quic = addr[i].opt.quic;
+#endif
#if (NGX_HTTP_V2)
addrs6[i].conf.http2 = addr[i].opt.http2;
#endif
+#if (NGX_HTTP_V3)
+ addrs6[i].conf.http3 = addr[i].opt.http3;
+#endif
addrs6[i].conf.proxy_protocol = addr[i].opt.proxy_protocol;
if (addr[i].hash.buckets == NULL