"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
operations: fix retries downloading too much data with certain backends
Nick Craig-Wood93955b755fba
diff --git a/fs/operations/reopen.go b/fs/operations/reopen.goindex b2531ced0..9b86c6da3 100644--- a/fs/operations/reopen.go+++ b/fs/operations/reopen.go@@ -138,6 +138,8 @@ func (h *ReOpen) open() error {// Adjust range start to where we have got toh.rangeOption.Start = h.start + h.offset}+ // Make a copy of the options as fs.FixRangeOption modifies them :-(+ opts = append(make([]fs.OpenOption, 0, len(opts)), opts...)h.tries++if h.tries > h.maxTries {h.err = errTooManyTriesdiff --git a/fs/operations/reopen_test.go b/fs/operations/reopen_test.goindex 153c0334a..891888c50 100644--- a/fs/operations/reopen_test.go+++ b/fs/operations/reopen_test.go@@ -39,6 +39,8 @@ type reOpenTestObject struct {//// This will break after reading the number of bytes in breaksfunc (o *reOpenTestObject) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error) {+ // Lots of backends do this - make sure it works as it modifies options+ fs.FixRangeOption(options, o.Size())gotHash := falsegotRange := falsestartPos := int64(0)