Fix another potential problem where TLS connection might get stalled

refs #8485
This commit is contained in:
Gunnar Beutner 2015-02-24 07:11:22 +01:00
parent 55c974b0f4
commit 2922d5d9bd
1 changed files with 4 additions and 4 deletions

View File

@ -128,7 +128,7 @@ void TlsStream::OnEvent(int revents)
char buffer[512];
if (m_CurrentAction == TlsActionNone) {
if (m_SendQ->GetAvailableBytes() > 0)
if (m_SendQ->GetAvailableBytes() > 0 && (revents & POLLOUT))
m_CurrentAction = TlsActionWrite;
else
m_CurrentAction = TlsActionRead;
@ -179,7 +179,7 @@ void TlsStream::OnEvent(int revents)
if (rc > 0) {
if (m_SendQ->GetAvailableBytes() > 0) {
m_CurrentAction = TlsActionWrite;
ChangeEvents(POLLOUT);
ChangeEvents(POLLIN|POLLOUT);
} else {
m_CurrentAction = TlsActionNone;
ChangeEvents(POLLIN);
@ -205,7 +205,7 @@ void TlsStream::OnEvent(int revents)
break;
case SSL_ERROR_WANT_WRITE:
m_Retry = true;
ChangeEvents(POLLOUT);
ChangeEvents(POLLIN|POLLOUT);
break;
case SSL_ERROR_ZERO_RETURN:
@ -278,7 +278,7 @@ void TlsStream::Write(const void *buffer, size_t count)
m_SendQ->Write(buffer, count);
ChangeEvents(POLLOUT);
ChangeEvents(POLLIN|POLLOUT);
}
/**