summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2011-03-17 14:19:25 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2011-03-17 14:37:12 (GMT)
commit268394b854766855c7ce5697bbc079a6974ad866 (patch)
treeed9b154e87985dec9b7a7f7a31d29f14031a07db /src
parent483a069415f2648a0d4c1f86d69f372607750ae6 (diff)
downloadQt-268394b854766855c7ce5697bbc079a6974ad866.zip
Qt-268394b854766855c7ce5697bbc079a6974ad866.tar.gz
Qt-268394b854766855c7ce5697bbc079a6974ad866.tar.bz2
Fix accidental population of the disk cache with partial content
Since the disk cache does not support partial content, we should not try to store it in the cache altogether. Done-with: Jocelyn Turcotte Reviewed-by: Markus Goetz Reviewed-by: Peter Hartmann
Diffstat (limited to 'src')
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 343f344..894df79 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -505,6 +505,13 @@ void QNetworkReplyImplPrivate::initCacheSaveDevice()
{
Q_Q(QNetworkReplyImpl);
+ // The disk cache does not support partial content, so don't even try to
+ // save any such content into the cache.
+ if (q->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 206) {
+ cacheEnabled = false;
+ return;
+ }
+
// save the meta data
QNetworkCacheMetaData metaData;
metaData.setUrl(url);