diff src/http/ngx_http_upstream_round_robin.c @ 334:3f511163d908 NGINX_0_6_11

nginx 0.6.11 *) Bugfix: active connection counter always increased if mail proxy was used. *) Bugfix: if backend returned response header only using non-buffered proxy, then nginx closed backend connection on timeout. *) Bugfix: nginx did not support several "Connection" request header lines. *) Bugfix: if the "max_fails" was set for upstream server, then after first failure server weight was always one; bug appeared in 0.6.6.
author Igor Sysoev <http://sysoev.ru>
date Tue, 11 Sep 2007 00:00:00 +0400
parents 3a91bfeffaba
children 1c519aff5c0c
line wrap: on
line diff
--- a/src/http/ngx_http_upstream_round_robin.c
+++ b/src/http/ngx_http_upstream_round_robin.c
@@ -514,8 +514,8 @@ ngx_http_upstream_get_peer(ngx_http_upst
         }
 
         for (i = 0; i < peers->number; i++) {
-            if (peer[i].fails == 0) {
-                peer[i].current_weight = peer[i].weight;
+            if (peer->max_fails == 0 || peer->fails < peer->max_fails) {
+                peer[i].current_weight += peer[i].weight;
 
             } else {
                 /* 1 allows to go to quick recovery when all peers failed */