aboutsummaryrefslogtreecommitdiff
path: root/src/stream/ngx_stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream/ngx_stream.c')
-rw-r--r--src/stream/ngx_stream.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/stream/ngx_stream.c b/src/stream/ngx_stream.c
index 3304c843c..4c41af173 100644
--- a/src/stream/ngx_stream.c
+++ b/src/stream/ngx_stream.c
@@ -518,6 +518,24 @@ ngx_stream_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
ls->reuseport = addr[i].opt.reuseport;
#endif
+#if (NGX_STREAM_QUIC)
+
+ ls->quic = addr[i].opt.quic;
+
+ if (ls->quic) {
+ ngx_rbtree_init(&ls->rbtree, &ls->sentinel,
+ ngx_quic_rbtree_insert_value);
+ }
+
+#endif
+
+#if !(NGX_WIN32)
+ if (!ls->quic) {
+ ngx_rbtree_init(&ls->rbtree, &ls->sentinel,
+ ngx_udp_rbtree_insert_value);
+ }
+#endif
+
stport = ngx_palloc(cf->pool, sizeof(ngx_stream_port_t));
if (stport == NULL) {
return NGX_CONF_ERROR;
@@ -576,6 +594,9 @@ ngx_stream_add_addrs(ngx_conf_t *cf, ngx_stream_port_t *stport,
#if (NGX_STREAM_SSL)
addrs[i].conf.ssl = addr[i].opt.ssl;
#endif
+#if (NGX_STREAM_QUIC)
+ addrs[i].conf.quic = addr[i].opt.quic;
+#endif
addrs[i].conf.proxy_protocol = addr[i].opt.proxy_protocol;
addrs[i].conf.addr_text = addr[i].opt.addr_text;
}
@@ -611,6 +632,9 @@ ngx_stream_add_addrs6(ngx_conf_t *cf, ngx_stream_port_t *stport,
#if (NGX_STREAM_SSL)
addrs6[i].conf.ssl = addr[i].opt.ssl;
#endif
+#if (NGX_STREAM_QUIC)
+ addrs6[i].conf.quic = addr[i].opt.quic;
+#endif
addrs6[i].conf.proxy_protocol = addr[i].opt.proxy_protocol;
addrs6[i].conf.addr_text = addr[i].opt.addr_text;
}