aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-03-24 03:50:21 +0000
committerRoger Dingledine <arma@torproject.org>2008-03-24 03:50:21 +0000
commitc26c77d24da5e2330225caba3b39614aec06d431 (patch)
treeee158f68178faff0c749fb186f3dd08a9f30eeb7 /src/or/circuituse.c
parent0b88a1c579baa049f7a590dc72c152f89862f334 (diff)
downloadtor-c26c77d24da5e2330225caba3b39614aec06d431.tar
tor-c26c77d24da5e2330225caba3b39614aec06d431.tar.gz
If our create-fast cell is mysteriously never answered for a begindir
attempt, notice more quickly. Some of our bootstrapping attempts have a 60 second delay while we sit there wondering why we're getting no response. svn:r14162
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index d7fcf907a..404b7485b 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -210,15 +210,21 @@ circuit_expire_building(time_t now)
{
circuit_t *victim, *circ = global_circuitlist;
time_t cutoff = now - get_options()->CircuitBuildTimeout;
+ time_t begindir_cutoff = now - get_options()->CircuitBuildTimeout/2;
+ cpath_build_state_t *build_state;
while (circ) {
victim = circ;
circ = circ->next;
if (!CIRCUIT_IS_ORIGIN(victim) || /* didn't originate here */
- victim->timestamp_created > cutoff || /* Not old enough to expire */
victim->marked_for_close) /* don't mess with marked circs */
continue;
+ build_state = TO_ORIGIN_CIRCUIT(victim)->build_state;
+ if (victim->timestamp_created >
+ (build_state && build_state->onehop_tunnel) ? begindir_cutoff : cutoff)
+ continue; /* it's still young, leave it alone */
+
#if 0
/* some debug logs, to help track bugs */
if (victim->purpose >= CIRCUIT_PURPOSE_C_INTRODUCING &&