aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-07-08 15:24:21 -0400
committerNick Mathewson <nickm@torproject.org>2016-07-19 11:40:46 +0200
commitc7558c906a1069308f8f4519b8c93245fbca9efd (patch)
treee0d22329d4f9ef7d1abb24767bf257162dc29c92 /src/or/circuitlist.c
parent6a2002fc091506f576934bbf50e7b8644b43bf4c (diff)
downloadtor-c7558c906a1069308f8f4519b8c93245fbca9efd.tar.gz
tor-c7558c906a1069308f8f4519b8c93245fbca9efd.zip
Use coarse monotonic timer instead of cached monotonized libevent time.
Diffstat (limited to 'src/or/circuitlist.c')
-rw-r--r--src/or/circuitlist.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index d2ba7d4781..5c691644a4 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -2015,7 +2015,7 @@ circuit_max_queued_cell_age(const circuit_t *c, uint32_t now)
/** Return the age in milliseconds of the oldest buffer chunk on <b>conn</b>,
* where age is taken in milliseconds before the time <b>now</b> (in truncated
- * milliseconds since the epoch). If the connection has no data, treat
+ * absolute monotonic msec). If the connection has no data, treat
* it as having age zero.
**/
static uint32_t
@@ -2138,7 +2138,6 @@ circuits_handle_oom(size_t current_allocation)
size_t mem_recovered=0;
int n_circuits_killed=0;
int n_dirconns_killed=0;
- struct timeval now;
uint32_t now_ms;
log_notice(LD_GENERAL, "We're low on memory. Killing circuits with "
"over-long queues. (This behavior is controlled by "
@@ -2152,8 +2151,7 @@ circuits_handle_oom(size_t current_allocation)
mem_to_recover = current_allocation - mem_target;
}
- tor_gettimeofday_cached_monotonic(&now);
- now_ms = (uint32_t)tv_to_msec(&now);
+ now_ms = (uint32_t)monotime_coarse_absolute_msec();
circlist = circuit_get_global_list();
SMARTLIST_FOREACH_BEGIN(circlist, circuit_t *, circ) {