Welcome! Log In Create A New Profile

Advanced

[nginx] Stream: fixed "reuseport" to actually work.

Ruslan Ermilov
June 06, 2015 01:00AM
details: http://hg.nginx.org/nginx/rev/f654addf0eea
branches:
changeset: 6169:f654addf0eea
user: Ruslan Ermilov <ru@nginx.com>
date: Fri Jun 05 23:03:13 2015 +0300
description:
Stream: fixed "reuseport" to actually work.

diffstat:

src/stream/ngx_stream.c | 7 +++++++
src/stream/ngx_stream.h | 3 +++
2 files changed, 10 insertions(+), 0 deletions(-)

diffs (37 lines):

diff -r 62869a9b2e7d -r f654addf0eea src/stream/ngx_stream.c
--- a/src/stream/ngx_stream.c Fri Jun 05 22:23:26 2015 +0300
+++ b/src/stream/ngx_stream.c Fri Jun 05 23:03:13 2015 +0300
@@ -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 *
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;
diff -r 62869a9b2e7d -r f654addf0eea src/stream/ngx_stream.h
--- a/src/stream/ngx_stream.h Fri Jun 05 22:23:26 2015 +0300
+++ b/src/stream/ngx_stream.h Fri Jun 05 23:03:13 2015 +0300
@@ -109,6 +109,9 @@ typedef struct {
#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)
int tcp_keepidle;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Stream: fixed "reuseport" to actually work.

Ruslan Ermilov 692 June 06, 2015 01:00AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 298
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready