aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_inet.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2013-01-10 12:58:55 +0000
committerRuslan Ermilov <ru@nginx.com>2013-01-10 12:58:55 +0000
commita2a229193abb45ad1ca4f6b3d2a7543b7e47976b (patch)
treeba7ee47761eb03b190121a9c4d69a7602560878e /src/core/ngx_inet.c
parent2cbb7ae42a455437b55b77213e3351ee126b4fc9 (diff)
downloadnginx-a2a229193abb45ad1ca4f6b3d2a7543b7e47976b.tar.gz
nginx-a2a229193abb45ad1ca4f6b3d2a7543b7e47976b.zip
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.
Diffstat (limited to 'src/core/ngx_inet.c')
-rw-r--r--src/core/ngx_inet.c14
1 files changed, 4 insertions, 10 deletions
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);
}
}