From 678411cc64c1a619ccc228028fbee0788f1e5ffd Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Thu, 22 Oct 2020 01:00:09 +0100 Subject: Send fully formed PONG responses to client PINGs, particularly relevant after server timeouts/reconnects e.g. for XChat. --- TODO | 8 -------- message.c | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/TODO b/TODO index b414406..edf1fdb 100644 --- a/TODO +++ b/TODO @@ -10,14 +10,6 @@ macOS compiler may need limits.h included in structures.h. "Starting log replay...." followed by "Unable to read replay log file!" even though replay seemed to work? -When blabouncer reconnects to a server, clients (at least XChat) get stuck with just e.g. -[13:14:50]* PONG LAG1574032890090568 -[13:15:20]* PONG LAG1574032920149401 -[13:15:50]* PONG LAG1574032950205568 -[13:16:20]* PONG LAG1574032980263198 -[13:16:50]* PONG LAG1574033010319500 -[13:17:20]* PONG LAG1574033040377501 - Sometimes replaymode = "lastspoke" will replay the last message you sent if you spoke last and sometimes it doesn't - change to always include your last message? Can memory usage be reduced further? (e.g. better channel struct management) diff --git a/message.c b/message.c index d0c5fed..6c8f5fc 100644 --- a/message.c +++ b/message.c @@ -1078,7 +1078,7 @@ int processclientmessage(SSL *server_ssl, char *str, struct client *clients, int debugprint(DEBUG_FULL, "Client PING found and it is: %s with length %zd! Sending response...\n", tokens[0], strlen(tokens[0])); char outgoingmsg[MAXDATASIZE]; // String to send to client - if (!snprintf(outgoingmsg, MAXDATASIZE, "PONG %s", tokens[1])) { // TODO - Make sure tokens[1] actually has a token + if (!snprintf(outgoingmsg, MAXDATASIZE, ":%s PONG %s :%s", ircdstate->ircdname, ircdstate->ircdname, tokens[1])) { // TODO - Make sure tokens[1] actually has a token fprintf(stderr, "Error while preparing PONG response!\n"); debugprint(DEBUG_CRIT, "Error while preparing PONG response!\n"); outgoingmsg[0] = '\0'; -- cgit v1.2.3