[or-cvs] kill -USR2 now moves all logs to loglevel debug

Roger Dingledine arma at seul.org
Sat Nov 20 07:33:58 UTC 2004


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

Modified Files:
	config.c connection.c hibernate.c main.c 
Log Message:
kill -USR2 now moves all logs to loglevel debug
plus fix some typos


Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.258
retrieving revision 1.259
diff -u -d -r1.258 -r1.259
--- config.c	20 Nov 2004 00:37:00 -0000	1.258
+++ config.c	20 Nov 2004 07:33:55 -0000	1.259
@@ -104,7 +104,7 @@
   VAR("DirPort",             UINT,     DirPort,              "0"),
   VAR("DirBindAddress",      LINELIST, DirBindAddress,       NULL),
   VAR("DirFetchPeriod",      INTERVAL, DirFetchPeriod,       "1 hour"),
-  VAR("DirPostPeriod",       INTERVAL, DirPostPeriod,        "10 mintues"),
+  VAR("DirPostPeriod",       INTERVAL, DirPostPeriod,        "10 minutes"),
   VAR("RendPostPeriod",      INTERVAL, RendPostPeriod,       "10 minutes"),
   VAR("DirPolicy",           LINELIST, DirPolicy,            NULL),
   VAR("DirServer",           LINELIST, DirServers,           NULL),

Index: connection.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection.c,v
retrieving revision 1.291
retrieving revision 1.292
diff -u -d -r1.291 -r1.292
--- connection.c	20 Nov 2004 00:37:00 -0000	1.291
+++ connection.c	20 Nov 2004 07:33:55 -0000	1.292
@@ -718,7 +718,7 @@
   }
 }
 
-/** Initiatialize the global read bucket to options->BandwidthBurst,
+/** Initialize the global read bucket to options->BandwidthBurst,
  * and current_time to the current time. */
 void connection_bucket_init(void) {
   or_options_t *options = get_options();

Index: hibernate.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/hibernate.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- hibernate.c	20 Nov 2004 00:37:00 -0000	1.23
+++ hibernate.c	20 Nov 2004 07:33:55 -0000	1.24
@@ -211,7 +211,7 @@
     /* If we haven't gotten enough data last interval, guess that
      * we'll be used at our maximum capacity.  This is unlikely to be
      * so, but it will give us an okay first estimate, and we'll stay
-     * up until we send Max ytes.  Next interval, we'll choose
+     * up until we send Max bytes.  Next interval, we'll choose
      * our starting time based on how much we sent this interval.
      */
     expected_bandwidth_usage = max_configured;

Index: main.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.379
retrieving revision 1.380
diff -u -d -r1.379 -r1.380
--- main.c	17 Nov 2004 20:26:39 -0000	1.379
+++ main.c	20 Nov 2004 07:33:55 -0000	1.380
@@ -50,6 +50,7 @@
 
 #ifndef MS_WINDOWS /* do signal stuff only on unix */
 static int please_dumpstats=0; /**< Whether we should dump stats during the loop. */
+static int please_debug=0; /**< Whether we should switch all logs to -l debug. */
 static int please_reset=0; /**< Whether we just got a sighup. */
 static int please_reap_children=0; /**< Whether we should waitpid for exited children. */
 static int please_sigpipe=0; /**< Whether we've caught a sigpipe lately. */
@@ -815,7 +816,7 @@
     }
 #endif
 #ifndef MS_WINDOWS /* do signal stuff only on unix */
-    if(please_shutdown) {
+    if (please_shutdown) {
       if(!server_mode(get_options())) { /* do it now */
         log(LOG_NOTICE,"Interrupt: exiting cleanly.");
         tor_cleanup();
@@ -824,16 +825,20 @@
       hibernate_begin_shutdown();
       please_shutdown = 0;
     }
-    if(please_sigpipe) {
+    if (please_sigpipe) {
       log(LOG_NOTICE,"Caught sigpipe. Ignoring.");
       please_sigpipe = 0;
     }
-    if(please_dumpstats) {
+    if (please_dumpstats) {
       /* prefer to log it at INFO, but make sure we always see it */
       dumpstats(get_min_log_level()<LOG_INFO ? get_min_log_level() : LOG_INFO);
       please_dumpstats = 0;
     }
-    if(please_reset) {
+    if (please_debug) {
+      switch_logs_debug();
+      please_debug = 0;
+    }
+    if (please_reset) {
       if (do_hup() < 0) {
         log_fn(LOG_WARN,"Restart failed (config error?). Exiting.");
         tor_cleanup();
@@ -841,7 +846,7 @@
       }
       please_reset = 0;
     }
-    if(please_reap_children) {
+    if (please_reap_children) {
       while(waitpid(-1,NULL,WNOHANG) > 0) ; /* keep reaping until no more zombies */
       please_reap_children = 0;
     }
@@ -853,7 +858,7 @@
     poll_result = tor_poll(poll_array, nfds, timeout);
 
     /* let catch() handle things like ^c, and otherwise don't worry about it */
-    if(poll_result < 0) {
+    if (poll_result < 0) {
       /* let the program survive things like ^z */
       if(tor_socket_errno(-1) != EINTR) {
         log_fn(LOG_ERR,"poll failed: %s [%d]",
@@ -869,15 +874,15 @@
     }
 
     /* do all the reads and errors first, so we can detect closed sockets */
-    for(i=0;i<nfds;i++)
+    for (i=0;i<nfds;i++)
       conn_read(i); /* this also marks broken connections */
 
     /* then do the writes */
-    for(i=0;i<nfds;i++)
+    for (i=0;i<nfds;i++)
       conn_write(i);
 
     /* any of the conns need to be closed now? */
-    for(i=0;i<nfds;i++)
+    for (i=0;i<nfds;i++)
       conn_close_if_marked(i);
 
     /* refilling buckets and sending cells happens at the beginning of the
@@ -910,6 +915,9 @@
     case SIGUSR1:
       please_dumpstats = 1;
       break;
+    case SIGUSR2:
+      please_debug = 1;
+      break;
     case SIGCHLD:
       please_reap_children = 1;
       break;



More information about the tor-commits mailing list