diff src/http/ngx_http_upstream_round_robin.c @ 1887:abbef7b5dab8

set absolute weight, this fixes bogus "no live upstream" case when last upstream is down while live one has negative weight
author Igor Sysoev <igor@sysoev.ru>
date Mon, 11 Feb 2008 14:31:38 +0000
parents 13f8dec720b5
children cb8c0c8e0c27
line wrap: on
line diff
--- a/src/http/ngx_http_upstream_round_robin.c
+++ b/src/http/ngx_http_upstream_round_robin.c
@@ -605,7 +605,7 @@ ngx_http_upstream_get_peer(ngx_http_upst
         }
 
         for (i = 0; i < peers->number; i++) {
-            peer[i].current_weight += peer[i].weight;
+            peer[i].current_weight = peer[i].weight;
         }
     }
 }