summaryrefslogtreecommitdiff
path: root/src/or/hs_circuitmap.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-12-11 09:53:39 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-11 09:53:39 -0500
commit7803b19c43b02596c3393667ab1cba9571347823 (patch)
tree90b6aa9dac4c45a97af4c00e66f9806dd9f6d062 /src/or/hs_circuitmap.c
parent030d3d52f5bf03d2e611c7f208a56b3e45d47210 (diff)
parent855982728085cc9497c70c2b74d8d58b62cab1a1 (diff)
downloadtor-7803b19c43b02596c3393667ab1cba9571347823.tar.gz
tor-7803b19c43b02596c3393667ab1cba9571347823.zip
Merge remote-tracking branch 'ffmancera/github/bug23459'
Diffstat (limited to 'src/or/hs_circuitmap.c')
-rw-r--r--src/or/hs_circuitmap.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/src/or/hs_circuitmap.c b/src/or/hs_circuitmap.c
index e3d364d7cd..112c8bdced 100644
--- a/src/or/hs_circuitmap.c
+++ b/src/or/hs_circuitmap.c
@@ -431,30 +431,54 @@ hs_circuitmap_get_rend_circ_client_side(const uint8_t *cookie)
{
origin_circuit_t *circ = NULL;
- circ = hs_circuitmap_get_origin_circuit(HS_TOKEN_REND_CLIENT_SIDE,
- REND_TOKEN_LEN, cookie,
- CIRCUIT_PURPOSE_C_REND_READY);
+ circ = hs_circuitmap_get_established_rend_circ_client_side(cookie);
if (circ) {
return circ;
}
circ = hs_circuitmap_get_origin_circuit(HS_TOKEN_REND_CLIENT_SIDE,
REND_TOKEN_LEN, cookie,
- CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED);
+ CIRCUIT_PURPOSE_C_ESTABLISH_REND);
+ return circ;
+}
+
+/* Public function: Return client-side established rendezvous circuit with
+ * rendezvous <b>cookie</b>. It will look for circuits with the following
+ * purposes:
+ *
+ * a) CIRCUIT_PURPOSE_C_REND_READY: Established rend circuit (received
+ * RENDEZVOUS_ESTABLISHED). Waiting for RENDEZVOUS2 from service, and for
+ * INTRODUCE_ACK from intro point.
+ *
+ * b) CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED: Established rend circuit and
+ * introduce circuit acked. Waiting for RENDEZVOUS2 from service.
+ *
+ * c) CIRCUIT_PURPOSE_C_REND_JOINED: Established rend circuit and received
+ * RENDEZVOUS2 from service.
+ *
+ * Return NULL if no such circuit is found in the circuitmap. */
+origin_circuit_t *
+hs_circuitmap_get_established_rend_circ_client_side(const uint8_t *cookie)
+{
+ origin_circuit_t *circ = NULL;
+
+ circ = hs_circuitmap_get_origin_circuit(HS_TOKEN_REND_CLIENT_SIDE,
+ REND_TOKEN_LEN, cookie,
+ CIRCUIT_PURPOSE_C_REND_READY);
if (circ) {
return circ;
}
circ = hs_circuitmap_get_origin_circuit(HS_TOKEN_REND_CLIENT_SIDE,
REND_TOKEN_LEN, cookie,
- CIRCUIT_PURPOSE_C_REND_JOINED);
+ CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED);
if (circ) {
return circ;
}
circ = hs_circuitmap_get_origin_circuit(HS_TOKEN_REND_CLIENT_SIDE,
REND_TOKEN_LEN, cookie,
- CIRCUIT_PURPOSE_C_ESTABLISH_REND);
+ CIRCUIT_PURPOSE_C_REND_JOINED);
return circ;
}