mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
Oh. And apparently, msvc6 doesnt think very much of doing u64-and-double arithmetic either.
svn:r6785
This commit is contained in:
parent
77c28d112b
commit
7fcb267e24
@ -683,7 +683,8 @@ hibernate_hard_limit_reached(void)
|
|||||||
static int
|
static int
|
||||||
hibernate_soft_limit_reached(void)
|
hibernate_soft_limit_reached(void)
|
||||||
{
|
{
|
||||||
uint64_t soft_limit = DBL_TO_U64((get_options()->AccountingMax) * .95);
|
uint64_t soft_limit = DBL_TO_U64(U64_TO_DBL(get_options()->AccountingMax)
|
||||||
|
* .95);
|
||||||
if (!soft_limit)
|
if (!soft_limit)
|
||||||
return 0;
|
return 0;
|
||||||
return n_bytes_read_in_interval >= soft_limit
|
return n_bytes_read_in_interval >= soft_limit
|
||||||
|
@ -1360,11 +1360,11 @@ dumpstats(int severity)
|
|||||||
if (stats_n_data_cells_packaged)
|
if (stats_n_data_cells_packaged)
|
||||||
log(severity,LD_NET,"Average packaged cell fullness: %2.3f%%",
|
log(severity,LD_NET,"Average packaged cell fullness: %2.3f%%",
|
||||||
100*(U64_TO_DBL(stats_n_data_bytes_packaged) /
|
100*(U64_TO_DBL(stats_n_data_bytes_packaged) /
|
||||||
(stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)) );
|
U64_TO_DBL(stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)) );
|
||||||
if (stats_n_data_cells_received)
|
if (stats_n_data_cells_received)
|
||||||
log(severity,LD_NET,"Average delivered cell fullness: %2.3f%%",
|
log(severity,LD_NET,"Average delivered cell fullness: %2.3f%%",
|
||||||
100*(U64_TO_DBL(stats_n_data_bytes_received) /
|
100*(U64_TO_DBL(stats_n_data_bytes_received) /
|
||||||
(stats_n_data_cells_received*RELAY_PAYLOAD_SIZE)) );
|
U64_TO_DBL(stats_n_data_cells_received*RELAY_PAYLOAD_SIZE)) );
|
||||||
|
|
||||||
if (now - time_of_process_start >= 0)
|
if (now - time_of_process_start >= 0)
|
||||||
elapsed = now - time_of_process_start;
|
elapsed = now - time_of_process_start;
|
||||||
|
Loading…
Reference in New Issue
Block a user