]> git.kaiwu.me - nginx.git/commitdiff
fix case when server was marked as down after one failure
authorIgor Sysoev <igor@sysoev.ru>
Wed, 5 Sep 2007 15:30:19 +0000 (15:30 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 5 Sep 2007 15:30:19 +0000 (15:30 +0000)
src/http/ngx_http_upstream_round_robin.c

index 106d6450e3c3cf92019765ce2f092005b5150a9e..4f017f9224edeec5cd0ef0cf4387c308b2ac4ccd 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].fails == 0) {
+            if (peer->max_fails == 0 || peer->fails < peer->max_fails) {
                 peer[i].current_weight += peer[i].weight;
 
             } else {