Upstream: fixed state resetting when switching to backup servers.

Based on patch by Thomas Chen (ticket #257).
This commit is contained in:
Valentin Bartenev 2012-12-25 08:02:21 +00:00
parent cb90df084f
commit dd46cc659a
2 changed files with 6 additions and 2 deletions

View File

@ -313,7 +313,9 @@ failed:
lcp->rrp.peers = peers->next;
pc->tries = lcp->rrp.peers->number;
n = lcp->rrp.peers->number / (8 * sizeof(uintptr_t)) + 1;
n = (lcp->rrp.peers->number + (8 * sizeof(uintptr_t) - 1))
/ (8 * sizeof(uintptr_t));
for (i = 0; i < n; i++) {
lcp->rrp.tried[i] = 0;
}

View File

@ -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;
}