Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Renci.SshNet/SftpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1681,10 +1681,11 @@ private IEnumerable<FileInfo> InternalSynchronizeDirectories(string sourcePath,

if (!isDifferent)
{
var temp = destDict[localFile.Name];
var dest = destDict[localFile.Name];
// TODO: Use md5 to detect a difference
//ltang: File exists at the destination => Using filesize to detect the difference
isDifferent = localFile.Length != temp.Length;
// ltang: File exists at the destination => Using filesize to detect the difference
// and the LastWriteTime (with a window of 60s to avoid clock differences between machines)
isDifferent = (localFile.Length != dest.Length) || (dest.LastWriteTimeUtc.AddSeconds(-60.0) <= localFile.LastWriteTimeUtc);
}

if (isDifferent)
Expand Down