diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp index 6e8ea1c58..497ce7b83 100644 --- a/lib/remote/httpserverconnection.cpp +++ b/lib/remote/httpserverconnection.cpp @@ -77,7 +77,7 @@ TlsStream::Ptr HttpServerConnection::GetStream() const void HttpServerConnection::Disconnect() { - boost::mutex::scoped_try_lock lock(m_DataHandlerMutex); + boost::recursive_mutex::scoped_try_lock lock(m_DataHandlerMutex); if (!lock.owns_lock()) { Log(LogInformation, "HttpServerConnection", "Unable to disconnect Http client, I/O thread busy"); return; @@ -342,7 +342,7 @@ void HttpServerConnection::DataAvailableHandler() bool close = false; if (!m_Stream->IsEof()) { - boost::mutex::scoped_lock lock(m_DataHandlerMutex); + boost::recursive_mutex::scoped_lock lock(m_DataHandlerMutex); m_Stream->SetCorked(true); diff --git a/lib/remote/httpserverconnection.hpp b/lib/remote/httpserverconnection.hpp index 5f959b8a0..6d1c3bd46 100644 --- a/lib/remote/httpserverconnection.hpp +++ b/lib/remote/httpserverconnection.hpp @@ -25,6 +25,7 @@ #include "remote/apiuser.hpp" #include "base/tlsstream.hpp" #include "base/workqueue.hpp" +#include namespace icinga { @@ -55,7 +56,7 @@ private: TlsStream::Ptr m_Stream; double m_Seen; HttpRequest m_CurrentRequest; - boost::mutex m_DataHandlerMutex; + boost::recursive_mutex m_DataHandlerMutex; WorkQueue m_RequestQueue; int m_PendingRequests;