summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_upstream_round_robin.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/http/ngx_http_upstream_round_robin.c
parent2cbb7ae42a455437b55b77213e3351ee126b4fc9 (diff)
downloadnginx-a2a229193abb45ad1ca4f6b3d2a7543b7e47976b.tar.gz
nginx-a2a229193abb45ad1ca4f6b3d2a7543b7e47976b.tar.bz2
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/http/ngx_http_upstream_round_robin.c')
-rw-r--r--src/http/ngx_http_upstream_round_robin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c
index 61dce69cb..b48039414 100644
--- a/src/http/ngx_http_upstream_round_robin.c
+++ b/src/http/ngx_http_upstream_round_robin.c
@@ -161,7 +161,7 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
/* an upstream implicitly defined by proxy_pass, etc. */
- if (us->port == 0 && us->default_port == 0) {
+ if (us->port == 0) {
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
"no port in upstream \"%V\" in %s:%ui",
&us->host, us->file_name, us->line);
@@ -171,7 +171,7 @@ ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
ngx_memzero(&u, sizeof(ngx_url_t));
u.host = us->host;
- u.port = (in_port_t) (us->port ? us->port : us->default_port);
+ u.port = us->port;
if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
if (u.err) {