about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-10-03 16:15:45 -0400
committerJune McEnroe <june@causal.agency>2021-10-03 16:15:45 -0400
commit77c597559292f018a0e5122ccbfd34bc35e43e5e (patch)
treefa8b6b7fe6f1804418abd3394822f8c235085361
parentSend PING to idle clients after 15 minutes (diff)
downloadpounce-77c597559292f018a0e5122ccbfd34bc35e43e5e.tar.gz
pounce-77c597559292f018a0e5122ccbfd34bc35e43e5e.zip
Intercept client PONG
Since pounce responds to server PINGs itself and doesn't relay them
to clients, the only PING a client could be responding to is one
of pounce's, in which case it doesn't make sense to relay the PONG
to the server.
-rw-r--r--client.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/client.c b/client.c
index 11962d0..10b28f8 100644
--- a/client.c
+++ b/client.c
@@ -340,6 +340,11 @@ static void handlePalaver(struct Client *client, struct Message *msg) {
 	clientProduce(client, buf);
 }
 
+static void handlePong(struct Client *client, struct Message *msg) {
+	(void)client;
+	(void)msg;
+}
+
 static const struct {
 	bool intercept;
 	bool need;
@@ -352,6 +357,7 @@ static const struct {
 	{ false, false, "USER", handleUser },
 	{ true, false, "CAP", handleCap },
 	{ true, false, "PALAVER", handlePalaver },
+	{ true, false, "PONG", handlePong },
 	{ true, true, "NOTICE", handlePrivmsg },
 	{ true, true, "PRIVMSG", handlePrivmsg },
 	{ true, true, "QUIT", handleQuit },