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:
psychon
2010-03-15 15:27:02 +00:00
parent 5a8193565d
commit cb193d8f72
4 changed files with 18 additions and 9 deletions

View File

@@ -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());