[nginx] svn commit: r4793 - in branches/stable-1.2: . src/http

mdounin at mdounin.ru mdounin at mdounin.ru
Mon Aug 6 16:03:57 UTC 2012


Author: mdounin
Date: 2012-08-06 16:03:56 +0000 (Mon, 06 Aug 2012)
New Revision: 4793
URL: http://trac.nginx.org/nginx/changeset/4793/nginx

Log:
Merge of r4756: fixed listen addresses sorting (ticket #187) 

Fixed sorting of listen addresses so that wildcard address is always at
the end.  Failure to do so could result in several listen sockets to be
created instead of only one listening on wildcard address.

Reported by Roman Odaisky.


Modified:
   branches/stable-1.2/
   branches/stable-1.2/src/http/ngx_http.c

Index: branches/stable-1.2
===================================================================
--- branches/stable-1.2	2012-08-06 15:52:02 UTC (rev 4792)
+++ branches/stable-1.2	2012-08-06 16:03:56 UTC (rev 4793)

Property changes on: branches/stable-1.2
___________________________________________________________________
Modified: svn:mergeinfo
## -1 +1 ##
-/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754
+/trunk:4611-4632,4636-4657,4671-4672,4674-4676,4682,4684-4699,4704-4706,4713,4736-4738,4740-4741,4754,4756
\ No newline at end of property
Modified: branches/stable-1.2/src/http/ngx_http.c
===================================================================
--- branches/stable-1.2/src/http/ngx_http.c	2012-08-06 15:52:02 UTC (rev 4792)
+++ branches/stable-1.2/src/http/ngx_http.c	2012-08-06 16:03:56 UTC (rev 4793)
@@ -1613,6 +1613,11 @@
         return 1;
     }
 
+    if (second->opt.wildcard) {
+        /* a wildcard address must be the last resort, shift it to the end */
+        return -1;
+    }
+
     if (first->opt.bind && !second->opt.bind) {
         /* shift explicit bind()ed addresses to the start */
         return -1;



More information about the nginx-devel mailing list