summaryrefslogtreecommitdiff
path: root/modules/extra
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
parent1dacc648a0ddc20679b6242bc94edb9ae657a247 (diff)
Cleanup ok if modules with pending identify requests are unloaded
Diffstat (limited to 'modules/extra')
-rw-r--r--modules/extra/m_xmlrpc_main.cpp8
-rw-r--r--modules/extra/webcpanel/pages/index.cpp4
-rw-r--r--modules/extra/webcpanel/webcpanel.cpp3
-rw-r--r--modules/extra/webcpanel/webcpanel.h2
4 files changed, 13 insertions, 4 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);
}
diff --git a/modules/extra/webcpanel/pages/index.cpp b/modules/extra/webcpanel/pages/index.cpp
index 73f7224f4..357d3ec3b 100644
--- a/modules/extra/webcpanel/pages/index.cpp
+++ b/modules/extra/webcpanel/pages/index.cpp
@@ -17,7 +17,7 @@ class WebpanelRequest : public IdentifyRequest
TemplateFileServer::Replacements replacements;
public:
- WebpanelRequest(HTTPReply &r, HTTPMessage &m, HTTPProvider *s, const Anope::string &p_n, HTTPClient *c, TemplateFileServer::Replacements &re, const Anope::string &user, const Anope::string &pass) : IdentifyRequest(user, pass), reply(r), message(m), server(s), page_name(p_n), client(c), replacements(re) { }
+ WebpanelRequest(Module *o, HTTPReply &r, HTTPMessage &m, HTTPProvider *s, const Anope::string &p_n, HTTPClient *c, TemplateFileServer::Replacements &re, const Anope::string &user, const Anope::string &pass) : IdentifyRequest(o, user, pass), reply(r), message(m), server(s), page_name(p_n), client(c), replacements(re) { }
void OnSuccess() anope_override
{
@@ -86,7 +86,7 @@ bool WebCPanel::Index::OnRequest(HTTPProvider *server, const Anope::string &page
{
// Rate limit check.
- WebpanelRequest *req = new WebpanelRequest(reply, message, server, page_name, client, replacements, user, pass);
+ WebpanelRequest *req = new WebpanelRequest(me, reply, message, server, page_name, client, replacements, user, pass);
FOREACH_MOD(I_OnCheckAuthentication, OnCheckAuthentication(NULL, req));
req->Dispatch();
return false;
diff --git a/modules/extra/webcpanel/webcpanel.cpp b/modules/extra/webcpanel/webcpanel.cpp
index b6b2d5776..c23b6efbf 100644
--- a/modules/extra/webcpanel/webcpanel.cpp
+++ b/modules/extra/webcpanel/webcpanel.cpp
@@ -7,6 +7,7 @@
#include "webcpanel.h"
+Module *me;
Anope::string provider_name, template_name, template_base, page_title;
class ModuleWebCPanel : public Module
@@ -45,6 +46,8 @@ class ModuleWebCPanel : public Module
{
this->SetAuthor("Anope");
+ me = this;
+
ConfigReader reader;
provider_name = reader.ReadValue("webcpanel", "server", "httpd/main", 0);
template_name = reader.ReadValue("webcpanel", "template", "template", 0);
diff --git a/modules/extra/webcpanel/webcpanel.h b/modules/extra/webcpanel/webcpanel.h
index e33025b52..926feaf53 100644
--- a/modules/extra/webcpanel/webcpanel.h
+++ b/modules/extra/webcpanel/webcpanel.h
@@ -11,6 +11,8 @@
#include "static_fileserver.h"
#include "template_fileserver.h"
+extern Module *me;
+
extern Anope::string provider_name, template_name, template_base, page_title;
struct SubSection