aboutsummaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-05-09 12:18:04 -0400
committerNick Mathewson <nickm@torproject.org>2018-05-09 12:18:39 -0400
commitc0feb698a0ab8574019d23cbd3060eb0513489c4 (patch)
tree20eb84a168e535513bf2f6c3fcb5cdcafbd02891 /src/or/router.c
parent50328533e3595b9cc2d3fc72f81f56572c9e732d (diff)
downloadtor-c0feb698a0ab8574019d23cbd3060eb0513489c4.tar.gz
tor-c0feb698a0ab8574019d23cbd3060eb0513489c4.zip
Comment-only fix: annotate we_are_hibernating() usage
Everywhere we use we_are_hibernating(), remind the reader what it means. (Also, add an XXXX to note a DisableNetwork usage to change later.)
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 996a28a91f..71b292a67b 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -2268,6 +2268,7 @@ router_build_fresh_descriptor(routerinfo_t **r, extrainfo_t **e)
/* and compute ri->bandwidthburst similarly */
ri->bandwidthburst = get_effective_bwburst(options);
+ /* Report bandwidth, unless we're hibernating or shutting down */
ri->bandwidthcapacity = hibernating ? 0 : rep_hist_bandwidth_assess();
if (dns_seems_to_be_broken() || has_dns_init_failed()) {
@@ -2538,6 +2539,8 @@ check_descriptor_bandwidth_changed(time_t now)
return;
prev = router_get_my_routerinfo()->bandwidthcapacity;
+ /* Consider ourselves to have zero bandwidth if we're hibernating or
+ * shutting down. */
cur = we_are_hibernating() ? 0 : rep_hist_bandwidth_assess();
if ((prev != cur && (!prev || !cur)) ||
cur > prev*2 ||