Correctly handle large CAP lists from the IRCd

As DarthGandalf noticed, the spec asks for an "*" to be prepended if the reply
needs to be split up into multiple lines. It doesn't really matter for the
current code, but let's make this future-proof. :)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2041 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-06-22 16:14:31 +00:00
parent 9ff7a3d05e
commit 04838648d2
+10 -1
View File
@@ -645,7 +645,16 @@ void CIRCSock::ReadLine(const CString& sData) {
// CAP spec don't mention this, but all implementations
// I've seen add this extra asterisk
CString sSubCmd = sRest.Token(1);
CString sArgs = sRest.Token(2, true).TrimPrefix_n(":");
// If the caplist of a reply is too long, it's split
// into multiple replies. A "*" is prepended to show
// that the list was split into multiple replies.
CString sArgs;
if (sRest.Token(2) == "*") {
sArgs = sRest.Token(3, true).TrimPrefix_n(":");
} else {
sArgs = sRest.Token(2, true).TrimPrefix_n(":");
}
if (sSubCmd == "LS" && !m_bAuthed) {
VCString vsTokens;