Merge pull request #6817 from Icinga/bugfix/stalled-tls-connections-6816

HttpServerConnection#DataAvailableHandler(): be aware of being called multiple times concurrently
This commit is contained in:
Michael Friedrich 2018-12-05 11:35:35 +01:00 committed by GitHub
commit b58ce84b0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -351,7 +351,11 @@ void HttpServerConnection::DataAvailableHandler()
bool close = false;
if (!m_Stream->IsEof()) {
boost::recursive_mutex::scoped_lock lock(m_DataHandlerMutex);
boost::recursive_mutex::scoped_try_lock lock(m_DataHandlerMutex);
if (!lock.owns_lock()) {
Log(LogInformation, "HttpServerConnection", "Unable to process available data, they're already being processed in another thread");
return;
}
try {
while (ProcessMessage())