X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_httpd.cpp;h=b1dc7b6101ee93cc964a5aa534459207b0b2e469;hb=d54fd9b1e6b31f69332a9241b5f17330c0ad61e0;hp=6e5ddd514af97b0ca0a1096bb4e3c070de0bf20d;hpb=0ba3bb8ade1311bd21c2285dae7aab228a14c650;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index 6e5ddd514..b1dc7b610 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -21,7 +21,7 @@ using namespace std; #include "channels.h" #include "modules.h" #include "inspsocket.h" -#include "helperfuncs.h" + #include "inspircd.h" #include "httpd.h" @@ -51,7 +51,7 @@ class HttpSocket : public InspSocket 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"); + SI->Log(DEBUG,"HttpSocket constructor"); InternalState = HTTP_LISTEN; } @@ -65,7 +65,7 @@ class HttpSocket : public InspSocket if (InternalState == HTTP_LISTEN) { HttpSocket* s = new HttpSocket(this->Instance, newsock, ip, index); - this->Instance->AddSocket(s); + s = s; /* Stop GCC whining */ } return true; } @@ -225,7 +225,7 @@ class HttpSocket : public InspSocket if (!claimed) { SendHeaders(0, 404, ""); - log(DEBUG,"Page not claimed, 404"); + Instance->Log(DEBUG,"Page not claimed, 404"); } } } @@ -245,7 +245,7 @@ class HttpSocket : public InspSocket void Page(std::stringstream* n, int response, std::string& extraheaders) { - log(DEBUG,"Sending page"); + Instance->Log(DEBUG,"Sending page"); SendHeaders(n->str().length(), response, extraheaders); this->Write(n->str()); } @@ -283,10 +283,6 @@ class ModuleHttp : public Module void CreateListener() { http = new HttpSocket(ServerInstance, this->bindip, this->port, true, 0, index); - if ((http) && (http->GetState() == I_LISTENING)) - { - ServerInstance->AddSocket(http); - } } ModuleHttp(InspIRCd* Me) : Module::Module(Me) @@ -302,7 +298,7 @@ class ModuleHttp : public Module char* OnRequest(Request* request) { - log(DEBUG,"Got HTTPDocument object"); + ServerInstance->Log(DEBUG,"Got HTTPDocument object"); claimed = true; HTTPDocument* doc = (HTTPDocument*)request->GetData(); HttpSocket* sock = (HttpSocket*)doc->sock; @@ -317,7 +313,7 @@ class ModuleHttp : public Module virtual ~ModuleHttp() { - ServerInstance->DelSocket(http); + ServerInstance->SE->DelFd(http); } virtual Version GetVersion()