Responses to request with AlwaysNetwork set should be cached
Previously the cache was not enabled if the request had AlwaysNetwork set. This removes the check for the CacheLoadControlAttribute when checking if the cache should be enabled. Task-number: QTBUG-15805 Change-Id: I3d0722fbc1e6c77c5b947a2af0a09e2de8f4f9df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
This commit is contained in:
parent
2b1e0940fd
commit
0a5440b2f0
@ -1945,10 +1945,7 @@ void QNetworkReplyHttpImplPrivate::createCache()
|
||||
{
|
||||
// check if we can save and if we're allowed to
|
||||
if (!managerPrivate->networkCache
|
||||
|| !request.attribute(QNetworkRequest::CacheSaveControlAttribute, true).toBool()
|
||||
|| request.attribute(QNetworkRequest::CacheLoadControlAttribute,
|
||||
QNetworkRequest::PreferNetwork).toInt()
|
||||
== QNetworkRequest::AlwaysNetwork)
|
||||
|| !request.attribute(QNetworkRequest::CacheSaveControlAttribute, true).toBool())
|
||||
return;
|
||||
cacheEnabled = true;
|
||||
}
|
||||
|
@ -451,10 +451,7 @@ void QNetworkReplyImplPrivate::createCache()
|
||||
{
|
||||
// check if we can save and if we're allowed to
|
||||
if (!networkCache()
|
||||
|| !request.attribute(QNetworkRequest::CacheSaveControlAttribute, true).toBool()
|
||||
|| request.attribute(QNetworkRequest::CacheLoadControlAttribute,
|
||||
QNetworkRequest::PreferNetwork).toInt()
|
||||
== QNetworkRequest::AlwaysNetwork)
|
||||
|| !request.attribute(QNetworkRequest::CacheSaveControlAttribute, true).toBool())
|
||||
return;
|
||||
cacheEnabled = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user