]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Adding 'SIGNAL HEARTBEAT' message that causes unscheduled heartbeat.
authorrl1987 <rl1987@sdf.lonestar.org>
Sun, 2 Nov 2014 17:14:58 +0000 (19:14 +0200)
committerNick Mathewson <nickm@torproject.org>
Tue, 25 Nov 2014 17:48:41 +0000 (12:48 -0500)
changes/feature9503 [new file with mode: 0644]
src/or/control.c
src/or/main.c
src/or/or.h

diff --git a/changes/feature9503 b/changes/feature9503
new file mode 100644 (file)
index 0000000..58ae67f
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor features (controller):
+    - Add a "SIGNAL HEARTBEAT" Tor controller command that provokes
+      writing unscheduled heartbeat message to the log. Implements
+      feature 9503.
index e3f913177b06c96496c1db97cf03d9ccbf49dfdf..5c65189bf2a830201feecaffba889de9df9baadc 100644 (file)
@@ -1263,6 +1263,7 @@ static const struct signal_t signal_table[] = {
   { SIGTERM, "INT" },
   { SIGNEWNYM, "NEWNYM" },
   { SIGCLEARDNSCACHE, "CLEARDNSCACHE"},
+  { SIGHEARTBEAT, "HEARTBEAT"},
   { 0, NULL },
 };
 
index 5a4e0a3e2dbbcb8f627ba9eb7556f875acff365a..6a6e36abc6d41a8997bd00903e7ac1f72d8e16ae 100644 (file)
@@ -2137,6 +2137,9 @@ process_signal(uintptr_t sig)
       addressmap_clear_transient();
       control_event_signal(sig);
       break;
+    case SIGHEARTBEAT:
+      log_heartbeat(time(NULL));
+      break;
   }
 }
 
index 6170c2119ccdf07000ae5fd592aaf4936c85d012..a0d3043f1797d3641910fbb8921e45dbc83d4bec 100644 (file)
  * conflict with system-defined signals. */
 #define SIGNEWNYM 129
 #define SIGCLEARDNSCACHE 130
+#define SIGHEARTBEAT 131
 
 #if (SIZEOF_CELL_T != 0)
 /* On Irix, stdlib.h defines a cell_t type, so we need to make sure