summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-09-06 14:39:40 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-22 08:55:53 -0400
commit66aff2d8f35217cc802bd46eeeaf49326d7de4b0 (patch)
treebca747b7248a034b77bcd8cb0384c0d8526d73c0 /src/or/circuituse.c
parentab18e5e5fcff7fbdbf0905e6dd2585b7e4a10108 (diff)
downloadtor-66aff2d8f35217cc802bd46eeeaf49326d7de4b0.tar.gz
tor-66aff2d8f35217cc802bd46eeeaf49326d7de4b0.zip
Remove or_circuit_t.is_first_hop; use channel_is_client() instead
The is_first_hop field should have been called used_create_fast, but everywhere that we wanted to check it, we should have been checking channel_is_client() instead.
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 570b05e572..6a45979871 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1514,7 +1514,7 @@ circuit_expire_old_circuits_clientside(void)
#define IDLE_ONE_HOP_CIRC_TIMEOUT 60
/** Find each non-origin circuit that has been unused for too long,
- * has no streams on it, used a create_fast, and ends here: mark it
+ * has no streams on it, came from a client, and ends here: mark it
* for close.
*/
void
@@ -1530,9 +1530,9 @@ circuit_expire_old_circuits_serverside(time_t now)
/* 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.
*/
- if (or_circ->is_first_hop && !circ->n_chan &&
+ 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->p_chan &&
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,