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 --- src/modules/m_httpd.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/modules/m_httpd.cpp') 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 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 -- cgit v1.3.1-10-gc9f91