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

Invalid assertion

Source commit: 5e4c88c5dbc3d5b86a6cc9e2ad355c4a333cdc2c
This commit is contained in:
Martin Prikryl
2021-04-08 12:06:34 +00:00
parent 00daaf7b98
commit ecdcc5ff24
3 changed files with 11 additions and 6 deletions

View File

@@ -812,9 +812,14 @@ unsigned long __fastcall TFileOperationProgressType::StaticBlockSize()
return TRANSFER_BUF_SIZE;
}
//---------------------------------------------------------------------------
bool __fastcall TFileOperationProgressType::IsTransferDone()
bool TFileOperationProgressType::IsTransferDoneChecked()
{
DebugAssert(TransferredSize <= TransferSize);
return IsTransferDone();
}
//---------------------------------------------------------------------------
bool TFileOperationProgressType::IsTransferDone()
{
return (TransferredSize == TransferSize);
}
//---------------------------------------------------------------------------

View File

@@ -182,7 +182,8 @@ public:
void __fastcall Progress();
unsigned long __fastcall LocalBlockSize();
bool __fastcall IsLocallyDone();
bool __fastcall IsTransferDone();
bool IsTransferDone();
bool IsTransferDoneChecked();
void __fastcall SetFile(UnicodeString AFileName, bool AFileInProgress = true);
void __fastcall SetFileInProgress();
unsigned long __fastcall TransferBlockSize();

View File

@@ -1881,7 +1881,7 @@ void __fastcall TSCPFileSystem::SCPSource(const UnicodeString FileName,
(AsciiBuf.Size)));
// Should be equal, just in case it's rounded (see above)
OperationProgress->ChangeTransferSize(AsciiBuf.Size);
while (!OperationProgress->IsTransferDone())
while (!OperationProgress->IsTransferDoneChecked())
{
unsigned long BlockSize = OperationProgress->TransferBlockSize();
FSecureShell->Send(
@@ -1919,7 +1919,7 @@ void __fastcall TSCPFileSystem::SCPSource(const UnicodeString FileName,
throw Exception(MainInstructions(LoadStr(USER_TERMINATED)));
}
}
while (!OperationProgress->IsLocallyDone() || !OperationProgress->IsTransferDone());
while (!OperationProgress->IsLocallyDone() || !OperationProgress->IsTransferDoneChecked());
FSecureShell->SendNull();
try
@@ -2579,8 +2579,7 @@ void __fastcall TSCPFileSystem::SCPSink(const UnicodeString TargetDir,
throw Exception(MainInstructions(LoadStr(USER_TERMINATED)));
}
}
while (!OperationProgress->IsLocallyDone() || !
OperationProgress->IsTransferDone());
while (!OperationProgress->IsLocallyDone() || !OperationProgress->IsTransferDoneChecked());
}
catch (Exception &E)
{