ソースを参照

Invalid assertion

(cherry picked from commit ecdcc5ff243afe884811d3c087b1eeb2bc2d1a53)

Source commit: 8235ae345666167d872c14019175ab1f5a00a60e
Martin Prikryl 4 年 前
コミット
2fdd36d818

+ 6 - 1
source/core/FileOperationProgress.cpp

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

+ 2 - 1
source/core/FileOperationProgress.h

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

+ 3 - 4
source/core/ScpFileSystem.cpp

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