mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05: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:
parent
31794553e6
commit
f98b77c4a2
@ -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(server != NULL);
|
||||||
g_return_if_fail(nick != 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);
|
str = g_strdup_printf("NOTICE %s :\001PING %s\001", nick, data);
|
||||||
ctcp_send_reply(server, str);
|
ctcp_send_reply(server, str);
|
||||||
g_free(str);
|
g_free(str);
|
||||||
|
Loading…
Reference in New Issue
Block a user