diff options
author | Shane Kearns <ext-shane.2.kearns@nokia.com> | 2012-02-15 17:58:11 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-20 16:27:31 (GMT) |
commit | f0f9677a875510c82d9b6918322194f7dcb35abd (patch) | |
tree | e4184f764b62a3b14a0fcb398eafe0c236d26431 /src/network/access | |
parent | 88f65a336248df6d2ba07e2bac24f0f4e8c1815b (diff) | |
download | Qt-f0f9677a875510c82d9b6918322194f7dcb35abd.zip Qt-f0f9677a875510c82d9b6918322194f7dcb35abd.tar.gz Qt-f0f9677a875510c82d9b6918322194f7dcb35abd.tar.bz2 |
Fix incorrect use of QObject::disconnect in synchronous http request
In certain circumstances, this could cause the request to time out
(and repeatedly send bad authentication credentials to the server)
instead of failing with AuthenticationRequiredError.
Change-Id: Iff66b32f1d7268f21fd77b6620aae4b5d49d857f
Reviewed-by: Richard J. Moore <rich@kde.org>
(cherry picked from commit d425a0dad38e51c99cfe59294a3706ced90b24a0)
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qhttpthreaddelegate.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp index 9dbd528..2340a94 100644 --- a/src/network/access/qhttpthreaddelegate.cpp +++ b/src/network/access/qhttpthreaddelegate.cpp @@ -556,7 +556,8 @@ void QHttpThreadDelegate::synchronousAuthenticationRequiredSlot(const QHttpNetwo } // Disconnect this connection now since we only want to ask the authentication cache once. - QObject::disconnect(this, SLOT(synchronousAuthenticationRequiredSlot(QHttpNetworkRequest,QAuthenticator*))); + QObject::disconnect(httpReply, SIGNAL(authenticationRequired(QHttpNetworkRequest,QAuthenticator*)), + this, SLOT(synchronousAuthenticationRequiredSlot(QHttpNetworkRequest,QAuthenticator*))); } #ifndef QT_NO_NETWORKPROXY @@ -573,7 +574,8 @@ void QHttpThreadDelegate::synchronousProxyAuthenticationRequiredSlot(const QNet } // Disconnect this connection now since we only want to ask the authentication cache once. - QObject::disconnect(this, SLOT(synchronousProxyAuthenticationRequiredSlot(QNetworkProxy,QAuthenticator*))); + QObject::disconnect(httpReply, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), + this, SLOT(synchronousProxyAuthenticationRequiredSlot(QNetworkProxy,QAuthenticator*))); } #endif |