summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-06-12 21:35:09 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-06-12 21:35:09 +0100
commit1b7abf6ee18697e28140a237df31426da37b594c (patch)
tree12f69d273de971ee1352c0546ea9058d7b94fa62
parent0bea530df3f718b34a1022a871f4f78a41c2bee6 (diff)
Don't pass server PONGs to clients.
-rw-r--r--TODO2
-rw-r--r--message.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/TODO b/TODO
index cfd260b..fe2cf21 100644
--- a/TODO
+++ b/TODO
@@ -9,6 +9,4 @@ Might need to #include <limits.h> in blabouncer.c to make some operating systems
Allow reloading the configuration file while running (at least for things like replayseconds, replaymode) - BLABOUNCER command and SIGHUP?
-Don't pass server PONGs to clients.
-
"error: createchannel(): channel name already exists.\n: Success" printed to terminal upon server reconnection.
diff --git a/message.c b/message.c
index 97d15c8..aa0dc1c 100644
--- a/message.c
+++ b/message.c
@@ -722,6 +722,12 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
debugprint(DEBUG_FULL, "Server NOTICE does not appear to be from a user, passing through.\n");
}
}
+
+ // Server PONG received? This is probably in response to our PING to see if we're still connected, discard it.
+ if (strncmp(tokens[1], "PONG", strlen(tokens[1])) == 0) {
+ debugprint(DEBUG_FULL, "Server PONG found and it is: %s with length %zd! Discarding.\n", tokens[1], strlen(tokens[1]));
+ return 1;
+ }
}
// We didn't process anything so return 0