diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java index 44f66735e..9a6676154 100644 --- a/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java +++ b/src/main/java/de/pixart/messenger/http/HttpDownloadConnection.java @@ -220,6 +220,8 @@ public class HttpDownloadConnection implements Transferable { if (connection instanceof HttpsURLConnection) { mHttpConnectionManager.setupTrustManager((HttpsURLConnection) connection, interactive); } + connection.setConnectTimeout(Config.SOCKET_TIMEOUT * 1000); + connection.setReadTimeout(Config.SOCKET_TIMEOUT * 1000); connection.connect(); String contentLength = connection.getHeaderField("Content-Length"); connection.disconnect(); @@ -288,6 +290,8 @@ public class HttpDownloadConnection implements Transferable { long size = file.getSize(); connection.setRequestProperty("Range", "bytes="+size+"-"); } + connection.setConnectTimeout(Config.SOCKET_TIMEOUT * 1000); + connection.setReadTimeout(Config.SOCKET_TIMEOUT * 1000); connection.connect(); is = new BufferedInputStream(connection.getInputStream()); boolean serverResumed = "bytes".equals(connection.getHeaderField("Accept-Ranges")); |