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.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/stream/ngx_stream.c b/src/stream/ngx_stream.c
index caaf38a68..3bd8f6dce 100644
--- a/src/stream/ngx_stream.c
+++ b/src/stream/ngx_stream.c
@@ -275,8 +275,11 @@ ngx_stream_add_ports(ngx_conf_t *cf, ngx_array_t *ports,
port = ports->elts;
for (i = 0; i < ports->nelts; i++) {
- if (p == port[i].port && sa->sa_family == port[i].family) {
+ if (p == port[i].port
+ && listen->type == port[i].type
+ && sa->sa_family == port[i].family)
+ {
/* a port is already in the port list */
port = &port[i];
@@ -292,6 +295,7 @@ ngx_stream_add_ports(ngx_conf_t *cf, ngx_array_t *ports,
}
port->family = sa->sa_family;
+ port->type = listen->type;
port->port = p;
if (ngx_array_init(&port->addrs, cf->temp_pool, 2,
@@ -364,6 +368,7 @@ ngx_stream_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
ls->addr_ntop = 1;
ls->handler = ngx_stream_init_connection;
ls->pool_size = 256;
+ ls->type = addr[i].opt.type;
cscf = addr->opt.ctx->srv_conf[ngx_stream_core_module.ctx_index];
@@ -373,6 +378,8 @@ ngx_stream_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
ls->backlog = addr[i].opt.backlog;
+ ls->wildcard = addr[i].opt.wildcard;
+
ls->keepalive = addr[i].opt.so_keepalive;
#if (NGX_HAVE_KEEPALIVE_TUNABLE)
ls->keepidle = addr[i].opt.tcp_keepidle;