summaryrefslogtreecommitdiff
path: root/src/modules/m_httpd_config.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-08 23:29:21 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-08 23:29:21 +0000
commit7e843c22e16c81054bad18073d24fe1a07026431 (patch)
tree44ca0213c7d7a80270b993fec1fbed275ec56424 /src/modules/m_httpd_config.cpp
parentc440038736f749a56dbac1badee5b2f099286117 (diff)
Update Event and Request APIs
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11808 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_httpd_config.cpp')
-rw-r--r--src/modules/m_httpd_config.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/modules/m_httpd_config.cpp b/src/modules/m_httpd_config.cpp
index 55f943d2c..988ba3977 100644
--- a/src/modules/m_httpd_config.cpp
+++ b/src/modules/m_httpd_config.cpp
@@ -35,8 +35,8 @@ class ModuleHttpStats : public Module
ModuleHttpStats() {
ReadConfig();
this->changed = true;
- Implementation eventlist[] = { I_OnEvent, I_OnRequest };
- ServerInstance->Modules->Attach(eventlist, this, 2);
+ Implementation eventlist[] = { I_OnEvent };
+ ServerInstance->Modules->Attach(eventlist, this, 1);
}
std::string Sanitize(const std::string &str)
@@ -73,14 +73,14 @@ class ModuleHttpStats : public Module
return ret;
}
- void OnEvent(Event* event)
+ void OnEvent(Event& event)
{
std::stringstream data("");
- if (event->GetEventID() == "httpd_url")
+ if (event.id == "httpd_url")
{
ServerInstance->Logs->Log("m_http_stats", DEBUG,"Handling httpd event");
- HTTPRequest* http = (HTTPRequest*)event->GetData();
+ HTTPRequest* http = (HTTPRequest*)&event;
if ((http->GetURI() == "/config") || (http->GetURI() == "/config/"))
{
@@ -99,21 +99,14 @@ class ModuleHttpStats : public Module
data << "</body></html>";
/* Send the document back to m_httpd */
- HTTPDocument response(http->sock, &data, 200);
+ HTTPDocumentResponse response(this, *http, &data, 200);
response.headers.SetHeader("X-Powered-By", "m_httpd_config.so");
response.headers.SetHeader("Content-Type", "text/html");
- Request req((char*)&response, (Module*)this, event->GetSource());
- req.Send();
+ response.Send();
}
}
}
- const char* OnRequest(Request* request)
- {
- return NULL;
- }
-
-
virtual ~ModuleHttpStats()
{
}