Why can't I use the "ssl" modified on more than one listen statement?

portante nginx-forum at nginx.us
Sat Sep 25 19:00:18 MSD 2010


Hello,

Here is a patch against 0.8.50 to only complain when the listen options
are actually different.

Would folks be interested in this?

[code]
$ svn diff -r 32178:32179 src/http/ngx_http.c
Index: src/http/ngx_http.c
===================================================================
--- src/http/ngx_http.c (revision 32178)
+++ src/http/ngx_http.c (revision 32179)
@@ -1273,9 +1273,35 @@
         if (lsopt->set) {
 
             if (addr[i].opt.set) {
-                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
-                        "a duplicate listen options for %s",
addr[i].opt.addr);
-                return NGX_ERROR;
+               /*
+                * If this set is not the same as the old set, complain
+                */
+               if ((lsopt->default_server !=
addr[i].opt.default_server)
+                       || (lsopt->bind != addr[i].opt.bind)
+                       || (lsopt->wildcard != addr[i].opt.wildcard)
+#if (NGX_HTTP_SSL)
+                       || (lsopt->ssl != addr[i].opt.ssl)
+#endif
+#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
+                       || (lsopt->ipv6only != addr[i].opt.ipv6only)
+#endif
+                       || (lsopt->backlog != addr[i].opt.backlog)
+                       || (lsopt->rcvbuf != addr[i].opt.rcvbuf)
+                       || (lsopt->sndbuf != addr[i].opt.sndbuf)
+#if (NGX_HAVE_SETFIB)
+                       || (lsopt->setfib != addr[i].opt.setfib)
+#endif
+#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
+                       || (ngx_strcmp(lsopt->accept_filter,
addr[i].opt.accept_filter) != 0)
+#endif
+#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
+                       || (lsopt->deferred_accept !=
addr[i].opt.deferred_accept)
+#endif
+                       || (ngx_strcmp(lsopt->addr, addr[i].opt.addr) !=
0)) {
+                   ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                       "conflicting listen options for %s",
addr[i].opt.addr);
+                   return NGX_ERROR;
+               }
             }
 
             addr[i].opt = *lsopt;
[/code]

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,132621,133967#msg-133967




More information about the nginx mailing list