void QNetworkAccessBackend::proxyAuthenticationRequired(const QNetworkProxy &proxy,
QAuthenticator *authenticator)
{
- manager->proxyAuthenticationRequired(this, proxy, authenticator);
+ manager->proxyAuthenticationRequired(proxy, synchronous, authenticator, &reply->lastProxyAuthentication);
}
#endif
}
#ifndef QT_NO_NETWORKPROXY
-void QNetworkAccessManagerPrivate::proxyAuthenticationRequired(QNetworkAccessBackend *backend,
- const QNetworkProxy &proxy,
- QAuthenticator *authenticator)
+void QNetworkAccessManagerPrivate::proxyAuthenticationRequired(const QNetworkProxy &proxy,
+ bool synchronous,
+ QAuthenticator *authenticator,
+ QNetworkProxy *lastProxyAuthentication)
{
Q_Q(QNetworkAccessManager);
// ### FIXME Tracking of successful authentications
// proxyAuthenticationRequired gets emitted again
// possible solution: some tracking inside the authenticator
// or a new function proxyAuthenticationSucceeded(true|false)
- if (proxy != backend->reply->lastProxyAuthentication) {
+ if (proxy != *lastProxyAuthentication) {
QNetworkAuthenticationCredential cred = authenticationManager->fetchCachedProxyCredentials(proxy);
if (!cred.isNull()) {
authenticator->setUser(cred.user);
// if we emit a signal here in synchronous mode, the user might spin
// an event loop, which might recurse and lead to problems
- if (backend->isSynchronous())
+ if (synchronous)
return;
- backend->reply->lastProxyAuthentication = proxy;
+ *lastProxyAuthentication = proxy;
emit q->proxyAuthenticationRequired(proxy, authenticator);
authenticationManager->cacheProxyCredentials(proxy, authenticator);
}
const QAuthenticator *auth = 0);
#ifndef QT_NO_NETWORKPROXY
- void proxyAuthenticationRequired(QNetworkAccessBackend *backend, const QNetworkProxy &proxy,
- QAuthenticator *authenticator);
+ void proxyAuthenticationRequired(const QNetworkProxy &proxy,
+ bool synchronous,
+ QAuthenticator *authenticator,
+ QNetworkProxy *lastProxyAuthentication);
void cacheProxyCredentials(const QNetworkProxy &proxy, const QAuthenticator *auth);
QNetworkAuthenticationCredential *fetchCachedProxyCredentials(const QNetworkProxy &proxy,
const QAuthenticator *auth = 0);