From ac6afadb5a686df2cf6459e6f2f2c1d6eed86633 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 9 Jul 2018 14:40:32 +0200 Subject: [PATCH] Make HttpServerConnection#m_DataHandlerMutex a boost::recursive_mutex refs #6428 --- lib/remote/httpserverconnection.cpp | 4 ++-- lib/remote/httpserverconnection.hpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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; -- 2.40.0