]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_httpd.cpp
Merge pull request #1443 from B00mX0r/master+filtershun
[user/henk/code/inspircd.git] / src / modules / m_httpd.cpp
index 961a70473f7383cfd152dead0711d45e61370078..a20b85f9d003e7cc9e26e73d4c598046ec68b04e 100644 (file)
@@ -100,7 +100,7 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
                AddToCull();
        }
 
-       std::string Response(int response)
+       std::string Response(unsigned int response)
        {
                switch (response)
                {
@@ -191,7 +191,7 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
                }
        }
 
-       void SendHTTPError(int response)
+       void SendHTTPError(unsigned int response)
        {
                HTTPHeaders empty;
                std::string data = "<html><head></head><body>Server error "+ConvToStr(response)+": "+Response(response)+"<br>"+
@@ -201,7 +201,7 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
                WriteData(data);
        }
 
-       void SendHeaders(unsigned long size, int response, HTTPHeaders &rheaders)
+       void SendHeaders(unsigned long size, unsigned int response, HTTPHeaders &rheaders)
        {
 
                WriteData(http_version + " "+ConvToStr(response)+" "+Response(response)+"\r\n");
@@ -345,7 +345,7 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
                }
        }
 
-       void Page(std::stringstream* n, int response, HTTPHeaders *hheaders)
+       void Page(std::stringstream* n, unsigned int response, HTTPHeaders *hheaders)
        {
                SendHeaders(n->str().length(), response, *hheaders);
                WriteData(n->str());
@@ -408,10 +408,8 @@ class ModuleHttpServer : public Module
        {
                if (from->bind_tag->getString("type") != "httpd")
                        return MOD_RES_PASSTHRU;
-               int port;
-               std::string incomingip;
-               irc::sockets::satoap(*client, incomingip, port);
-               sockets.push_front(new HttpServerSocket(nfd, incomingip, from, client, server, timeoutsec));
+
+               sockets.push_front(new HttpServerSocket(nfd, client->addr(), from, client, server, timeoutsec));
                return MOD_RES_ALLOW;
        }