diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-06 02:00:40 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-05-06 02:00:40 (GMT) |
commit | 1d9a18142eb19d5dde93b7e5c63f9be0e4caf896 (patch) | |
tree | 823612360adc8b04bc537732ddc9001c5cef743e /src/network/access | |
parent | 95cd3aca76a47d59ef43e7c1566e5d43ab8b7c30 (diff) | |
parent | 9e95890804d8b5114f8090496b82327178055348 (diff) | |
download | Qt-1d9a18142eb19d5dde93b7e5c63f9be0e4caf896.zip Qt-1d9a18142eb19d5dde93b7e5c63f9be0e4caf896.tar.gz Qt-1d9a18142eb19d5dde93b7e5c63f9be0e4caf896.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging:
QSslConfiguration documentation fix
Ensure that QDateTimeEdit::calendarWidget() will always return a valid widget.
HTTP auto tests: do not load resources from cache that must be revalidtd
HTTP cache backend: do not load resources that must be revalidated
HTTP backend: do not load resources from cache that must be revalidated
Compile fix for QLocale on Symbian.
Added Kazakh language to the QLocale mapping table on Symbian.
Added support for QLocale::uiLanguages on Symbian.
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qnetworkaccesscachebackend.cpp | 9 | ||||
-rw-r--r-- | src/network/access/qnetworkaccesshttpbackend.cpp | 12 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/network/access/qnetworkaccesscachebackend.cpp b/src/network/access/qnetworkaccesscachebackend.cpp index 13f4cd9..c585848 100644 --- a/src/network/access/qnetworkaccesscachebackend.cpp +++ b/src/network/access/qnetworkaccesscachebackend.cpp @@ -66,6 +66,7 @@ void QNetworkAccessCacheBackend::open() QString msg = QCoreApplication::translate("QNetworkAccessCacheBackend", "Error opening %1") .arg(this->url().toString()); error(QNetworkReply::ContentNotFoundError, msg); + } else { setAttribute(QNetworkRequest::SourceIsFromCacheAttribute, true); } finished(); @@ -85,14 +86,18 @@ bool QNetworkAccessCacheBackend::sendCacheContents() QNetworkCacheMetaData::AttributesMap attributes = item.attributes(); setAttribute(QNetworkRequest::HttpStatusCodeAttribute, attributes.value(QNetworkRequest::HttpStatusCodeAttribute)); setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, attributes.value(QNetworkRequest::HttpReasonPhraseAttribute)); - setAttribute(QNetworkRequest::SourceIsFromCacheAttribute, true); // set the raw headers QNetworkCacheMetaData::RawHeaderList rawHeaders = item.rawHeaders(); QNetworkCacheMetaData::RawHeaderList::ConstIterator it = rawHeaders.constBegin(), end = rawHeaders.constEnd(); - for ( ; it != end; ++it) + for ( ; it != end; ++it) { + if (it->first.toLower() == "cache-control" && + it->second.toLower().contains("must-revalidate")) { + return false; + } setRawHeader(it->first, it->second); + } // handle a possible redirect QVariant redirectionTarget = attributes.value(QNetworkRequest::RedirectionTargetAttribute); diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp index c619114..a45c2de 100644 --- a/src/network/access/qnetworkaccesshttpbackend.cpp +++ b/src/network/access/qnetworkaccesshttpbackend.cpp @@ -262,13 +262,11 @@ bool QNetworkAccessHttpBackend::loadFromCacheIfAllowed(QHttpNetworkRequest &http if (lastModified.isValid()) httpRequest.setHeaderField("If-Modified-Since", QNetworkHeadersPrivate::toHttpDate(lastModified)); - if (CacheLoadControlAttribute == QNetworkRequest::PreferNetwork) { - it = cacheHeaders.findRawHeader("Cache-Control"); - if (it != cacheHeaders.rawHeaders.constEnd()) { - QHash<QByteArray, QByteArray> cacheControl = parseHttpOptionHeader(it->second); - if (cacheControl.contains("must-revalidate")) - return false; - } + it = cacheHeaders.findRawHeader("Cache-Control"); + if (it != cacheHeaders.rawHeaders.constEnd()) { + QHash<QByteArray, QByteArray> cacheControl = parseHttpOptionHeader(it->second); + if (cacheControl.contains("must-revalidate")) + return false; } QDateTime currentDateTime = QDateTime::currentDateTime(); |