summaryrefslogtreecommitdiff
path: root/src/modules/m_httpd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_httpd.cpp')
-rw-r--r--src/modules/m_httpd.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index 0dd028924..3558b0a2b 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -32,6 +32,7 @@ static ModuleHttpServer* HttpModule;
static bool claimed;
static insp::intrusive_list<HttpServerSocket> sockets;
static Events::ModuleEventProvider* aclevprov;
+static Events::ModuleEventProvider* reqevprov;
/** HTTP socket states
*/
@@ -330,8 +331,8 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
if (MOD_RESULT != MOD_RES_DENY)
{
HTTPRequest url((Module*)HttpModule, "httpd_url", request_type, uri, &headers, this, ip, postdata);
- url.Send();
- if (!claimed)
+ FIRST_MOD_RESULT_CUSTOM(*reqevprov, HTTPRequestEventListener, OnHTTPRequest, MOD_RESULT, (url));
+ if (MOD_RESULT == MOD_RES_PASSTHRU)
{
SendHTTPError(404);
}
@@ -375,13 +376,16 @@ class ModuleHttpServer : public Module
HTTPdAPIImpl APIImpl;
unsigned int timeoutsec;
Events::ModuleEventProvider acleventprov;
+ Events::ModuleEventProvider reqeventprov;
public:
ModuleHttpServer()
: APIImpl(this)
, acleventprov(this, "event/http-acl")
+ , reqeventprov(this, "event/http-request")
{
aclevprov = &acleventprov;
+ reqevprov = &reqeventprov;
}
void init() CXX11_OVERRIDE