From: <ps...@us...> - 2009-05-11 16:07:07
|
Revision: 1506 http://znc.svn.sourceforge.net/znc/?rev=1506&view=rev Author: psychon Date: 2009-05-11 16:06:40 +0000 (Mon, 11 May 2009) Log Message: ----------- 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. Modified Paths: -------------- trunk/Client.cpp Modified: trunk/Client.cpp =================================================================== --- trunk/Client.cpp 2009-05-10 09:50:37 UTC (rev 1505) +++ trunk/Client.cpp 2009-05-11 16:06:40 UTC (rev 1506) @@ -295,7 +295,7 @@ } 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 @@ 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::BouncedOff() { PutStatusNotice("You are being disconnected because another user just authenticated as you."); m_pIRCSock = NULL; - Close(); + Close(Csock::CLT_AFTERWRITE); } void CClient::IRCDisconnected() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |