[or-cvs] When we think we have no bandwidth, guess that we will run ...

Nick Mathewson nickm at seul.org
Wed Nov 10 19:32:47 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv17328/src/or

Modified Files:
	hibernate.c 
Log Message:
When we think we have no bandwidth, guess that we will run for 1 day.

Index: hibernate.c
===================================================================
RCS file: /home/or/cvsroot/src/or/hibernate.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- hibernate.c	10 Nov 2004 04:19:53 -0000	1.15
+++ hibernate.c	10 Nov 2004 19:32:44 -0000	1.16
@@ -285,8 +285,11 @@
   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; }



More information about the tor-commits mailing list