Skip to content

Commit

Permalink
Fix offset overflow in multipart download (#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfkm authored Mar 23, 2022
1 parent 84e2427 commit a089f55
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private[s3] class MultipartDownloadObservable(
totalSize: Long,
chunkSize: Long,
getRequest: GetObjectRequest,
offset: Int): Task[Unit] = {
offset: Long): Task[Unit] = {

for {
chunk <- {
Expand All @@ -77,7 +77,7 @@ private[s3] class MultipartDownloadObservable(
nextChunk <- {
ack match {
case Ack.Continue => {
val nextOffset = offset + chunk.size
val nextOffset = offset + chunk.length
if (nextOffset < totalSize) {
val nextRange = s"bytes=${nextOffset}-${nextOffset + chunkSize}"
val nextRequest = getRequest.toBuilder.range(nextRange).build()
Expand Down

0 comments on commit a089f55

Please sign in to comment.