diff options
Diffstat (limited to 'src/event/ngx_event_connect.c')
-rw-r--r-- | src/event/ngx_event_connect.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/event/ngx_event_connect.c b/src/event/ngx_event_connect.c index c06896895..6f0d94f86 100644 --- a/src/event/ngx_event_connect.c +++ b/src/event/ngx_event_connect.c @@ -81,9 +81,12 @@ ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc) for ( ;; ) { peer = &pc->peers->peers[pc->cur_peer]; - if (peer->fails <= pc->peers->max_fails - || (now - peer->accessed > pc->peers->fail_timeout)) - { + if (peer->fails <= pc->peers->max_fails) { + break; + } + + if (now - peer->accessed > pc->peers->fail_timeout) { + peer->fails = 0; break; } |