diff options
author | Robert Ransom <rransom.8774@gmail.com> | 2011-12-24 04:47:30 -0800 |
---|---|---|
committer | Robert Ransom <rransom.8774@gmail.com> | 2011-12-27 08:02:43 -0800 |
commit | f88c8ca8c98dc3a0c9e63012ce425d1287625444 (patch) | |
tree | b61d52edad8fec8dc045ddd53e2bc49b6f0666bf /src/or/rendservice.c | |
parent | 078e3e9dd59520b7f40a126a91e89eba91098c49 (diff) | |
download | tor-f88c8ca8c98dc3a0c9e63012ce425d1287625444.tar.gz tor-f88c8ca8c98dc3a0c9e63012ce425d1287625444.zip |
Don't close HS service-side rend circs on timeout
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r-- | src/or/rendservice.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 76caeffd0f..bbc9c91866 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -1419,6 +1419,17 @@ rend_service_relaunch_rendezvous(origin_circuit_t *oldcirc) tor_assert(oldcirc->_base.purpose == CIRCUIT_PURPOSE_S_CONNECT_REND); + /* Don't relaunch the same rend circ twice. */ + if (oldcirc->hs_service_side_rend_circ_has_been_relaunched) { + log_info(LD_REND, "Rendezvous circuit to %s has already been relaunched; " + "not relaunching it again.", + oldcirc->build_state ? + safe_str(extend_info_describe(oldcirc->build_state->chosen_exit)) + : "*unknown*"); + return; + } + oldcirc->hs_service_side_rend_circ_has_been_relaunched = 1; + if (!oldcirc->build_state || oldcirc->build_state->failure_count > MAX_REND_FAILURES || oldcirc->build_state->expiry_time < time(NULL)) { @@ -1727,6 +1738,11 @@ rend_service_rendezvous_has_opened(origin_circuit_t *circuit) "cookie %s for service %s", circuit->_base.n_circ_id, hexcookie, serviceid); + /* Clear the 'in-progress HS circ has timed out' flag for + * consistency with what happens on the client side; this line has + * no effect on Tor's behaviour. */ + circuit->hs_circ_has_timed_out = 0; + service = rend_service_get_by_pk_digest( circuit->rend_data->rend_pk_digest); if (!service) { |