summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-27 10:16:31 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-27 10:16:31 +0000
commit8e8af6aaee4c760e051f114df2295a9cd67364cd (patch)
tree32ac1b6039f47f06fa1a67851aa6b2f07c571036
parent873564ea9ce6e9ec5a07bc2a42ffd54e34b97c72 (diff)
downloadtor-8e8af6aaee4c760e051f114df2295a9cd67364cd.tar.gz
tor-8e8af6aaee4c760e051f114df2295a9cd67364cd.zip
don't expire joined-rend circs that have an exit connection attached
and don't expire non-general excess circuits svn:r1728
-rw-r--r--src/or/circuit.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c
index 731e547426..37c9fa4abe 100644
--- a/src/or/circuit.c
+++ b/src/or/circuit.c
@@ -1231,13 +1231,16 @@ void circuit_expire_old_circuits(void) {
*/
if (circ->timestamp_dirty &&
circ->timestamp_dirty + options.NewCircuitPeriod < now &&
- !circ->p_conn &&
- !circ->p_streams) {
- log_fn(LOG_DEBUG,"Closing n_circ_id %d",circ->n_circ_id);
+ !circ->p_conn && /* we're the origin */
+ !circ->p_streams && /* AP connections */
+ !circ->n_streams /* exit connections */ ) {
+ log_fn(LOG_DEBUG,"Closing n_circ_id %d (dirty %d secs ago)",circ->n_circ_id,
+ (int)(now - circ->timestamp_dirty));
circuit_mark_for_close(circ);
} else if (!circ->timestamp_dirty && CIRCUIT_IS_ORIGIN(circ) &&
- circ->state == CIRCUIT_STATE_OPEN) {
- /* Also, gather a list of open unused circuits that we created.
+ circ->state == CIRCUIT_STATE_OPEN &&
+ circ->purpose == CIRCUIT_PURPOSE_C_GENERAL) {
+ /* Also, gather a list of open unused general circuits that we created.
* Because we add elements to the front of global_circuitlist,
* the last elements of unused_open_circs will be the oldest
* ones.