Fix performance problem with NTLM auth in http POST
authorShane Kearns <ext-shane.2.kearns@nokia.com>
Thu, 22 Mar 2012 15:10:26 +0000 (15:10 +0000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 23 Mar 2012 10:45:25 +0000 (11:45 +0100)
A combination of other fixes resulted in authentication credentials
with a blank username & password being incorrectly added to the
cache only for NTLM.
This caused authentication to be attempted with blank credentials
first (which would fail), before the authenticationRequired
signal was emitted.
It caused a performance issue because of the extra 2 requests to the
server (and possibly delays inserted by the server following a failed
login)

Change-Id: Ic588a20cfe7c24d5e60cd384caff0673a587e484
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
src/network/kernel/qauthenticator.cpp

index eef2a7f..43b3618 100644 (file)
@@ -380,6 +380,8 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
         break;
     case Ntlm:
         // #### extract from header
+        if (user.isEmpty() && password.isEmpty())
+            phase = Done;
         break;
     case DigestMd5: {
         this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));