diff options
author | Roger Dingledine <arma@torproject.org> | 2014-08-05 16:54:46 -0400 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2014-08-06 18:30:14 -0400 |
commit | fcac4b4467427e8f6ad948e8c8e6f34a0131e716 (patch) | |
tree | f5af6efe0fef0697787e3d75067f342a8f033a30 /src | |
parent | 0c869af7f8626cc74a7b82d0c0d6192cbb796d02 (diff) | |
download | tor-fcac4b4467427e8f6ad948e8c8e6f34a0131e716.tar.gz tor-fcac4b4467427e8f6ad948e8c8e6f34a0131e716.zip |
Build circuits more readily when DisableNetwork goes to 0
When Tor starts with DisabledNetwork set, it would correctly
conclude that it shouldn't try making circuits, but it would
mistakenly cache this conclusion and continue believing it even
when DisableNetwork is set to 0. Fixes the bug introduced by the
fix for bug 11200; bugfix on 0.2.5.4-alpha.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/nodelist.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c index 8f870816d2..7b1f338bd4 100644 --- a/src/or/nodelist.c +++ b/src/or/nodelist.c @@ -1275,10 +1275,21 @@ static char dir_info_status[256] = ""; int router_have_minimum_dir_info(void) { + static int logged_delay=0; + const char *delay_fetches_msg = NULL; + if (should_delay_dir_fetches(get_options(), &delay_fetches_msg)) { + if (!logged_delay) + log_notice(LD_DIR, "Delaying directory fetches: %s", delay_fetches_msg); + logged_delay=1; + strlcpy(dir_info_status, delay_fetches_msg, sizeof(dir_info_status)); + return 0; + } + logged_delay = 0; /* reset it if we get this far */ + if (PREDICT_UNLIKELY(need_to_update_have_min_dir_info)) { update_router_have_minimum_dir_info(); - need_to_update_have_min_dir_info = 0; } + return have_min_dir_info; } @@ -1498,7 +1509,6 @@ update_router_have_minimum_dir_info(void) const networkstatus_t *consensus = networkstatus_get_reasonably_live_consensus(now,usable_consensus_flavor()); int using_md; - const char *delay_fetches_msg = NULL; if (!consensus) { if (!networkstatus_get_latest_consensus()) @@ -1511,13 +1521,6 @@ update_router_have_minimum_dir_info(void) goto done; } - if (should_delay_dir_fetches(get_options(), &delay_fetches_msg)) { - log_notice(LD_DIR, "Delaying directory fetches: %s", delay_fetches_msg); - strlcpy(dir_info_status, delay_fetches_msg, sizeof(dir_info_status)); - res = 0; - goto done; - } - using_md = consensus->flavor == FLAV_MICRODESC; { |