From 02d9fc3279bf5b09256f535d9c2c873526a619fd Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 10 Jul 2006 21:05:24 +0000 Subject: Http service provider module (this doesnt do anything yet!) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4307 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_http.cpp | 101 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 src/modules/m_http.cpp diff --git a/src/modules/m_http.cpp b/src/modules/m_http.cpp new file mode 100644 index 000000000..b4f77903a --- /dev/null +++ b/src/modules/m_http.cpp @@ -0,0 +1,101 @@ +/* +------------------------------------+ + * | Inspire Internet Relay Chat Daemon | + * +------------------------------------+ + * + * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. + * E-mail: + * + * + * + * 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 +#include "users.h" +#include "channels.h" +#include "modules.h" + +/* $ModDesc: Povides a proof-of-concept test /WOOT command */ + +static Server *Srv; + +enum HttpState +{ + HTTP_LISTEN = 0, + HTTP_SERVE = 1 +}; + +class HttpSocket : public InspSocket +{ + public: + + HttpSocket(std::string host, int port, bool listening, unsigned long maxtime) : InspSocket(host, port, listening, maxtime) + { + } + + HttpSocket(int newfd, char* ip) : InspSocket(newfd, ip) + { + } +}; + +class ModuleHttp : public Module +{ + public: + + void ReadConfig() + { + ConfigReader c; + } + + ModuleHttp(Server* Me) + : Module::Module(Me) + { + ReadConfig(); + } + + void Implements(char* List) + { + List[I_OnEvent] = List[I_OnRequest] = 1; + } + + virtual ~ModuleHttp() + { + } + + virtual Version GetVersion() + { + return Version(1,0,0,0,VF_STATIC|VF_VENDOR); + } +}; + + +class ModuleHttpFactory : public ModuleFactory +{ + public: + ModuleHttpFactory() + { + } + + ~ModuleHttpFactory() + { + } + + virtual Module * CreateModule(Server* Me) + { + return new ModuleHttp(Me); + } + +}; + + +extern "C" void * init_module( void ) +{ + return new ModuleHttpFactory; +} + -- cgit v1.2.3