mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:41:44 +08:00
fs: Verify sizes are the same after transfer in Copy()
This commit is contained in:
parent
1c472348b6
commit
e559194fb2
|
@ -142,6 +142,15 @@ func Copy(f Fs, dst, src Object) {
|
|||
return
|
||||
}
|
||||
|
||||
// Verify sizes are the same after transfer
|
||||
if src.Size() != dst.Size() {
|
||||
Stats.Error()
|
||||
err = fmt.Errorf("Corrupted on transfer: sizes differ %d vs %d", src.Size(), dst.Size())
|
||||
Log(dst, "%s", err)
|
||||
removeFailedCopy(dst)
|
||||
return
|
||||
}
|
||||
|
||||
// Verify md5sums are the same after transfer - ignoring blank md5sums
|
||||
srcMd5sum, md5sumErr := src.Md5sum()
|
||||
if md5sumErr != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user