File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -326,14 +326,14 @@ ComposeObjectResponse Client::ComposeObject(ComposeObjectArgs args,
326326 while (size > 0 ) {
327327 part_number++;
328328
329- size_t start_bytes = offset ;
330- size_t end_bytes = start_bytes + utils::kMaxPartSize ;
331- if (size < utils:: kMaxPartSize ) end_bytes = start_bytes + size ;
329+ size_t length = size ;
330+ if (length > utils:: kMaxPartSize ) length = utils::kMaxPartSize ;
331+ size_t end_bytes = offset + length - 1 ;
332332
333333 utils::Multimap headerscopy;
334334 headerscopy.AddAll (headers);
335335 headerscopy.Add (" x-amz-copy-source-range" ,
336- " bytes=" + std::to_string (start_bytes ) + " -" +
336+ " bytes=" + std::to_string (offset ) + " -" +
337337 std::to_string (end_bytes));
338338
339339 UploadPartCopyArgs upc_args;
@@ -350,8 +350,8 @@ ComposeObjectResponse Client::ComposeObject(ComposeObjectArgs args,
350350 }
351351 parts.push_back (Part (part_number, std::move (resp.etag )));
352352 }
353- offset = start_bytes ;
354- size -= (end_bytes - start_bytes) ;
353+ offset += length ;
354+ size -= length ;
355355 }
356356 }
357357 }
You can’t perform that action at this time.
0 commit comments