Mercurial > hg > nginx
changeset 2325:50be8dd53d5e stable-0.6
r2205 merge:
fix divide by zero if max_fails=0
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 20 Nov 2008 17:16:39 +0000 |
parents | 9e219f02594c |
children | 805165c6ba2b |
files | src/http/ngx_http_upstream_round_robin.c |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http_upstream_round_robin.c Thu Nov 20 17:12:15 2008 +0000 +++ b/src/http/ngx_http_upstream_round_robin.c Thu Nov 20 17:16:39 2008 +0000 @@ -645,7 +645,9 @@ peer->fails++; peer->accessed = now; - peer->current_weight -= peer->weight / peer->max_fails; + if (peer->max_fails) { + peer->current_weight -= peer->weight / peer->max_fails; + } ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0, "free rr peer failed: %ui %i",