diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2011-03-17 14:51:10 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2011-03-17 15:36:25 +0100 |
commit | 483a069415f2648a0d4c1f86d69f372607750ae6 (patch) | |
tree | 42dc30bbbbf40b6be1683741abbafbb58e86a0ae /src/network | |
parent | 5c7d297cd2323c3bc824cd05344b1d57512a65c2 (diff) |
Fix disk cache interaction for range retrieval HTTP requests.
The disk cache API does not currently support retrieving partial content,
it can only serve entire files. Therefore we disable the use of the cache
for these kinds of requests, as indicated by the presence of the Range
header field.
Done-with: Jocelyn Turcotte
Reviewed-by: Markus Goetz
Reviewed-by: Peter Hartmann
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qnetworkaccesshttpbackend.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index 4189743b39..108ac681f8 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -360,6 +360,11 @@ void QNetworkAccessHttpBackend::validateCache(QHttpNetworkRequest &httpRequest, return; } + // The disk cache API does not currently support partial content retrieval. + // That is why we don't use the disk cache for any such requests. + if (request().hasRawHeader("Range")) + return; + QAbstractNetworkCache *nc = networkCache(); if (!nc) return; // no local cache |