rcat: check checksums by default like copy does #6305
Before this change we were calculating the checksum for an rcat transfer but never checking it. See: https://forum.rclone.org/t/optimize-rclone-on-raspberry-pi-4-8gb/31741
This commit is contained in:
parent
2515039e18
commit
2e54b56a01
1 changed files with 4 additions and 1 deletions
|
@ -1391,11 +1391,14 @@ func Rcat(ctx context.Context, fdst fs.Fs, dstFileName string, in io.ReadCloser,
|
|||
|
||||
compare := func(dst fs.Object) error {
|
||||
var sums map[hash.Type]string
|
||||
opt := defaultEqualOpt(ctx)
|
||||
if hasher != nil {
|
||||
// force --checksum on if we have hashes
|
||||
opt.checkSum = true
|
||||
sums = hasher.Sums()
|
||||
}
|
||||
src := object.NewStaticObjectInfo(dstFileName, modTime, int64(readCounter.BytesRead()), false, sums, fdst)
|
||||
if !Equal(ctx, src, dst) {
|
||||
if !equal(ctx, src, dst, opt) {
|
||||
err = fmt.Errorf("corrupted on transfer")
|
||||
err = fs.CountError(err)
|
||||
fs.Errorf(dst, "%v", err)
|
||||
|
|
Loading…
Reference in a new issue