about summary refs log tree commit diff
path: root/bounce.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-04-03 17:14:28 -0400
committerJune McEnroe <june@causal.agency>2022-04-03 17:15:56 -0400
commit7d2303dca9ce1eba6f3fc7cbe6e418b78c5aa1c1 (patch)
tree8a274ae9213064849c63410007e754c596c925b4 /bounce.c
parentRename client->error to client->remove (diff)
downloadpounce-7d2303dca9ce1eba6f3fc7cbe6e418b78c5aa1c1.tar.gz
pounce-7d2303dca9ce1eba6f3fc7cbe6e418b78c5aa1c1.zip
Allow quitting pounce from clients
Diffstat (limited to 'bounce.c')
-rw-r--r--bounce.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bounce.c b/bounce.c
index cd4898a..4146c0e 100644
--- a/bounce.c
+++ b/bounce.c
@@ -441,7 +441,7 @@ int main(int argc, char *argv[]) {
 			}
 		}
 
-		if (signals[SIGINT] || signals[SIGTERM]) {
+		if (clientQuit || signals[SIGINT] || signals[SIGTERM]) {
 			break;
 		}
 		if (signals[SIGALRM]) {
@@ -458,6 +458,7 @@ int main(int argc, char *argv[]) {
 		}
 	}
 
+	if (clientQuit && clientQuit[0]) quit = clientQuit;
 	serverFormat("QUIT :%s\r\n", quit);
 	serverClose();
 	for (size_t i = clientIndex; i < event.len; ++i) {