diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-02-12 16:35:02 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-02-12 16:35:02 +0100 |
commit | ae6967b8b30ebc956e3158127ecba5d01dc09204 (patch) | |
tree | b0940ea9cbd75acfdaa655b3a9975f67e3f8ae48 /include/modules/httpd.h | |
parent | a7aa76f17ac22897e08558f0f78d891d3d4f7de6 (diff) | |
parent | 7918febc630d7d6f94fda1a918fe7b98c2d0e742 (diff) |
Merge branch 'master+crossmodevents'
Diffstat (limited to 'include/modules/httpd.h')
-rw-r--r-- | include/modules/httpd.h | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/include/modules/httpd.h b/include/modules/httpd.h index 86234d53f..b4b88bed5 100644 --- a/include/modules/httpd.h +++ b/include/modules/httpd.h @@ -24,6 +24,7 @@ #pragma once #include "base.h" +#include "event.h" #include <string> #include <sstream> @@ -107,7 +108,7 @@ class HttpServerSocket; /** This class represents a HTTP request. */ -class HTTPRequest : public Event +class HTTPRequest { protected: std::string type; @@ -134,9 +135,9 @@ class HTTPRequest : public Event * @param ip The IP address making the web request. * @param pdata The post data (content after headers) received with the request, up to Content-Length in size */ - HTTPRequest(Module* me, const std::string &eventid, const std::string &request_type, const std::string &uri, + HTTPRequest(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) { } @@ -237,3 +238,25 @@ class HTTPdAPI : public dynamic_reference<HTTPdAPIBase> { } }; + +class HTTPACLEventListener : public Events::ModuleEventListener +{ + public: + HTTPACLEventListener(Module* mod) + : ModuleEventListener(mod, "event/http-acl") + { + } + + 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; +}; |