aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-04-11 10:24:11 -0400
committerNick Mathewson <nickm@torproject.org>2013-04-11 10:26:17 -0400
commitec4ee3197fb0891a094a5fc4860c0b94eefee3c7 (patch)
tree94cdf56ed4b07ed53572063e2c7cb64a3158b2bc /src/or/dirserv.c
parent922ab0883d2f037d18cfc02083c68777e4dfb349 (diff)
downloadtor-ec4ee3197fb0891a094a5fc4860c0b94eefee3c7.tar
tor-ec4ee3197fb0891a094a5fc4860c0b94eefee3c7.tar.gz
Use correct units for dirserv_get_{credible_bandwidth,bandwidth_for_router}
We were mixing bandwidth file entries (which are in kilobytes) with router_get_advertised_bw() entries, which were in bytes. Also, use router_get_advertised_bandwidth_capped() for credible_bandwidth.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index e837e4bed..ed19406ba 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -2214,7 +2214,7 @@ dirserv_get_bandwidth_for_router(const routerinfo_t *ri)
bw = (uint32_t)mbw;
} else {
/* If not, fall back to advertised */
- bw = router_get_advertised_bandwidth(ri);
+ bw = router_get_advertised_bandwidth(ri) / 1000;
}
}
@@ -2263,7 +2263,7 @@ dirserv_get_credible_bandwidth(const routerinfo_t *ri)
bw = 0;
} else {
/* Return an advertised bandwidth otherwise */
- bw = router_get_advertised_bandwidth(ri);
+ bw = router_get_advertised_bandwidth_capped(ri) / 1000;
}
} else {
/* We have the measured bandwidth in mbw */