Suspend registration on CAP REQ

Fix #1820
This commit is contained in:
Alexey Sokolov
2024-02-10 00:53:44 +00:00
parent 3c62741b5c
commit ca3b76368d
2 changed files with 13 additions and 0 deletions
+1
View File
@@ -808,6 +808,7 @@ void CClient::HandleCap(const CMessage& Message) {
}
}
} else if (sSubCmd.Equals("REQ")) {
m_bInCap = true;
VCString vsTokens;
Message.GetParam(1).Split(" ", vsTokens, false);
+12
View File
@@ -733,5 +733,17 @@ TEST_F(ZNCTest, HashUpgrade) {
client.Close();
}
TEST_F(ZNCTest, CapReqWithoutLs) {
auto znc = Run();
auto ircd = ConnectIRCd();
auto client = ConnectClient();
client.Write("CAP REQ nonono");
client.Write("PASS :hunter2");
client.Write("NICK nick");
client.Write("USER foo x x :x");
ASSERT_THAT(client.ReadRemainder().toStdString(), Not(HasSubstr("Welcome")));
}
} // namespace
} // namespace znc_inttest