]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Improve the logging of the httpd module.
authorSadie Powell <sadie@witchery.services>
Wed, 8 Apr 2020 23:14:59 +0000 (00:14 +0100)
committerSadie Powell <sadie@witchery.services>
Wed, 8 Apr 2020 23:14:59 +0000 (00:14 +0100)
src/modules/m_httpd.cpp

index 978a60ab76e8a959fca18f52a76f4190deb719ea..7b2487d1c14d4c208a4ee6f98ba68924e1bc4058 100644 (file)
@@ -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();
        }