mirror of
https://github.com/znc/znc.git
synced 2026-05-08 22:34:45 +02:00
Send PONGs for client's PINGs if we are not connected to a server
Thanks to SilverLeo for the patch (I changed those spaces into tabs and added some *huge* comment on top). git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1016 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+6
-3
@@ -146,9 +146,12 @@ void CClient::ReadLine(const CString& sData) {
|
||||
} else if (sCommand.CaseCmp("PING") == 0) {
|
||||
CString sTarget = sLine.Token(1);
|
||||
|
||||
if (sTarget.CaseCmp("irc.znc.com") == 0) {
|
||||
PutClient("PONG " + sLine.substr(5));
|
||||
return;
|
||||
// If the client meant to ping us or we can be sure the server
|
||||
// won't answer the ping (=no server connected) -> PONG back.
|
||||
// else: It's the server's job to send a PONG.
|
||||
if (sTarget.CaseCmp("irc.znc.com") == 0 || !m_pIRCSock) {
|
||||
PutClient("PONG " + sLine.substr(5));
|
||||
return;
|
||||
}
|
||||
} else if (sCommand.CaseCmp("PONG") == 0) {
|
||||
return; // Block pong replies, we already responded to the pings
|
||||
|
||||
Reference in New Issue
Block a user