aboutsummaryrefslogtreecommitdiff
path: root/src/or/relay.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-11-15 15:29:24 -0500
committerNick Mathewson <nickm@torproject.org>2013-11-15 15:29:24 -0500
commit59f50c80d443a7e148f85cfed493e3e703cc4386 (patch)
treebdaef44fe052c88c81c3e5fb130837f6ebc65202 /src/or/relay.c
parenta82b18f2168ce19e0637740fed5746d6daac4e3a (diff)
parent9e907076025ccd91abfad7fc70c09ba4c9228f82 (diff)
downloadtor-59f50c80d443a7e148f85cfed493e3e703cc4386.tar.gz
tor-59f50c80d443a7e148f85cfed493e3e703cc4386.zip
Merge remote-tracking branch 'origin/maint-0.2.3' into maint-0.2.4
Conflicts: src/or/or.h src/or/relay.c Conflicts were simple to resolve. More fixes were needed for compilation, including: reinstating the tv_to_msec function, and renaming *_conn_cells to *_chan_cells.
Diffstat (limited to 'src/or/relay.c')
-rw-r--r--src/or/relay.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index 29dc36194a..63119cbf07 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -2149,15 +2149,19 @@ void
cell_queue_append_packed_copy(cell_queue_t *queue, const cell_t *cell,
int wide_circ_ids)
{
+ 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) {
- struct timeval now;
uint32_t added;
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));