Mercurial > hg > nginx
diff src/http/ngx_http_upstream_round_robin.c @ 4991:a384c60d55f3
Upstream: fixed state resetting when switching to backup servers.
Based on patch by Thomas Chen (ticket #257).
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Tue, 25 Dec 2012 08:02:21 +0000 |
parents | dcb853acae97 |
children | c9059bd5445b |
line wrap: on
line diff
--- 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; }