Improve error handling for TlsStream::Handshake

fixes #11046
This commit is contained in:
Gunnar Beutner 2016-05-11 10:09:54 +02:00
parent b9fdb3bfd9
commit 2adfcb56fe
1 changed files with 4 additions and 1 deletions

View File

@ -268,9 +268,12 @@ void TlsStream::Handshake(void)
m_CurrentAction = TlsActionHandshake;
ChangeEvents(POLLOUT);
while (!m_HandshakeOK && !m_ErrorOccurred)
while (!m_HandshakeOK && !m_ErrorOccurred && !m_Eof)
m_CV.wait(lock);
if (m_Eof)
BOOST_THROW_EXCEPTION(std::runtime_error("Socket was closed during TLS handshake."));
HandleError();
}