aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/or/hibernate.c3
-rw-r--r--src/or/main.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index b41bf44ed..5f1131da7 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -683,7 +683,8 @@ hibernate_hard_limit_reached(void)
static int
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)
return 0;
return n_bytes_read_in_interval >= soft_limit
diff --git a/src/or/main.c b/src/or/main.c
index f6f314c4a..5941241d1 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1360,11 +1360,11 @@ dumpstats(int severity)
if (stats_n_data_cells_packaged)
log(severity,LD_NET,"Average packaged cell fullness: %2.3f%%",
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)
log(severity,LD_NET,"Average delivered cell fullness: %2.3f%%",
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)
elapsed = now - time_of_process_start;