mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Make it possible to process HTTP requests async
This changes CHTTPSock so that one can handle HTTP requests asynchronously. This is done by not forcing a page to be sent out in the caller of OnPageRequest() but instead requiring a call to the new function CHTTPSock::PrintPage(). git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1830 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -493,7 +493,16 @@ bool CWebSock::SetCookie(const CString& sKey, const CString& sValue) {
|
||||
return CHTTPSock::SetCookie(sKey, sValue);
|
||||
}
|
||||
|
||||
bool CWebSock::OnPageRequest(const CString& sURI, CString& sPageRet) {
|
||||
void CWebSock::OnPageRequest(const CString& sURI) {
|
||||
CString sPageRet;
|
||||
if (OnPageRequestInternal(sURI, sPageRet)) {
|
||||
PrintPage(sPageRet);
|
||||
} else {
|
||||
PrintNotFound();
|
||||
}
|
||||
}
|
||||
|
||||
bool CWebSock::OnPageRequestInternal(const CString& sURI, CString& sPageRet) {
|
||||
DEBUG("CWebSock::OnPageRequest(" + sURI + ")");
|
||||
m_spSession = GetSession();
|
||||
SetCookie("SessionId", m_spSession->GetId());
|
||||
|
||||
Reference in New Issue
Block a user