[icinga-checkins] icinga.org: icinga2/master: Fix another problem where Icinga doesn' t detect that a cluster connection is dead

git at icinga.org git at icinga.org
Wed Feb 25 13:21:58 CET 2015


Module: icinga2
Branch: master
Commit: 4972364f4214e637a6bd74b9ae782770891dfaa7
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=4972364f4214e637a6bd74b9ae782770891dfaa7

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Wed Feb 25 13:21:38 2015 +0100

Fix another problem where Icinga doesn't detect that a cluster connection is dead

refs #8485

---

 lib/base/tlsstream.cpp |   18 ++++--------------
 lib/base/tlsstream.hpp |    3 +--
 2 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/lib/base/tlsstream.cpp b/lib/base/tlsstream.cpp
index 829da6f..9ff8fbd 100644
--- a/lib/base/tlsstream.cpp
+++ b/lib/base/tlsstream.cpp
@@ -168,14 +168,6 @@ void TlsStream::OnEvent(int revents)
 			}
 
 			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 10c4c58..80be2d9 100644
--- a/lib/base/tlsstream.hpp
+++ b/lib/base/tlsstream.hpp
@@ -35,8 +35,7 @@ enum TlsAction
 	TlsActionNone,
 	TlsActionRead,
 	TlsActionWrite,
-	TlsActionHandshake,
-	TlsActionClose
+	TlsActionHandshake
 };
 
 /**



More information about the icinga-checkins mailing list