diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-12-12 19:27:14 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-12-12 19:27:14 -0500 |
commit | 9abef516f609a619b25e8f53a413a2e3df05bde8 (patch) | |
tree | 2b80767e1ad490e20e4e2de034145594173b3171 /src/or/circuituse.c | |
parent | 13455c0f1a191824d383339c9efcc3b31ecd8e6f (diff) | |
parent | bf89b089306067cffa4d2ca6b7fa7cd54790a961 (diff) | |
download | tor-9abef516f609a619b25e8f53a413a2e3df05bde8.tar.gz tor-9abef516f609a619b25e8f53a413a2e3df05bde8.zip |
Merge branch 'maint-0.3.2'
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r-- | src/or/circuituse.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 825535739f..f04448ffce 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -2074,8 +2074,12 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn, if (!connection_get_by_type(CONN_TYPE_DIR)) { int severity = LOG_NOTICE; /* Retry some stuff that might help the connection work. */ - if (entry_list_is_constrained(options) && - guards_retry_optimistic(options)) { + /* If we are configured with EntryNodes or UseBridges */ + if (entry_list_is_constrained(options)) { + /* Retry all our guards / bridges. + * guards_retry_optimistic() always returns true here. */ + int rv = guards_retry_optimistic(options); + tor_assert_nonfatal_once(rv); log_fn(severity, LD_APP|LD_DIR, "Application request when we haven't %s. " "Optimistically trying known %s again.", @@ -2083,7 +2087,12 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn, "used client functionality lately" : "received a consensus with exits", options->UseBridges ? "bridges" : "entrynodes"); - } else if (!options->UseBridges || any_bridge_descriptors_known()) { + } else { + /* Getting directory documents doesn't help much if we have a limited + * number of guards */ + tor_assert_nonfatal(!options->UseBridges); + tor_assert_nonfatal(!options->EntryNodes); + /* Retry our directory fetches, so we have a fresh set of guard info */ log_fn(severity, LD_APP|LD_DIR, "Application request when we haven't %s. " "Optimistically trying directory fetches again.", |