]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Clarify use of magic number 0.98 with #define.
authorMike Perry <mikeperry-git@fscked.org>
Thu, 17 Sep 2009 01:41:22 +0000 (18:41 -0700)
committerMike Perry <mikeperry-git@fscked.org>
Thu, 17 Sep 2009 01:41:22 +0000 (18:41 -0700)
src/or/circuitbuild.c
src/or/or.h
src/or/test.c

index c20db4b205c376f8c80d3c622fe1b77e68e555a1..177852f91ace95963543b1e99e8e43a5c90aec37 100644 (file)
@@ -529,10 +529,8 @@ void
 circuit_build_times_add_timeout_worker(circuit_build_times_t *cbt,
                                        double quantile_cutoff)
 {
-  /* We want to stay a bit short of 1.0, because longtail is
-   * loooooooooooooooooooooooooooooooooooooooooooooooooooong */
   build_time_t gentime = circuit_build_times_generate_sample(cbt,
-              quantile_cutoff, 0.98);
+              quantile_cutoff, MAX_SYNTHETIC_QUANTILE);
 
   if (gentime < (build_time_t)cbt->timeout*1000) {
     log_warn(LD_CIRC,
index 98fa841065f9f394b958f3c4307417ff649ba73c..bdb4d97924e87433a16a966e50cc90512bc8f119 100644 (file)
@@ -2867,6 +2867,11 @@ void entry_guards_free_all(void);
  * RECENT_CIRCUITS before calculating a new timeout */
 #define MAX_RECENT_TIMEOUT_RATE 0.7999999
 
+/** Maximum quantile to use to generate synthetic timeouts.
+ *  We want to stay a bit short of 1.0, because longtail is
+ *  loooooooooooooooooooooooooooooooooooooooooooooooooooong. */
+#define MAX_SYNTHETIC_QUANTILE 0.98
+
 /** Minimum circuits before estimating a timeout */
 #define MIN_CIRCUITS_TO_OBSERVE 500
 
index df7bead4b3fd0be77b4106bf74a1ad508c161aec..cf00c080d49eec69c4c7482fa0deeb0636c85d60 100644 (file)
@@ -3444,7 +3444,8 @@ test_circuit_timeout(void)
     int n = 0;
     for (i=0; i < MIN_CIRCUITS_TO_OBSERVE; i++) {
       if (circuit_build_times_add_time(&estimate,
-              circuit_build_times_generate_sample(&initial, 0, .98)) == 0) {
+              circuit_build_times_generate_sample(&initial, 0,
+                  MAX_SYNTHETIC_QUANTILE)) == 0) {
         n++;
       }
     }