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.
This commit is contained in:
parent
8f854c2c6e
commit
66ac4bcec3
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user