cache: rename validateCache() to loadFromCacheIfAllowed()
This commit is contained in:
parent
43b6320a5a
commit
76e04fdf3d
@ -398,7 +398,7 @@ QNetworkReplyHttpImplPrivate::~QNetworkReplyHttpImplPrivate()
|
||||
2) If we have a cache entry for this url populate headers so the server can return 304
|
||||
3) Calculate if response_is_fresh and if so send the cache and set loadedFromCache to true
|
||||
*/
|
||||
void QNetworkReplyHttpImplPrivate::validateCache(QHttpNetworkRequest &httpRequest, bool &loadedFromCache)
|
||||
void QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed(QHttpNetworkRequest &httpRequest, bool &loadedFromCache)
|
||||
{
|
||||
QNetworkRequest::CacheLoadControl CacheLoadControlAttribute =
|
||||
(QNetworkRequest::CacheLoadControl)request.attribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork).toInt();
|
||||
@ -615,12 +615,12 @@ void QNetworkReplyHttpImplPrivate::postRequest()
|
||||
switch (operation) {
|
||||
case QNetworkAccessManager::GetOperation:
|
||||
httpRequest.setOperation(QHttpNetworkRequest::Get);
|
||||
validateCache(httpRequest, loadedFromCache);
|
||||
loadFromCacheIfAllowed(httpRequest, loadedFromCache);
|
||||
break;
|
||||
|
||||
case QNetworkAccessManager::HeadOperation:
|
||||
httpRequest.setOperation(QHttpNetworkRequest::Head);
|
||||
validateCache(httpRequest, loadedFromCache);
|
||||
loadFromCacheIfAllowed(httpRequest, loadedFromCache);
|
||||
break;
|
||||
|
||||
case QNetworkAccessManager::PostOperation:
|
||||
|
@ -264,7 +264,7 @@ public:
|
||||
#endif
|
||||
|
||||
|
||||
void validateCache(QHttpNetworkRequest &httpRequest, bool &loadedFromCache);
|
||||
void loadFromCacheIfAllowed(QHttpNetworkRequest &httpRequest, bool &loadedFromCache);
|
||||
void invalidateCache();
|
||||
bool sendCacheContents(const QNetworkCacheMetaData &metaData);
|
||||
QNetworkCacheMetaData fetchCacheMetaData(const QNetworkCacheMetaData &metaData) const;
|
||||
|
Loading…
Reference in New Issue
Block a user