diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-06-15 10:31:34 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-06-15 15:07:53 -0400 |
commit | e62104a7d21432380c66db1901215412e9c53ad7 (patch) | |
tree | 669560c0b8ecec17603fc787e8eff80d8b4b9bb8 /src/or | |
parent | 1755f792ed265dcea70a199c19ffde47aae7544b (diff) | |
download | tor-e62104a7d21432380c66db1901215412e9c53ad7.tar tor-e62104a7d21432380c66db1901215412e9c53ad7.tar.gz |
Move tor_gettimeofday_cached() into compat_libevent
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/relay.c | 23 | ||||
-rw-r--r-- | src/or/relay.h | 2 |
2 files changed, 0 insertions, 25 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index 8bbc9891e..3f894bfe1 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -52,11 +52,6 @@ static int circuit_consider_stop_edge_reading(circuit_t *circ, crypt_path_t *layer_hint); static int circuit_queue_streams_are_blocked(circuit_t *circ); -/* XXXX023 move this all to compat_libevent */ -/** Cache the current hi-res time; the cache gets reset when libevent - * calls us. */ -static struct timeval cached_time_hires = {0, 0}; - /** Stop reading on edge connections when we have this many cells * waiting on the appropriate queue. */ #define CELL_QUEUE_HIGHWATER_SIZE 256 @@ -64,24 +59,6 @@ static struct timeval cached_time_hires = {0, 0}; * cells. */ #define CELL_QUEUE_LOWWATER_SIZE 64 -/** Return a fairly recent view of the current time. */ -static void -tor_gettimeofday_cached(struct timeval *tv) -{ - if (cached_time_hires.tv_sec == 0) { - tor_gettimeofday(&cached_time_hires); - } - *tv = cached_time_hires; -} - -/** Reset the cached view of the current time, so that the next time we try - * to learn it, we will get an up-to-date value. */ -void -tor_gettimeofday_cache_clear(void) -{ - cached_time_hires.tv_sec = 0; -} - /** Stats: how many relay cells have originated at this hop, or have * been relayed onward (not recognized at this hop)? */ diff --git a/src/or/relay.h b/src/or/relay.h index 6a5437365..41675e210 100644 --- a/src/or/relay.h +++ b/src/or/relay.h @@ -64,8 +64,6 @@ void cell_ewma_set_scale_factor(const or_options_t *options, const networkstatus_t *consensus); void circuit_clear_cell_queue(circuit_t *circ, or_connection_t *orconn); -void tor_gettimeofday_cache_clear(void); - #ifdef RELAY_PRIVATE int relay_crypt(circuit_t *circ, cell_t *cell, cell_direction_t cell_direction, crypt_path_t **layer_hint, char *recognized); |