Klaus Demo nginx / 333723e
fix divide by zero if max_fails=0 Igor Sysoev 13 years ago
1 changed file(s) with 3 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
644644 peer->fails++;
645645 peer->accessed = now;
646646
647 peer->current_weight -= peer->weight / peer->max_fails;
647 if (peer->max_fails) {
648 peer->current_weight -= peer->weight / peer->max_fails;
649 }
648650
649651 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
650652 "free rr peer failed: %ui %i",