]> git.kaiwu.me - nginx.git/commitdiff
set absolute weight, this fixes bogus "no live upstream" case when
authorIgor Sysoev <igor@sysoev.ru>
Mon, 11 Feb 2008 14:31:38 +0000 (14:31 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 11 Feb 2008 14:31:38 +0000 (14:31 +0000)
last upstream is down while live one has negative weight

src/http/ngx_http_upstream_round_robin.c

index 79747f6c44295e0d658468a2217cd6ad172b0568..c25c076b4ef1e7b777f5ea5daa2e08df133e8f5f 100644 (file)
@@ -605,7 +605,7 @@ ngx_http_upstream_get_peer(ngx_http_upstream_rr_peers_t *peers)
         }
 
         for (i = 0; i < peers->number; i++) {
-            peer[i].current_weight += peer[i].weight;
+            peer[i].current_weight = peer[i].weight;
         }
     }
 }