]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
no measurement circs if not enough build times
authorRoger Dingledine <arma@torproject.org>
Wed, 29 Sep 2010 22:05:10 +0000 (18:05 -0400)
committerRoger Dingledine <arma@torproject.org>
Wed, 29 Sep 2010 22:05:10 +0000 (18:05 -0400)
In the first 100 circuits, our timeout_ms and close_ms
are the same. So we shouldn't transition circuits to purpose
CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT, since they will just timeout again
next time we check.

src/or/circuituse.c

index 66ee0c43531c80a22941875d5acbed4ea9b330e7..18ef0c824bd7928548521ffdfdbdd9972040e216 100644 (file)
@@ -384,7 +384,8 @@ circuit_expire_building(time_t now)
         continue;
       }
 
-      if (circuit_timeout_want_to_count_circ(TO_ORIGIN_CIRCUIT(victim))) {
+      if (circuit_timeout_want_to_count_circ(TO_ORIGIN_CIRCUIT(victim)) &&
+          circuit_build_times_enough_to_compute(&circ_times)) {
         /* Circuits are allowed to last longer for measurement.
          * Switch their purpose and wait. */
         if (victim->purpose != CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT) {