mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Merge pull request #6402 from Icinga/fix/tls-stream-read-pending
Use SSL_pending() for remaining TLS stream data
This commit is contained in:
commit
1b2af3f0c4
@ -186,7 +186,26 @@ void TlsStream::OnEvent(int revents)
|
|||||||
|
|
||||||
readTotal += rc;
|
readTotal += rc;
|
||||||
}
|
}
|
||||||
} while (rc > 0 && readTotal < 64 * 1024);
|
|
||||||
|
#ifdef I2_DEBUG /* I2_DEBUG */
|
||||||
|
Log(LogDebug, "TlsStream")
|
||||||
|
<< "Read bytes: " << rc << " Total read bytes: " << readTotal;
|
||||||
|
#endif /* I2_DEBUG */
|
||||||
|
/* Limit read size. We cannot do this check inside the while loop
|
||||||
|
* since below should solely check whether OpenSSL has more data
|
||||||
|
* or not. */
|
||||||
|
if (readTotal >= 64 * 1024) {
|
||||||
|
#ifdef I2_DEBUG /* I2_DEBUG */
|
||||||
|
Log(LogWarning, "TlsStream")
|
||||||
|
<< "Maximum read bytes exceeded: " << readTotal;
|
||||||
|
#endif /* I2_DEBUG */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Use OpenSSL's state machine here to determine whether we need
|
||||||
|
* to read more data. SSL_has_pending() is available with 1.1.0.
|
||||||
|
*/
|
||||||
|
} while (SSL_pending(m_SSL.get()));
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
m_CV.notify_all();
|
m_CV.notify_all();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user