mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
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.
This commit is contained in:
parent
922ab0883d
commit
ec4ee3197f
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user