Procházet zdrojové kódy

Invalid assertion

Source commit: 5e4c88c5dbc3d5b86a6cc9e2ad355c4a333cdc2c
Martin Prikryl před 4 roky
rodič
revize
ecdcc5ff24

+ 6 - 1
source/core/FileOperationProgress.cpp

@@ -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);
 }
 //---------------------------------------------------------------------------

+ 2 - 1
source/core/FileOperationProgress.h

@@ -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();

+ 3 - 4
source/core/ScpFileSystem.cpp

@@ -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)
               {