]> 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 0b6b2e32b7dcd1c261cb8aa926c4b79b7fbfd2f0..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;
+                       }
+               }
 
-               if (via->iohookprov)
-                       via->iohookprov->OnAccept(this, client, server);
+               ServerInstance->Timers.AddTimer(this);
        }
 
        ~HttpServerSocket()