summaryrefslogtreecommitdiff
path: root/blabouncer.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2025-08-09 11:14:06 +0100
committerLuke Bratch <luke@bratch.co.uk>2025-08-09 11:14:06 +0100
commit1d41511b7ffb607137308adabd6b2d06906d4023 (patch)
tree74c1be01b3d572a91fb14fc6936d6bfb7b3bcb60 /blabouncer.c
parentfe6ac12dbe4a91cd8652421aaaae18fed23cc6e6 (diff)
Add quit to STDIN commands.
Diffstat (limited to 'blabouncer.c')
-rw-r--r--blabouncer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/blabouncer.c b/blabouncer.c
index f4b084e..2e569a1 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -842,6 +842,19 @@ void dochat(int *serversockfd, int *clientsockfd, struct settings *settings) {
continue;
}
+ // STDIN: Quit blabouncer
+ if (strncmp(outgoingmsg, "quit", strlen("quit")) == 0) {
+ printf("STDIN command starting: quit\n");
+ debugprint(DEBUG_SOME, "dochat(): stdin: STDIN command starting: quit\n");
+
+ cleanexit(server_ssl, clients, 0, &ircdstate, settings, "");
+
+ debugprint(DEBUG_SOME, "dochat(): stdin: STDIN command complete: quit\n");
+ printf("STDIN command complete: quit\n");
+
+ continue;
+ }
+
debugprint(DEBUG_FULL, "dochat(): stdin: '%s' not processed as a command, sending to server.\n", outgoingmsg);
printf("'%s' not processed as a command, sending to server.\n", outgoingmsg);
// sourcefd = 0 as this is a trusted message