diff options
author | Roger Dingledine <arma@torproject.org> | 2004-11-09 02:12:41 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-11-09 02:12:41 +0000 |
commit | e3a067c73a0c483156cbe33350a7c2d67556c25c (patch) | |
tree | d95779a11826d96c0bd4331878d1ceb4e70a32d4 | |
parent | 10ddf2b47fd2b36e50fdd82ca3079c0b9aaca46a (diff) | |
download | tor-e3a067c73a0c483156cbe33350a7c2d67556c25c.tar tor-e3a067c73a0c483156cbe33350a7c2d67556c25c.tar.gz |
fix comments in hibernate.c
svn:r2714
-rw-r--r-- | src/or/hibernate.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c index 102d4dc9f..abe662c81 100644 --- a/src/or/hibernate.c +++ b/src/or/hibernate.c @@ -37,9 +37,9 @@ static time_t hibernate_end_time = 0; /* Fields for accounting logic. Accounting overview: * - * Accounting is designed to ensure that more than N bytes are sent in - * either direction over a given interval (currently, one month, - * starting at 0:00 GMT an arbitrary date within the month). We could + * Accounting is designed to ensure that no more than N bytes are sent + * in either direction over a given interval (currently, one month, + * starting at 0:00 GMT an arbitrary day within the month). We could * try to do this by choking our bandwidth to a trickle, but that * would make our streams useless. Instead, we estimate what our * bandwidth usage will be, and guess how long we'll be able to @@ -451,7 +451,7 @@ static void hibernate_begin(int new_state, time_t now) { tor_assert(hibernate_state == HIBERNATE_STATE_LIVE); - /* close listeners */ + /* 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))) { @@ -511,8 +511,11 @@ hibernate_go_dormant(void) { hibernate_state = HIBERNATE_STATE_DORMANT; log_fn(LOG_NOTICE,"Going dormant. Blowing away remaining connections."); - /* Close all OR/AP/exit conns. Leave dir conns. */ - /* XXXX Why leave dir cons? -NM */ + /* Close all OR/AP/exit conns. Leave dir conns because we still want + * to be able to upload server descriptors so people know we're still + * 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))) { @@ -546,7 +549,7 @@ hibernate_end_time_elapsed(time_t now) */ void consider_hibernation(time_t now) { - /* If we're in 'exiting' mode, then we just shutdown after the interval + /* If we're in 'exiting' mode, then we just shut down after the interval * elapses. */ if (hibernate_state == HIBERNATE_STATE_EXITING) { tor_assert(hibernate_end_time); |