From 4b2cd5c4c349ea3e5683a6b2beb42c518d3ccef3 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Mon, 27 May 2019 22:05:20 +0100 Subject: Include 671 (RPL_WHOISSECURE) responses in WHOIS pending code. --- TODO | 2 -- blabouncer.c | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 6ca0a72..e1b7253 100644 --- a/TODO +++ b/TODO @@ -10,5 +10,3 @@ Add various auto replay options: Might need to #include in blabouncer.c to make some operating systems and/or compilers happy. Send a PING to the server before assuming a timeout is definite. - -Include server 671 responses in WHO pending code. diff --git a/blabouncer.c b/blabouncer.c index 6149ef1..85305c6 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -1292,15 +1292,16 @@ int processircmessage(SSL *server_ssl, char *str, int source, struct client *cli } // Server 307 (RPL_SUSERHOST), 311 (RPL_WHOISUSER), 312 (RPL_WHOISSERVER), 313 (RPL_WHOISOPERATOR), 317 (RPL_WHOISIDLE), - // 319 (RPL_WHOISCHANNELS), 320 (RPL_WHOISSPECIAL), or 318 (RPL_ENDOFWHOIS) received? + // 319 (RPL_WHOISCHANNELS), 320 (RPL_WHOISSPECIAL), 671 (RPL_WHOISSECURE), or 318 (RPL_ENDOFWHOIS) received? // Send to any clients who requested a WHOIS. if (strncmp(tokens[1], "307", strlen(tokens[1])) == 0 || strncmp(tokens[1], "311", strlen(tokens[1])) == 0 || strncmp(tokens[1], "312", strlen(tokens[1])) == 0 || strncmp(tokens[1], "313", strlen(tokens[1])) == 0 || strncmp(tokens[1], "317", strlen(tokens[1])) == 0 || strncmp(tokens[1], "319", strlen(tokens[1])) == 0 || - strncmp(tokens[1], "320", strlen(tokens[1])) == 0 || strncmp(tokens[1], "318", strlen(tokens[1])) == 0) { + strncmp(tokens[1], "320", strlen(tokens[1])) == 0 || strncmp(tokens[1], "671", strlen(tokens[1])) == 0 || + strncmp(tokens[1], "318", strlen(tokens[1])) == 0) { printf("Server 307 RPL_SUSERHOST, 311 RPL_WHOISUSER, 312 RPL_WHOISSERVER, 313 (RPL_WHOISOPERATOR), 317 RPL_WHOISIDLE, " - "319 RPL_WHOISCHANNELS, 320 (RPL_WHOISSPECIAL), or 318 RPL_ENDOFWHOIS found and it is: %s with length %zd! " - "Sending to clients who are pending one of these.\n", tokens[1], strlen(tokens[1])); + "319 RPL_WHOISCHANNELS, 320 (RPL_WHOISSPECIAL), 671 (RPL_WHOISSECURE), or 318 RPL_ENDOFWHOIS found and it is: " + "%s with length %zd! Sending to clients who are pending one of these.\n", tokens[1], strlen(tokens[1])); // Relay to all pending clients for (int i = 0; i < MAXCLIENTS; i++) { -- cgit v1.2.3