aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_inet.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2012-12-17 09:44:46 +0000
committerRuslan Ermilov <ru@nginx.com>2012-12-17 09:44:46 +0000
commit2f8c1b73b8a6ba05219fa2e3643f1a4f42308043 (patch)
tree476b8dca6aaabe77100ebdcc4ac4e92b9544ec2a /src/core/ngx_inet.c
parentbbf7043fe7a4c9adb23586ea18605efa124c564c (diff)
downloadnginx-2f8c1b73b8a6ba05219fa2e3643f1a4f42308043.tar.gz
nginx-2f8c1b73b8a6ba05219fa2e3643f1a4f42308043.zip
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.
Diffstat (limited to 'src/core/ngx_inet.c')
-rw-r--r--src/core/ngx_inet.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c
index ea27fada8..1fd1691ab 100644
--- a/src/core/ngx_inet.c
+++ b/src/core/ngx_inet.c
@@ -828,6 +828,11 @@ ngx_parse_inet6_url(ngx_pool_t *pool, ngx_url_t *u)
} 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 @@ ngx_parse_inet6_url(ngx_pool_t *pool, ngx_url_t *u)
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;