Skip to content

Commit 09fd846

Browse files
Update ChunkFromFileChannelRequestEntity.java
The -1 can cause the last byte to not end up in the request body (incomplete file), causing the server to time out because it expects the content length to be one byte larger. However, this one byte that isn't loaded and isn't sent is present in the file. I was able to successfully test this and it fixed the error for me. Signed-off-by: Alexander-Ger-Reich <50119493+Alexander-Ger-Reich@users.noreply.github.com>
1 parent 9e3c004 commit 09fd846

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

library/src/main/java/com/owncloud/android/lib/common/network/ChunkFromFileChannelRequestEntity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public void writeRequest(final OutputStream out) throws IOException {
103103
if (size == 0) {
104104
size = -1;
105105
}
106-
long maxCount = Math.min(mOffset + length - 1, mChannel.size());
106+
long maxCount = Math.min(mOffset + length, mChannel.size());
107107
while (mChannel.position() < maxCount) {
108108
readCount = mChannel.read(mBuffer);
109109
try {

0 commit comments

Comments
 (0)