mirror of
https://github.com/nginx/nginx.git
synced 2026-07-03 23:33:26 +00:00
r2205 merge:
fix divide by zero if max_fails=0
This commit is contained in:
parent
85739a44d7
commit
abb54176a2
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…
Add table
Add a link
Reference in a new issue