1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Merge pull request #436 from owncloud/fix/final_chunk_size

Fix a protocol exception when uploading chunked files
This commit is contained in:
Abel García de Prada 2021-11-03 18:07:18 +01:00 committed by GitHub
commit 37bae10618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,8 @@ public class ChunkFromFileRequestBody extends FileRequestBody {
readCount = mChannel.read(mBuffer);
sink.getBuffer().write(mBuffer.array(), 0, readCount);
int bytesToWriteInBuffer = (int) Math.min(readCount, mFile.length() - mTransferred);
sink.getBuffer().write(mBuffer.array(), 0, bytesToWriteInBuffer);
sink.flush();
@ -102,10 +103,8 @@ public class ChunkFromFileRequestBody extends FileRequestBody {
}
}
Timber.v("Chunk with size " + mChunkSize + " written in request body");
} catch (Exception exception) {
Timber.e(exception);
Timber.e(exception, "Transferred " + mTransferred + " bytes from a total of " + mFile.length());
}
}