mirror of https://github.com/Icinga/icinga2.git
Fix another potential problem where TLS connection might get stalled
refs #8485
This commit is contained in:
parent
55c974b0f4
commit
2922d5d9bd
|
@ -128,7 +128,7 @@ void TlsStream::OnEvent(int revents)
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
|
|
||||||
if (m_CurrentAction == TlsActionNone) {
|
if (m_CurrentAction == TlsActionNone) {
|
||||||
if (m_SendQ->GetAvailableBytes() > 0)
|
if (m_SendQ->GetAvailableBytes() > 0 && (revents & POLLOUT))
|
||||||
m_CurrentAction = TlsActionWrite;
|
m_CurrentAction = TlsActionWrite;
|
||||||
else
|
else
|
||||||
m_CurrentAction = TlsActionRead;
|
m_CurrentAction = TlsActionRead;
|
||||||
|
@ -179,7 +179,7 @@ void TlsStream::OnEvent(int revents)
|
||||||
if (rc > 0) {
|
if (rc > 0) {
|
||||||
if (m_SendQ->GetAvailableBytes() > 0) {
|
if (m_SendQ->GetAvailableBytes() > 0) {
|
||||||
m_CurrentAction = TlsActionWrite;
|
m_CurrentAction = TlsActionWrite;
|
||||||
ChangeEvents(POLLOUT);
|
ChangeEvents(POLLIN|POLLOUT);
|
||||||
} else {
|
} else {
|
||||||
m_CurrentAction = TlsActionNone;
|
m_CurrentAction = TlsActionNone;
|
||||||
ChangeEvents(POLLIN);
|
ChangeEvents(POLLIN);
|
||||||
|
@ -205,7 +205,7 @@ void TlsStream::OnEvent(int revents)
|
||||||
break;
|
break;
|
||||||
case SSL_ERROR_WANT_WRITE:
|
case SSL_ERROR_WANT_WRITE:
|
||||||
m_Retry = true;
|
m_Retry = true;
|
||||||
ChangeEvents(POLLOUT);
|
ChangeEvents(POLLIN|POLLOUT);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case SSL_ERROR_ZERO_RETURN:
|
case SSL_ERROR_ZERO_RETURN:
|
||||||
|
@ -278,7 +278,7 @@ void TlsStream::Write(const void *buffer, size_t count)
|
||||||
|
|
||||||
m_SendQ->Write(buffer, count);
|
m_SendQ->Write(buffer, count);
|
||||||
|
|
||||||
ChangeEvents(POLLOUT);
|
ChangeEvents(POLLIN|POLLOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue