From b3c1152bae9e021e10dd014970913114753ac74d Mon Sep 17 00:00:00 2001 From: David Goulet Date: Fri, 16 Jan 2015 17:43:33 -0500 Subject: [PATCH 1/2] Fix: close intro circuit if no more intro points are usable Once a NACK is received on the intro circuit, tor tries an other usable one by extending the current circuit to it. If no more intro points are usable, now close the circuit. Fixes #14224 Signed-off-by: David Goulet --- src/or/rendclient.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/or/rendclient.c b/src/or/rendclient.c index 19a8cef1bf..1353ee38d5 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -468,6 +468,10 @@ rend_client_introduction_acked(origin_circuit_t *circ, /* XXXX If that call failed, should we close the rend circuit, * too? */ return result; + } else { + /* Close circuit because no more intro points are usable thus this + * circuit is not useful anymore. */ + circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_FINISHED); } } return 0; From b5525476f5fea4b97d562247dbad117068eb4fbb Mon Sep 17 00:00:00 2001 From: David Goulet Date: Mon, 19 Jan 2015 10:23:58 -0500 Subject: [PATCH 2/2] Fix: close intro circuit if no more intro points are usable Once a NACK is received on the intro circuit, tor tries an other usable one by extending the current circuit to it. If no more intro points are usable, now close the circuit. Also, it's reason is changed before closing it so we don't report again an intro point failure and trigger an extra HS fetch. Fixes #14224 Signed-off-by: David Goulet --- changes/bug14224 | 4 ++++ src/or/rendclient.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 changes/bug14224 diff --git a/changes/bug14224 b/changes/bug14224 new file mode 100644 index 0000000000..0608940449 --- /dev/null +++ b/changes/bug14224 @@ -0,0 +1,4 @@ + o Minor Bugfix + - Close the intro circuit once we don't have any more usable intro + points instead of making it timeout at some point. This also make sure + no extra HS descriptor fetch is triggered. diff --git a/src/or/rendclient.c b/src/or/rendclient.c index 1353ee38d5..31e220aca2 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -469,8 +469,11 @@ rend_client_introduction_acked(origin_circuit_t *circ, * too? */ return result; } else { - /* Close circuit because no more intro points are usable thus this - * circuit is not useful anymore. */ + /* Close circuit because no more intro points are usable thus not + * useful anymore. Change it's purpose before so we don't report an + * intro point failure again triggering an extra descriptor fetch. */ + circuit_change_purpose(TO_CIRCUIT(circ), + CIRCUIT_PURPOSE_C_INTRODUCE_ACKED); circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_FINISHED); } }