From 66ac4bcec38c97325515069f93eeff55709067aa Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 13 Feb 2019 12:38:13 +0100 Subject: [PATCH] also set Read Timeout with mirror logic timeout value The Read Timeout makes a SocketTimeoutException be thrown if the timeout expires before data is available for reading from the connection's returned InputStream. This should help the client switch to a new mirror when the current mirror is too slow or overloaded. --- app/src/main/java/org/fdroid/fdroid/net/HttpDownloader.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/org/fdroid/fdroid/net/HttpDownloader.java b/app/src/main/java/org/fdroid/fdroid/net/HttpDownloader.java index a6fe63dc2..62dc3a56f 100644 --- a/app/src/main/java/org/fdroid/fdroid/net/HttpDownloader.java +++ b/app/src/main/java/org/fdroid/fdroid/net/HttpDownloader.java @@ -176,6 +176,7 @@ public class HttpDownloader extends Downloader { connection.setRequestProperty("User-Agent", "F-Droid " + BuildConfig.VERSION_NAME); connection.setConnectTimeout(getTimeout()); + connection.setReadTimeout(getTimeout()); if (Build.VERSION.SDK_INT < 19) { // gzip encoding can be troublesome on old Androids connection.setRequestProperty("Accept-Encoding", "identity");