summaryrefslogtreecommitdiff
path: root/src/modules/m_httpd_stats.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-11 13:23:10 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-11 13:23:10 +0000
commit6fac3ffc3b6f2c3ec72dcda02abb5db73854cdb8 (patch)
tree07b7ce6f31f962fa10eb3ef0a0aefa0a63aa48af /src/modules/m_httpd_stats.cpp
parent994c70862fd98531d72f3604b54f56e1a90ac82c (diff)
We might as well start on some module to interface with the service provider, eh
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4327 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_httpd_stats.cpp')
-rw-r--r--src/modules/m_httpd_stats.cpp103
1 files changed, 103 insertions, 0 deletions
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
new file mode 100644
index 000000000..c02a1a215
--- /dev/null
+++ b/src/modules/m_httpd_stats.cpp
@@ -0,0 +1,103 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
+ * E-mail:
+ * <brain@chatspike.net>
+ * <Craig@chatspike.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+using namespace std;
+
+#include <stdio.h>
+#include "users.h"
+#include "channels.h"
+#include "modules.h"
+#include "inspsocket.h"
+#include "helperfuncs.h"
+#include "httpd.h"
+
+/* $ModDesc: Provides statistics over HTTP via m_httpd.so */
+
+class ModuleHttpStats : public Module
+{
+ int port;
+ std::string host;
+ std::string bindip;
+ std::string indexfile;
+
+ FileReader index;
+
+ HttpSocket* http;
+
+ public:
+
+ void ReadConfig()
+ {
+ }
+
+ ModuleHttpStats(Server* Me) : Module::Module(Me)
+ {
+ Srv = Me;
+ ReadConfig();
+ }
+
+ void OnEvent(Event* event)
+ {
+ if (event->GetID() == "httpd_url")
+ {
+ log(DEBUG,"HTTP URL!");
+ }
+ }
+
+ char* OnRequest(Request* request)
+ {
+ return NULL;
+ }
+
+ void Implements(char* List)
+ {
+ List[I_OnEvent] = List[I_OnRequest] = 1;
+ }
+
+ virtual ~ModuleHttpStats()
+ {
+ Srv->DelSocket(http);
+ }
+
+ virtual Version GetVersion()
+ {
+ return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
+ }
+};
+
+
+class ModuleHttpStatsFactory : public ModuleFactory
+{
+ public:
+ ModuleHttpStatsFactory()
+ {
+ }
+
+ ~ModuleHttpStatsFactory()
+ {
+ }
+
+ virtual Module * CreateModule(Server* Me)
+ {
+ return new ModuleHttpStats(Me);
+ }
+};
+
+
+extern "C" void * init_module( void )
+{
+ return new ModuleHttpStatsFactory;
+}