summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-12-01 02:54:13 +0000
committerRoger Dingledine <arma@torproject.org>2004-12-01 02:54:13 +0000
commitbde1d5bfb2a6c1c39d51ff807e2d13ce6e8a30ce (patch)
tree85476a476d64fc8723e0d8495667abad779b1f55
parentb3f2a768dbfd3d6b34d0c578b2120dd333af8619 (diff)
downloadtor-bde1d5bfb2a6c1c39d51ff807e2d13ce6e8a30ce.tar.gz
tor-bde1d5bfb2a6c1c39d51ff807e2d13ce6e8a30ce.zip
do even less inside our signal handler,
just to be extra paranoidly safe svn:r3050
-rw-r--r--src/or/config.c5
-rw-r--r--src/or/main.c13
-rw-r--r--src/or/rephist.c2
3 files changed, 13 insertions, 7 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 7385e6ca68..c51da00a0a 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -861,6 +861,7 @@ add_default_trusted_dirservers(or_options_t *options)
/* 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 @@ parse_dir_server_line(const char *line, int validate_only)
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 @@ print_cvs_version(void)
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[];
diff --git a/src/or/main.c b/src/or/main.c
index 357c4efe6c..d4983ce114 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -55,7 +55,8 @@ 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. */
-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 @@ static int do_main_loop(void) {
}
#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 @@ static void catch(int the_signal) {
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;
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 769f6439f8..7928256652 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -247,7 +247,7 @@ void rep_hist_note_extend_failed(const char *from_id, const char *to_id)
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)