summaryrefslogtreecommitdiff
path: root/src/mbgl/storage
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-05-08 11:30:26 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-05-08 11:30:26 +0200
commitfb984a22d191949fd7f998dbf1f746a9ee0a6724 (patch)
treef8bcf8d8569f85fa3e6101b3ce92d80843e64360 /src/mbgl/storage
parent66f67fe2fca73ebd22e9097494bd559caf399790 (diff)
downloadqtlocation-mapboxgl-fb984a22d191949fd7f998dbf1f746a9ee0a6724.tar.gz
don't trigger a HTTP request twice
Diffstat (limited to 'src/mbgl/storage')
-rw-r--r--src/mbgl/storage/default_file_source.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mbgl/storage/default_file_source.cpp b/src/mbgl/storage/default_file_source.cpp
index ddfcc89845..690a968812 100644
--- a/src/mbgl/storage/default_file_source.cpp
+++ b/src/mbgl/storage/default_file_source.cpp
@@ -101,9 +101,11 @@ void DefaultFileSource::Impl::startCacheRequest(const Resource& resource) {
cache->get(resource, [this, resource](std::unique_ptr<Response> response) {
DefaultFileRequest* request = find(resource);
- if (!request) {
+ if (!request || request->request) {
// There is no request for this URL anymore. Likely, the request was canceled
// before we got around to process the cache result.
+ // The second possibility is that a request has already been started by another cache
+ // request. In this case, we don't have to do anything either.
return;
}