Cosmetic fix for the debug output

PrintStaticFile() called ExpandFile() twice if debug output was enabled which
caused it's DEBUG() error messages to be printed twice.

It then called CHTTPSock::PrintFile() to print the actual file. PrintFile()
always sends a result page, no matter if this is an error page or a proper
result page. Thus we should always return PAGE_DONE here, since PAGE_NOTFOUND
was already handled.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1882 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-04-04 18:54:44 +00:00
parent 21c30c84d5
commit 9b9fd6699a

View File

@@ -406,12 +406,12 @@ bool CWebSock::AddModLoop(const CString& sLoopName, CModule& Module) {
CWebSock::EPageReqResult CWebSock::PrintStaticFile(const CString& sPath, CString& sPageRet, CModule* pModule) {
SetPaths(pModule);
DEBUG("About to print [" + m_Template.ExpandFile(sPath) + "]");
if (PrintFile(m_Template.ExpandFile(sPath.TrimLeft_n("/")))) {
return PAGE_DONE;
} else {
return PAGE_NOTFOUND;
}
CString sFile = m_Template.ExpandFile(sPath.TrimLeft_n("/"));
DEBUG("About to print [" + sFile+ "]");
// Either PrintFile() fails and sends an error page or it suceeds and
// sends a result. In both cases we don't have anything more to do.
PrintFile(sFile);
return PAGE_DONE;
}
CWebSock::EPageReqResult CWebSock::PrintTemplate(const CString& sPageName, CString& sPageRet, CModule* pModule) {