]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_httpd.cpp
Check for errors after calling IOHookProvider::OnAccept()
[user/henk/code/inspircd.git] / src / modules / m_httpd.cpp
index 64bef70d11ad3959a4323f0a1efedf5de2ab07d9..6055d1f77b38d179cff8d508aba840ccd6eaa022 100644 (file)
@@ -76,10 +76,18 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
                , postsize(0)
                , waitingcull(false)
        {
-               ServerInstance->Timers.AddTimer(this);
-
                if ((!via->iohookprovs.empty()) && (via->iohookprovs.back()))
+               {
                        via->iohookprovs.back()->OnAccept(this, client, server);
+                       // IOHook may have errored
+                       if (!getError().empty())
+                       {
+                               AddToCull();
+                               return;
+                       }
+               }
+
+               ServerInstance->Timers.AddTimer(this);
        }
 
        ~HttpServerSocket()