Merge pull request #6429 from Icinga/bugfix/api-log-spam-6428

Make HttpServerConnection#m_DataHandlerMutex a boost::recursive_mutex
This commit is contained in:
Michael Friedrich 2018-07-09 16:58:51 +02:00 committed by GitHub
commit 8c8f1deb1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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);

View File

@ -25,6 +25,7 @@
#include "remote/apiuser.hpp"
#include "base/tlsstream.hpp"
#include "base/workqueue.hpp"
#include <boost/thread/recursive_mutex.hpp>
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;