summaryrefslogtreecommitdiff
path: root/src/modules/m_remoteinclude.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-11 20:52:21 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-11-11 20:52:21 +0000
commit9b3f2821960aa5203d84cf7994090d069b0d1e51 (patch)
tree9ee60b515a2d47c517254416f2ae8f590eb54aee /src/modules/m_remoteinclude.cpp
parent8f0f9654f841f8034be4c071660a378a91434782 (diff)
Fixed all that, back to the crash we had before (yay?)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8583 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_remoteinclude.cpp')
-rw-r--r--src/modules/m_remoteinclude.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/modules/m_remoteinclude.cpp b/src/modules/m_remoteinclude.cpp
index ca0d7af72..7e6ba8df3 100644
--- a/src/modules/m_remoteinclude.cpp
+++ b/src/modules/m_remoteinclude.cpp
@@ -42,9 +42,9 @@ class ModuleRemoteInclude : public Module
char* OnRequest(Request* req)
{
- HTTPClientResponse* resp = (HTTPClientResponse*)req;
- if(!strcmp(resp->GetId(), HTTP_CLIENT_RESPONSE))
+ if (!strcmp(req->GetId(), HTTP_CLIENT_RESPONSE))
{
+ HTTPClientResponse* resp = (HTTPClientResponse*)req;
ServerInstance->Log(DEBUG, "Got http file for %s", resp->GetURL().c_str());
std::map<std::string, std::stringstream*>::iterator n = assoc.find(resp->GetURL());
@@ -64,7 +64,18 @@ class ModuleRemoteInclude : public Module
*/
assoc.erase(n);
}
+ else if (!strcmp(req->GetId(), HTTP_CLIENT_ERROR))
+ {
+ HTTPClientError* resp = (HTTPClientError*)req;
+
+ ServerInstance->Log(DEBUG, "Got http error when accessing %s", resp->GetURL().c_str());
+ ServerInstance->Config->Complete(resp->GetURL(), true);
+ std::map<std::string, std::stringstream*>::iterator n = assoc.find(resp->GetURL());
+
+ if (n != assoc.end())
+ assoc.erase(n);
+ }
return NULL;
}