Mercurial > hg > nginx
changeset 2204:70a2bcc7e307
fix divide by zero if max_fails=0
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 26 Aug 2008 14:34:16 +0000 |
parents | 8e5bf1bc87e2 |
children | 5398f47082f0 |
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 Tue Aug 26 14:24:14 2008 +0000 +++ b/src/http/ngx_http_upstream_round_robin.c Tue Aug 26 14:34:16 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",