aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
Diffstat (limited to 'src/or')
-rw-r--r--src/or/geoip.c6
-rw-r--r--src/or/relay.c3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c
index 3336401220..5c13154205 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -739,16 +739,16 @@ geoip_get_dirreq_history(geoip_client_action_t action,
} else {
if (ent->completed) {
uint32_t *bytes_per_second = tor_malloc_zero(sizeof(uint32_t));
- uint32_t time_diff = (uint32_t) tv_udiff(&ent->request_time,
+ uint32_t time_diff = (uint32_t) tv_mdiff(&ent->request_time,
&ent->completion_time);
if (time_diff == 0)
time_diff = 1; /* Avoid DIV/0; "instant" answers are impossible
* anyway by law of nature or something.. */
- *bytes_per_second = 1000000 * ent->response_size / time_diff;
+ *bytes_per_second = 1000 * ent->response_size / time_diff;
smartlist_add(dirreq_times, bytes_per_second);
complete++;
} else {
- if (tv_udiff(&ent->request_time, &now) / 1000000 > DIRREQ_TIMEOUT)
+ if (tv_mdiff(&ent->request_time, &now) / 1000 > DIRREQ_TIMEOUT)
timeouts++;
else
running++;
diff --git a/src/or/relay.c b/src/or/relay.c
index 098b95253e..66b613cca0 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1836,7 +1836,8 @@ connection_or_flush_from_first_active_circuit(or_connection_t *conn, int max,
or_circuit_t *orcirc = TO_OR_CIRCUIT(circ);
tor_gettimeofday(&flushed_from_queue);
cell_waiting_time = (uint32_t)
- (tv_udiff(&cell->packed_timeval, &flushed_from_queue) / 1000);
+ tv_mdiff(&cell->packed_timeval, &flushed_from_queue);
+
orcirc->total_cell_waiting_time += cell_waiting_time;
orcirc->processed_cells++;
}