[or-cvs] r17106: {tor} put in karsten's patch #1 for proposal 155, modified (in tor/trunk: . doc/spec/proposals src/or)

arma at seul.org arma at seul.org
Wed Oct 15 00:36:09 UTC 2008


Author: arma
Date: 2008-10-14 20:36:09 -0400 (Tue, 14 Oct 2008)
New Revision: 17106

Modified:
   tor/trunk/ChangeLog
   tor/trunk/doc/spec/proposals/155-four-hidden-service-improvements.txt
   tor/trunk/src/or/circuituse.c
Log:
put in karsten's patch #1 for proposal 155, modified


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-10-15 00:27:04 UTC (rev 17105)
+++ tor/trunk/ChangeLog	2008-10-15 00:36:09 UTC (rev 17106)
@@ -3,6 +3,8 @@
     - Now NodeFamily and MyFamily config options allow spaces in
       identity fingerprints, so it's easier to paste them in.
       Suggested by Lucky Green.
+    - Reduce extension timeout for introduction circuits from 60 to 30
+      seconds.
 
   o Minor bugfixes:
     - Minor fix in the warning messages when you're having problems

Modified: tor/trunk/doc/spec/proposals/155-four-hidden-service-improvements.txt
===================================================================
--- tor/trunk/doc/spec/proposals/155-four-hidden-service-improvements.txt	2008-10-15 00:27:04 UTC (rev 17105)
+++ tor/trunk/doc/spec/proposals/155-four-hidden-service-improvements.txt	2008-10-15 00:36:09 UTC (rev 17106)
@@ -18,7 +18,7 @@
   in the network as well as connection establishment time. Some of these
   design changes have side-effects on anonymity or overall network load
   which had to be weighed up against individual performance gains. A
-  discussion of seven possible design changes [2] has lead to a selection
+  discussion of seven possible design changes [2] has led to a selection
   of four changes [3] that are proposed to be implemented here.
 
 Design:

Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c	2008-10-15 00:27:04 UTC (rev 17105)
+++ tor/trunk/src/or/circuituse.c	2008-10-15 00:36:09 UTC (rev 17106)
@@ -251,11 +251,13 @@
 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;
+  time_t general_cutoff = now - get_options()->CircuitBuildTimeout;
+  time_t begindir_cutoff = general_cutoff/2;
+  time_t introcirc_cutoff = general_cutoff/2;
   cpath_build_state_t *build_state;
 
   while (circ) {
+    time_t cutoff;
     victim = circ;
     circ = circ->next;
     if (!CIRCUIT_IS_ORIGIN(victim) || /* didn't originate here */
@@ -263,13 +265,23 @@
       continue;
 
     build_state = TO_ORIGIN_CIRCUIT(victim)->build_state;
-    if (victim->timestamp_created >
-        ((build_state && build_state->onehop_tunnel) ?
-         begindir_cutoff : cutoff))
+    if (build_state && build_state->onehop_tunnel)
+      cutoff = begindir_cutoff;
+    else if (victim->purpose == CIRCUIT_PURPOSE_C_INTRODUCING)
+      cutoff = introcirc_cutoff;
+    else
+      cutoff = general_cutoff;
+    if (victim->timestamp_created > 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 &&
+        victim->timestamp_created <= introcirc_cutoff &&
+        victim->timestamp_created > general_cutoff)
+      log_info(LD_REND|LD_CIRC, "Timing out introduction circuit which we "
+               "would not have done if it had been a general circuit.");
+
     if (victim->purpose >= CIRCUIT_PURPOSE_C_INTRODUCING &&
         victim->purpose <= CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED) {
       if (!victim->timestamp_dirty)



More information about the tor-commits mailing list