summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-09-22 14:17:52 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-09-23 11:23:36 +0200
commitc5a3e5edd9e63b18abf1838c86a27a662224b02c (patch)
tree9a367c113d9b586da73439cb100744d616ce6399 /src/network
parent3312ac91692c3a4a033d123eecbf982d3ff10471 (diff)
parenta5df2e7120412dfdedb9f4951cdb061c0f218bf7 (diff)
Merge remote-tracking branch 'origin/5.3' into 5.4
The isAlwaysAskOption was removed in 38621713150b663355ebeb799a5a50d8e39a3c38 so manually removed code in src/plugins/bearer/connman/qconnmanengine.cpp Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qcollator_macx.cpp src/corelib/tools/qstring.cpp src/gui/kernel/qwindow.cpp src/gui/kernel/qwindow_p.h src/gui/text/qtextengine.cpp src/platformsupport/fontdatabases/fontconfig/qfontenginemultifontconfig_p.h src/plugins/platforms/android/qandroidinputcontext.cpp src/plugins/platforms/xcb/qglxintegration.cpp src/plugins/platforms/xcb/qglxintegration.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp src/testlib/qtestlog.cpp src/widgets/dialogs/qfiledialog.cpp src/widgets/kernel/qwindowcontainer.cpp tests/auto/corelib/tools/qcollator/tst_qcollator.cpp tests/auto/gui/text/qtextscriptengine/tst_qtextscriptengine.cpp tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp Change-Id: Ic5d4187f682257a17509f6cd28d2836c6cfe2fc8
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkaccessauthenticationmanager.cpp2
-rw-r--r--src/network/access/qnetworkaccessftpbackend.cpp20
-rw-r--r--src/network/access/qnetworkaccessftpbackend_p.h7
-rw-r--r--src/network/kernel/qauthenticator.cpp4
-rw-r--r--src/network/kernel/qurlinfo_p.h11
-rw-r--r--src/network/socket/qhttpsocketengine.cpp10
-rw-r--r--src/network/ssl/qsslcertificateextension_p.h11
-rw-r--r--src/network/ssl/qsslcontext_openssl_p.h11
8 files changed, 57 insertions, 19 deletions
diff --git a/src/network/access/qnetworkaccessauthenticationmanager.cpp b/src/network/access/qnetworkaccessauthenticationmanager.cpp
index ea7bdc198a..b92f9c1b9b 100644
--- a/src/network/access/qnetworkaccessauthenticationmanager.cpp
+++ b/src/network/access/qnetworkaccessauthenticationmanager.cpp
@@ -231,6 +231,8 @@ void QNetworkAccessAuthenticationManager::cacheCredentials(const QUrl &url,
const QAuthenticator *authenticator)
{
Q_ASSERT(authenticator);
+ if (authenticator->isNull())
+ return;
QString domain = QString::fromLatin1("/"); // FIXME: make QAuthenticator return the domain
QString realm = authenticator->realm();
diff --git a/src/network/access/qnetworkaccessftpbackend.cpp b/src/network/access/qnetworkaccessftpbackend.cpp
index 246eb41657..e8695f9b56 100644
--- a/src/network/access/qnetworkaccessftpbackend.cpp
+++ b/src/network/access/qnetworkaccessftpbackend.cpp
@@ -211,7 +211,7 @@ void QNetworkAccessFtpBackend::ftpConnectionReady(QNetworkAccessCache::Cacheable
// no, defer the actual operation until after we've logged in
}
-void QNetworkAccessFtpBackend::disconnectFromFtp()
+void QNetworkAccessFtpBackend::disconnectFromFtp(CacheCleanupMode mode)
{
state = Disconnecting;
@@ -219,7 +219,12 @@ void QNetworkAccessFtpBackend::disconnectFromFtp()
disconnect(ftp, 0, this, 0);
QByteArray key = makeCacheKey(url());
- QNetworkAccessManagerPrivate::getObjectCache(this)->releaseEntry(key);
+ if (mode == RemoveCachedConnection) {
+ QNetworkAccessManagerPrivate::getObjectCache(this)->removeEntry(key);
+ ftp->dispose();
+ } else {
+ QNetworkAccessManagerPrivate::getObjectCache(this)->releaseEntry(key);
+ }
ftp = 0;
}
@@ -274,14 +279,7 @@ void QNetworkAccessFtpBackend::ftpDone()
}
// we're not connected, so remove the cache entry:
- QByteArray key = makeCacheKey(url());
- QNetworkAccessManagerPrivate::getObjectCache(this)->removeEntry(key);
-
- disconnect(ftp, 0, this, 0);
- ftp->dispose();
- ftp = 0;
-
- state = Disconnecting;
+ disconnectFromFtp(RemoveCachedConnection);
finished();
return;
}
@@ -301,7 +299,7 @@ void QNetworkAccessFtpBackend::ftpDone()
else
error(QNetworkReply::ContentAccessDenied, msg);
- disconnectFromFtp();
+ disconnectFromFtp(RemoveCachedConnection);
finished();
}
diff --git a/src/network/access/qnetworkaccessftpbackend_p.h b/src/network/access/qnetworkaccessftpbackend_p.h
index c006d450b8..534efad676 100644
--- a/src/network/access/qnetworkaccessftpbackend_p.h
+++ b/src/network/access/qnetworkaccessftpbackend_p.h
@@ -90,7 +90,12 @@ public:
virtual void downstreamReadyWrite();
- void disconnectFromFtp();
+ enum CacheCleanupMode {
+ ReleaseCachedConnection,
+ RemoveCachedConnection
+ };
+
+ void disconnectFromFtp(CacheCleanupMode mode = ReleaseCachedConnection);
public slots:
void ftpConnectionReady(QNetworkAccessCache::CacheableObject *object);
diff --git a/src/network/kernel/qauthenticator.cpp b/src/network/kernel/qauthenticator.cpp
index ea935869fb..c4c7abb240 100644
--- a/src/network/kernel/qauthenticator.cpp
+++ b/src/network/kernel/qauthenticator.cpp
@@ -439,9 +439,7 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
phase = Done;
break;
case Ntlm:
- // #### extract from header
- if (user.isEmpty() && password.isEmpty())
- phase = Done;
+ // work is done in calculateResponse()
break;
case DigestMd5: {
this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));
diff --git a/src/network/kernel/qurlinfo_p.h b/src/network/kernel/qurlinfo_p.h
index 1aa59f25ad..31eb0730d3 100644
--- a/src/network/kernel/qurlinfo_p.h
+++ b/src/network/kernel/qurlinfo_p.h
@@ -42,6 +42,17 @@
#ifndef QURLINFO_H
#define QURLINFO_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qdatetime.h>
#include <QtCore/qstring.h>
#include <QtCore/qiodevice.h>
diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp
index 0a25815752..9f3c29e207 100644
--- a/src/network/socket/qhttpsocketengine.cpp
+++ b/src/network/socket/qhttpsocketengine.cpp
@@ -594,16 +594,18 @@ void QHttpSocketEngine::slotSocketReadNotification()
priv = QAuthenticatorPrivate::getPrivate(d->authenticator);
priv->hasFailed = false;
} else if (statusCode == 407) {
- if (d->credentialsSent) {
+ if (d->authenticator.isNull())
+ d->authenticator.detach();
+ priv = QAuthenticatorPrivate::getPrivate(d->authenticator);
+
+ if (d->credentialsSent && priv->phase != QAuthenticatorPrivate::Phase2) {
+ // Remember that (e.g.) NTLM is two-phase, so only reset when the authentication is not currently in progress.
//407 response again means the provided username/password were invalid.
d->authenticator = QAuthenticator(); //this is needed otherwise parseHttpResponse won't set the state, and then signal isn't emitted.
d->authenticator.detach();
priv = QAuthenticatorPrivate::getPrivate(d->authenticator);
priv->hasFailed = true;
}
- else if (d->authenticator.isNull())
- d->authenticator.detach();
- priv = QAuthenticatorPrivate::getPrivate(d->authenticator);
priv->parseHttpResponse(d->reply->header(), true);
diff --git a/src/network/ssl/qsslcertificateextension_p.h b/src/network/ssl/qsslcertificateextension_p.h
index cc04e76634..6891733174 100644
--- a/src/network/ssl/qsslcertificateextension_p.h
+++ b/src/network/ssl/qsslcertificateextension_p.h
@@ -42,6 +42,17 @@
#ifndef QSSLCERTIFICATEEXTENSION_P_H
#define QSSLCERTIFICATEEXTENSION_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include "qsslcertificateextension.h"
QT_BEGIN_NAMESPACE
diff --git a/src/network/ssl/qsslcontext_openssl_p.h b/src/network/ssl/qsslcontext_openssl_p.h
index 9fb9bd2204..d4ab91f8ec 100644
--- a/src/network/ssl/qsslcontext_openssl_p.h
+++ b/src/network/ssl/qsslcontext_openssl_p.h
@@ -44,6 +44,17 @@
#ifndef QSSLCONTEXT_OPENSSL_P_H
#define QSSLCONTEXT_OPENSSL_P_H
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
#include <QtCore/qvariant.h>
#include <QtNetwork/qsslcertificate.h>
#include <QtNetwork/qsslconfiguration.h>