fs: Verify sizes are the same after transfer in Copy()
This commit is contained in:
parent
1c472348b6
commit
e559194fb2
1 changed files with 9 additions and 0 deletions
|
@ -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 a new issue