diff options
author | Roger Dingledine <arma@torproject.org> | 2018-01-15 16:30:55 -0500 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2018-01-19 02:28:55 -0500 |
commit | a15eb9ff439623f800de813c1a78eeb5d61f7f5a (patch) | |
tree | e4b674fa6f36be4c0d2dad5014713d68bb325f60 /src/or/rendservice.c | |
parent | 9464da210d3214fc094f5fc3b2c229470dbea59c (diff) | |
download | tor-a15eb9ff439623f800de813c1a78eeb5d61f7f5a.tar.gz tor-a15eb9ff439623f800de813c1a78eeb5d61f7f5a.zip |
MAX_REND_FAILURES is 1, but we would try three times
Fix an "off by 2" error in counting rendezvous failures on the onion
service side.
While we thought we would stop the rendezvous attempt after one failed
circuit, we were actually making three circuit attempts before giving up.
Fixes bug 24895; bugfix on 0.0.6.
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r-- | src/or/rendservice.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index a8c383444d..acc431a577 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -2930,8 +2930,11 @@ rend_service_relaunch_rendezvous(origin_circuit_t *oldcirc) } oldcirc->hs_service_side_rend_circ_has_been_relaunched = 1; + /* We check failure_count >= MAX_REND_FAILURES-1 below rather than + * failure_count >= MAX_REND_FAILURES, because we increment the failure + * count for our current failure *after* this clause. */ if (!oldcirc->build_state || - oldcirc->build_state->failure_count > MAX_REND_FAILURES || + oldcirc->build_state->failure_count >= MAX_REND_FAILURES-1 || oldcirc->build_state->expiry_time < time(NULL)) { log_info(LD_REND, "Attempt to build circuit to %s for rendezvous has failed " |