mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Rethink PING/PONG handling
All PINGs are replied by ZNC, only PINGs from the client are forwarded. All PONGs are blocked. This should solve all issues with annoying PONGs showing up in clients. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2043 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
15
Client.cpp
15
Client.cpp
@@ -180,17 +180,12 @@ void CClient::ReadLine(const CString& sData) {
|
||||
PutStatusNotice("Detached from [" + sChan + "]");
|
||||
return;
|
||||
} else if (sCommand.Equals("PING")) {
|
||||
CString sTarget = sLine.Token(1);
|
||||
|
||||
// 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.Equals("irc.znc.in") || !GetIRCSock()) {
|
||||
PutClient("PONG " + sLine.substr(5));
|
||||
return;
|
||||
}
|
||||
// All PONGs are generated by znc. We will still forward this to
|
||||
// the ircd, but all PONGs from irc will be blocked.
|
||||
PutClient(":irc.znc.in PONG irc.znc.in " + sLine.substr(5));
|
||||
} else if (sCommand.Equals("PONG")) {
|
||||
return; // Block pong replies, we already responded to the pings
|
||||
// Block PONGs, we already responded to the pings
|
||||
return;
|
||||
} else if (sCommand.Equals("JOIN")) {
|
||||
CString sChans = sLine.Token(1);
|
||||
CString sKey = sLine.Token(2);
|
||||
|
||||
Reference in New Issue
Block a user