From 2e54b56a01b14da2e488ffb3ffde47b399f08866 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 7 Jul 2022 11:31:53 +0100 Subject: [PATCH] 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 --- fs/operations/operations.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/operations/operations.go b/fs/operations/operations.go index e00a20a9e..0b0f9f75e 100644 --- a/fs/operations/operations.go +++ b/fs/operations/operations.go @@ -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)