aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@fscked.org>2013-01-19 21:16:24 -0800
committerMike Perry <mikeperry-git@fscked.org>2013-01-20 14:32:56 -0800
commitf858370233a7d01d89949f79f92e8b67acd69f46 (patch)
treee8a6df846a6e7a97ef6a43e25a2ebf5032309921 /src/or/circuituse.c
parentfb711e6d77cc6b4d4ff2daa506960919626a3f6a (diff)
downloadtor-f858370233a7d01d89949f79f92e8b67acd69f46.tar
tor-f858370233a7d01d89949f79f92e8b67acd69f46.tar.gz
Prevent early close of path bias testing circuits.
We need to let them live long enough to perform the test.
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 0b2fe9eb8..48a774352 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1078,7 +1078,10 @@ circuit_expire_old_circuits_clientside(void)
"purpose %d)",
circ->n_circ_id, (long)(now.tv_sec - circ->timestamp_dirty),
circ->purpose);
- circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED);
+ /* Don't do this magic for testing circuits. Their death is governed
+ * by circuit_expire_building */
+ if (circ->purpose != CIRCUIT_PURPOSE_PATH_BIAS_TESTING)
+ circuit_mark_for_close(circ, END_CIRC_REASON_FINISHED);
} else if (!circ->timestamp_dirty && circ->state == CIRCUIT_STATE_OPEN) {
if (timercmp(&circ->timestamp_began, &cutoff, <)) {
if (circ->purpose == CIRCUIT_PURPOSE_C_GENERAL ||