diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2009-08-18 15:53:08 +0200 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2009-08-18 15:53:08 +0200 |
commit | dccadb30cd1ceddb9063ba074ba75bf07575e407 (patch) | |
tree | 1258117decd8f413dde50e9bb2b6e2cc69cf5c04 /src/or/relay.c | |
parent | 799af41157c74922a8cc7889510e4b1b040ea215 (diff) | |
download | tor-dccadb30cd1ceddb9063ba074ba75bf07575e407.tar.gz tor-dccadb30cd1ceddb9063ba074ba75bf07575e407.zip |
Clean up proposal 166 and its implementation.
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index b45856d51e..a79a4c161a 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -1626,12 +1626,11 @@ void cell_queue_append_packed_copy(cell_queue_t *queue, const cell_t *cell) { packed_cell_t *copy = packed_cell_copy(cell); - /* Remember the time in millis when this cell was put in the queue. */ + /* Remember the time when this cell was put in the queue. */ if (get_options()->CellStatistics) { struct timeval now; uint32_t added; insertion_time_queue_t *it_queue = queue->insertion_times; - int add_new_elem = 0; if (!it_pool) it_pool = mp_pool_new(sizeof(insertion_time_elem_t), 1024); tor_gettimeofday(&now); @@ -1641,15 +1640,9 @@ cell_queue_append_packed_copy(cell_queue_t *queue, const cell_t *cell) it_queue = tor_malloc_zero(sizeof(insertion_time_queue_t)); queue->insertion_times = it_queue; } - if (!it_queue->first) { - add_new_elem = 1; + if (it_queue->last && it_queue->last->insertion_time == added) { + it_queue->last->counter++; } else { - if (it_queue->last->insertion_time == added) - it_queue->last->counter++; - else - add_new_elem = 1; - } - if (add_new_elem) { insertion_time_elem_t *elem = mp_pool_get(it_pool); elem->next = NULL; elem->insertion_time = added; |