diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-11 01:35:01 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-11 01:35:01 +0000 |
commit | 12737ab4ad61a0d8a908c8a21594c7012e21eb3c (patch) | |
tree | bf819b3a528227d3ddf929e25e8b74d1db8ef1c7 /src/modules/m_httpd.cpp | |
parent | b8383dcc9524ca832de7daf56f44fe54b19e5bdc (diff) |
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
Diffstat (limited to 'src/modules/m_httpd.cpp')
-rw-r--r-- | src/modules/m_httpd.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
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(); } |