aboutsummaryrefslogtreecommitdiff
path: root/src/feature/nodelist
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-04-25 20:25:34 -0400
committerNick Mathewson <nickm@torproject.org>2019-04-25 20:25:34 -0400
commitefeb101b968fe6604ff97604afe527a36b94cfc9 (patch)
tree41085bd9b5bf159e0e3a6688ea1e0bacf527eb16 /src/feature/nodelist
parent36b4fc7437f22208838616495f699b793ca30771 (diff)
parentcc87acf29b40a135745f74412caaececf8ea0329 (diff)
downloadtor-efeb101b968fe6604ff97604afe527a36b94cfc9.tar.gz
tor-efeb101b968fe6604ff97604afe527a36b94cfc9.zip
Merge remote-tracking branch 'tor-github/pr/889'
Diffstat (limited to 'src/feature/nodelist')
-rw-r--r--src/feature/nodelist/networkstatus.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/feature/nodelist/networkstatus.c b/src/feature/nodelist/networkstatus.c
index ee22e16323..acc2f0af26 100644
--- a/src/feature/nodelist/networkstatus.c
+++ b/src/feature/nodelist/networkstatus.c
@@ -2381,7 +2381,6 @@ networkstatus_getinfo_by_purpose(const char *purpose_string, time_t now)
smartlist_t *statuses;
const uint8_t purpose = router_purpose_from_string(purpose_string);
routerstatus_t rs;
- 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.",
@@ -2398,9 +2397,6 @@ 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 */
set_routerstatus_from_routerinfo(&rs, node, ri, now, 0);
smartlist_add(statuses, networkstatus_getinfo_helper_single(&rs));
@@ -2412,11 +2408,12 @@ networkstatus_getinfo_by_purpose(const char *purpose_string, time_t now)
return answer;
}
-/** Write out router status entries for all our bridge descriptors. */
+/** Write out router status entries for all our bridge descriptors. Here, we
+ * also mark routers as running. */
void
networkstatus_dump_bridge_status_to_file(time_t now)
{
- char *status = networkstatus_getinfo_by_purpose("bridge", now);
+ char *status;
char *fname = NULL;
char *thresholds = NULL;
char *published_thresholds_and_status = NULL;
@@ -2425,6 +2422,9 @@ networkstatus_dump_bridge_status_to_file(time_t now)
char fingerprint[FINGERPRINT_LEN+1];
char *fingerprint_line = NULL;
+ dirserv_set_bridges_running(now);
+ status = networkstatus_getinfo_by_purpose("bridge", now);
+
if (me && crypto_pk_get_fingerprint(me->identity_pkey,
fingerprint, 0) >= 0) {
tor_asprintf(&fingerprint_line, "fingerprint %s\n", fingerprint);