summaryrefslogtreecommitdiff
path: root/src/modules/m_remoteinclude.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-11 21:07:11 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-11 21:07:11 +0000
commit72afed308c5c0100033dad4c15e352968109d9f2 (patch)
tree5fe9c77c166fdeb9bbcb465c02c32cf89314b0aa /src/modules/m_remoteinclude.cpp
parent70f0fa058f75e3395bac71d5e2e9c0ae46f7425b (diff)
Handle non-200 HTTP status codes as error
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8586 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_remoteinclude.cpp')
-rw-r--r--src/modules/m_remoteinclude.cpp16
1 files changed, 11 insertions, 5 deletions
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.