diff options
author | David Goulet <dgoulet@torproject.org> | 2018-01-19 16:21:55 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2018-01-19 16:21:55 -0500 |
commit | f98f7ca89865d1a477fc65165b92c86b9d8437fa (patch) | |
tree | 244995fb98017b7505b386449688dcf0f526d2c0 /src/or/rendservice.c | |
parent | f406b9df0533c9730b4537b39f3a7f8d232f3558 (diff) | |
parent | 490ae26b24a6b2b8843515425cedabf99801163a (diff) | |
download | tor-f98f7ca89865d1a477fc65165b92c86b9d8437fa.tar.gz tor-f98f7ca89865d1a477fc65165b92c86b9d8437fa.zip |
Merge branch 'bug24895_029_02' into bug24895_031_02
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r-- | src/or/rendservice.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index b1e8a2f0cd..2a3594918e 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -2159,7 +2159,8 @@ rend_service_receive_introduction(origin_circuit_t *circuit, /* Launch a circuit to the client's chosen rendezvous point. */ - for (i=0;i<MAX_REND_FAILURES;i++) { + int max_rend_failures=hs_get_service_max_rend_failures(); + for (i=0;i<max_rend_failures;i++) { int flags = CIRCLAUNCH_NEED_CAPACITY | CIRCLAUNCH_IS_INTERNAL; if (circ_needs_uptime) flags |= CIRCLAUNCH_NEED_UPTIME; /* A Single Onion Service only uses a direct connection if its @@ -3067,8 +3068,13 @@ rend_service_relaunch_rendezvous(origin_circuit_t *oldcirc) } oldcirc->hs_service_side_rend_circ_has_been_relaunched = 1; + /* 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; + if (!oldcirc->build_state || - oldcirc->build_state->failure_count > MAX_REND_FAILURES || + oldcirc->build_state->failure_count >= max_rend_failures || oldcirc->build_state->expiry_time < time(NULL)) { log_info(LD_REND, "Attempt to build circuit to %s for rendezvous has failed " |