Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Decrease ->tries after every connection attempt

  • Loading branch information...
commit 1e1b0be1301cdf1d2b6f2b91983a495f257a0306 1 parent 04b210b
@gnosek authored
Showing with 3 additions and 6 deletions.
  1. +3 −6 ngx_http_upstream_fair_module.c
View
9 ngx_http_upstream_fair_module.c
@@ -479,9 +479,6 @@ ngx_http_upstream_fair_try_peer(ngx_peer_connection_t *pc,
}
ngx_bitvector_set(fp->tried, peer_id);
-
- if (pc)
- pc->tries--;
return NGX_BUSY;
}
@@ -577,6 +574,9 @@ ngx_http_upstream_get_fair_peer(ngx_peer_connection_t *pc, void *data)
ngx_log_debug(NGX_LOG_DEBUG_HTTP, pc->log, 0, "[upstream_fair] fp->current = %d, peer_id = %d, ret = %d",
fp->current, peer_id, ret);
+ if (pc)
+ pc->tries--;
+
if (ret == NGX_BUSY) {
for (i = 0; i < fp->rrp->number; i++) {
fp->rrp->peer[i].fails = 0;
@@ -584,9 +584,6 @@ ngx_http_upstream_get_fair_peer(ngx_peer_connection_t *pc, void *data)
pc->name = fp->rrp->name;
fp->current = NGX_PEER_INVALID;
- if (pc->tries > 0) {
- pc->tries--;
- }
return NGX_BUSY;
}
Please sign in to comment.
Something went wrong with that request. Please try again.