1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-23 06:35:36 +00:00

Don't reply to CTCP PINGs longer than 100 bytes (see the comment).

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1578 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-06-27 21:26:33 +00:00 committed by cras
parent 31794553e6
commit f98b77c4a2

View File

@ -73,6 +73,21 @@ static void ctcp_ping(IRC_SERVER_REC *server, const char *data,
g_return_if_fail(server != NULL);
g_return_if_fail(nick != NULL);
if (strlen(data) > 100) {
/* Yes, this is kind of a kludge, but people who PING you
with messages this long deserve not to get the reply.
The problem with long messages is that when you send lots
of data to server, it's input buffer gets full and you get
killed from server because of "excess flood".
Irssi's current flood protection doesn't count the message
length, but even if it did, the CTCP flooder would still
be able to at least slow down your possibility to send
messages to server. */
return;
}
str = g_strdup_printf("NOTICE %s :\001PING %s\001", nick, data);
ctcp_send_reply(server, str);
g_free(str);