[or-cvs] r14162: If our create-fast cell is mysteriously never answered for a (tor/trunk/src/or)

arma at seul.org arma at seul.org
Mon Mar 24 03:50:21 UTC 2008


Author: arma
Date: 2008-03-23 23:50:21 -0400 (Sun, 23 Mar 2008)
New Revision: 14162

Modified:
   tor/trunk/src/or/circuituse.c
Log:
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.


Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c	2008-03-23 21:02:36 UTC (rev 14161)
+++ tor/trunk/src/or/circuituse.c	2008-03-24 03:50:21 UTC (rev 14162)
@@ -210,15 +210,21 @@
 {
   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 &&



More information about the tor-commits mailing list