diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-09-27 12:26:23 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-09-27 12:26:23 -0400 |
commit | 26811a8e2d23cc248dc40095bbd6e0e00af08c1c (patch) | |
tree | 0d337127b542fb35b6832cab75daf89286c85f91 /src/or/routerlist.c | |
parent | 2579d827ab5e840561fb293f42a7147b8ba78efe (diff) | |
parent | 24a45f54d270d86dde456cbb45640811d1ba26c2 (diff) | |
download | tor-26811a8e2d23cc248dc40095bbd6e0e00af08c1c.tar tor-26811a8e2d23cc248dc40095bbd6e0e00af08c1c.tar.gz |
Merge remote branch 'origin/maint-0.2.2'
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 5fb4fe13c..1f542b1f4 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1610,6 +1610,7 @@ smartlist_choose_by_bandwidth_weights(smartlist_t *sl, double *bandwidths; double tmp = 0; unsigned int i; + int have_unknown = 0; /* true iff sl contains element not in consensus. */ /* Can't choose exit and guard at same time */ tor_assert(rule == NO_WEIGHTING || @@ -1726,6 +1727,7 @@ smartlist_choose_by_bandwidth_weights(smartlist_t *sl, this_bw = kb_to_bytes(rs->bandwidth); } else { /* bridge or other descriptor not in our consensus */ this_bw = router_get_advertised_bandwidth_capped(router); + have_unknown = 1; } if (router_digest_is_me(router->cache_info.identity_digest)) is_me = 1; @@ -1756,9 +1758,11 @@ smartlist_choose_by_bandwidth_weights(smartlist_t *sl, /* If there is no bandwidth, choose at random */ if (DBL_TO_U64(weighted_bw) == 0) { - log_warn(LD_CIRC, - "Weighted bandwidth is %lf in node selection for rule %s", - weighted_bw, bandwidth_weight_rule_to_string(rule)); + /* Don't warn when using bridges/relays not in the consensus */ + if (!have_unknown) + log_warn(LD_CIRC, + "Weighted bandwidth is %lf in node selection for rule %s", + weighted_bw, bandwidth_weight_rule_to_string(rule)); tor_free(bandwidths); return smartlist_choose(sl); } |