mirror of
https://github.com/znc/znc.git
synced 2026-05-08 22:34:45 +02: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:
-19
@@ -67,25 +67,6 @@ void CClient::ReadLine(const CString& sData) {
|
||||
if (IsAttached()) {
|
||||
MODULECALL(OnUserRaw(sLine), m_pUser, this, return);
|
||||
} else {
|
||||
// If it's an HTTP Request - Check the webmods
|
||||
if (sLine.WildCmp("GET * HTTP/1.?") || sLine.WildCmp("POST * HTTP/1.?")) {
|
||||
CModule* pMod = new CModule(NULL, "<webmod>", "");
|
||||
pMod->SetFake(true);
|
||||
|
||||
CWebSock* pSock = new CWebSock(pMod);
|
||||
CZNC::Get().GetManager().SwapSockByAddr(pSock, this);
|
||||
|
||||
// And don't forget to give it some sane name / timeout
|
||||
pSock->SetSockName("WebMod::Client");
|
||||
pSock->SetTimeout(120);
|
||||
|
||||
// TODO can we somehow get rid of this?
|
||||
pSock->ReadLine(sLine);
|
||||
pSock->PushBuff("", 0, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (CZNC::Get().GetModules().OnUnknownUserRaw(this, sLine)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user