- HTTPDocumentResponse(Module* me, HTTPRequest& req, std::stringstream* doc, int response)
- : Request(me, req.source, "HTTP-DOC"), document(doc), responsecode(response), src(req)
+ HTTPDocumentResponse(Module* mod, HTTPRequest& req, std::stringstream* doc, unsigned int response)
+ : module(mod), document(doc), responsecode(response), src(req)
+ {
+ }
+};
+
+class HTTPdAPIBase : public DataProvider
+{
+ public:
+ HTTPdAPIBase(Module* parent)
+ : DataProvider(parent, "m_httpd_api")
+ {
+ }
+
+ /** Answer an incoming HTTP request with the provided document
+ * @param response The response created by your module that will be sent to the client
+ */
+ virtual void SendResponse(HTTPDocumentResponse& response) = 0;
+};
+
+/** The API provided by the httpd module that allows other modules to respond to incoming
+ * HTTP requests
+ */
+class HTTPdAPI : public dynamic_reference<HTTPdAPIBase>
+{
+ public:
+ HTTPdAPI(Module* parent)
+ : dynamic_reference<HTTPdAPIBase>(parent, "m_httpd_api")
+ {
+ }
+};
+
+class HTTPACLEventListener : public Events::ModuleEventListener
+{
+ public:
+ HTTPACLEventListener(Module* mod)
+ : ModuleEventListener(mod, "event/http-acl")