summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2011-03-17 14:51:10 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2011-03-17 15:36:25 +0100
commit483a069415f2648a0d4c1f86d69f372607750ae6 (patch)
tree42dc30bbbbf40b6be1683741abbafbb58e86a0ae /src/network
parent5c7d297cd2323c3bc824cd05344b1d57512a65c2 (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.cpp5
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