From 39c5a677a9c45a0b60fb52b26be7e29d46cdbb6f Mon Sep 17 00:00:00 2001 From: psychon Date: Tue, 16 Mar 2010 10:04:31 +0000 Subject: [PATCH] Fix a couple of places where WebMods tried to send multiple pages git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1838 726aef4b-f618-498e-8847-2d620e286838 --- WebModules.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/WebModules.cpp b/WebModules.cpp index 2a96f258..b1e4de46 100644 --- a/WebModules.cpp +++ b/WebModules.cpp @@ -414,7 +414,7 @@ CWebSock::EPageReqResult CWebSock::PrintStaticFile(const CString& sPath, CString SetPaths(pModule); DEBUG("About to print [" + m_Template.ExpandFile(sPath) + "]"); if (PrintFile(m_Template.ExpandFile(sPath.TrimLeft_n("/")))) { - return PAGE_PRINT; + return PAGE_DEFERRED; } else { return PAGE_NOTFOUND; } @@ -534,7 +534,8 @@ CWebSock::EPageReqResult CWebSock::OnPageRequestInternal(const CString& sURI, CS SetLoggedIn(false); Redirect("/"); - return PAGE_PRINT; + // We already sent a reply + return PAGE_DEFERRED; } else if (sURI == "/login" || sURI.Left(7) == "/login/") { if (GetParam("submitted").ToBool()) { m_sUser = GetParam("user"); @@ -553,7 +554,7 @@ CWebSock::EPageReqResult CWebSock::OnPageRequestInternal(const CString& sURI, CS // Make sure modules are treated as directories if (sURI.Right(1) != "/" && sURI.find(".") == CString::npos && sURI.TrimLeft_n("/mods/").TrimLeft_n("/").find("/") == CString::npos) { Redirect(sURI + "/"); - return PAGE_PRINT; + return PAGE_DEFERRED; } if (m_sModName.empty()) { @@ -565,7 +566,7 @@ CWebSock::EPageReqResult CWebSock::OnPageRequestInternal(const CString& sURI, CS if (!pModule && m_sForceUser.empty()) { if (!ForceLogin()) { - return PAGE_PRINT; + return PAGE_DEFERRED; } pModule = CZNC::Get().FindModule(m_sModName, m_spSession->GetUser());