summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-12-12 19:17:38 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-12 19:17:38 -0500
commitbf89b089306067cffa4d2ca6b7fa7cd54790a961 (patch)
treea7717d0c55eb662e37f84a63281944caf28ddba5 /src/or/circuituse.c
parentcf5ab5934e80c6c04825d9db83329627fe6b9729 (diff)
parent19a4abf2a99c6a3de2c9a2fdf3e6d7b7c404f8f8 (diff)
downloadtor-bf89b089306067cffa4d2ca6b7fa7cd54790a961.tar.gz
tor-bf89b089306067cffa4d2ca6b7fa7cd54790a961.zip
Merge branch 'bug24367_032_squashed' into maint-0.3.2
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index ebaa46e301..7baa035696 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -2079,8 +2079,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.",
@@ -2088,7 +2092,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.",