mirror of
https://github.com/rclone/rclone.git
synced 2025-12-06 00:03:32 +00:00
b2: fix multipart upload: corrupted on transfer: sizes differ XXX vs 0
Before this change the b2 backend wasn't writing the metadata to the
object properly after a multipart upload.
The symptom of this was that sometimes it would give the error:
corrupted on transfer: sizes differ XXX vs 0
This was fixed by returning the metadata in the chunk writer and setting it in Update.
See: https://forum.rclone.org/t/multipart-upload-to-b2-sometimes-failing-with-corrupted-on-transfer-sizes-differ/41829
This commit is contained in:
@@ -85,6 +85,7 @@ type largeUpload struct {
|
||||
uploads []*api.GetUploadPartURLResponse // result of get upload URL calls
|
||||
chunkSize int64 // chunk size to use
|
||||
src *Object // if copying, object we are reading from
|
||||
info *api.FileInfo // final response with info about the object
|
||||
}
|
||||
|
||||
// newLargeUpload starts an upload of object o from in with metadata in src
|
||||
@@ -352,7 +353,8 @@ func (up *largeUpload) Close(ctx context.Context) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return up.o.decodeMetaDataFileInfo(&response)
|
||||
up.info = &response
|
||||
return nil
|
||||
}
|
||||
|
||||
// Abort aborts the large upload
|
||||
|
||||
Reference in New Issue
Block a user