summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2019-06-20 17:34:39 +0200
committerGitHub <noreply@github.com>2019-06-20 17:34:39 +0200
commit24b7b413b5232121ba1599b613152dea124314bf (patch)
treef5629e88c2e1021543e12cc17bc4c56331b3f050
parent577e03f949c9e897269b99db376a518193b2a895 (diff)
downloadqtlocation-mapboxgl-24b7b413b5232121ba1599b613152dea124314bf.tar.gz
[android] - limit concurrent request for Android 4.4 and below to 10 (#14971)
-rw-r--r--platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/HttpRequestImpl.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/HttpRequestImpl.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/HttpRequestImpl.java
index 14b76e4fb7..24cb353d24 100644
--- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/HttpRequestImpl.java
+++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/module/http/HttpRequestImpl.java
@@ -182,9 +182,15 @@ public class HttpRequestImpl implements HttpRequest {
@NonNull
private static Dispatcher getDispatcher() {
Dispatcher dispatcher = new Dispatcher();
- // Matches core limit set on
- // https://github.com/mapbox/mapbox-gl-native/blob/master/platform/android/src/http_file_source.cpp#L192
- dispatcher.setMaxRequestsPerHost(20);
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ // Matches core limit set on
+ // https://github.com/mapbox/mapbox-gl-native/blob/master/platform/android/src/http_file_source.cpp#L192
+ dispatcher.setMaxRequestsPerHost(20);
+ } else {
+ // Limiting concurrent request on Android 4.4, to limit impact of SSL handshake platform library crash
+ // https://github.com/mapbox/mapbox-gl-native/issues/14910
+ dispatcher.setMaxRequestsPerHost(10);
+ }
return dispatcher;
}
} \ No newline at end of file