1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00

Prevent hang when closing TLS connection after network failure

Related to 2c0b486d, 5d68c005. Caused by 268f6355.

Source commit: 095c15c2ed15e8cfd517a3aebf1665d60d6b5977
This commit is contained in:
Martin Prikryl
2021-10-20 08:15:06 +00:00
parent e70fd8fa51
commit aff5cba787

View File

@@ -606,10 +606,10 @@ int CAsyncSslSocketLayer::Receive(void* lpBuf, int nBufLen, int nFlags)
void CAsyncSslSocketLayer::Close()
{
if (!m_nShutDown && m_bSslEstablished && !m_nCriticalError)
if (!m_nShutDown && m_bSslEstablished && !m_nNetworkError && !m_nCriticalError)
{
ShutDown();
while (!ShutDownComplete())
while (!ShutDownComplete() && !m_nNetworkError && !m_nCriticalError)
{
OnSend(0);
}