From 9b9fd6699a381fb9eb7abf9a735ae204b2e75e98 Mon Sep 17 00:00:00 2001 From: psychon Date: Sun, 4 Apr 2010 18:54:44 +0000 Subject: [PATCH] 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 --- WebModules.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/WebModules.cpp b/WebModules.cpp index e63398b4..0bf57257 100644 --- a/WebModules.cpp +++ b/WebModules.cpp @@ -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) {