aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-12-06 12:07:37 -0500
committerNick Mathewson <nickm@torproject.org>2010-12-06 12:07:37 -0500
commit3fc43debfb65c73b0d7b1fb16016a0fc74a63582 (patch)
tree8be68ac5343d55eab37449deaad92630f36879c6 /src
parentbbadf07d1697bea4d6825c9816111d0159febf58 (diff)
parentdc2f10bd81cfcfdd65bad38a34c042259b1c1ece (diff)
downloadtor-3fc43debfb65c73b0d7b1fb16016a0fc74a63582.tar.gz
tor-3fc43debfb65c73b0d7b1fb16016a0fc74a63582.zip
Merge remote branch 'origin/maint-0.2.2'
Diffstat (limited to 'src')
-rw-r--r--src/or/hibernate.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index 356f9a0f55..929c1994c3 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -515,7 +515,6 @@ accounting_run_housekeeping(time_t now)
static void
accounting_set_wakeup_time(void)
{
- char buf[ISO_TIME_LEN+1];
char digest[DIGEST_LEN];
crypto_digest_env_t *d_env;
int time_in_interval;
@@ -530,6 +529,7 @@ accounting_set_wakeup_time(void)
}
if (server_identity_key_is_set()) {
+ char buf[ISO_TIME_LEN+1];
format_iso_time(buf, interval_start_time);
crypto_pk_get_digest(get_server_identity_key(), digest);
@@ -548,7 +548,6 @@ accounting_set_wakeup_time(void)
char buf2[ISO_TIME_LEN+1];
format_local_iso_time(buf1, interval_start_time);
format_local_iso_time(buf2, interval_end_time);
- time_to_exhaust_bw = GUESS_TIME_TO_USE_BANDWIDTH;
interval_wakeup_time = interval_start_time;
log_notice(LD_ACCT,
@@ -563,8 +562,8 @@ accounting_set_wakeup_time(void)
time_to_exhaust_bw =
(get_options()->AccountingMax/expected_bandwidth_usage)*60;
- if (time_to_exhaust_bw > TIME_MAX) {
- time_to_exhaust_bw = TIME_MAX;
+ if (time_to_exhaust_bw > INT_MAX) {
+ time_to_exhaust_bw = INT_MAX;
time_to_consider = 0;
} else {
time_to_consider = time_in_interval - (int)time_to_exhaust_bw;
@@ -582,8 +581,6 @@ accounting_set_wakeup_time(void)
* to be chosen than the last half. */
interval_wakeup_time = interval_start_time +
(get_uint32(digest) % time_to_consider);
-
- format_iso_time(buf, interval_wakeup_time);
}
{