From 1e8e379dce7a3311eff7161269593f1655f577eb Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 11 Feb 2015 17:13:08 +0100 Subject: Convert the HTTPd request event to use the new cross-module event system --- include/modules/httpd.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'include/modules') diff --git a/include/modules/httpd.h b/include/modules/httpd.h index 5e3e780dc..60032cb16 100644 --- a/include/modules/httpd.h +++ b/include/modules/httpd.h @@ -108,7 +108,7 @@ class HttpServerSocket; /** This class represents a HTTP request. */ -class HTTPRequest : public Event +class HTTPRequest { protected: std::string type; @@ -137,7 +137,7 @@ class HTTPRequest : public Event */ HTTPRequest(Module* me, const std::string &eventid, const std::string &request_type, const std::string &uri, HTTPHeaders* hdr, HttpServerSocket* socket, const std::string &ip, const std::string &pdata) - : Event(me, eventid), type(request_type), document(uri), ipaddr(ip), postdata(pdata), headers(hdr), sock(socket) + : type(request_type), document(uri), ipaddr(ip), postdata(pdata), headers(hdr), sock(socket) { } @@ -249,3 +249,14 @@ class HTTPACLEventListener : public Events::ModuleEventListener virtual ModResult OnHTTPACLCheck(HTTPRequest& req) = 0; }; + +class HTTPRequestEventListener : public Events::ModuleEventListener +{ + public: + HTTPRequestEventListener(Module* mod) + : ModuleEventListener(mod, "event/http-request") + { + } + + virtual ModResult OnHTTPRequest(HTTPRequest& req) = 0; +}; -- cgit v1.3.1-10-gc9f91