From 1750fa90b10ed91816db87443aee7eb5a8930e58 Mon Sep 17 00:00:00 2001 From: mhutti1 Date: Mon, 26 Sep 2016 11:25:07 +0100 Subject: [PATCH] Fix for chunks behaving incorrectly on loss of internet connection #323 --- src/org/kiwix/kiwixmobile/downloader/ChunkUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/kiwix/kiwixmobile/downloader/ChunkUtils.java b/src/org/kiwix/kiwixmobile/downloader/ChunkUtils.java index 0ad8ef561..c5c102598 100644 --- a/src/org/kiwix/kiwixmobile/downloader/ChunkUtils.java +++ b/src/org/kiwix/kiwixmobile/downloader/ChunkUtils.java @@ -25,12 +25,12 @@ public class ChunkUtils { String range; if (currentRange + CHUNK_SIZE >= contentLength) { range = String.format("%d-", currentRange); - currentRange += CHUNK_SIZE + 1; chunks.add(new Chunk(range, zim, url, contentLength, notificationID, currentRange, contentLength)); + currentRange += CHUNK_SIZE + 1; } else { range = String.format("%d-%d", currentRange, currentRange + CHUNK_SIZE); - currentRange += CHUNK_SIZE + 1; chunks.add(new Chunk(range, zim, url, contentLength, notificationID, currentRange, currentRange + CHUNK_SIZE)); + currentRange += CHUNK_SIZE + 1; } } return chunks;