mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Move the HTTP/IRC switching to CIncomingConnection
This new class waits for the first line from the client and checks if it's an HTTP request and then passes the connection on to the irc or http code. Before this, the IRC parser handled this as a special case which wasn't as nice-looking as this is. :) git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1925 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -52,7 +52,7 @@ public:
|
||||
PutModule("is blocked after a failed login.");
|
||||
}
|
||||
|
||||
virtual void OnClientConnect(CClient* pClient, const CString& sHost, unsigned short uPort) {
|
||||
virtual void OnClientConnect(CZNCSock* pClient, const CString& sHost, unsigned short uPort) {
|
||||
unsigned int *pCount = m_Cache.GetItem(sHost);
|
||||
if (sHost.empty() || pCount == NULL || *pCount < m_uiAllowedFailed) {
|
||||
return;
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
// refresh their ban
|
||||
Add(sHost, *pCount);
|
||||
|
||||
pClient->PutClient("ERROR :Closing link [Please try again later - reconnecting too fast]");
|
||||
pClient->Write("ERROR :Closing link [Please try again later - reconnecting too fast]\r\n");
|
||||
pClient->Close(Csock::CLT_AFTERWRITE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user