]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Bugfix on r7072, which turned out to basically be a no-op:
authorRoger Dingledine <arma@torproject.org>
Sun, 21 Oct 2007 04:15:28 +0000 (04:15 +0000)
committerRoger Dingledine <arma@torproject.org>
Sun, 21 Oct 2007 04:15:28 +0000 (04:15 +0000)
Respond to INT and TERM SIGNAL commands before we execute the
signal, in case the signal shuts us down. We had a patch in
0.1.2.1-alpha that tried to do this by queueing the response on
the connection's buffer before shutting down, but that really
isn't the same thing. Bug located by Matt Edman.

This is a bug in 0.1.2.x too, but there's no way we should backport
this fix. Speaking of which, can somebody double-check it? :)

svn:r12070

ChangeLog
src/or/control.c

index d62e6c05cc6b4217ebb331b506fc77ce0a0e032d..dfea491bebdaf8e5b95779b8b0c1f8994942ab0b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -68,7 +68,7 @@ Changes in version 0.2.0.9-alpha - 2007-10-??
       detached signatures for a divergent vote.
     - Fix a small memory leak when computing a consensus.
 
-  o Minor bugfixes (v3 directory protocol)
+  o Minor bugfixes (v3 directory protocol):
     - Delete unverified-consensus when the real consensus is set.
     - Consider retrying a consensus networkstatus fetch immediately after one
       fails: don't wait 60 seconds to notice.
@@ -76,8 +76,13 @@ Changes in version 0.2.0.9-alpha - 2007-10-??
       exists before trying to replace the current one.
 
   o Minor bugfixes (controller):
-    - Don't reset trusted dir server list when we set a configuration option.
-      (Patch from Robert Hogan.)
+    - Don't reset trusted dir server list when we set a configuration
+      option. Patch from Robert Hogan.
+    - Respond to INT and TERM SIGNAL commands before we execute the
+      signal, in case the signal shuts us down. We had a patch in
+      0.1.2.1-alpha that tried to do this by queueing the response on
+      the connection's buffer before shutting down, but that really
+      isn't the same thing. Bug located by Matt Edman.
 
   o Minor bugfixes (memory leaks):
     - Stop leaking memory on failing case of base32_decode.  Bugfix on
index 249406de88bb8932e0c0fa851065790a4c672419..76b53e8ba71619590e2fe65fb6b298b1dc74b878 100644 (file)
@@ -1119,8 +1119,10 @@ handle_control_signal(control_connection_t *conn, uint32_t len,
   if (sig<0)
     return 0;
 
-  /* Send DONE first, in case the signal makes us shut down. */
   send_control_done(conn);
+  /* Flush the "done" first if the signal might make us shut down. */
+  if (sig == SIGTERM || sig == SIGINT)
+    connection_handle_write(TO_CONN(conn), 1);
   control_signal_act(sig);
   return 0;
 }