]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_httpd.cpp
Fix m_randquote with 0 quotes
[user/henk/code/inspircd.git] / src / modules / m_httpd.cpp
index 0584e97c5eea620a46b587ae7291541b78040fc9..37f715a8da221914b3d54a44c0556193e5796b93 100644 (file)
@@ -186,7 +186,7 @@ class HttpServerSocket : public BufferedSocket
                date[strlen(date) - 1] = '\0';
                rheaders.CreateHeader("Date", date);
 
-               rheaders.CreateHeader("Server", "InspIRCd/m_httpd.so/1.2");
+               rheaders.CreateHeader("Server", BRANCH);
                rheaders.SetHeader("Content-Length", ConvToStr(size));
 
                if (size)
@@ -282,7 +282,7 @@ class HttpServerSocket : public BufferedSocket
                        return;
                }
 
-               if (headers.IsSet("Content-Length") && (postsize = atoi(headers.GetHeader("Content-Length").c_str())) != 0)
+               if (headers.IsSet("Content-Length") && (postsize = ConvToInt(headers.GetHeader("Content-Length"))) > 0)
                {
                        InternalState = HTTP_SERVE_RECV_POSTDATA;
 
@@ -336,7 +336,8 @@ class ModuleHttpServer : public Module
        std::vector<HttpServerSocket *> httpsocks;
  public:
 
-       ModuleHttpServer()      {
+       void init()
+       {
                HttpModule = this;
                ServerInstance->Modules->Attach(I_OnAcceptConnection, this);
        }