aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-06-25 11:14:44 -0400
committerNick Mathewson <nickm@torproject.org>2015-06-25 11:14:44 -0400
commit1c1d71fe1adf9202a1e0c9e4aa35c2cb7ce1fe7b (patch)
treec6904c932032d667fd5211ef91ccfc71b94b2320 /src/or/circuituse.c
parent03e3cf6a7aa86c74d01cebd61c9ad89200661e73 (diff)
parent68eaaed7982b63abedfcfba33f7e2656c68e3e4a (diff)
downloadtor-1c1d71fe1adf9202a1e0c9e4aa35c2cb7ce1fe7b.tar.gz
tor-1c1d71fe1adf9202a1e0c9e4aa35c2cb7ce1fe7b.zip
Merge remote-tracking branch 'public/bug16013_025' into maint-0.2.6
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index d0d31ad9cf..3b6f982666 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -2406,6 +2406,18 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
return 1;
}
+ /* At this point we need to re-check the state, since it's possible that
+ * our call to circuit_get_open_circ_or_launch() changed the connection's
+ * state from "CIRCUIT_WAIT" to "RENDDESC_WAIT" because we decided to
+ * re-fetch the descriptor.
+ */
+ if (ENTRY_TO_CONN(conn)->state != AP_CONN_STATE_CIRCUIT_WAIT) {
+ log_info(LD_REND, "This connection is no longer ready to attach; its "
+ "state changed."
+ "(We probably have to re-fetch its descriptor.)");
+ return 0;
+ }
+
if (rendcirc && (rendcirc->base_.purpose ==
CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED)) {
log_info(LD_REND,