summaryrefslogtreecommitdiff
path: root/src/or/hs_circuit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/hs_circuit.c')
-rw-r--r--src/or/hs_circuit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/hs_circuit.c b/src/or/hs_circuit.c
index c896eeb0cc..753c0fcd6a 100644
--- a/src/or/hs_circuit.c
+++ b/src/or/hs_circuit.c
@@ -485,9 +485,14 @@ can_relaunch_service_rendezvous_point(const origin_circuit_t *circ)
goto disallow;
}
+ /* We check failure_count >= hs_get_service_max_rend_failures()-1 below, and
+ * the -1 is because we increment the failure count for our current failure
+ * *after* this clause. */
+ int max_rend_failures = hs_get_service_max_rend_failures() - 1;
+
/* A failure count that has reached maximum allowed or circuit that expired,
* we skip relaunching. */
- if (circ->build_state->failure_count > MAX_REND_FAILURES ||
+ if (circ->build_state->failure_count > max_rend_failures ||
circ->build_state->expiry_time <= time(NULL)) {
log_info(LD_REND, "Attempt to build a rendezvous circuit to %s has "
"failed with %d attempts and expiry time %ld. "