Fix another potential hang in TlsStream::Handshake

refs #8550
This commit is contained in:
Gunnar Beutner 2015-02-27 09:03:23 +01:00
parent bb2cdff435
commit 9567cd663b
2 changed files with 2 additions and 2 deletions

View File

@ -63,5 +63,5 @@ void StdioStream::Close(void)
bool StdioStream::IsEof(void) const bool StdioStream::IsEof(void) const
{ {
return m_InnerStream->eof(); return !m_InnerStream->good();
} }

View File

@ -131,7 +131,7 @@ void TlsStream::OnEvent(int revents)
char buffer[512]; char buffer[512];
if (m_CurrentAction == TlsActionNone) { if (m_CurrentAction == TlsActionNone) {
if (revents & POLLIN) if (revents & (POLLIN | POLLERR | POLLHUP))
m_CurrentAction = TlsActionRead; m_CurrentAction = TlsActionRead;
else if (m_SendQ->GetAvailableBytes() > 0 && (revents & POLLOUT)) else if (m_SendQ->GetAvailableBytes() > 0 && (revents & POLLOUT))
m_CurrentAction = TlsActionWrite; m_CurrentAction = TlsActionWrite;