[or-cvs] fix comments in hibernate.c

Roger Dingledine arma at seul.org
Tue Nov 9 02:12:44 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	hibernate.c 
Log Message:
fix comments in hibernate.c


Index: hibernate.c
===================================================================
RCS file: /home/or/cvsroot/src/or/hibernate.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- hibernate.c	9 Nov 2004 01:23:58 -0000	1.10
+++ hibernate.c	9 Nov 2004 02:12:41 -0000	1.11
@@ -37,9 +37,9 @@
 
 /* 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 @@
 
   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_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 @@
  */
 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);



More information about the tor-commits mailing list