Просмотр исходного кода

When we think we have no bandwidth, guess that we will run for 1 day.

svn:r2795
Nick Mathewson 20 лет назад
Родитель
Сommit
ec49905fb8
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      src/or/hibernate.c

+ 5 - 2
src/or/hibernate.c

@@ -285,8 +285,11 @@ accounting_set_wakeup_time(void)
   crypto_digest_get_digest(d, digest, DIGEST_LEN);
   crypto_free_digest_env(d);
 
-  n_days_to_exhaust_bw =
-    (get_options()->AccountingMaxKB/expected_bandwidth_usage)/(24*60);
+  if (expected_bandwidth_usage)
+    n_days_to_exhaust_bw =
+      (get_options()->AccountingMaxKB/expected_bandwidth_usage)/(24*60);
+  else
+    n_days_to_exhaust_bw = 1;
 
   tm = gmtime(&interval_start_time);
   if (++tm->tm_mon > 11) { tm->tm_mon = 0; ++tm->tm_year; }