summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-10-26 13:48:42 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-10-27 12:40:28 (GMT)
commitfb404765a5af559598dc5b3906e45d8c5e48884b (patch)
tree4ed25dade61ffb29614dc31c8546f964ebb8158d
parent3b87e4639edb2c7050c5ae74fa8280fd120b8de1 (diff)
downloadQt-fb404765a5af559598dc5b3906e45d8c5e48884b.zip
Qt-fb404765a5af559598dc5b3906e45d8c5e48884b.tar.gz
Qt-fb404765a5af559598dc5b3906e45d8c5e48884b.tar.bz2
QNAM HTTP: Move proxyAuthenticationRequired() to QHttpNetworkReply
Reviewed-by: Prasanth Task-Number: QTBUG-13234
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp5
-rw-r--r--src/network/access/qhttpnetworkconnection_p.h5
-rw-r--r--src/network/access/qhttpnetworkreply_p.h4
-rw-r--r--src/network/access/qnetworkaccesshttpbackend.cpp8
4 files changed, 9 insertions, 13 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 1166a9a..f266322 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -354,7 +354,7 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
emit q->authenticationRequired(reply, reply->request(), auth, q);
#ifndef QT_NO_NETWORKPROXY
} else {
- emit q->proxyAuthenticationRequired(networkProxy, auth, q);
+ emit reply->proxyAuthenticationRequired(networkProxy, auth);
#endif
}
resumeConnection();
@@ -963,11 +963,10 @@ void QHttpNetworkConnection::ignoreSslErrors(const QList<QSslError> &errors, int
// e.g. it is for SOCKS proxies which require authentication.
void QHttpNetworkConnectionPrivate::emitProxyAuthenticationRequired(const QHttpNetworkConnectionChannel *chan, const QNetworkProxy &proxy, QAuthenticator* auth)
{
- Q_Q(QHttpNetworkConnection);
// Also pause the connection because socket notifiers may fire while an user
// dialog is displaying
pauseConnection();
- emit q->proxyAuthenticationRequired(proxy, auth, q);
+ emit chan->reply->proxyAuthenticationRequired(proxy, auth);
resumeConnection();
int i = indexOf(chan->socket);
copyCredentials(i, auth, true);
diff --git a/src/network/access/qhttpnetworkconnection_p.h b/src/network/access/qhttpnetworkconnection_p.h
index f8c4bb4..af33bf9 100644
--- a/src/network/access/qhttpnetworkconnection_p.h
+++ b/src/network/access/qhttpnetworkconnection_p.h
@@ -123,11 +123,6 @@ public:
#endif
Q_SIGNALS:
-#ifndef QT_NO_NETWORKPROXY
- //cannot be used with queued connection.
- void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator,
- const QHttpNetworkConnection *connection = 0);
-#endif
void authenticationRequired(const QHttpNetworkReply*, const QHttpNetworkRequest &request, QAuthenticator *authenticator,
const QHttpNetworkConnection *connection = 0);
void error(QNetworkReply::NetworkError errorCode, const QString &detail = QString());
diff --git a/src/network/access/qhttpnetworkreply_p.h b/src/network/access/qhttpnetworkreply_p.h
index 79966fd..b4a14f9 100644
--- a/src/network/access/qhttpnetworkreply_p.h
+++ b/src/network/access/qhttpnetworkreply_p.h
@@ -152,7 +152,9 @@ Q_SIGNALS:
void dataReadProgress(int done, int total);
void dataSendProgress(qint64 done, qint64 total);
void cacheCredentials(const QHttpNetworkRequest &request, QAuthenticator *authenticator);
-
+#ifndef QT_NO_NETWORKPROXY
+ void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator);
+#endif
private:
Q_DECLARE_PRIVATE(QHttpNetworkReply)
friend class QHttpNetworkConnection;
diff --git a/src/network/access/qnetworkaccesshttpbackend.cpp b/src/network/access/qnetworkaccesshttpbackend.cpp
index 3bad2fe..3611e77 100644
--- a/src/network/access/qnetworkaccesshttpbackend.cpp
+++ b/src/network/access/qnetworkaccesshttpbackend.cpp
@@ -340,10 +340,6 @@ void QNetworkAccessHttpBackend::finished()
void QNetworkAccessHttpBackend::setupConnection()
{
-#ifndef QT_NO_NETWORKPROXY
- connect(http, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
- SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
-#endif
connect(http, SIGNAL(authenticationRequired(const QHttpNetworkReply*, QHttpNetworkRequest,QAuthenticator*,const QHttpNetworkConnection*)),
SLOT(httpAuthenticationRequired(const QHttpNetworkReply*, QHttpNetworkRequest,QAuthenticator*)));
connect(http, SIGNAL(error(QNetworkReply::NetworkError,QString)),
@@ -598,6 +594,10 @@ void QNetworkAccessHttpBackend::postRequest()
connect(httpReply, SIGNAL(headerChanged()), SLOT(replyHeaderChanged()));
connect(httpReply, SIGNAL(cacheCredentials(QHttpNetworkRequest,QAuthenticator*)),
SLOT(httpCacheCredentials(QHttpNetworkRequest,QAuthenticator*)));
+#ifndef QT_NO_NETWORKPROXY
+ connect(httpReply, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
+ SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
+#endif
}
void QNetworkAccessHttpBackend::invalidateCache()