Revert "Remove an erroneous 0.5 in compute_weighted_bandwidths()"

This reverts commit 01e984870a.
This commit is contained in:
Nick Mathewson 2017-11-07 20:35:19 -05:00
parent c58471325a
commit 3dc61a5d71
2 changed files with 1 additions and 8 deletions

View File

@ -1,7 +0,0 @@
o Minor bugfixes (path selection):
- When selecting relays by bandwidth, avoid a rounding error that
could sometimes cause load to be imbalanced incorrectly. Previously,
we would always round upwards; now, we round towards the nearest
integer. This had the biggest effect when a relay's weight adjustments
should have given it weight 0, but it got weight 1 instead.
Fixes bug 23318; bugfix on 0.2.4.3-alpha.

View File

@ -2706,7 +2706,7 @@ compute_weighted_bandwidths(const smartlist_t *sl,
final_weight = weight*this_bw;
}
bandwidths[node_sl_idx] = final_weight;
bandwidths[node_sl_idx] = final_weight + 0.5;
} SMARTLIST_FOREACH_END(node);
log_debug(LD_CIRC, "Generated weighted bandwidths for rule %s based "