diff options
author | Peter Hartmann <peter.hartmann@nokia.com> | 2011-04-13 11:45:00 +0200 |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2011-05-03 16:43:56 +0200 |
commit | 04f2c4a7a7c65ff36ad60a26b193fa9d681af45f (patch) | |
tree | e98557b79f335ea8709e5c92f2caa25ccc579dee /src/network/access | |
parent | 6d3044db9578d14b11dc7d156e2d81709c3d0ed7 (diff) |
Revert "HTTP caching internals: fix logic for PreferNetwork and PreferCache"
This reverts commit 11838861a23ace66307306cf9c96b3f1910e09a9.
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qnetworkreplyhttpimpl.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/network/access/qnetworkreplyhttpimpl.cpp b/src/network/access/qnetworkreplyhttpimpl.cpp index fcfa1bb7ea..eb4adb8cd0 100644 --- a/src/network/access/qnetworkreplyhttpimpl.cpp +++ b/src/network/access/qnetworkreplyhttpimpl.cpp @@ -457,11 +457,6 @@ bool QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &h httpRequest.setHeaderField("If-Modified-Since", QNetworkHeadersPrivate::toHttpDate(lastModified)); if (CacheLoadControlAttribute == QNetworkRequest::PreferNetwork) { - // PreferNetwork == send request with "If-None-Match" and "If-Modified-Since" header, - // which will return a 304 Not Modifed if resource has not been changed. - // We might read from cache later, if receiving a 304. - return false; - } else if (CacheLoadControlAttribute == QNetworkRequest::PreferCache) { it = cacheHeaders.findRawHeader("Cache-Control"); if (it != cacheHeaders.rawHeaders.constEnd()) { QHash<QByteArray, QByteArray> cacheControl = parseHttpOptionHeader(it->second); @@ -1443,7 +1438,7 @@ QNetworkCacheMetaData QNetworkReplyHttpImplPrivate::fetchCacheMetaData(const QNe attributes.insert(QNetworkRequest::HttpStatusCodeAttribute, statusCode); attributes.insert(QNetworkRequest::HttpReasonPhraseAttribute, reasonPhrase); } else { - // this is the server telling us the resource has not changed, keep the attributes intact + // this is a redirection, keep the attributes intact attributes = oldMetaData.attributes(); } metaData.setAttributes(attributes); |