mirror of
https://github.com/minio/minio-rs.git
synced 2025-12-06 23:36:52 +08:00
fix range calculation in compose_object API (#87)
Signed-off-by: Bala.FA <bala@minio.io>
This commit is contained in:
parent
43af36441a
commit
18c5707a4a
@ -941,16 +941,16 @@ impl Client {
|
|||||||
while size > 0 {
|
while size > 0 {
|
||||||
part_number += 1;
|
part_number += 1;
|
||||||
|
|
||||||
let start_bytes = offset;
|
let mut length = size;
|
||||||
let mut end_bytes = start_bytes + MAX_PART_SIZE;
|
if length > MAX_PART_SIZE {
|
||||||
if size < MAX_PART_SIZE {
|
length = MAX_PART_SIZE;
|
||||||
end_bytes = start_bytes + size;
|
|
||||||
}
|
}
|
||||||
|
let end_bytes = offset + length - 1;
|
||||||
|
|
||||||
let mut headers_copy = headers.clone();
|
let mut headers_copy = headers.clone();
|
||||||
headers_copy.insert(
|
headers_copy.insert(
|
||||||
String::from("x-amz-copy-source-range"),
|
String::from("x-amz-copy-source-range"),
|
||||||
format!("bytes={}-{}", start_bytes, end_bytes),
|
format!("bytes={}-{}", offset, end_bytes),
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut upc_args = UploadPartCopyArgs::new(
|
let mut upc_args = UploadPartCopyArgs::new(
|
||||||
@ -968,8 +968,8 @@ impl Client {
|
|||||||
etag: resp.etag,
|
etag: resp.etag,
|
||||||
});
|
});
|
||||||
|
|
||||||
offset = start_bytes;
|
offset += length;
|
||||||
size -= end_bytes - start_bytes;
|
size -= length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user