From b200104cf2c61465acecaca111e3ec727fc3b954 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 24 Aug 2016 12:27:51 +0200 Subject: Check for errors after calling IOHookProvider::OnAccept() --- src/modules/m_httpd.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/modules/m_httpd.cpp') diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index 64bef70d1..6055d1f77 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -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() -- cgit v1.3.1-10-gc9f91