]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_httpd.cpp
Delete modewatchers when unloading modules that use them to keep the server from...
[user/henk/code/inspircd.git] / src / modules / m_httpd.cpp
index 7fc342e04c2ee521e63e9f355cbbef3beeb1f529..b453a28056d0f0e9489ee3225115117f7b41f51c 100644 (file)
@@ -60,6 +60,7 @@ class HttpServerSocket : public BufferedSocket
 
        virtual void OnError(BufferedSocketError)
        {
+               ServerInstance->GlobalCulls.AddItem(this);
        }
 
        std::string Response(int response)
@@ -326,6 +327,7 @@ class ModuleHttpServer : public Module
 
        ModuleHttpServer()      {
                HttpModule = this;
+               ServerInstance->Modules->Attach(I_OnAcceptConnection, this);
        }
 
        void OnRequest(Request& request)
@@ -339,11 +341,11 @@ class ModuleHttpServer : public Module
 
        ModResult OnAcceptConnection(int nfd, ListenSocket* from, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server)
        {
-               if (from->bind_tag->getString("type") != "httpd");
+               if (from->bind_tag->getString("type") != "httpd")
                        return MOD_RES_PASSTHRU;
                int port;
                std::string incomingip;
-               irc::sockets::satoap(client, incomingip, port);
+               irc::sockets::satoap(*client, incomingip, port);
                new HttpServerSocket(nfd, incomingip, from, client, server);
                return MOD_RES_ALLOW;
        }