summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-11-10 17:55:27 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-11-10 17:55:27 (GMT)
commitde0dcfdb1133dcee7b6d0d50a2bcd95f5bdf2515 (patch)
tree02a6e7d6cc23c670eaed13db0f8a9aa45651e701 /src/network
parent8cd2af3982a79b72c0d795e5952e1822b023110f (diff)
parent3ae96155a760ba114fb7843154f9ae8e311162f9 (diff)
downloadQt-de0dcfdb1133dcee7b6d0d50a2bcd95f5bdf2515.zip
Qt-de0dcfdb1133dcee7b6d0d50a2bcd95f5bdf2515.tar.gz
Qt-de0dcfdb1133dcee7b6d0d50a2bcd95f5bdf2515.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-earth-staging: networking: regenerate effective TLD table for cookies QNAM: Fix authentication cache when the password is in the URL
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qhttpnetworkconnection.cpp5
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp1
-rw-r--r--src/network/access/qhttpthreaddelegate.cpp5
3 files changed, 8 insertions, 3 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp
index 4f2145e..0365703 100644
--- a/src/network/access/qhttpnetworkconnection.cpp
+++ b/src/network/access/qhttpnetworkconnection.cpp
@@ -387,6 +387,11 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
// send any pending requests
copyCredentials(i, auth, isProxy);
}
+ } else if (priv->phase == QAuthenticatorPrivate::Start) {
+ // If the url's authenticator has a 'user' set we will end up here (phase is only set to 'Done' by
+ // parseHttpResponse above if 'user' is empty). So if credentials were supplied with the request,
+ // such as in the case of an XMLHttpRequest, this is our only opportunity to cache them.
+ emit reply->cacheCredentials(reply->request(), auth);
}
// - Changing values in QAuthenticator will reset the 'phase'. Therefore if it is still "Done"
// then nothing was filled in by the user or the cache
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 9b2a6e8..15fda34 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -201,7 +201,6 @@ bool QHttpNetworkConnectionChannel::sendRequest()
|| (!url.password().isEmpty() && url.password() != auth.password())) {
auth.setUser(url.userName());
auth.setPassword(url.password());
- emit reply->cacheCredentials(request, &auth);
connection->d_func()->copyCredentials(connection->d_func()->indexOf(socket), &auth, false);
}
// clear the userinfo, since we use the same request for resending
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp
index 092fa7d..68c2292 100644
--- a/src/network/access/qhttpthreaddelegate.cpp
+++ b/src/network/access/qhttpthreaddelegate.cpp
@@ -312,8 +312,6 @@ void QHttpThreadDelegate::startRequest()
// some signals are only interesting when normal asynchronous style is used
connect(httpReply,SIGNAL(readyRead()), this, SLOT(readyReadSlot()));
connect(httpReply,SIGNAL(dataReadProgress(int, int)), this, SLOT(dataReadProgressSlot(int,int)));
- connect(httpReply, SIGNAL(cacheCredentials(QHttpNetworkRequest,QAuthenticator*)),
- this, SLOT(cacheCredentialsSlot(QHttpNetworkRequest,QAuthenticator*)));
#ifndef QT_NO_OPENSSL
connect(httpReply,SIGNAL(sslErrors(const QList<QSslError>)), this, SLOT(sslErrorsSlot(QList<QSslError>)));
#endif
@@ -325,6 +323,9 @@ void QHttpThreadDelegate::startRequest()
connect(httpReply, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),
this, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)));
}
+
+ connect(httpReply, SIGNAL(cacheCredentials(QHttpNetworkRequest,QAuthenticator*)),
+ this, SLOT(cacheCredentialsSlot(QHttpNetworkRequest,QAuthenticator*)));
}
// This gets called from the user thread or by the synchronous HTTP timeout timer