X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_httpd_stats.cpp;h=e30aced4b69ce1ef4fdcfd59e3a6e4487df83e9f;hb=909cba9b756179bfa16d985916db1084cb7b4a9d;hp=8f25415a95117e40a06154d222d2a3b95c9b8dce;hpb=c5a46583800374344d8676eccd7061a15a5ac1ce;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 8f25415a9..e30aced4b 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -26,13 +26,16 @@ #include "xline.h" #include "protocol.h" -/* $ModDesc: Provides statistics over HTTP via m_httpd.so */ - class ModuleHttpStats : public Module { static std::map const &entities; + HTTPdAPI API; public: + ModuleHttpStats() + : API(this) + { + } void init() CXX11_OVERRIDE { @@ -97,7 +100,7 @@ class ModuleHttpStats : public Module if (event.id == "httpd_url") { - ServerInstance->Logs->Log("m_http_stats", LOG_DEBUG,"Handling httpd event"); + ServerInstance->Logs->Log("m_http_stats", LOG_DEBUG, "Handling httpd event"); HTTPRequest* http = (HTTPRequest*)&event; if ((http->GetURI() == "/stats") || (http->GetURI() == "/stats/")) @@ -233,7 +236,7 @@ class ModuleHttpStats : public Module HTTPDocumentResponse response(this, *http, &data, 200); response.headers.SetHeader("X-Powered-By", "m_httpd_stats.so"); response.headers.SetHeader("Content-Type", "text/xml"); - response.Send(); + API->SendResponse(response); } } }