summaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2017-12-11 02:29:05 +1100
committerNick Mathewson <nickm@torproject.org>2017-12-12 19:17:25 -0500
commit19a4abf2a99c6a3de2c9a2fdf3e6d7b7c404f8f8 (patch)
tree48e37c5c8b39c91a4ee509b677d93a39822d1a2e /src/or/directory.c
parent6b5c70670b26b9560febf5dc70f814d5e515c0f8 (diff)
downloadtor-19a4abf2a99c6a3de2c9a2fdf3e6d7b7c404f8f8.tar.gz
tor-19a4abf2a99c6a3de2c9a2fdf3e6d7b7c404f8f8.zip
Make sure bridges are definitely running before delaying directory fetches
Retry directory downloads when we get our first bridge descriptor during bootstrap or while reconnecting to the network. Keep retrying every time we get a bridge descriptor, until we have a reachable bridge. Stop delaying bridge descriptor fetches when we have cached bridge descriptors. Instead, only delay bridge descriptor fetches when we have at least one reachable bridge. Fixes bug 24367; bugfix on 0.2.0.3-alpha.
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index e49fd595c9..f14bdde90b 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -5337,12 +5337,13 @@ find_dl_schedule(const download_status_t *dls, const or_options_t *options)
}
}
case DL_SCHED_BRIDGE:
- /* A bridge client downloading bridge descriptors */
- if (options->UseBridges && num_bridges_usable() > 0) {
- /* A bridge client with one or more running bridges */
+ if (options->UseBridges && num_bridges_usable(0) > 0) {
+ /* A bridge client that is sure that one or more of its bridges are
+ * running can afford to wait longer to update bridge descriptors. */
return options->TestingBridgeDownloadSchedule;
} else {
- /* A bridge client with no running bridges */
+ /* A bridge client which might have no running bridges, must try to
+ * get bridge descriptors straight away. */
return options->TestingBridgeBootstrapDownloadSchedule;
}
default: