diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2009-07-14 02:04:20 +0200 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2009-07-15 16:12:45 +0200 |
commit | 85e7f67e1c773e81a0269858169a9992eeb53da6 (patch) | |
tree | cac36f5fd3684600597b1dbfa848447471417096 /src/or/geoip.c | |
parent | 4002980d1cbb95c70528a35aa2491fff4345999d (diff) | |
download | tor-85e7f67e1c773e81a0269858169a9992eeb53da6.tar.gz tor-85e7f67e1c773e81a0269858169a9992eeb53da6.zip |
Round up results to the next multiple of 4.
Diffstat (limited to 'src/or/geoip.c')
-rw-r--r-- | src/or/geoip.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c index 1430f34ae5..819c9f0182 100644 --- a/src/or/geoip.c +++ b/src/or/geoip.c @@ -730,6 +730,13 @@ geoip_get_dirreqdl_history(geoip_client_action_t action, MAP_DEL_CURRENT(key); } } STRMAP_FOREACH_END; +#define DIR_REQ_GRANULARITY 4 + complete = round_uint32_to_next_multiple_of(complete, + DIR_REQ_GRANULARITY); + timeouts = round_uint32_to_next_multiple_of(timeouts, + DIR_REQ_GRANULARITY); + running = round_uint32_to_next_multiple_of(running, + DIR_REQ_GRANULARITY); result = tor_malloc_zero(bufsize); written = tor_snprintf(result, bufsize, "complete=%u,timeout=%u," "running=%u", complete, timeouts, running); |