diff options
author | teor <teor2345@gmail.com> | 2017-12-11 02:29:05 +1100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-12-12 19:17:25 -0500 |
commit | 19a4abf2a99c6a3de2c9a2fdf3e6d7b7c404f8f8 (patch) | |
tree | 48e37c5c8b39c91a4ee509b677d93a39822d1a2e /src/test/test_dir.c | |
parent | 6b5c70670b26b9560febf5dc70f814d5e515c0f8 (diff) | |
download | tor-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/test/test_dir.c')
-rw-r--r-- | src/test/test_dir.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test/test_dir.c b/src/test/test_dir.c index 0b34e8b339..997b110d62 100644 --- a/src/test/test_dir.c +++ b/src/test/test_dir.c @@ -5877,8 +5877,9 @@ mock_networkstatus_consensus_can_use_extra_fallbacks( static int mock_num_bridges_usable_value = 0; static int -mock_num_bridges_usable(void) +mock_num_bridges_usable(int use_maybe_reachable) { + (void)use_maybe_reachable; return mock_num_bridges_usable_value; } @@ -6031,7 +6032,7 @@ test_dir_find_dl_schedule(void* data) /* client */ mock_options->ClientOnly = 1; mock_options->UseBridges = 1; - if (num_bridges_usable() > 0) { + if (num_bridges_usable(0) > 0) { tt_ptr_op(find_dl_schedule(&dls, mock_options), OP_EQ, &bridge); } else { tt_ptr_op(find_dl_schedule(&dls, mock_options), OP_EQ, &bridge_bootstrap); |