don't trigger a HTTP request twice

This commit is contained in:
Konstantin Käfer
2015-05-08 11:30:26 +02:00
parent 66f67fe2fc
commit fb984a22d1
3 changed files with 48 additions and 1 deletions

View File

@@ -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;
}