aboutsummaryrefslogtreecommitdiff
path: root/src/app/main
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-11-26 16:33:31 -0500
committerNick Mathewson <nickm@torproject.org>2018-11-26 16:33:31 -0500
commit7d8e0cc9abf2a74789e635d2fd4d0e18b8e0d1fe (patch)
tree0ac25bf4798d16765392039a43db7b878a46b293 /src/app/main
parent2b9a907bdccc588203d2110866d4e7bb72a25773 (diff)
parent02843c4a4e2fab9c5d9cdb95c425c37ff3d1a4ae (diff)
downloadtor-7d8e0cc9abf2a74789e635d2fd4d0e18b8e0d1fe.tar.gz
tor-7d8e0cc9abf2a74789e635d2fd4d0e18b8e0d1fe.zip
Merge branch 'dormant_v2_squashed'
Diffstat (limited to 'src/app/main')
-rw-r--r--src/app/main/main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/app/main/main.c b/src/app/main/main.c
index b8dcb852d2..03b3a95d03 100644
--- a/src/app/main/main.c
+++ b/src/app/main/main.c
@@ -303,6 +303,19 @@ process_signal(int sig)
log_heartbeat(time(NULL));
control_event_signal(sig);
break;
+ case SIGACTIVE:
+ /* "SIGACTIVE" counts as ersatz user activity. */
+ note_user_activity(approx_time());
+ control_event_signal(sig);
+ break;
+ case SIGDORMANT:
+ /* "SIGDORMANT" means to ignore past user activity */
+ log_notice(LD_GENERAL, "Going dormant because of controller request.");
+ reset_user_activity(0);
+ set_network_participation(false);
+ schedule_rescan_periodic_events();
+ control_event_signal(sig);
+ break;
}
}
@@ -472,6 +485,8 @@ static struct {
{ SIGNEWNYM, 0, NULL },
{ SIGCLEARDNSCACHE, 0, NULL },
{ SIGHEARTBEAT, 0, NULL },
+ { SIGACTIVE, 0, NULL },
+ { SIGDORMANT, 0, NULL },
{ -1, -1, NULL }
};