forked from TrueCloudLab/rclone
Don't check md5sum after download with --size-only - fixes #75
This commit is contained in:
parent
e04acb09ce
commit
97dced6a0b
1 changed files with 15 additions and 13 deletions
|
@ -193,21 +193,23 @@ tryAgain:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify md5sums are the same after transfer - ignoring blank md5sums
|
// Verify md5sums are the same after transfer - ignoring blank md5sums
|
||||||
srcMd5sum, md5sumErr := src.Md5sum()
|
if !Config.SizeOnly {
|
||||||
if md5sumErr != nil {
|
srcMd5sum, md5sumErr := src.Md5sum()
|
||||||
Stats.Error()
|
|
||||||
Log(src, "Failed to read md5sum: %s", md5sumErr)
|
|
||||||
} else if srcMd5sum != "" {
|
|
||||||
dstMd5sum, md5sumErr := dst.Md5sum()
|
|
||||||
if md5sumErr != nil {
|
if md5sumErr != nil {
|
||||||
Stats.Error()
|
Stats.Error()
|
||||||
Log(dst, "Failed to read md5sum: %s", md5sumErr)
|
Log(src, "Failed to read md5sum: %s", md5sumErr)
|
||||||
} else if dstMd5sum != "" && srcMd5sum != dstMd5sum {
|
} else if srcMd5sum != "" {
|
||||||
Stats.Error()
|
dstMd5sum, md5sumErr := dst.Md5sum()
|
||||||
err = fmt.Errorf("Corrupted on transfer: md5sums differ %q vs %q", srcMd5sum, dstMd5sum)
|
if md5sumErr != nil {
|
||||||
Log(dst, "%s", err)
|
Stats.Error()
|
||||||
removeFailedCopy(dst)
|
Log(dst, "Failed to read md5sum: %s", md5sumErr)
|
||||||
return
|
} else if dstMd5sum != "" && srcMd5sum != dstMd5sum {
|
||||||
|
Stats.Error()
|
||||||
|
err = fmt.Errorf("Corrupted on transfer: md5sums differ %q vs %q", srcMd5sum, dstMd5sum)
|
||||||
|
Log(dst, "%s", err)
|
||||||
|
removeFailedCopy(dst)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue