summaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-12-06 14:37:15 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-06 14:37:15 -0500
commit91f72bbb6c2ef97836393144f9cd095a71c5f008 (patch)
tree14707414a61f6232188eca6bd358d5ba149c8901 /src/or/networkstatus.c
parentaa6212a85810937b2aa43fa1021e0118a5fb3f2a (diff)
parent9acfd70f26ce8ad10c0b4a68de24121abf503c69 (diff)
downloadtor-91f72bbb6c2ef97836393144f9cd095a71c5f008.tar.gz
tor-91f72bbb6c2ef97836393144f9cd095a71c5f008.zip
Merge remote-tracking branch 'teor/bug24489'
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index d426d4858e..14629cc5ff 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -2224,13 +2224,13 @@ networkstatus_getinfo_helper_single(const routerstatus_t *rs)
char *
networkstatus_getinfo_by_purpose(const char *purpose_string, time_t now)
{
- time_t cutoff = now - ROUTER_MAX_AGE_TO_PUBLISH;
+ const time_t cutoff = now - ROUTER_MAX_AGE_TO_PUBLISH;
char *answer;
routerlist_t *rl = router_get_routerlist();
smartlist_t *statuses;
- uint8_t purpose = router_purpose_from_string(purpose_string);
+ const uint8_t purpose = router_purpose_from_string(purpose_string);
routerstatus_t rs;
- int bridge_auth = authdir_mode_bridge(get_options());
+ const int bridge_auth = authdir_mode_bridge(get_options());
if (purpose == ROUTER_PURPOSE_UNKNOWN) {
log_info(LD_DIR, "Unrecognized purpose '%s' when listing router statuses.",
@@ -2247,6 +2247,7 @@ networkstatus_getinfo_by_purpose(const char *purpose_string, time_t now)
continue;
if (ri->purpose != purpose)
continue;
+ /* TODO: modifying the running flag in a getinfo is a bad idea */
if (bridge_auth && ri->purpose == ROUTER_PURPOSE_BRIDGE)
dirserv_set_router_is_running(ri, now);
/* then generate and write out status lines for each of them */