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
+3 -6
View File
@@ -125,15 +125,12 @@ void CHTTPSock::ReadLine(const CString& sData) {
}
void CHTTPSock::GetPage() {
CString sPage;
DEBUG("Page Request [" << m_sURI << "] ");
if (!OnPageRequest(m_sURI, sPage)) {
PrintNotFound();
return;
}
OnPageRequest(m_sURI);
}
void CHTTPSock::PrintPage(const CString& sPage) {
if (!SentHeader()) {
PrintHeader(sPage.length());
}