aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2019-03-09 03:18:25 -0500
committerGeorge Kadianakis <desnacked@riseup.net>2019-03-14 12:54:16 +0200
commita3bc950e4201fe49e7a0996753a4af83d822828b (patch)
treeec41a6ea7359ab62e811a0fc723bf6ff6af5ee55
parent155b0f5521b12c17d7e5b500c6aa7ed20fcacc12 (diff)
downloadtor-a3bc950e4201fe49e7a0996753a4af83d822828b.tar.gz
tor-a3bc950e4201fe49e7a0996753a4af83d822828b.zip
relays shouldn't close idle rend circuits
Allow connections to single onion services to remain idle without being disconnected. Relays acting as rendezvous points for single onion services were mistakenly closing idle established rendezvous circuits after 60 seconds, thinking that they are unused directory-fetching circuits that had served their purpose. Fixes bug 29665; bugfix on 0.2.1.26.
-rw-r--r--changes/bug296657
-rw-r--r--src/or/circuituse.c4
2 files changed, 11 insertions, 0 deletions
diff --git a/changes/bug29665 b/changes/bug29665
new file mode 100644
index 0000000000..d89046faf5
--- /dev/null
+++ b/changes/bug29665
@@ -0,0 +1,7 @@
+ o Minor bugfixes (single onion services):
+ - Allow connections to single onion services to remain idle without
+ being disconnected. Relays acting as rendezvous points for
+ single onion services were mistakenly closing idle established
+ rendezvous circuits after 60 seconds, thinking that they are unused
+ directory-fetching circuits that had served their purpose. Fixes
+ bug 29665; bugfix on 0.2.1.26.
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 8e007ce920..03f2ae52cf 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1560,10 +1560,14 @@ circuit_expire_old_circuits_serverside(time_t now)
or_circ = TO_OR_CIRCUIT(circ);
/* If the circuit has been idle for too long, and there are no streams
* on it, and it ends here, and it used a create_fast, mark it for close.
+ *
+ * Also if there is a rend_splice on it, it's a single onion service
+ * circuit and we should not close it.
*/
if (or_circ->p_chan && channel_is_client(or_circ->p_chan) &&
!circ->n_chan &&
!or_circ->n_streams && !or_circ->resolving_streams &&
+ !or_circ->rend_splice &&
channel_when_last_xmit(or_circ->p_chan) <= cutoff) {
log_info(LD_CIRC, "Closing circ_id %u (empty %d secs ago)",
(unsigned)or_circ->p_circ_id,