[or-cvs] r16849: {tor} Reduce extension timeout for introduction circuits from 60 t (tor/branches/hidserv-design-changes/src/or)
kloesing at seul.org
kloesing at seul.org
Thu Sep 11 16:56:47 UTC 2008
Author: kloesing
Date: 2008-09-11 12:56:47 -0400 (Thu, 11 Sep 2008)
New Revision: 16849
Modified:
tor/branches/hidserv-design-changes/src/or/circuituse.c
Log:
Reduce extension timeout for introduction circuits from 60 to 30 seconds.
Modified: tor/branches/hidserv-design-changes/src/or/circuituse.c
===================================================================
--- tor/branches/hidserv-design-changes/src/or/circuituse.c 2008-09-11 16:45:24 UTC (rev 16848)
+++ tor/branches/hidserv-design-changes/src/or/circuituse.c 2008-09-11 16:56:47 UTC (rev 16849)
@@ -219,8 +219,12 @@
circuit_expire_building(time_t now)
{
circuit_t *victim, *circ = global_circuitlist;
- time_t cutoff = now - get_options()->CircuitBuildTimeout;
+ time_t cutoff;
+ time_t general_cutoff = now - get_options()->CircuitBuildTimeout;
time_t begindir_cutoff = now - get_options()->CircuitBuildTimeout/2;
+/* TODO debug value; change to 30 for release */
+#define REND_INTRO_TIMEOUT 10
+ time_t introrend_cutoff = now - REND_INTRO_TIMEOUT;
cpath_build_state_t *build_state;
while (circ) {
@@ -231,11 +235,21 @@
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 = introrend_cutoff;
+ else
+ cutoff = general_cutoff;
+ if (victim->timestamp_created > cutoff)
continue; /* it's still young, leave it alone */
+ if (victim->purpose == CIRCUIT_PURPOSE_C_INTRODUCING &&
+ victim->timestamp_created <= introrend_cutoff &&
+ victim->timestamp_created > general_cutoff)
+ log_info(LD_REND|LD_CIRC, "Timing out intro circ that we would have "
+ "left running in the original protocol.");
+
#if 0
/* some debug logs, to help track bugs */
if (victim->purpose >= CIRCUIT_PURPOSE_C_INTRODUCING &&
More information about the tor-commits
mailing list