From: Gunnar Beutner Date: Wed, 25 Feb 2015 12:21:38 +0000 (+0100) Subject: Fix another problem where Icinga doesn't detect that a cluster connection is dead X-Git-Tag: v2.3.0~131 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4972364f4214e637a6bd74b9ae782770891dfaa7;p=icinga2 Fix another problem where Icinga doesn't detect that a cluster connection is dead refs #8485 --- diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp index 829da6f08..9ff8fbd43 100644 --- a/lib/base/tlsstream.cpp +++ b/lib/base/tlsstream.cpp @@ -167,14 +167,6 @@ void TlsStream::OnEvent(int revents) m_CV.notify_all(); } - break; - case TlsActionClose: - (void) SSL_shutdown(m_SSL.get()); - rc = 1; - - m_CloseOK = true; - m_CV.notify_all(); - break; default: VERIFY(!"Invalid TlsAction"); @@ -290,13 +282,11 @@ void TlsStream::Write(const void *buffer, size_t count) void TlsStream::Close(void) { boost::mutex::scoped_lock lock(m_Mutex); - m_CurrentAction = TlsActionClose; - ChangeEvents(POLLOUT); - - while (!m_CloseOK && !m_ErrorOccurred) - m_CV.wait(lock); + (void) SSL_shutdown(m_SSL.get()); + m_Socket->Close(); - HandleError(); + m_CloseOK = true; + m_CV.notify_all(); } bool TlsStream::IsEof(void) const diff --git a/lib/base/tlsstream.hpp b/lib/base/tlsstream.hpp index 10c4c58bd..80be2d917 100644 --- a/lib/base/tlsstream.hpp +++ b/lib/base/tlsstream.hpp @@ -35,8 +35,7 @@ enum TlsAction TlsActionNone, TlsActionRead, TlsActionWrite, - TlsActionHandshake, - TlsActionClose + TlsActionHandshake }; /**