mirror of
https://github.com/znc/znc.git
synced 2026-08-06 08:52:57 +02:00
Close client sockets only after all pending data was sent
Now e.g. the message "Invalid Password" on login even reaches the other end before the connection shoots itself in the foot. There is one place in Client.cpp which I didn't change: ReachedMaxBuffer() If a client is flooding is, why should we wait until we are done answering that flood?... Thanks to morelia for making me notice this. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1506 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
+3
-3
@@ -295,7 +295,7 @@ void CClient::ReadLine(const CString& sData) {
|
||||
} else if (sCommand.Equals("QUIT")) {
|
||||
m_pUser->UserDisconnected(this);
|
||||
|
||||
Close(); // Treat a client quit as a detach
|
||||
Close(Csock::CLT_AFTERWRITE); // Treat a client quit as a detach
|
||||
return; // Don't forward this msg. We don't want the client getting us disconnected.
|
||||
} else if (sCommand.Equals("PROTOCTL")) {
|
||||
unsigned int i = 1;
|
||||
@@ -652,7 +652,7 @@ void CClient::RefuseLogin(const CString& sReason) {
|
||||
|
||||
PutStatus("Bad username and/or password.");
|
||||
PutClient(":irc.znc.in 464 " + GetNick() + " :" + sReason);
|
||||
Close();
|
||||
Close(Csock::CLT_AFTERWRITE);
|
||||
}
|
||||
|
||||
void CClientAuth::AcceptedLogin(CUser& User) {
|
||||
@@ -729,7 +729,7 @@ void CClient::IRCConnected(CIRCSock* pIRCSock) {
|
||||
void CClient::BouncedOff() {
|
||||
PutStatusNotice("You are being disconnected because another user just authenticated as you.");
|
||||
m_pIRCSock = NULL;
|
||||
Close();
|
||||
Close(Csock::CLT_AFTERWRITE);
|
||||
}
|
||||
|
||||
void CClient::IRCDisconnected() {
|
||||
|
||||
Reference in New Issue
Block a user