Adding 'SIGNAL HEARTBEAT' message that causes unscheduled heartbeat.

This commit is contained in:
rl1987 2014-11-02 19:14:58 +02:00 committed by Nick Mathewson
parent f179ff18f3
commit 8c135062e5
4 changed files with 9 additions and 0 deletions

4
changes/feature9503 Normal file
View File

@ -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.

View File

@ -1263,6 +1263,7 @@ static const struct signal_t signal_table[] = {
{ SIGTERM, "INT" },
{ SIGNEWNYM, "NEWNYM" },
{ SIGCLEARDNSCACHE, "CLEARDNSCACHE"},
{ SIGHEARTBEAT, "HEARTBEAT"},
{ 0, NULL },
};

View 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;
}
}

View File

@ -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