summaryrefslogtreecommitdiff
path: root/modules/extra/xmlrpc.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/extra/xmlrpc.h')
-rw-r--r--modules/extra/xmlrpc.h50
1 files changed, 8 insertions, 42 deletions
diff --git a/modules/extra/xmlrpc.h b/modules/extra/xmlrpc.h
index bc3ba893d..13097f4be 100644
--- a/modules/extra/xmlrpc.h
+++ b/modules/extra/xmlrpc.h
@@ -1,40 +1,4 @@
-
-class XMLRPCClientSocket;
-class XMLRPCListenSocket;
-class XMLRPCServiceInterface;
-
-class XMLRPCClientSocket : public ClientSocket, public BufferedSocket, public Base
-{
- protected:
- Anope::string query;
-
- public:
- XMLRPCClientSocket(ListenSocket *ls, const sockaddrs &addr) : ClientSocket(ls, addr), BufferedSocket() { }
-
- virtual ~XMLRPCClientSocket() { }
-
- virtual bool Read(const Anope::string &message) anope_override = 0;
-
- virtual bool GetData(Anope::string &tag, Anope::string &data) = 0;
-
- virtual void HandleMessage() = 0;
-};
-
-class XMLRPCListenSocket : public ListenSocket
-{
- protected:
- std::vector<Anope::string> allowed;
-
- public:
- Anope::string username;
- Anope::string password;
-
- XMLRPCListenSocket(const Anope::string &bindip, int port, bool ipv6, const Anope::string &u, const Anope::string &p, const std::vector<Anope::string> &a) : ListenSocket(bindip, port, ipv6), allowed(a), username(u), password(p) { }
-
- virtual ~XMLRPCListenSocket() { }
-
- virtual ClientSocket *OnAccept(int fd, const sockaddrs &addr) anope_override = 0;
-};
+#include "httpd.h"
class XMLRPCRequest
{
@@ -44,15 +8,19 @@ class XMLRPCRequest
Anope::string name;
Anope::string id;
std::deque<Anope::string> data;
+ HTTPReply& r;
+ XMLRPCRequest(HTTPReply &_r) : r(_r) { }
inline void reply(const Anope::string &dname, const Anope::string &ddata) { this->replies.insert(std::make_pair(dname, ddata)); }
inline const std::map<Anope::string, Anope::string> &get_replies() { return this->replies; }
};
+class XMLRPCServiceInterface;
+
class XMLRPCEvent
{
public:
- virtual void Run(XMLRPCServiceInterface *iface, XMLRPCClientSocket *source, XMLRPCRequest *request) = 0;
+ virtual bool Run(XMLRPCServiceInterface *iface, HTTPClient *client, XMLRPCRequest &request) = 0;
};
class XMLRPCServiceInterface : public Service
@@ -64,10 +32,8 @@ class XMLRPCServiceInterface : public Service
virtual void Unregister(XMLRPCEvent *event) = 0;
- virtual void Reply(XMLRPCClientSocket *source, XMLRPCRequest *request) = 0;
-
virtual Anope::string Sanitize(const Anope::string &string) = 0;
-
- virtual void RunXMLRPC(XMLRPCClientSocket *source, XMLRPCRequest *request) = 0;
+
+ virtual void Reply(XMLRPCRequest &request) = 0;
};