diff options
Diffstat (limited to 'src/http/ngx_http_upstream_round_robin.c')
-rw-r--r-- | src/http/ngx_http_upstream_round_robin.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/http/ngx_http_upstream_round_robin.c b/src/http/ngx_http_upstream_round_robin.c index 4b78cffd8..61dce69cb 100644 --- a/src/http/ngx_http_upstream_round_robin.c +++ b/src/http/ngx_http_upstream_round_robin.c @@ -474,7 +474,9 @@ failed: rrp->peers = peers->next; pc->tries = rrp->peers->number; - n = rrp->peers->number / (8 * sizeof(uintptr_t)) + 1; + n = (rrp->peers->number + (8 * sizeof(uintptr_t) - 1)) + / (8 * sizeof(uintptr_t)); + for (i = 0; i < n; i++) { rrp->tried[i] = 0; } |