summaryrefslogtreecommitdiff
path: root/modules/extra/m_xmlrpc_main.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-10-09 05:22:02 -0400
committerAdam <Adam@anope.org>2012-10-09 05:22:02 -0400
commit8f5d786f0eaec17dd2cb60f3dfb434caabf48e92 (patch)
tree5bc42eaee77104af3169d321eae8730c5e13ee03 /modules/extra/m_xmlrpc_main.cpp
parent1dacc648a0ddc20679b6242bc94edb9ae657a247 (diff)
Cleanup ok if modules with pending identify requests are unloaded
Diffstat (limited to 'modules/extra/m_xmlrpc_main.cpp')
-rw-r--r--modules/extra/m_xmlrpc_main.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/extra/m_xmlrpc_main.cpp b/modules/extra/m_xmlrpc_main.cpp
index 90c8fdc5d..94b655ad7 100644
--- a/modules/extra/m_xmlrpc_main.cpp
+++ b/modules/extra/m_xmlrpc_main.cpp
@@ -1,6 +1,8 @@
#include "module.h"
#include "xmlrpc.h"
+static Module *me;
+
class XMLRPCIdentifyRequest : public IdentifyRequest
{
XMLRPCRequest request;
@@ -8,7 +10,7 @@ class XMLRPCIdentifyRequest : public IdentifyRequest
dynamic_reference<XMLRPCClientSocket> source;
public:
- XMLRPCIdentifyRequest(XMLRPCRequest& req, XMLRPCServiceInterface* iface, XMLRPCClientSocket* s, const Anope::string &acc, const Anope::string &pass) : IdentifyRequest(acc, pass), request(req), xinterface(iface), source(s) { }
+ XMLRPCIdentifyRequest(Module *m, XMLRPCRequest& req, XMLRPCServiceInterface* iface, XMLRPCClientSocket* s, const Anope::string &acc, const Anope::string &pass) : IdentifyRequest(m, acc, pass), request(req), xinterface(iface), source(s) { }
void OnSuccess() anope_override
{
@@ -104,7 +106,7 @@ class MyXMLRPCEvent : public XMLRPCEvent
request->reply("error", "Invalid parameters");
else
{
- XMLRPCIdentifyRequest *req = new XMLRPCIdentifyRequest(*request, iface, source, username, password);
+ XMLRPCIdentifyRequest *req = new XMLRPCIdentifyRequest(me, *request, iface, source, username, password);
FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(NULL, req));
req->Dispatch();
}
@@ -248,6 +250,8 @@ class ModuleXMLRPCMain : public Module
if (!xmlrpc)
throw ModuleException("Unable to find xmlrpc reference, is m_xmlrpc loaded?");
+ me = this;
+
xmlrpc->Register(&stats);
}