aboutsummaryrefslogtreecommitdiff
path: root/src/or/hibernate.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-28 09:05:49 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-28 09:05:49 +0000
commit6f5dbefa7efe0c0c86928777b8821b3fdc91cf45 (patch)
treee92106bd8cac85684983daf62d952a9d8e6b8f18 /src/or/hibernate.c
parent67dc7baa59e2b38a6720d843b54257ca0dd9e722 (diff)
downloadtor-6f5dbefa7efe0c0c86928777b8821b3fdc91cf45.tar.gz
tor-6f5dbefa7efe0c0c86928777b8821b3fdc91cf45.zip
Normalize space: add one between every control keyword and control clause.
svn:r3003
Diffstat (limited to 'src/or/hibernate.c')
-rw-r--r--src/or/hibernate.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c
index 6da6e8d55e..582b0d450d 100644
--- a/src/or/hibernate.c
+++ b/src/or/hibernate.c
@@ -640,7 +640,7 @@ static int hibernate_soft_limit_reached(void)
static void hibernate_begin(int new_state, time_t now) {
connection_t *conn;
- if(hibernate_state == HIBERNATE_STATE_EXITING) {
+ if (hibernate_state == HIBERNATE_STATE_EXITING) {
/* we've been called twice now. close immediately. */
log(LOG_NOTICE,"Second sigint received; exiting now.");
tor_cleanup();
@@ -648,9 +648,9 @@ static void hibernate_begin(int new_state, time_t now) {
}
/* close listeners. leave control listener(s). */
- while((conn = connection_get_by_type(CONN_TYPE_OR_LISTENER)) ||
- (conn = connection_get_by_type(CONN_TYPE_AP_LISTENER)) ||
- (conn = connection_get_by_type(CONN_TYPE_DIR_LISTENER))) {
+ while ((conn = connection_get_by_type(CONN_TYPE_OR_LISTENER)) ||
+ (conn = connection_get_by_type(CONN_TYPE_AP_LISTENER)) ||
+ (conn = connection_get_by_type(CONN_TYPE_DIR_LISTENER))) {
log_fn(LOG_INFO,"Closing listener type %d", conn->type);
connection_mark_for_close(conn);
}
@@ -658,7 +658,7 @@ static void hibernate_begin(int new_state, time_t now) {
/* XXX kill intro point circs */
/* XXX upload rendezvous service descriptors with no intro points */
- if(new_state == HIBERNATE_STATE_EXITING) {
+ 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;
} else { /* soft limit reached */
@@ -715,9 +715,9 @@ hibernate_go_dormant(time_t now) {
* running, and download directories so we can detect if we're obsolete.
* Leave control conns because we still want to be controllable.
*/
- while((conn = connection_get_by_type(CONN_TYPE_OR)) ||
- (conn = connection_get_by_type(CONN_TYPE_AP)) ||
- (conn = connection_get_by_type(CONN_TYPE_EXIT))) {
+ while ((conn = connection_get_by_type(CONN_TYPE_OR)) ||
+ (conn = connection_get_by_type(CONN_TYPE_AP)) ||
+ (conn = connection_get_by_type(CONN_TYPE_EXIT))) {
log_fn(LOG_INFO,"Closing conn type %d", conn->type);
connection_mark_for_close(conn);
}
@@ -763,7 +763,7 @@ void consider_hibernation(time_t now) {
* elapses. */
if (hibernate_state == HIBERNATE_STATE_EXITING) {
tor_assert(hibernate_end_time);
- if(hibernate_end_time <= now) {
+ if (hibernate_end_time <= now) {
log(LOG_NOTICE,"Clean shutdown finished. Exiting.");
tor_cleanup();
exit(0);
@@ -771,7 +771,7 @@ void consider_hibernation(time_t now) {
return; /* if exiting soon, don't worry about bandwidth limits */
}
- if(hibernate_state == HIBERNATE_STATE_DORMANT) {
+ if (hibernate_state == HIBERNATE_STATE_DORMANT) {
/* We've been hibernating because of bandwidth accounting. */
tor_assert(hibernate_end_time);
if (hibernate_end_time > now && accounting_enabled) {