From 57fd1b1d581bf893c730445a364aa197054d9a02 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 2 Aug 2021 21:49:42 -0400 Subject: [PATCH] fix incorrect handling of overlong lines when allow-truncation is enabled --- irc/client.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/irc/client.go b/irc/client.go index 80f7a723..cd0cc760 100644 --- a/irc/client.go +++ b/irc/client.go @@ -747,9 +747,11 @@ func (client *Client) run(session *Session) { } else if err == ircmsg.ErrorTagsTooLong { session.Send(nil, client.server.name, ERR_INPUTTOOLONG, client.Nick(), client.t("Input line contained excess tag data")) continue - } else if err == ircmsg.ErrorBodyTooLong && !client.server.Config().Server.Compatibility.allowTruncation { - session.Send(nil, client.server.name, ERR_INPUTTOOLONG, client.Nick(), client.t("Input line too long")) - continue + } else if err == ircmsg.ErrorBodyTooLong { + if !client.server.Config().Server.Compatibility.allowTruncation { + session.Send(nil, client.server.name, ERR_INPUTTOOLONG, client.Nick(), client.t("Input line too long")) + continue + } // else: proceed with the truncated line } else if err != nil { client.Quit(client.t("Received malformed line"), session) break