From 12737ab4ad61a0d8a908c8a21594c7012e21eb3c Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 11 Aug 2006 01:35:01 +0000 Subject: ConfigReader and FileReader now take InspIRCd* to their constructors git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4865 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_httpd.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/modules/m_httpd.cpp') diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index f8178ed3a..1afa3bd09 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -220,7 +220,7 @@ class HttpSocket : public InspSocket claimed = false; HTTPRequest httpr(request_type,uri,&headers,this,this->GetIP()); Event e((char*)&httpr, (Module*)HttpModule, "httpd_url"); - e.Send(); + e.Send(this->Instance); if (!claimed) { @@ -258,7 +258,7 @@ class ModuleHttp : public Module std::string bindip; std::string indexfile; - FileReader index; + FileReader* index; HttpSocket* http; @@ -266,18 +266,23 @@ class ModuleHttp : public Module void ReadConfig() { - ConfigReader c; + ConfigReader c(ServerInstance); this->host = c.ReadValue("http", "host", 0); this->bindip = c.ReadValue("http", "ip", 0); this->port = c.ReadInteger("http", "port", 0, true); this->indexfile = c.ReadValue("http", "index", 0); - index.LoadFile(this->indexfile); + if (index) + { + delete index; + index = NULL; + } + index = new FileReader(ServerInstance, this->indexfile); } void CreateListener() { - http = new HttpSocket(ServerInstance, this->bindip, this->port, true, 0, &index); + http = new HttpSocket(ServerInstance, this->bindip, this->port, true, 0, index); if ((http) && (http->GetState() == I_LISTENING)) { ServerInstance->AddSocket(http); @@ -286,7 +291,7 @@ class ModuleHttp : public Module ModuleHttp(InspIRCd* Me) : Module::Module(Me) { - + index = NULL; ReadConfig(); CreateListener(); } -- cgit v1.2.3