use real weight, do not downground to one
Igor Sysoev
14 years ago
510 | 510 | } |
511 | 511 | |
512 | 512 | for (i = 0; i < peers->number; i++) { |
513 | if (peer[i].max_fails == 0 || peer[i].fails < peer[i].max_fails) { | |
514 | peer[i].current_weight += peer[i].weight; | |
515 | ||
516 | } else { | |
517 | /* 1 allows to go to quick recovery when all peers failed */ | |
518 | peer[i].current_weight = 1; | |
519 | } | |
513 | peer[i].current_weight += peer[i].weight; | |
520 | 514 | } |
521 | 515 | } |
522 | 516 | } |