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

Bug 1770: Files larger than 0.5 GB are never uploaded in ascii/text mode with SCP protocol as it would fail anyway due to memory issues

https://winscp.net/tracker/1770

Source commit: 5556d5c5dc139de1e67954f7466ad174ce5a11f3
This commit is contained in:
Martin Prikryl
2019-07-24 12:31:22 +00:00
parent e4f9093aba
commit 1fea8fe90e

View File

@@ -1757,7 +1757,15 @@ void __fastcall TSCPFileSystem::SCPSource(const UnicodeString FileName,
OperationProgress->SetTransferSize(OperationProgress->LocalSize);
OperationProgress->SetTransferringFile(false);
FTerminal->SelectSourceTransferMode(Handle, CopyParam);
if (Handle.Size > 512*1024*1024)
{
OperationProgress->SetAsciiTransfer(false);
FTerminal->LogEvent(FORMAT(L"Binary transfer mode selected as the file is too large (%s) to be uploaded in Ascii mode using SCP protocol.", (IntToStr(Handle.Size))));
}
else
{
FTerminal->SelectSourceTransferMode(Handle, CopyParam);
}
TUploadSessionAction Action(FTerminal->ActionLog);
Action.FileName(ExpandUNCFileName(FileName));