[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r17189: {tor} (a - b) / 2 != a - (b / 2); this is the reason why tunneled (tor/trunk/src/or)



Author: kloesing
Date: 2008-11-05 05:40:29 -0500 (Wed, 05 Nov 2008)
New Revision: 17189

Modified:
   tor/trunk/src/or/circuituse.c
Log:
(a - b) / 2 != a - (b / 2); this is the reason why tunneled directory requests and client-side introduction circuits don't time out after the intended 30 seconds (task #847). Bugfix on r17106. Found by miner.

Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c	2008-11-03 16:36:15 UTC (rev 17188)
+++ tor/trunk/src/or/circuituse.c	2008-11-05 10:40:29 UTC (rev 17189)
@@ -268,8 +268,8 @@
 {
   circuit_t *victim, *circ = global_circuitlist;
   time_t general_cutoff = now - get_options()->CircuitBuildTimeout;
-  time_t begindir_cutoff = general_cutoff/2;
-  time_t introcirc_cutoff = general_cutoff/2;
+  time_t begindir_cutoff = now - get_options()->CircuitBuildTimeout/2;
+  time_t introcirc_cutoff = begindir_cutoff;
   cpath_build_state_t *build_state;
 
   while (circ) {