aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitstats.c
diff options
context:
space:
mode:
authorvagrant <vagrant@precise32.(none)>2013-08-21 11:44:28 -0400
committerNick Mathewson <nickm@torproject.org>2013-08-22 10:15:56 -0400
commit4834641dce809fbb6fd4a586a823446970d19c1d (patch)
tree21808e3e34994b1e4255f3b7a106820a65ec2469 /src/or/circuitstats.c
parent7121e7bd15659052ccf42e554ae959a75cfacb45 (diff)
downloadtor-4834641dce809fbb6fd4a586a823446970d19c1d.tar.gz
tor-4834641dce809fbb6fd4a586a823446970d19c1d.zip
Make circ_times static and add accessor functions.
Change the global circ_times to a static variable and use accessor functions throughout the code, instead of accessing it directly.
Diffstat (limited to 'src/or/circuitstats.c')
-rw-r--r--src/or/circuitstats.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/or/circuitstats.c b/src/or/circuitstats.c
index 95129f9a43..88ed350a89 100644
--- a/src/or/circuitstats.c
+++ b/src/or/circuitstats.c
@@ -26,8 +26,7 @@
// vary in their own latency. The downside of this is that guards
// can change frequently, so we'd be building a lot more circuits
// most likely.
-/* XXXX024 Make this static; add accessor functions. */
-circuit_build_times_t circ_times;
+static circuit_build_times_t circ_times;
#ifdef TOR_UNIT_TESTS
/** If set, we're running the unit tests: we should avoid clobbering
@@ -37,6 +36,24 @@ static int unit_tests = 0;
#define unit_tests 0
#endif
+circuit_build_times_t *
+get_circuit_build_times(void)
+{
+ return &circ_times;
+}
+
+double
+get_circuit_build_close_time(void)
+{
+ return circ_times.close_ms;
+}
+
+double
+get_circuit_build_timeout(void)
+{
+ return circ_times.timeout_ms;
+}
+
/**
* This function decides if CBT learning should be disabled. It returns
* true if one or more of the following four conditions are met: