diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-01-13 22:58:00 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-01-13 22:58:00 +0100 |
commit | 39ac2b149242697682ab70a8094d2f9c03a5a4cf (patch) | |
tree | 37b910fcf16a8a2b085caec7e51e9ae8203983e3 /src/de/danoeh/antennapod/service | |
parent | 1d8107827caf5e8c1a4fff14bbce57db9016549e (diff) | |
download | AntennaPod-39ac2b149242697682ab70a8094d2f9c03a5a4cf.zip |
Increased socket and connection timeout of HTTP downloader
Diffstat (limited to 'src/de/danoeh/antennapod/service')
-rw-r--r-- | src/de/danoeh/antennapod/service/download/HttpDownloader.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/de/danoeh/antennapod/service/download/HttpDownloader.java b/src/de/danoeh/antennapod/service/download/HttpDownloader.java index af72ab69f..4a4d9e58b 100644 --- a/src/de/danoeh/antennapod/service/download/HttpDownloader.java +++ b/src/de/danoeh/antennapod/service/download/HttpDownloader.java @@ -16,6 +16,7 @@ import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.params.HttpClientParams; +import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; import android.net.http.AndroidHttpClient; @@ -33,7 +34,8 @@ public class HttpDownloader extends Downloader { private static final int MAX_REDIRECTS = 5; private static final int BUFFER_SIZE = 8 * 1024; - private static final int CONNECTION_TIMEOUT = 5000; + private static final int CONNECTION_TIMEOUT = 30000; + private static final int SOCKET_TIMEOUT = 30000; public HttpDownloader(DownloaderCallback downloaderCallback, DownloadStatus status) { @@ -46,7 +48,8 @@ public class HttpDownloader extends Downloader { params.setIntParameter("http.protocol.max-redirects", MAX_REDIRECTS); params.setBooleanParameter("http.protocol.reject-relative-redirect", false); - params.setIntParameter("http.socket.timeout", CONNECTION_TIMEOUT); + HttpConnectionParams.setSoTimeout(params, SOCKET_TIMEOUT); + HttpConnectionParams.setConnectionTimeout(params, CONNECTION_TIMEOUT); HttpClientParams.setRedirecting(params, true); return httpClient; } |