aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/http
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-01-25 21:22:44 +0100
committerChristian Schneppe <christian@pix-art.de>2019-01-25 21:22:44 +0100
commit3ca7e0c55a99e098c6035929b889829be3b352ef (patch)
treeab000cd70d1f1c4d1c8a4632c44ca46e88abb18c /src/main/java/de/pixart/messenger/http
parent001ffba4204c80c7058240cd59745446a9b90811 (diff)
fixed downloading of deleted files
Diffstat (limited to 'src/main/java/de/pixart/messenger/http')
-rw-r--r--src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
index 308ec0605..b625067e3 100644
--- a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
+++ b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java
@@ -380,9 +380,9 @@ public class HttpDownloadConnection implements Transferable {
connection.setUseCaches(false);
connection.setRequestProperty("User-Agent", mXmppConnectionService.getIqGenerator().getUserAgent());
connection.setRequestProperty("Accept-Encoding", "identity");
- final boolean tryResume = file.exists() && file.getKey() == null && file.getSize() > 0;
+ final long expected = file.getExpectedSize();
+ final boolean tryResume = file.exists() && file.getKey() == null && file.getSize() > 0 && file.getSize() < expected;
long resumeSize = 0;
- long expected = file.getExpectedSize();
if (tryResume) {
resumeSize = file.getSize();
Log.d(Config.LOGTAG, "http download trying resume after" + resumeSize + " of " + expected);