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:
psychon
2009-05-11 16:06:40 +00:00
parent 7140873bd8
commit 1a859f3806
+3 -3
View File
@@ -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() {