aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/http/HttpDownloadConnection.java
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2015-08-21 20:08:23 +0200
committerlookshe <github@lookshe.org>2015-08-21 20:08:23 +0200
commit2dac6c8f3624d659e45fa332bd4fe163ca3a8309 (patch)
tree71a00e24c19d8178f0e2890c4d3191a62bf92393 /src/main/java/de/thedevstack/conversationsplus/http/HttpDownloadConnection.java
parent075448f764ba7178b3a02f3cd40941655afe6208 (diff)
parentef0f8d4507391dafba2fc9d2b691a117e84b40fc (diff)
Merge branch 'trz/rebase' into trz/rename
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/http/HttpDownloadConnection.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/http/HttpDownloadConnection.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/http/HttpDownloadConnection.java b/src/main/java/de/thedevstack/conversationsplus/http/HttpDownloadConnection.java
index 3f66be21..834539d5 100644
--- a/src/main/java/de/thedevstack/conversationsplus/http/HttpDownloadConnection.java
+++ b/src/main/java/de/thedevstack/conversationsplus/http/HttpDownloadConnection.java
@@ -150,7 +150,7 @@ public class HttpDownloadConnection implements Transferable {
return;
}
file.setExpectedSize(size);
- if (size <= mHttpConnectionManager.getAutoAcceptFileSize()) {
+ if (size != -1 && size <= mHttpConnectionManager.getAutoAcceptFileSize()) {
HttpDownloadConnection.this.acceptedAutomatically = true;
new Thread(new FileDownloader(interactive)).start();
} else {
@@ -171,12 +171,12 @@ public class HttpDownloadConnection implements Transferable {
connection.connect();
String contentLength = connection.getHeaderField("Content-Length");
if (contentLength == null) {
- throw new IOException();
+ return -1;
}
try {
return Long.parseLong(contentLength, 10);
} catch (NumberFormatException e) {
- throw new IOException();
+ return -1;
}
}