summaryrefslogtreecommitdiffstats
path: root/src/network/access
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2011-03-17 13:51:10 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2011-03-17 14:36:25 (GMT)
commit483a069415f2648a0d4c1f86d69f372607750ae6 (patch)
tree42dc30bbbbf40b6be1683741abbafbb58e86a0ae /src/network/access
parent5c7d297cd2323c3bc824cd05344b1d57512a65c2 (diff)
downloadQt-483a069415f2648a0d4c1f86d69f372607750ae6.zip
Qt-483a069415f2648a0d4c1f86d69f372607750ae6.tar.gz
Qt-483a069415f2648a0d4c1f86d69f372607750ae6.tar.bz2
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/access')
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index 4189743..108ac68 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