mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-23 14:40:51 +01:00
Round up results to the next multiple of 4.
This commit is contained in:
parent
4002980d1c
commit
85e7f67e1c
1 changed files with 7 additions and 0 deletions
|
@ -730,6 +730,13 @@ geoip_get_dirreqdl_history(geoip_client_action_t action,
|
||||||
MAP_DEL_CURRENT(key);
|
MAP_DEL_CURRENT(key);
|
||||||
}
|
}
|
||||||
} STRMAP_FOREACH_END;
|
} 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);
|
result = tor_malloc_zero(bufsize);
|
||||||
written = tor_snprintf(result, bufsize, "complete=%u,timeout=%u,"
|
written = tor_snprintf(result, bufsize, "complete=%u,timeout=%u,"
|
||||||
"running=%u", complete, timeouts, running);
|
"running=%u", complete, timeouts, running);
|
||||||
|
|
Loading…
Add table
Reference in a new issue