diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2014-11-02 19:14:58 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-11-25 12:48:41 -0500 |
commit | 8c135062e51b2ead38a756b045e7d243ffbda5a9 (patch) | |
tree | 09c6bf51508753476bee11001629c9c1f7767596 | |
parent | f179ff18f3d05cff2a28add5b0ae9df929d94536 (diff) | |
download | tor-8c135062e51b2ead38a756b045e7d243ffbda5a9.tar.gz tor-8c135062e51b2ead38a756b045e7d243ffbda5a9.zip |
Adding 'SIGNAL HEARTBEAT' message that causes unscheduled heartbeat.
-rw-r--r-- | changes/feature9503 | 4 | ||||
-rw-r--r-- | src/or/control.c | 1 | ||||
-rw-r--r-- | src/or/main.c | 3 | ||||
-rw-r--r-- | src/or/or.h | 1 |
4 files changed, 9 insertions, 0 deletions
diff --git a/changes/feature9503 b/changes/feature9503 new file mode 100644 index 0000000000..58ae67f184 --- /dev/null +++ b/changes/feature9503 @@ -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. diff --git a/src/or/control.c b/src/or/control.c index e3f913177b..5c65189bf2 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1263,6 +1263,7 @@ static const struct signal_t signal_table[] = { { SIGTERM, "INT" }, { SIGNEWNYM, "NEWNYM" }, { SIGCLEARDNSCACHE, "CLEARDNSCACHE"}, + { SIGHEARTBEAT, "HEARTBEAT"}, { 0, NULL }, }; diff --git a/src/or/main.c b/src/or/main.c index 5a4e0a3e2d..6a6e36abc6 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -2137,6 +2137,9 @@ process_signal(uintptr_t sig) addressmap_clear_transient(); control_event_signal(sig); break; + case SIGHEARTBEAT: + log_heartbeat(time(NULL)); + break; } } diff --git a/src/or/or.h b/src/or/or.h index 6170c2119c..a0d3043f17 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -119,6 +119,7 @@ * 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 |