aboutsummaryrefslogtreecommitdiff
path: root/src/or/hibernate.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-10 19:32:44 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-10 19:32:44 +0000
commitec49905fb8e050ffcdb46f461a96b42fb57e9b45 (patch)
treed0bd7e15cb91627946f6f7ddc3d90cb24bbd7487 /src/or/hibernate.c
parent9c22b428bf3ff8b8cb898099c92994a9de82cb73 (diff)
downloadtor-ec49905fb8e050ffcdb46f461a96b42fb57e9b45.tar
tor-ec49905fb8e050ffcdb46f461a96b42fb57e9b45.tar.gz
When we think we have no bandwidth, guess that we will run for 1 day.
svn:r2795
Diffstat (limited to 'src/or/hibernate.c')
-rw-r--r--src/or/hibernate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index 281d60563..0eebd74fe 100644
--- a/src/or/hibernate.c
+++ b/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; }