1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-27 06:41:15 +00:00

Merge branch 'FlashSystems-master'

This commit is contained in:
Felix Ableitner 2015-07-15 03:01:37 +02:00
commit fcf6506527

View file

@ -55,14 +55,15 @@ public class GetTask extends AsyncTask<String, Void, String> {
String fullUri = params[0] + params[1];
Log.v(TAG, "Calling Rest API at " + fullUri);
// Retry at most 10 times before failing
for (int i = 0; i < 10; i++) {
HttpClient httpclient = Https.createHttpsClient(mHttpsCertPath);
if (params.length == 5) {
LinkedList<NameValuePair> urlParams = new LinkedList<>();
urlParams.add(new BasicNameValuePair(params[3], params[4]));
fullUri += "?" + URLEncodedUtils.format(urlParams, HTTP.UTF_8);
}
// Retry at most 10 times before failing
for (int i = 0; i < 10; i++) {
HttpClient httpclient = Https.createHttpsClient(mHttpsCertPath);
HttpGet get = new HttpGet(fullUri);
get.addHeader(new BasicHeader(RestApi.HEADER_API_KEY, params[2]));