X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_httpd.cpp;h=37f715a8da221914b3d54a44c0556193e5796b93;hb=3f782d5cad84165d695203977c75d2a3877f4644;hp=0584e97c5eea620a46b587ae7291541b78040fc9;hpb=553a8da754c8cd308bad2008018849714e70f9b7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index 0584e97c5..37f715a8d 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -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 httpsocks; public: - ModuleHttpServer() { + void init() + { HttpModule = this; ServerInstance->Modules->Attach(I_OnAcceptConnection, this); }