commit f858370233a7d01d89949f79f92e8b67acd69f46 Author: Mike Perry mikeperry-git@fscked.org Date: Sat Jan 19 21:16:24 2013 -0800
Prevent early close of path bias testing circuits.
We need to let them live long enough to perform the test. --- src/or/circuituse.c | 5 ++++- src/or/rendservice.c | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 0b2fe9e..48a7743 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 || diff --git a/src/or/rendservice.c b/src/or/rendservice.c index 3b2eeb4..f115d8b 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -3068,7 +3068,8 @@ rend_services_introduce(void) if (intro->time_expiring + INTRO_POINT_EXPIRATION_GRACE_PERIOD > now) { /* This intro point has completely expired. Remove it, and * mark the circuit for close if it's still alive. */ - if (intro_circ != NULL) { + if (intro_circ != NULL && + intro_circ->base_.purpose != CIRCUIT_PURPOSE_PATH_BIAS_TESTING) { circuit_mark_for_close(TO_CIRCUIT(intro_circ), END_CIRC_REASON_FINISHED); }