mirror of
https://github.com/nginx/nginx.git
synced 2026-05-28 04:12:47 -04:00
fix divide by zero if max_fails=0
This commit is contained in:
parent
c9491d113c
commit
333723e001
1 changed files with 3 additions and 1 deletions
|
|
@ -645,7 +645,9 @@ ngx_http_upstream_free_round_robin_peer(ngx_peer_connection_t *pc, void *data,
|
|||
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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue