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

[tor-commits] [tor/master] Rename get_circuit_nbuild_* to end with _ms



commit e1c9b43b8efbc76ab3a6decf47d6d1ef1967ef77
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Aug 21 11:59:19 2013 -0400

    Rename get_circuit_nbuild_* to end with _ms
---
 src/or/circuitbuild.c |   17 +++++++++--------
 src/or/circuitstats.c |    4 ++--
 src/or/circuitstats.h |    4 ++--
 src/or/circuituse.c   |   20 ++++++++++----------
 4 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index c144f27..cb2f423 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -772,7 +772,8 @@ circuit_send_next_onion_skin(origin_circuit_t *circ)
          * it off at, we probably had a suspend event along this codepath,
          * and we should discard the value.
          */
-        if (timediff < 0 || timediff > 2*get_circuit_build_close_time()+1000) {
+        if (timediff < 0 ||
+            timediff > 2*get_circuit_build_close_time_ms()+1000) {
           log_notice(LD_CIRC, "Strange value for circuit build time: %ldmsec. "
                               "Assuming clock jump. Purpose %d (%s)", timediff,
                      circ->base_.purpose,
@@ -2276,7 +2277,7 @@ pathbias_measure_use_rate(entry_guard_t *guard)
                  tor_lround(guard->unusable_circuits),
                  tor_lround(guard->collapsed_circuits),
                  tor_lround(guard->timeouts),
-                 tor_lround(get_circuit_build_close_time()/1000));
+                 tor_lround(get_circuit_build_close_time_ms()/1000));
           guard->path_bias_disabled = 1;
           guard->bad_since = approx_time();
           entry_guards_changed();
@@ -2302,7 +2303,7 @@ pathbias_measure_use_rate(entry_guard_t *guard)
                  tor_lround(guard->unusable_circuits),
                  tor_lround(guard->collapsed_circuits),
                  tor_lround(guard->timeouts),
-                 tor_lround(get_circuit_build_close_time()/1000));
+                 tor_lround(get_circuit_build_close_time_ms()/1000));
       }
     } else if (pathbias_get_use_success_count(guard)/guard->use_attempts
                < pathbias_get_notice_use_rate(options)) {
@@ -2326,7 +2327,7 @@ pathbias_measure_use_rate(entry_guard_t *guard)
                  tor_lround(guard->unusable_circuits),
                  tor_lround(guard->collapsed_circuits),
                  tor_lround(guard->timeouts),
-                 tor_lround(get_circuit_build_close_time()/1000));
+                 tor_lround(get_circuit_build_close_time_ms()/1000));
       }
     }
   }
@@ -2382,7 +2383,7 @@ pathbias_measure_close_rate(entry_guard_t *guard)
                  tor_lround(guard->unusable_circuits),
                  tor_lround(guard->collapsed_circuits),
                  tor_lround(guard->timeouts),
-                 tor_lround(get_circuit_build_close_time()/1000));
+                 tor_lround(get_circuit_build_close_time_ms()/1000));
           guard->path_bias_disabled = 1;
           guard->bad_since = approx_time();
           entry_guards_changed();
@@ -2408,7 +2409,7 @@ pathbias_measure_close_rate(entry_guard_t *guard)
                  tor_lround(guard->unusable_circuits),
                  tor_lround(guard->collapsed_circuits),
                  tor_lround(guard->timeouts),
-                 tor_lround(get_circuit_build_close_time()/1000));
+                 tor_lround(get_circuit_build_close_time_ms()/1000));
       }
     } else if (pathbias_get_close_success_count(guard)/guard->circ_attempts
                 < pathbias_get_warn_rate(options)) {
@@ -2433,7 +2434,7 @@ pathbias_measure_close_rate(entry_guard_t *guard)
                  tor_lround(guard->unusable_circuits),
                  tor_lround(guard->collapsed_circuits),
                  tor_lround(guard->timeouts),
-                 tor_lround(get_circuit_build_close_time()/1000));
+                 tor_lround(get_circuit_build_close_time_ms()/1000));
       }
     } else if (pathbias_get_close_success_count(guard)/guard->circ_attempts
                < pathbias_get_notice_rate(options)) {
@@ -2456,7 +2457,7 @@ pathbias_measure_close_rate(entry_guard_t *guard)
                  tor_lround(guard->unusable_circuits),
                  tor_lround(guard->collapsed_circuits),
                  tor_lround(guard->timeouts),
-                 tor_lround(get_circuit_build_close_time()/1000));
+                 tor_lround(get_circuit_build_close_time_ms()/1000));
       }
     }
   }
diff --git a/src/or/circuitstats.c b/src/or/circuitstats.c
index 88ed350..25813de 100644
--- a/src/or/circuitstats.c
+++ b/src/or/circuitstats.c
@@ -43,13 +43,13 @@ get_circuit_build_times(void)
 }
 
 double
-get_circuit_build_close_time(void)
+get_circuit_build_close_time_ms(void)
 {
   return circ_times.close_ms;
 }
 
 double
-get_circuit_build_timeout(void)
+get_circuit_build_timeout_ms(void)
 {
   return circ_times.timeout_ms;
 }
diff --git a/src/or/circuitstats.h b/src/or/circuitstats.h
index 2381bf9..4115b68 100644
--- a/src/or/circuitstats.h
+++ b/src/or/circuitstats.h
@@ -13,8 +13,8 @@
 #define TOR_CIRCUITSTATS_H
 
 circuit_build_times_t *get_circuit_build_times(void);
-double get_circuit_build_close_time(void);
-double get_circuit_build_timeout(void);
+double get_circuit_build_close_time_ms(void);
+double get_circuit_build_timeout_ms(void);
 
 int circuit_build_times_disabled(void);
 int circuit_build_times_enough_to_compute(circuit_build_times_t *cbt);
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 57079f0..919ca35 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -442,12 +442,12 @@ circuit_expire_building(void)
    *   RTTs = 4a + 3b + 2c
    *   RTTs = 9h
    */
-  SET_CUTOFF(general_cutoff, get_circuit_build_timeout());
-  SET_CUTOFF(begindir_cutoff, get_circuit_build_timeout());
+  SET_CUTOFF(general_cutoff, get_circuit_build_timeout_ms());
+  SET_CUTOFF(begindir_cutoff, get_circuit_build_timeout_ms());
 
   /* > 3hop circs seem to have a 1.0 second delay on their cannibalized
    * 4th hop. */
-  SET_CUTOFF(fourhop_cutoff, get_circuit_build_timeout() * (10/6.0) + 1000);
+  SET_CUTOFF(fourhop_cutoff, get_circuit_build_timeout_ms() * (10/6.0) + 1000);
 
   /* CIRCUIT_PURPOSE_C_ESTABLISH_REND behaves more like a RELAY cell.
    * Use the stream cutoff (more or less). */
@@ -456,20 +456,20 @@ circuit_expire_building(void)
   /* Be lenient with cannibalized circs. They already survived the official
    * CBT, and they're usually not performance-critical. */
   SET_CUTOFF(cannibalized_cutoff,
-             MAX(get_circuit_build_close_time()*(4/6.0),
+             MAX(get_circuit_build_close_time_ms()*(4/6.0),
                  options->CircuitStreamTimeout * 1000) + 1000);
 
   /* Intro circs have an extra round trip (and are also 4 hops long) */
-  SET_CUTOFF(c_intro_cutoff, get_circuit_build_timeout() * (14/6.0) + 1000);
+  SET_CUTOFF(c_intro_cutoff, get_circuit_build_timeout_ms() * (14/6.0) + 1000);
 
   /* Server intro circs have an extra round trip */
-  SET_CUTOFF(s_intro_cutoff, get_circuit_build_timeout() * (9/6.0) + 1000);
+  SET_CUTOFF(s_intro_cutoff, get_circuit_build_timeout_ms() * (9/6.0) + 1000);
 
-  SET_CUTOFF(close_cutoff, get_circuit_build_close_time());
-  SET_CUTOFF(extremely_old_cutoff, get_circuit_build_close_time()*2 + 1000);
+  SET_CUTOFF(close_cutoff, get_circuit_build_close_time_ms());
+  SET_CUTOFF(extremely_old_cutoff, get_circuit_build_close_time_ms()*2 + 1000);
 
   SET_CUTOFF(hs_extremely_old_cutoff,
-             MAX(get_circuit_build_close_time()*2 + 1000,
+             MAX(get_circuit_build_close_time_ms()*2 + 1000,
                  options->SocksTimeout * 1000));
 
   TOR_LIST_FOREACH(next_circ, circuit_get_global_list(), head) {
@@ -552,7 +552,7 @@ circuit_expire_building(void)
         continue;
       } else {
         static ratelim_t relax_timeout_limit = RATELIM_INIT(3600);
-        const double build_close_ms = get_circuit_build_close_time();
+        const double build_close_ms = get_circuit_build_close_time_ms();
         log_fn_ratelim(&relax_timeout_limit, LOG_NOTICE, LD_CIRC,
                  "No circuits are opened. Relaxed timeout for circuit %d "
                  "(a %s %d-hop circuit in state %s with channel state %s) to "



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits