Mercurial > hg > nginx-quic
diff src/http/ngx_http_upstream_round_robin.c @ 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 | 74477ea8074f |
children | 7af1e5fe102c |
line wrap: on
line diff
--- a/src/http/ngx_http_upstream_round_robin.c +++ b/src/http/ngx_http_upstream_round_robin.c @@ -645,7 +645,9 @@ ngx_http_upstream_free_round_robin_peer( 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",