summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkaccessmanager.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-13 05:05:43 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-13 05:05:43 (GMT)
commit8c6b5c53a2f6f8c9113fa616b458dde0be86a9e2 (patch)
treef3883fb4fce6227a9fe33a4d53449ffc4c4cf505 /src/network/access/qnetworkaccessmanager.cpp
parent50711dd7aa22052eff58431d9f4e95e1a688047e (diff)
parentd41ccae68683dd0d35c20affec7e5c55ce6bca37 (diff)
downloadQt-8c6b5c53a2f6f8c9113fa616b458dde0be86a9e2.zip
Qt-8c6b5c53a2f6f8c9113fa616b458dde0be86a9e2.tar.gz
Qt-8c6b5c53a2f6f8c9113fa616b458dde0be86a9e2.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: (159 commits) Doc: Adding loading image to search textbox qdoc: Yet another revision of the top doc page. Doc: Update on web template Added QDateTime::msecsTo() Doc: Fixed tables and images for the new docs qdoc: Yet another revision of the top doc page. Revert "Improve QUrl handling of local file paths" Revert "[QNAM FTP] Check for the "ftp" scheme case-insensitively" Revert "QUrl::fromLocalFile: fix silly mistake: it's fromNativeSeparators, not to" Revert "Use QUrl::isLocalFile and fix the scheme checking in local URLs." qdoc: Another revision of the top doc page. Doc correction to css Doc: Updates to the html template and javascript tst_SuiteTest: Fix a meaningless switch statement My 4.7.0 changelog entries. qdoc: Fixed annotated list generation to use <td>, not <th>. Doc: Tuning search script qdoc: Reorganized examples panel. Doc: Chages to search feature, css and table order QtDeclarative: avoid waiting for a network load on URIs with empty schemes. ...
Diffstat (limited to 'src/network/access/qnetworkaccessmanager.cpp')
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index feb9d99..1c7661d 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -948,10 +948,15 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
// but the data that is outgoing is random-access
request.setHeader(QNetworkRequest::ContentLengthHeader, outgoingData->size());
}
- if (d->cookieJar) {
- QList<QNetworkCookie> cookies = d->cookieJar->cookiesForUrl(request.url());
- if (!cookies.isEmpty())
- request.setHeader(QNetworkRequest::CookieHeader, qVariantFromValue(cookies));
+
+ if (static_cast<QNetworkRequest::LoadControl>
+ (request.attribute(QNetworkRequest::CookieLoadControlAttribute,
+ QNetworkRequest::Automatic).toInt()) == QNetworkRequest::Automatic) {
+ if (d->cookieJar) {
+ QList<QNetworkCookie> cookies = d->cookieJar->cookiesForUrl(request.url());
+ if (!cookies.isEmpty())
+ request.setHeader(QNetworkRequest::CookieHeader, qVariantFromValue(cookies));
+ }
}
// first step: create the reply
@@ -967,11 +972,15 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
priv->manager = this;
// second step: fetch cached credentials
- QNetworkAuthenticationCredential *cred = d->fetchCachedCredentials(url);
- if (cred) {
- url.setUserName(cred->user);
- url.setPassword(cred->password);
- priv->urlForLastAuthentication = url;
+ if (static_cast<QNetworkRequest::LoadControl>
+ (request.attribute(QNetworkRequest::AuthenticationReuseAttribute,
+ QNetworkRequest::Automatic).toInt()) == QNetworkRequest::Automatic) {
+ QNetworkAuthenticationCredential *cred = d->fetchCachedCredentials(url);
+ if (cred) {
+ url.setUserName(cred->user);
+ url.setPassword(cred->password);
+ priv->urlForLastAuthentication = url;
+ }
}
// third step: find a backend