changeset 1707:f3188f6eae1f

$upstream_addr did not contain last address, the bug was introduced in r1659
author Igor Sysoev <igor@sysoev.ru>
date Tue, 11 Dec 2007 16:26:56 +0000
parents 9242e21d2f8d
children 3748e50f9b23
files src/http/ngx_http_upstream.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -665,7 +665,6 @@ ngx_http_upstream_connect(ngx_http_reque
     tp = ngx_timeofday();
     u->state->response_sec = tp->sec;
     u->state->response_msec = tp->msec;
-    u->state->peer = u->peer.name;
 
     rc = ngx_event_connect_peer(&u->peer);
 
@@ -678,6 +677,8 @@ ngx_http_upstream_connect(ngx_http_reque
         return;
     }
 
+    u->state->peer = u->peer.name;
+
     if (rc == NGX_BUSY) {
         ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "no live upstreams");
         ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_NOLIVE);