LibTLS: Ensure that on_tls_finished is called only once

Connection state changes when the logical transport is closed should
not trigger tls_finished.
This commit is contained in:
Ali Mohammad Pur 2021-06-28 16:10:59 +04:30 committed by Andreas Kling
parent cef2f55a8b
commit 2a7cb4fe42
Notes: sideshowbarker 2024-07-18 11:24:27 +09:00

View File

@ -195,7 +195,7 @@ bool TLSv12::check_connection_state(bool read)
return false;
}
if (((read && m_context.application_buffer.size() == 0) || !read) && m_context.connection_finished) {
if (m_context.application_buffer.size() == 0) {
if (m_context.application_buffer.size() == 0 && m_context.connection_status != ConnectionStatus::Disconnected) {
if (on_tls_finished)
on_tls_finished();
}