[nginx] svn commit: r4971 - trunk/src/core

ru at nginx.com ru at nginx.com
Mon Dec 17 09:44:46 UTC 2012


Author: ru
Date: 2012-12-17 09:44:46 +0000 (Mon, 17 Dec 2012)
New Revision: 4971
URL: http://trac.nginx.org/nginx/changeset/4971/nginx

Log:
Fixed URL parsing code.

The URL parsing code is not expected to initialize port from default port
when in "no_resolve" mode.  This got broken in r4671 for the case of IPv6
literals.


Modified:
   trunk/src/core/ngx_inet.c

Modified: trunk/src/core/ngx_inet.c
===================================================================
--- trunk/src/core/ngx_inet.c	2012-12-17 09:31:53 UTC (rev 4970)
+++ trunk/src/core/ngx_inet.c	2012-12-17 09:44:46 UTC (rev 4971)
@@ -828,6 +828,11 @@
 
         } else {
             u->no_port = 1;
+
+            if (!u->no_resolve) {
+                u->port = u->default_port;
+                sin6->sin6_port = htons(u->default_port);
+            }
         }
     }
 
@@ -850,11 +855,6 @@
         u->wildcard = 1;
     }
 
-    if (u->no_port) {
-        u->port = u->default_port;
-        sin6->sin6_port = htons(u->default_port);
-    }
-
     u->family = AF_INET6;
     u->naddrs = 1;
 



More information about the nginx-devel mailing list