[nginx] Upstream: fix tries check in ip_hash.

Roman Arutyunyan arut at nginx.com
Fri May 23 09:49:59 UTC 2014


details:   http://hg.nginx.org/nginx/rev/a2bf26774cd3
branches:  
changeset: 5706:a2bf26774cd3
user:      Roman Arutyunyan <arut at nginx.com>
date:      Fri May 23 13:47:05 2014 +0400
description:
Upstream: fix tries check in ip_hash.

Make two checks for maximum number of tries consistent.
The other one checks '>' condition.

diffstat:

 src/http/modules/ngx_http_upstream_ip_hash_module.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r d5b8ee9f2201 -r a2bf26774cd3 src/http/modules/ngx_http_upstream_ip_hash_module.c
--- a/src/http/modules/ngx_http_upstream_ip_hash_module.c	Thu May 22 00:16:17 2014 +0400
+++ b/src/http/modules/ngx_http_upstream_ip_hash_module.c	Fri May 23 13:47:05 2014 +0400
@@ -231,7 +231,7 @@ ngx_http_upstream_get_ip_hash_peer(ngx_p
 
     next:
 
-        if (++iphp->tries >= 20) {
+        if (++iphp->tries > 20) {
             return iphp->get_rr_peer(pc, &iphp->rrp);
         }
     }



More information about the nginx-devel mailing list