summaryrefslogtreecommitdiff
path: root/platform/default
diff options
context:
space:
mode:
Diffstat (limited to 'platform/default')
-rw-r--r--platform/default/mbgl/storage/offline_download.cpp5
-rw-r--r--platform/default/mbgl/storage/offline_download.hpp2
2 files changed, 5 insertions, 2 deletions
diff --git a/platform/default/mbgl/storage/offline_download.cpp b/platform/default/mbgl/storage/offline_download.cpp
index 118f3aad88..da53271bd4 100644
--- a/platform/default/mbgl/storage/offline_download.cpp
+++ b/platform/default/mbgl/storage/offline_download.cpp
@@ -88,7 +88,8 @@ OfflineDownload::OfflineDownload(int64_t id_,
: id(id_),
definition(definition_),
offlineDatabase(offlineDatabase_),
- onlineFileSource(onlineFileSource_) {
+ onlineFileSource(onlineFileSource_),
+ maximumConcurrentRequests(std::max<uint32_t>(HTTPFileSource::maximumConcurrentRequests() / 2, 1)) {
setObserver(nullptr);
}
@@ -338,7 +339,7 @@ void OfflineDownload::continueDownload() {
return;
}
- while (!resourcesRemaining.empty() && requests.size() < HTTPFileSource::maximumConcurrentRequests()) {
+ while (!resourcesRemaining.empty() && requests.size() < maximumConcurrentRequests) {
ensureResource(resourcesRemaining.front());
resourcesRemaining.pop_front();
}
diff --git a/platform/default/mbgl/storage/offline_download.hpp b/platform/default/mbgl/storage/offline_download.hpp
index cffac1665b..eec48dd985 100644
--- a/platform/default/mbgl/storage/offline_download.hpp
+++ b/platform/default/mbgl/storage/offline_download.hpp
@@ -63,6 +63,8 @@ private:
void queueResource(Resource);
void queueTiles(style::SourceType, uint16_t tileSize, const Tileset&);
+
+ uint32_t maximumConcurrentRequests;
};
} // namespace mbgl