aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-13 09:20:19 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-13 09:20:19 -0400
commitdcaf971a01f912d74a076d53baf7689460c3474e (patch)
treead647cf47a4e3dba98faec767afbc1e4232df322 /src/or/directory.c
parent3092c8bb3e5eef94016327a83b07bab1c4ab3694 (diff)
parentc86013291bd26f3497e9efcf96125342d97cba33 (diff)
downloadtor-dcaf971a01f912d74a076d53baf7689460c3474e.tar.gz
tor-dcaf971a01f912d74a076d53baf7689460c3474e.zip
Merge remote-tracking branch 'teor/bug23470-029'
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index fed4277dec..89e2735e61 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -5323,26 +5323,24 @@ connection_dir_finished_connecting(dir_connection_t *conn)
STATIC const smartlist_t *
find_dl_schedule(const download_status_t *dls, const or_options_t *options)
{
- const int dir_server = dir_server_mode(options);
- const int multi_d = networkstatus_consensus_can_use_multiple_directories(
- options);
- const int we_are_bootstrapping = networkstatus_consensus_is_bootstrapping(
- time(NULL));
- const int use_fallbacks = networkstatus_consensus_can_use_extra_fallbacks(
- options);
switch (dls->schedule) {
case DL_SCHED_GENERIC:
- if (dir_server) {
+ /* Any other directory document */
+ if (dir_server_mode(options)) {
+ /* A directory authority or directory mirror */
return options->TestingServerDownloadSchedule;
} else {
return options->TestingClientDownloadSchedule;
}
case DL_SCHED_CONSENSUS:
- if (!multi_d) {
+ if (!networkstatus_consensus_can_use_multiple_directories(options)) {
+ /* A public relay */
return options->TestingServerConsensusDownloadSchedule;
} else {
- if (we_are_bootstrapping) {
- if (!use_fallbacks) {
+ /* A client or bridge */
+ if (networkstatus_consensus_is_bootstrapping(time(NULL))) {
+ /* During bootstrapping */
+ if (!networkstatus_consensus_can_use_extra_fallbacks(options)) {
/* A bootstrapping client without extra fallback directories */
return
options->ClientBootstrapConsensusAuthorityOnlyDownloadSchedule;
@@ -5358,6 +5356,8 @@ find_dl_schedule(const download_status_t *dls, const or_options_t *options)
options->ClientBootstrapConsensusFallbackDownloadSchedule;
}
} else {
+ /* A client with a reasonably live consensus, with or without
+ * certificates */
return options->TestingClientConsensusDownloadSchedule;
}
}