Network: Emit authenticationRequired when using Ntlm

Adds a new state Phase1 to QAuthenticatorPrivate::Phase which is used
when authenticating using Ntlm. The new state forces an emit of the
authenticationRequired signal and tracks that it is called only once.

Fixes: QTBUG-44096
Pick-to: 6.2 6.3 5.15
Change-Id: Icc9662d4fdc1f0f8c8e8bc5538f211baaa055d4c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Sören Bohn 2017-03-14 10:36:49 +01:00 committed by Volker Hilsheimer
parent 5a0849ed6b
commit 0b7b3a069e
2 changed files with 7 additions and 1 deletions

View File

@ -454,7 +454,12 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
if (priv->method == QAuthenticatorPrivate::None)
return false;
if (priv->phase == QAuthenticatorPrivate::Done) {
if (priv->phase == QAuthenticatorPrivate::Done ||
(priv->phase == QAuthenticatorPrivate::Start
&& priv->method == QAuthenticatorPrivate::Ntlm)) {
if (priv->phase == QAuthenticatorPrivate::Start)
priv->phase = QAuthenticatorPrivate::Phase1;
pauseConnection();
if (!isProxy) {
if (channels[i].authenticationCredentialsSent) {

View File

@ -91,6 +91,7 @@ public:
enum Phase {
Start,
Phase1,
Phase2,
Done,
Invalid