From a2a229193abb45ad1ca4f6b3d2a7543b7e47976b Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Thu, 10 Jan 2013 12:58:55 +0000 Subject: Fixed "proxy_pass" with IP address and no port (ticket #276). Upstreams created by "proxy_pass" with IP address and no port were broken in 1.3.10, by not initializing port in u->sockaddr. API change: ngx_parse_url() was modified to always initialize port (in u->sockaddr and in u->port), even for the u->no_resolve case; ngx_http_upstream() and ngx_http_upstream_add() were adopted. --- src/core/ngx_inet.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/core/ngx_inet.c') diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c index 9aec68964..7757ab7d9 100644 --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -707,11 +707,8 @@ ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u) } u->no_port = 1; - - if (!u->no_resolve) { - u->port = u->default_port; - sin->sin_port = htons(u->default_port); - } + u->port = u->default_port; + sin->sin_port = htons(u->default_port); } len = last - host; @@ -868,11 +865,8 @@ 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); - } + u->port = u->default_port; + sin6->sin6_port = htons(u->default_port); } } -- cgit