summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkaccessmanager.cpp
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-03-08 01:27:27 +0100
committerJoão Abecasis <joao.abecasis@nokia.com>2012-03-08 01:27:39 +0100
commit12f221410fbe41d0b2efda4cd3289dfcf9044aa8 (patch)
tree897cf6bfb1814b0935982ff5975a6cbfb48d6d9e /src/network/access/qnetworkaccessmanager.cpp
parent3d19422ef16a230bb11dbbfe4a8cc9667f39bf15 (diff)
parent6c612c933803ef57ea45e907d0181b40659148ac (diff)
Merge remote-tracking branch 'origin/master' into api_changes
Diffstat (limited to 'src/network/access/qnetworkaccessmanager.cpp')
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 60c28274c6..c65edb6673 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -1089,15 +1089,16 @@ void QNetworkAccessManagerPrivate::authenticationRequired(QAuthenticator *authen
QNetworkReply *reply,
bool synchronous,
QUrl &url,
- QUrl *urlForLastAuthentication)
+ QUrl *urlForLastAuthentication,
+ bool allowAuthenticationReuse)
{
Q_Q(QNetworkAccessManager);
// don't try the cache for the same URL twice in a row
// being called twice for the same URL means the authentication failed
// also called when last URL is empty, e.g. on first call
- if (urlForLastAuthentication->isEmpty()
- || url != *urlForLastAuthentication) {
+ if (allowAuthenticationReuse && (urlForLastAuthentication->isEmpty()
+ || url != *urlForLastAuthentication)) {
// if credentials are included in the url, then use them
if (!url.userName().isEmpty()
&& !url.password().isEmpty()) {
@@ -1124,7 +1125,8 @@ void QNetworkAccessManagerPrivate::authenticationRequired(QAuthenticator *authen
*urlForLastAuthentication = url;
emit q->authenticationRequired(reply, authenticator);
- authenticationManager->cacheCredentials(url, authenticator);
+ if (allowAuthenticationReuse)
+ authenticationManager->cacheCredentials(url, authenticator);
}
#ifndef QT_NO_NETWORKPROXY