summaryrefslogtreecommitdiff
path: root/src/modules/m_httpd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-09 14:53:19 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-09 14:53:19 +0000
commitab46b96db4d457e6a4f2e978c38b79762cdeb9d5 (patch)
tree01b9489ae9804ee45b765ad7045efee54b34347b /src/modules/m_httpd.cpp
parentf0680338833dd76966ba1769980abb9eafb50467 (diff)
Move socket_ref and module_sockets vectors/arrays into InspIRCd*. These are public members, which InspSocket can modify.
(eventually, this will be marshalled safely through some accessors). When constructing an InspSocket you must now provide an InspIRCd* instance to 'attach' the socket to. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4812 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_httpd.cpp')
-rw-r--r--src/modules/m_httpd.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp
index 0591ded9a..fb9ea954c 100644
--- a/src/modules/m_httpd.cpp
+++ b/src/modules/m_httpd.cpp
@@ -29,6 +29,8 @@ using namespace std;
class ModuleHttp;
+extern InspIRCd* ServerInstance;
+
static Server *Srv;
static ModuleHttp* HttpModule;
extern time_t TIME;
@@ -49,13 +51,13 @@ class HttpSocket : public InspSocket
public:
- HttpSocket(std::string host, int port, bool listening, unsigned long maxtime, FileReader* index_page) : InspSocket(host, port, listening, maxtime), index(index_page)
+ HttpSocket(InspIRCd* SI, std::string host, int port, bool listening, unsigned long maxtime, FileReader* index_page) : InspSocket(SI, host, port, listening, maxtime), index(index_page)
{
log(DEBUG,"HttpSocket constructor");
InternalState = HTTP_LISTEN;
}
- HttpSocket(int newfd, char* ip, FileReader* ind) : InspSocket(newfd, ip), index(ind)
+ HttpSocket(InspIRCd* SI, int newfd, char* ip, FileReader* ind) : InspSocket(SI, newfd, ip), index(ind)
{
InternalState = HTTP_SERVE_WAIT_REQUEST;
}
@@ -64,7 +66,7 @@ class HttpSocket : public InspSocket
{
if (InternalState == HTTP_LISTEN)
{
- HttpSocket* s = new HttpSocket(newsock, ip, index);
+ HttpSocket* s = new HttpSocket(this->Instance, newsock, ip, index);
Srv->AddSocket(s);
}
return true;
@@ -276,7 +278,7 @@ class ModuleHttp : public Module
void CreateListener()
{
- http = new HttpSocket(this->bindip, this->port, true, 0, &index);
+ http = new HttpSocket(ServerInstance, this->bindip, this->port, true, 0, &index);
if ((http) && (http->GetState() == I_LISTENING))
{
Srv->AddSocket(http);