diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-11-15 15:35:00 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-11-15 15:35:00 -0500 |
commit | 7a2b30fe16eacc040b3dd11f8c39c410628c2f43 (patch) | |
tree | 356e060be24608160a8e5d4fea33d39cc01a4c46 /src/or/relay.c | |
parent | 4aa9affec2eac0a95ba026e380718b032451a0af (diff) | |
parent | 59f50c80d443a7e148f85cfed493e3e703cc4386 (diff) | |
download | tor-7a2b30fe16eacc040b3dd11f8c39c410628c2f43.tar.gz tor-7a2b30fe16eacc040b3dd11f8c39c410628c2f43.zip |
Merge remote-tracking branch 'origin/maint-0.2.4'
Conflicts:
src/or/relay.c
Conflict changes were easy; compilation fixes required were using
using TOR_SIMPLEQ_FIRST to get head of cell queue.
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index 3600707d1b..0c9267a9a5 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -2213,8 +2213,13 @@ cell_queue_append_packed_copy(circuit_t *circ, cell_queue_t *queue, int exitward, const cell_t *cell, int wide_circ_ids, int use_stats) { + struct timeval now; packed_cell_t *copy = packed_cell_copy(cell, wide_circ_ids); + tor_gettimeofday_cached(&now); + copy->inserted_time = (uint32_t)tv_to_msec(&now); + /* Remember the time when this cell was put in the queue. */ + /*XXXX This may be obsoleted by inserted_time */ if ((get_options()->CellStatistics || get_options()->TestingEnableCellStatsEvent) && use_stats) { struct timeval now; @@ -2222,7 +2227,7 @@ cell_queue_append_packed_copy(circuit_t *circ, cell_queue_t *queue, insertion_time_queue_t *it_queue = queue->insertion_times; if (!it_pool) it_pool = mp_pool_new(sizeof(insertion_time_elem_t), 1024); - tor_gettimeofday_cached(&now); + #define SECONDS_IN_A_DAY 86400L added = (uint32_t)(((now.tv_sec % SECONDS_IN_A_DAY) * 100L) + ((uint32_t)now.tv_usec / (uint32_t)10000L)); |