From 72afed308c5c0100033dad4c15e352968109d9f2 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 11 Nov 2007 21:07:11 +0000 Subject: Handle non-200 HTTP status codes as error git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8586 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_remoteinclude.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/modules/m_remoteinclude.cpp') diff --git a/src/modules/m_remoteinclude.cpp b/src/modules/m_remoteinclude.cpp index 7e6ba8df3..3ad9b7ef2 100644 --- a/src/modules/m_remoteinclude.cpp +++ b/src/modules/m_remoteinclude.cpp @@ -51,13 +51,19 @@ class ModuleRemoteInclude : public Module if (n == assoc.end()) ServerInstance->Config->Complete(resp->GetURL(), true); - - *(n->second) << resp->GetData(); + + std::string responsestr; + if (resp->GetResponse(responsestr) == 200) + { + *(n->second) << resp->GetData(); - ServerInstance->Log(DEBUG, "Got data: %s", resp->GetData().c_str()); + ServerInstance->Log(DEBUG, "Got data: %s", resp->GetData().c_str()); - ServerInstance->Log(DEBUG, "Flag file complete without error"); - ServerInstance->Config->Complete(resp->GetURL(), false); + ServerInstance->Log(DEBUG, "Flag file complete without error"); + ServerInstance->Config->Complete(resp->GetURL(), false); + } + else + ServerInstance->Config->Complete(resp->GetURL(), true); /* Erase from our association map, but dont delete the pointer. * the core will want to access this pointer for the file data. -- cgit v1.2.3