summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-11 14:16:27 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-11 14:16:27 +0000
commit5a673b22fc50ccc9a47616c8ba8a7fab8faf1d51 (patch)
tree419bb595a57aaaa5ec9657427875e65bd968f469 /src
parent2b697b5b039161cfa8d1b998e8cee08f97047180 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_httpd.cpp5
-rw-r--r--src/modules/m_httpd_stats.cpp3
2 files changed, 8 insertions, 0 deletions
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 << "<html><h1>Chickens</h1></html>";
HTTPRequest* http = (HTTPRequest*)event->GetData();
HTTPDocument response(http->sock, &data, 200);
Request req((char*)&response, (Module*)this, event->GetSource());
req.Send();
+
+ log(DEBUG,"Sent");
}
}