summaryrefslogtreecommitdiff
path: root/include/modules/httpd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/modules/httpd.h')
-rw-r--r--include/modules/httpd.h29
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;
+};