]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_httpd.cpp
Improve HTTP logging.
[user/henk/code/inspircd.git] / src / modules / m_httpd.cpp
index b4e221e621094a11cd2dc393c594406d867742ff..efed34799bb9ee1d1ee892da7a830fcbc7ffde12 100644 (file)
@@ -266,12 +266,16 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
 
        void SendHTTPError(unsigned int response, const char* errstr = NULL)
        {
+               if (!errstr)
+                       errstr = http_status_str((http_status)response);
+
+               ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Sending HTTP error %u: %s", response, errstr);
                static HTTPHeaders empty;
                std::string data = InspIRCd::Format(
                        "<html><head></head><body style='font-family: sans-serif; text-align: center'>"
                        "<h1 style='font-size: 48pt'>Error %u</h1><h2 style='font-size: 24pt'>%s</h2><hr>"
                        "<small>Powered by <a href='https://www.inspircd.org'>InspIRCd</a></small></body></html>",
-                       response, errstr ? errstr : http_status_str((http_status)response));
+                       response, errstr);
 
                Page(data, response, &empty);
        }