]> git.kaiwu.me - nginx.git/commitdiff
Stream: fixed "reuseport" to actually work.
authorRuslan Ermilov <ru@nginx.com>
Fri, 5 Jun 2015 20:03:13 +0000 (23:03 +0300)
committerRuslan Ermilov <ru@nginx.com>
Fri, 5 Jun 2015 20:03:13 +0000 (23:03 +0300)
src/stream/ngx_stream.c
src/stream/ngx_stream.h

index 1c5e7a87c2a4bfb2d549449f21b3618b085296e2..b0889e4d6500ac656374e88ce996cfbcea1dbb98 100644 (file)
@@ -314,6 +314,9 @@ found:
 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
     addr->ipv6only = listen->ipv6only;
 #endif
+#if (NGX_HAVE_REUSEPORT)
+    addr->reuseport = listen->reuseport;
+#endif
 
     return NGX_OK;
 }
@@ -386,6 +389,10 @@ ngx_stream_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
             ls->ipv6only = addr[i].ipv6only;
 #endif
 
+#if (NGX_HAVE_REUSEPORT)
+            ls->reuseport = addr[i].reuseport;
+#endif
+
             stport = ngx_palloc(cf->pool, sizeof(ngx_stream_port_t));
             if (stport == NULL) {
                 return NGX_CONF_ERROR;
index a10f68fffd1bd533fced2b3dd9695b0faae6370d..116c0cc54e9a207c479e8f1007aee67c68576a0f 100644 (file)
@@ -108,6 +108,9 @@ typedef struct {
 #endif
 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
     unsigned                ipv6only:1;
+#endif
+#if (NGX_HAVE_REUSEPORT)
+    unsigned                reuseport:1;
 #endif
     unsigned                so_keepalive:2;
 #if (NGX_HAVE_KEEPALIVE_TUNABLE)