diff options
author | Roger Dingledine <arma@torproject.org> | 2005-03-12 20:13:38 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2005-03-12 20:13:38 +0000 |
commit | fe768d1d2a85de42b50a0499d53b9f4a330b4e3b (patch) | |
tree | 3d72a7284d66a9c38dfeccd0178fcd6cbeea5b33 /src/or/hibernate.c | |
parent | 115271f65e1b84cea09f0fb401afb123f22b075b (diff) | |
download | tor-fe768d1d2a85de42b50a0499d53b9f4a330b4e3b.tar.gz tor-fe768d1d2a85de42b50a0499d53b9f4a330b4e3b.zip |
change SHUTDOWN_WAIT_LENGTH from a fixed 30 secs to a config option
svn:r3752
Diffstat (limited to 'src/or/hibernate.c')
-rw-r--r-- | src/or/hibernate.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c index cb96bf39d6..a9cbdd6b72 100644 --- a/src/or/hibernate.c +++ b/src/or/hibernate.c @@ -29,8 +29,6 @@ hibernating, phase 2: #define HIBERNATE_STATE_LOWBANDWIDTH 3 #define HIBERNATE_STATE_DORMANT 4 -#define SHUTDOWN_WAIT_LENGTH 30 /* seconds */ - extern long stats_n_seconds_working; /* published uptime */ static int hibernate_state = HIBERNATE_STATE_LIVE; @@ -656,6 +654,7 @@ static int hibernate_soft_limit_reached(void) * connections, but we continue handling old ones. */ static void hibernate_begin(int new_state, time_t now) { connection_t *conn; + or_options_t *options = get_options(); if (new_state == HIBERNATE_STATE_EXITING && hibernate_state != HIBERNATE_STATE_LIVE) { @@ -678,8 +677,8 @@ static void hibernate_begin(int new_state, time_t now) { /* XXX upload rendezvous service descriptors with no intro points */ if (new_state == HIBERNATE_STATE_EXITING) { - log(LOG_NOTICE,"Interrupt: will shut down in %d seconds. Interrupt again to exit now.", SHUTDOWN_WAIT_LENGTH); - hibernate_end_time = time(NULL) + SHUTDOWN_WAIT_LENGTH; + log(LOG_NOTICE,"Interrupt: will shut down in %d seconds. Interrupt again to exit now.", options->ShutdownWaitLength); + hibernate_end_time = time(NULL) + options->ShutdownWaitLength; } else { /* soft limit reached */ hibernate_end_time = interval_end_time; } |