Browse Source

Bug fix: Transferring newer files only did not work with FTP protocol

Caused by Bug 1403.

Source commit: a772a9e586433afbcfeb04f9aaa841d33cfcd35a
Martin Prikryl 9 years ago
parent
commit
d92c9bb362
2 changed files with 6 additions and 5 deletions
  1. 5 4
      source/core/FtpFileSystem.cpp
  2. 1 1
      source/core/FtpFileSystem.h

+ 5 - 4
source/core/FtpFileSystem.cpp

@@ -1715,7 +1715,7 @@ void __fastcall TFTPFileSystem::Sink(const UnicodeString FileName,
       FFileTransferPreserveTime = CopyParam->PreserveTime;
       // not used for downloads anyway
       FFileTransferRemoveBOM = CopyParam->RemoveBOM;
-      FFileTransferNoList = CanTransferSkipList(Params, Flags);
+      FFileTransferNoList = CanTransferSkipList(Params, Flags, CopyParam);
       UserData.FileName = DestFileName;
       UserData.Params = Params;
       UserData.AutoResume = FLAGSET(Flags, tfAutoResume);
@@ -1883,14 +1883,15 @@ void __fastcall TFTPFileSystem::SourceRobust(const UnicodeString FileName,
   while (RobustLoop.Retry());
 }
 //---------------------------------------------------------------------------
-bool __fastcall TFTPFileSystem::CanTransferSkipList(int Params, unsigned int Flags)
+bool __fastcall TFTPFileSystem::CanTransferSkipList(int Params, unsigned int Flags, const TCopyParamType * CopyParam)
 {
   bool Result =
     FLAGSET(Params, cpNoConfirmation) &&
     // cpAppend is not supported with FTP
     DebugAlwaysTrue(FLAGCLEAR(Params, cpAppend)) &&
     FLAGCLEAR(Params, cpResume) &&
-    FLAGCLEAR(Flags, tfAutoResume);
+    FLAGCLEAR(Flags, tfAutoResume) &&
+    !CopyParam->NewerOnly;
   return Result;
 }
 //---------------------------------------------------------------------------
@@ -1977,7 +1978,7 @@ void __fastcall TFTPFileSystem::Source(const UnicodeString FileName,
       // not used for uploads anyway
       FFileTransferPreserveTime = CopyParam->PreserveTime;
       FFileTransferRemoveBOM = CopyParam->RemoveBOM;
-      FFileTransferNoList = CanTransferSkipList(Params, Flags);
+      FFileTransferNoList = CanTransferSkipList(Params, Flags, CopyParam);
       // not used for uploads, but we get new name (if any) back in this field
       UserData.FileName = DestFileName;
       UserData.Params = Params;

+ 1 - 1
source/core/FtpFileSystem.h

@@ -201,7 +201,7 @@ protected:
   bool __fastcall SupportsCommand(const UnicodeString & Command) const;
   void __fastcall RegisterChecksumAlgCommand(const UnicodeString & Alg, const UnicodeString & Command);
   void __fastcall SendCommand(const UnicodeString & Command);
-  bool __fastcall CanTransferSkipList(int Params, unsigned int Flags);
+  bool __fastcall CanTransferSkipList(int Params, unsigned int Flags, const TCopyParamType * CopyParam);
 
   static bool __fastcall Unquote(UnicodeString & Str);