summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-08-21 12:10:05 -0400
committerNick Mathewson <nickm@torproject.org>2013-08-22 10:15:56 -0400
commit775c491502e43f0490023b2917c4e1a05b38b5b8 (patch)
treefcde4b10787c0bbcf983f3811f5f4c45693aa21a /src/or/circuituse.c
parente1c9b43b8efbc76ab3a6decf47d6d1ef1967ef77 (diff)
downloadtor-775c491502e43f0490023b2917c4e1a05b38b5b8.tar.gz
tor-775c491502e43f0490023b2917c4e1a05b38b5b8.zip
Separate mutable/const accessors for circuit_build_times
(These have proved invaluable for other global accessors.)
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 919ca35d19..e3c0d0cbd8 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -545,7 +545,7 @@ circuit_expire_building(void)
* was a timeout, and the timeout value needs to reset if we
* see enough of them. Note this means we also need to avoid
* double-counting below, too. */
- circuit_build_times_count_timeout(get_circuit_build_times(),
+ circuit_build_times_count_timeout(get_circuit_build_times_mutable(),
first_hop_succeeded);
TO_ORIGIN_CIRCUIT(victim)->relaxed_timeout = 1;
}
@@ -658,8 +658,9 @@ circuit_expire_building(void)
* have a timeout. We also want to avoid double-counting
* already "relaxed" circuits, which are counted above. */
if (!TO_ORIGIN_CIRCUIT(victim)->relaxed_timeout) {
- circuit_build_times_count_timeout(get_circuit_build_times(),
- first_hop_succeeded);
+ circuit_build_times_count_timeout(
+ get_circuit_build_times_mutable(),
+ first_hop_succeeded);
}
continue;
}
@@ -676,10 +677,11 @@ circuit_expire_building(void)
(long)(now.tv_sec - victim->timestamp_began.tv_sec),
victim->purpose,
circuit_purpose_to_string(victim->purpose));
- } else if (circuit_build_times_count_close(get_circuit_build_times(),
+ } else if (circuit_build_times_count_close(
+ get_circuit_build_times_mutable(),
first_hop_succeeded,
victim->timestamp_created.tv_sec)) {
- circuit_build_times_set_timeout(get_circuit_build_times());
+ circuit_build_times_set_timeout(get_circuit_build_times_mutable());
}
}
}