From a35e62e15c1b4cbedc9cef9dc775f157b0a30d23 Mon Sep 17 00:00:00 2001 From: Chris Redekop Date: Mon, 16 Apr 2018 22:19:49 +0000 Subject: [PATCH] s3: Add an option to disable checksum uploading - fixes #2213 --- backend/s3/s3.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index a31dc1d4f..a2420d4ac 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -537,9 +537,10 @@ const ( // Globals var ( // Flags - s3ACL = flags.StringP("s3-acl", "", "", "Canned ACL used when creating buckets and/or storing objects in S3") - s3StorageClass = flags.StringP("s3-storage-class", "", "", "Storage class to use when uploading S3 objects (STANDARD|REDUCED_REDUNDANCY|STANDARD_IA|ONEZONE_IA)") - s3ChunkSize = fs.SizeSuffix(s3manager.MinUploadPartSize) + s3ACL = flags.StringP("s3-acl", "", "", "Canned ACL used when creating buckets and/or storing objects in S3") + s3StorageClass = flags.StringP("s3-storage-class", "", "", "Storage class to use when uploading S3 objects (STANDARD|REDUCED_REDUNDANCY|STANDARD_IA|ONEZONE_IA)") + s3ChunkSize = fs.SizeSuffix(s3manager.MinUploadPartSize) + s3DisableChecksum = flags.BoolP("s3-disable-checksum", "", false, "Don't store MD5 checksum with object metadata") ) // Fs represents a remote s3 server @@ -1370,7 +1371,7 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo, options ...fs.OpenOptio metaMtime: aws.String(swift.TimeToFloatString(modTime)), } - if size > uploader.PartSize { + if !*s3DisableChecksum && size > uploader.PartSize { hash, err := src.Hash(hash.MD5) if err == nil && matchMd5.MatchString(hash) {