aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/circuituse.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2019-12-03 11:08:13 -0500
committerGeorge Kadianakis <desnacked@riseup.net>2019-12-10 18:33:48 +0200
commitfc32349adc33ceb0323b7149d661fba71b7f7b98 (patch)
treef19d3af10d6603e489d7a3e0f8fd87ea2404acc5 /src/core/or/circuituse.c
parent65759f29019ed4cd33502fef9b06bb92aa6e348a (diff)
downloadtor-fc32349adc33ceb0323b7149d661fba71b7f7b98.tar.gz
tor-fc32349adc33ceb0323b7149d661fba71b7f7b98.zip
hs-v3: Handle client rendezvous circuit timeout
With v3, the "pending_final_cpath" of a circuit is always NULL which means that for v3, established client rendezvous circuit waiting for the intro point to ACK, will always end up timing out quickly. This can increase the delays to which you connect to a service since in order to succeed, the rendezvous circuit needs to fully established (CIRCUIT_PURPOSE_C_REND_JOINED) within the cutoff of the introduction circuit as well which is these days around 2-3 seconds. Fixes #32021 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core/or/circuituse.c')
-rw-r--r--src/core/or/circuituse.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c
index ad9841cc36..e5013fe968 100644
--- a/src/core/or/circuituse.c
+++ b/src/core/or/circuituse.c
@@ -775,16 +775,11 @@ circuit_expire_building(void)
if (!(TO_ORIGIN_CIRCUIT(victim)->hs_circ_has_timed_out)) {
switch (victim->purpose) {
case CIRCUIT_PURPOSE_C_REND_READY:
- /* We only want to spare a rend circ if it has been specified in
- * an INTRODUCE1 cell sent to a hidden service. A circ's
- * pending_final_cpath field is non-NULL iff it is a rend circ
- * and we have tried to send an INTRODUCE1 cell specifying it.
- * Thus, if the pending_final_cpath field *is* NULL, then we
- * want to not spare it. */
- if (TO_ORIGIN_CIRCUIT(victim)->build_state &&
- TO_ORIGIN_CIRCUIT(victim)->build_state->pending_final_cpath ==
- NULL)
+ /* We only want to spare a rend circ iff it has been specified in an
+ * INTRODUCE1 cell sent to a hidden service. */
+ if (!hs_circ_is_rend_sent_in_intro1(CONST_TO_ORIGIN_CIRCUIT(victim))) {
break;
+ }
/* fallthrough! */
case CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT:
case CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED: