]> git.kaiwu.me - nginx.git/commitdiff
fix r1552 and r1464: test max fails in correct peer
authorIgor Sysoev <igor@sysoev.ru>
Tue, 2 Oct 2007 12:34:16 +0000 (12:34 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 2 Oct 2007 12:34:16 +0000 (12:34 +0000)
src/http/ngx_http_upstream_round_robin.c

index d2a894799ed29ce1609478b0925568350f6ac295..5caf06091965261d4d2472fec3be9e112dcd9a08 100644 (file)
@@ -514,7 +514,7 @@ ngx_http_upstream_get_peer(ngx_http_upstream_rr_peers_t *peers)
         }
 
         for (i = 0; i < peers->number; i++) {
-            if (peer[i].max_fails == 0 || peer[i].fails < peer->max_fails) {
+            if (peer[i].max_fails == 0 || peer[i].fails < peer[i].max_fails) {
                 peer[i].current_weight += peer[i].weight;
 
             } else {