summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-03-19 04:36:51 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-03-19 04:36:51 (GMT)
commit86ceda033eda6bd615134f71b9850081a0c808c9 (patch)
treedd4506f056f234e04ea66e0c4a8eeae23d389cda /src/network
parenteaa1ba18e1db380bcacff1b7c41212a910da0550 (diff)
parentf9815142befe5fb312a6fea1dac43c33a3189145 (diff)
downloadQt-86ceda033eda6bd615134f71b9850081a0c808c9.zip
Qt-86ceda033eda6bd615134f71b9850081a0c808c9.tar.gz
Qt-86ceda033eda6bd615134f71b9850081a0c808c9.tar.bz2
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: Changes to driver workarounds. Switch to raster also when last window is destroyed (on MeeGo). Fix accidental population of the disk cache with partial content Fix disk cache interaction for range retrieval HTTP requests. Clipboard/Windows: Fix a hang when sending to non-responsive clients.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp5
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp7
2 files changed, 12 insertions, 0 deletions
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index 4908e0a..a031cd0 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -233,6 +233,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
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index 485f449..1c9fa3e 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -514,6 +514,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);