From 14326e2186e95f491b2af3d04e1db9609838697a Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 11 Jul 2006 15:06:05 +0000 Subject: Check for uri and only claim /stats and /stats/ git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4340 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_httpd_stats.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index 526f9fda2..7c43d19d8 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -51,22 +51,26 @@ class ModuleHttpStats : public Module if (event->GetEventID() == "httpd_url") { - log(DEBUG,"HTTP URL!"); + HTTPRequest* http = (HTTPRequest*)event->GetData(); - data << ""; - data << "InspIRCd server statisitics for " << Srv->GetServerName() << " (" << Srv->GetServerDescription() << ")"; - data << ""; - data << "

InspIRCd server statisitics for " << Srv->GetServerName() << " (" << Srv->GetServerDescription() << ")

"; - - data << ""; - data << ""; + if ((http->GetURI() == "/stats") || (http->GetURI() == "/stats/")) + { + log(DEBUG,"HTTP URL!"); - HTTPRequest* http = (HTTPRequest*)event->GetData(); - HTTPDocument response(http->sock, &data, 200, "X-Powered-By: m_http_stats.so\r\nContent-Type: text/html\r\n"); - Request req((char*)&response, (Module*)this, event->GetSource()); - req.Send(); + data << ""; + data << "InspIRCd server statisitics for " << Srv->GetServerName() << " (" << Srv->GetServerDescription() << ")"; + data << ""; + data << "

InspIRCd server statisitics for " << Srv->GetServerName() << " (" << Srv->GetServerDescription() << ")

"; + + data << ""; + data << ""; + + HTTPDocument response(http->sock, &data, 200, "X-Powered-By: m_http_stats.so\r\nContent-Type: text/html\r\n"); + Request req((char*)&response, (Module*)this, event->GetSource()); + req.Send(); - log(DEBUG,"Sent"); + log(DEBUG,"Sent"); + } } } -- cgit v1.2.3