summaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-03-23 11:22:58 -0400
committerNick Mathewson <nickm@torproject.org>2018-03-23 11:22:58 -0400
commite263317e07e61e7adbb3515b46a978997a9d20c0 (patch)
treede37f8fd7e0b01d58237760c5f4000ad2b09dfd2 /src/or/networkstatus.c
parent11114c7e83161beb8adb47556ff437261498d618 (diff)
parent930b9855819ff80f165930fa4096ef063e802274 (diff)
downloadtor-e263317e07e61e7adbb3515b46a978997a9d20c0.tar.gz
tor-e263317e07e61e7adbb3515b46a978997a9d20c0.zip
Merge remote-tracking branch 'fristonio/ticket-24740'
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 72b96753cb..235b95b704 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -951,9 +951,12 @@ update_consensus_networkstatus_downloads(time_t now)
continue;
}
- /* Check if we're waiting for certificates to download */
- if (check_consensus_waiting_for_certs(i, now, &consensus_dl_status[i]))
+ /** Check if we're waiting for certificates to download. If we are,
+ * launch download for missing directory authority certificates. */
+ if (check_consensus_waiting_for_certs(i, now, &consensus_dl_status[i])) {
+ update_certificate_downloads(now);
continue;
+ }
/* Try the requested attempt */
log_info(LD_DIR, "Launching %s standard networkstatus consensus "
@@ -1230,16 +1233,20 @@ should_delay_dir_fetches(const or_options_t *options, const char **msg_out)
return 0;
}
-/** Launch requests for networkstatus documents and authority certificates as
- * appropriate. */
+/** Launch requests for networkstatus documents as appropriate. This is called
+ * when we retry all the connections on a SIGHUP and periodically by a Periodic
+ * event which checks whether we want to download any networkstatus documents.
+ */
void
update_networkstatus_downloads(time_t now)
{
const or_options_t *options = get_options();
if (should_delay_dir_fetches(options, NULL))
return;
+ /** Launch a consensus download request, we will wait for the consensus to
+ * download and when it completes we will launch a certificate download
+ * request. */
update_consensus_networkstatus_downloads(now);
- update_certificate_downloads(now);
}
/** Launch requests as appropriate for missing directory authority