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

Bug 1834: FTP file uploads are interrupting with TLS 1.3

https://winscp.net/tracker/1834

Source commit: ed1a795deeb85606fa2ebb3cb265a407b5abfbef
This commit is contained in:
Martin Prikryl
2020-04-22 10:51:12 +00:00
parent ec65bb2ac9
commit e78c2485a0
2 changed files with 10 additions and 6 deletions

View File

@@ -983,12 +983,12 @@ BOOL CAsyncSslSocketLayer::ShutDown(int nHow /*=sends*/)
}
int res = SSL_shutdown(m_ssl);
if (res != -1)
if (res == 0)
{
res = SSL_shutdown(m_ssl);
}
if (res >= 0)
{
if (!res)
{
SSL_shutdown(m_ssl);
}
if (ShutDownComplete())
return ShutDownNext();
else

View File

@@ -785,8 +785,12 @@ void CTransferSocket::OnSend(int nErrorCode)
CloseOnShutDownOrError(CSMODE_TRANSFERERROR);
return;
}
else if (!pos && numread < (currentBufferSize-m_bufferpos) && m_bufferpos != currentBufferSize)
else if (!pos && // all data in buffer were sent
numread < (currentBufferSize-m_bufferpos) && // was read less then wanted (eof reached?)
m_bufferpos != currentBufferSize) // and it's not because the buffer is full?
{
// With TLS 1.3 we can get back
m_bufferpos = 0;
CloseOnShutDownOrError(0);
return;
}