File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
api/src/main/java/io/minio Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -769,15 +769,15 @@ public CompletableFuture<ObjectWriteResponse> composeObject(ComposeObjectArgs ar
769
769
while (size > 0 ) {
770
770
partNumber ++;
771
771
772
- long startBytes = offset ;
773
- long endBytes = startBytes + ObjectWriteArgs .MAX_PART_SIZE ;
774
- if (size < ObjectWriteArgs .MAX_PART_SIZE )
775
- endBytes = startBytes + size ;
772
+ long length = size ;
773
+ if (length > ObjectWriteArgs .MAX_PART_SIZE ) {
774
+ length = ObjectWriteArgs .MAX_PART_SIZE ;
775
+ }
776
+ long endBytes = offset + length - 1 ;
776
777
777
778
Multimap <String , String > headersCopy = newMultimap (headers );
778
779
headersCopy .put (
779
- "x-amz-copy-source-range" ,
780
- "bytes=" + startBytes + "-" + endBytes );
780
+ "x-amz-copy-source-range" , "bytes=" + offset + "-" + endBytes );
781
781
782
782
final int partNum = partNumber ;
783
783
future =
@@ -801,8 +801,8 @@ public CompletableFuture<ObjectWriteResponse> composeObject(ComposeObjectArgs ar
801
801
throw new CompletionException (e );
802
802
}
803
803
});
804
- offset = startBytes ;
805
- size -= ( endBytes - startBytes ) ;
804
+ offset += length ;
805
+ size -= length ;
806
806
}
807
807
}
808
808
You can’t perform that action at this time.
0 commit comments