summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkaccessmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/access/qnetworkaccessmanager.cpp')
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index 740e54b833..c65edb6673 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -451,12 +451,12 @@ QNetworkProxyFactory *QNetworkAccessManager::proxyFactory() const
For example, a proxy factory could apply the following rules:
\list
- \o if the target address is in the local network (for example,
+ \li if the target address is in the local network (for example,
if the hostname contains no dots or if it's an IP address in
the organization's range), return QNetworkProxy::NoProxy
- \o if the request is FTP, return an FTP proxy
- \o if the request is HTTP or HTTPS, then return an HTTP proxy
- \o otherwise, return a SOCKSv5 proxy server
+ \li if the request is FTP, return an FTP proxy
+ \li if the request is HTTP or HTTPS, then return an HTTP proxy
+ \li otherwise, return a SOCKSv5 proxy server
\endlist
The lifetime of the object \a factory will be managed by
@@ -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