[or-cvs] do even less inside our signal handler,

Roger Dingledine arma at seul.org
Wed Dec 1 02:54:15 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 main.c rephist.c 
Log Message:
do even less inside our signal handler,
just to be extra paranoidly safe


Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.275
retrieving revision 1.276
diff -u -d -r1.275 -r1.276
--- config.c	30 Nov 2004 08:44:19 -0000	1.275
+++ config.c	1 Dec 2004 02:54:12 -0000	1.276
@@ -861,6 +861,7 @@
   /* tor26 */
   options->DirServers = config_line_prepend(options->DirServers, "DirServer",
      "62.116.124.106:9030 847B 1F85 0344 D787 6491 A548 92F9 0493 4E4E B85D");
+//  "tor.noreply.org:9030 847B 1F85 0344 D787 6491 A548 92F9 0493 4E4E B85D");
 }
 
 /** Print a usage message for tor. */
@@ -2099,7 +2100,7 @@
     goto err;
   }
   if (!port) {
-    log_fn(LOG_WARN, "Missing port in DirServe address '%s'",addrport);
+    log_fn(LOG_WARN, "Missing port in DirServer address '%s'",addrport);
     goto err;
   }
 
@@ -2394,7 +2395,7 @@
   extern const char circuitlist_c_id[];
   extern const char circuituse_c_id[];
   extern const char command_c_id[];
-  extern const char config_c_id[];
+//  extern const char config_c_id[];
   extern const char connection_c_id[];
   extern const char connection_edge_c_id[];
   extern const char connection_or_c_id[];

Index: main.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.398
retrieving revision 1.399
diff -u -d -r1.398 -r1.399
--- main.c	30 Nov 2004 08:39:14 -0000	1.398
+++ main.c	1 Dec 2004 02:54:13 -0000	1.399
@@ -55,7 +55,8 @@
 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. */
-static int please_shutdown=0; /**< Whether we should shut down Tor. */
+static int please_shutdown=0; /**< Whether we should slowly shut down Tor. */
+static int please_die=0; /**< Whether we should immediately shut down Tor. */
 #endif /* signal stuff */
 
 /** We set this to 1 when we've fetched a dir, to know whether to complain
@@ -826,6 +827,11 @@
     }
 #endif
 #ifndef MS_WINDOWS /* do signal stuff only on unix */
+    if (please_die) {
+      log(LOG_ERR,"Catching signal TERM, exiting cleanly.");
+      tor_cleanup();
+      exit(0);
+    }
     if (please_shutdown) {
       if (!server_mode(get_options())) { /* do it now */
         log(LOG_NOTICE,"Interrupt: exiting cleanly.");
@@ -909,9 +915,8 @@
   switch (the_signal) {
 //    case SIGABRT:
     case SIGTERM:
-      log(LOG_ERR,"Catching signal %d, exiting cleanly.", the_signal);
-      tor_cleanup();
-      exit(0);
+      please_die = 1;
+      break;
     case SIGINT:
       please_shutdown = 1;
       break;

Index: rephist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rephist.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- rephist.c	29 Nov 2004 22:25:30 -0000	1.45
+++ rephist.c	1 Dec 2004 02:54:13 -0000	1.46
@@ -247,7 +247,7 @@
   hist->changed = time(NULL);
 }
 
-/** Log all the reliability data we have rememberred, with the chosen
+/** Log all the reliability data we have remembered, with the chosen
  * severity.
  */
 void rep_hist_dump_stats(time_t now, int severity)



More information about the tor-commits mailing list