From d425a0dad38e51c99cfe59294a3706ced90b24a0 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Wed, 15 Feb 2012 17:58:11 +0000 Subject: 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 --- src/network/access/qhttpthreaddelegate.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/network/access') diff --git a/src/network/access/qhttpthreaddelegate.cpp b/src/network/access/qhttpthreaddelegate.cpp index 5cf153325b..3901635ca0 100644 --- a/src/network/access/qhttpthreaddelegate.cpp +++ b/src/network/access/qhttpthreaddelegate.cpp @@ -560,7 +560,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 @@ -577,7 +578,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 -- cgit v1.2.3