"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
b2: fix accounting for multpart uploads
Nick Craig-Woodd69cdb79f70c
diff --git a/backend/b2/upload.go b/backend/b2/upload.goindex fc843d12b..6b62ada7e 100644--- a/backend/b2/upload.go+++ b/backend/b2/upload.go@@ -212,6 +212,13 @@ func (up *largeUpload) addSha1(chunkNumber int, sha1 string) {// WriteChunk will write chunk number with reader bytes, where chunk number >= 0func (up *largeUpload) WriteChunk(ctx context.Context, chunkNumber int, reader io.ReadSeeker) (size int64, err error) {+ // Only account after the checksum reads have been done+ if do, ok := reader.(pool.DelayAccountinger); ok {+ // To figure out this number, do a transfer and if the accounted size is 0 or a+ // multiple of what it should be, increase or decrease this number.+ do.DelayAccounting(1)+ }+err = up.f.pacer.Call(func() (bool, error) {// Discover the size by seeking to the endsize, err = reader.Seek(0, io.SeekEnd)