fix divide by zero if max_fails=0
diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c
index d9450c9..2479baa 100644
--- a/src/http/ngx_http_upstream_round_robin.c
+++ b/src/http/ngx_http_upstream_round_robin.c
@@ -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",