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.
This commit is contained in:
Ruslan Ermilov 2012-12-17 09:44:46 +00:00
parent bbf7043fe7
commit 2f8c1b73b8

View File

@ -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;