From: rl1987 Date: Sun, 2 Nov 2014 17:14:58 +0000 (+0200) Subject: Adding 'SIGNAL HEARTBEAT' message that causes unscheduled heartbeat. X-Git-Tag: tor-0.2.6.2-alpha~76^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c135062e51b2ead38a756b045e7d243ffbda5a9;p=thirdparty%2Ftor.git Adding 'SIGNAL HEARTBEAT' message that causes unscheduled heartbeat. --- 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