[android] - limit concurrent request for Android 4.4 and below to 10 (#14971)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user