From 5a673b22fc50ccc9a47616c8ba8a7fab8faf1d51 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 11 Jul 2006 14:16:27 +0000 Subject: This works now, m_httpd_stats.so prints 'chickens' on all pages except the index git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4332 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_httpd.cpp | 5 +++++ src/modules/m_httpd_stats.cpp | 3 +++ 2 files changed, 8 insertions(+) (limited to 'src/modules') diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index 7d670ea2b..dc6a7f418 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -213,7 +213,10 @@ class HttpSocket : public InspSocket e.Send(); if (!claimed) + { SendHeaders(0, 404); + log(DEBUG,"Page not claimed, 404"); + } } } @@ -232,6 +235,7 @@ class HttpSocket : public InspSocket void Page(std::stringstream* n, int response) { + log(DEBUG,"Sending page"); SendHeaders(n->str().length(),response); this->Write(n->str()); } @@ -283,6 +287,7 @@ class ModuleHttp : public Module char* OnRequest(Request* request) { + log(DEBUG,"Got HTTPDocument object"); claimed = true; HTTPDocument* doc = (HTTPDocument*)request->GetData(); HttpSocket* sock = (HttpSocket*)doc->sock; diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index dd646d18f..3d02c68b5 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -48,12 +48,15 @@ class ModuleHttpStats : public Module { log(DEBUG,"HTTP URL!"); + data.clear(); data << "

Chickens

"; HTTPRequest* http = (HTTPRequest*)event->GetData(); HTTPDocument response(http->sock, &data, 200); Request req((char*)&response, (Module*)this, event->GetSource()); req.Send(); + + log(DEBUG,"Sent"); } } -- cgit v1.2.3