diff options
author | teor <teor2345@gmail.com> | 2017-08-29 14:04:24 +1000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-09-12 10:38:25 -0400 |
commit | 97249c4f5e389141cb4ff3562a3813bd09bff6ad (patch) | |
tree | fea0d8ade7b106af53d5a389b56ce9867b7083da /src/or/bridges.c | |
parent | 435952538da2d99e7ce46f510ac3f7dc3f910fca (diff) | |
download | tor-97249c4f5e389141cb4ff3562a3813bd09bff6ad.tar.gz tor-97249c4f5e389141cb4ff3562a3813bd09bff6ad.zip |
Make bridge clients download bridge descriptors immediately
The download schedule tells Tor to wait 15 minutes before downloading
bridge descriptors. But 17750 made Tor ignore that and start immediately.
Since we fixed 17750, Tor waits 15 minutes for bridge client bootstrap,
like the schedule says.
This fixes the download schedule to start immediately, and to try each
bridge 3 times in the first 30 seconds. This should make bridge bootstraps
more reliable.
Fixes 23347.
Diffstat (limited to 'src/or/bridges.c')
-rw-r--r-- | src/or/bridges.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/bridges.c b/src/or/bridges.c index 0818fb0812..f2244004f3 100644 --- a/src/or/bridges.c +++ b/src/or/bridges.c @@ -632,7 +632,9 @@ fetch_bridge_descriptors(const or_options_t *options, time_t now) continue; } - /* schedule another fetch as if this one will fail, in case it does */ + /* schedule another fetch as if this one will fail, in case it does + * (we can't increment after a failure, because sometimes we use the + * bridge authority, and sometimes we use the bridge direct) */ download_status_failed(&bridge->fetch_status, 0); can_use_bridge_authority = !tor_digest_is_zero(bridge->identity) && @@ -787,8 +789,13 @@ learned_bridge_descriptor(routerinfo_t *ri, int from_cache) if (bridge) { /* if we actually want to use this one */ node_t *node; /* it's here; schedule its re-fetch for a long time from now. */ - if (!from_cache) + if (!from_cache) { download_status_reset(&bridge->fetch_status); + /* We have two quick attempts in the bridge schedule, and then slow + * ones */ + download_status_failed(&bridge->fetch_status, 0); + download_status_failed(&bridge->fetch_status, 0); + } node = node_get_mutable_by_id(ri->cache_info.identity_digest); tor_assert(node); |