]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_httpd.cpp
Only assign NewServices once the duplicate check is done.
[user/henk/code/inspircd.git] / src / modules / m_httpd.cpp
index 978a60ab76e8a959fca18f52a76f4190deb719ea..330e98c6a9739877f85589f211d097db65feb8ab 100644 (file)
@@ -3,9 +3,9 @@
  *
  *   Copyright (C) 2019 linuxdaemon <linuxdaemon.irc@gmail.com>
  *   Copyright (C) 2018 edef <edef@edef.eu>
- *   Copyright (C) 2013-2014, 2017-2019 Sadie Powell <sadie@witchery.services>
+ *   Copyright (C) 2013-2014, 2017-2020 Sadie Powell <sadie@witchery.services>
  *   Copyright (C) 2012-2016 Attila Molnar <attilamolnar@hush.com>
- *   Copyright (C) 2012, 2019 Robby <robby@chatbelgie.be>
+ *   Copyright (C) 2012 Robby <robby@chatbelgie.be>
  *   Copyright (C) 2009 Uli Schlachter <psychon@inspircd.org>
  *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
  *   Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
@@ -95,6 +95,7 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
        {
                if (!messagecomplete)
                {
+                       ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "HTTP socket %d timed out", GetFd());
                        Close();
                        return false;
                }
@@ -229,6 +230,8 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
                        // IOHook may have errored
                        if (!getError().empty())
                        {
+                               ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "HTTP socket %d encountered a hook error: %s",
+                                       GetFd(), getError().c_str());
                                Close();
                                return;
                        }
@@ -254,8 +257,10 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
                ServerInstance->GlobalCulls.AddItem(this);
        }
 
-       void OnError(BufferedSocketError) CXX11_OVERRIDE
+       void OnError(BufferedSocketError err) CXX11_OVERRIDE
        {
+               ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "HTTP socket %d encountered an error: %d - %s",
+                       GetFd(), err, getError().c_str());
                Close();
        }
 
@@ -284,7 +289,7 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
                else
                        rheaders.RemoveHeader("Content-Type");
 
-               /* Supporting Connection: keep-alive causes a whole world of hurt syncronizing timeouts,
+               /* Supporting Connection: keep-alive causes a whole world of hurt synchronizing timeouts,
                 * so remove it, its not essential for what we need.
                 */
                rheaders.SetHeader("Connection", "Close");
@@ -446,7 +451,7 @@ class ModuleHttpServer : public Module
 
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("Provides HTTP serving facilities to modules", VF_VENDOR);
+               return Version("Allows the server administrator to serve various useful resources over HTTP.", VF_VENDOR);
        }
 };