summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-09-25 16:47:16 -0400
committerDavid Goulet <dgoulet@torproject.org>2017-12-05 10:55:41 -0500
commitba63c4099a491c3f96160005f94cf3a61433c145 (patch)
tree4825b3fcf1a38422e2316816f3af92dbd71de834
parent97702c69b03b19a8a6f867e56f716ce984550fa0 (diff)
downloadtor-ba63c4099a491c3f96160005f94cf3a61433c145.tar.gz
tor-ba63c4099a491c3f96160005f94cf3a61433c145.zip
hs-v3: Don't cleanup intro point in has_closed()
The hs_service_intro_circ_has_closed() was removing intro point objects if too many retries. We shouldn't cleanup those objects in that function at all but rather let cleanup_intro_points() do its job and clean it properly. This was causing an issue in #23603. Furthermore, this moves the logic of remembering failing intro points in the cleanup_intro_points() function which should really be the only function to know when to cleanup and thus when an introduction point should be remembered as a failed one. Fixes #23603 Signed-off-by: David Goulet <dgoulet@torproject.org>
-rw-r--r--src/or/hs_service.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/or/hs_service.c b/src/or/hs_service.c
index a2082b3914..99965ddc37 100644
--- a/src/or/hs_service.c
+++ b/src/or/hs_service.c
@@ -1839,6 +1839,12 @@ cleanup_intro_points(hs_service_t *service, time_t now)
(node == NULL) ? " fell off the consensus" : "",
ip->circuit_retries);
+ /* We've retried too many times, remember it as a failed intro point
+ * so we don't pick it up again for INTRO_CIRC_RETRY_PERIOD sec. */
+ if (ip->circuit_retries > MAX_INTRO_POINT_CIRCUIT_RETRIES) {
+ remember_failing_intro_point(ip, desc, approx_time());
+ }
+
/* Remove intro point from descriptor map. We'll add it to the failed
* map if we retried it too many times. */
MAP_DEL_CURRENT(key);
@@ -2946,15 +2952,6 @@ hs_service_intro_circ_has_closed(origin_circuit_t *circ)
* keeping the object in the descriptor, we'll be able to retry. */
ip->circuit_established = 0;
- /* We've retried too many times, remember it as a failed intro point so we
- * don't pick it up again. It will be retried in INTRO_CIRC_RETRY_PERIOD
- * seconds. */
- if (ip->circuit_retries > MAX_INTRO_POINT_CIRCUIT_RETRIES) {
- remember_failing_intro_point(ip, desc, approx_time());
- service_intro_point_remove(service, ip);
- service_intro_point_free(ip);
- }
-
end:
return;
}