Fix race in http connection channel
When authentication is cancelled, close the channel instead of the underlying socket. The previous behaviour could result in further requests being sent on the closed socket, which caused errors in case of https over a proxy. Change-Id: I3dbfc164de4fb29a426c06acaac8f29b9da1d705 Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
This commit is contained in:
parent
d24aad8289
commit
a7b99151f4
@ -482,7 +482,6 @@ bool QHttpNetworkConnectionPrivate::handleAuthenticateChallenge(QAbstractSocket
|
||||
reply->d_func()->errorString = errorDetail(errorCode, socket);
|
||||
emit reply->finishedWithError(errorCode, reply->d_func()->errorString);
|
||||
// ### at this point the reply could be deleted
|
||||
socket->close();
|
||||
return true;
|
||||
}
|
||||
//resend the request
|
||||
|
@ -793,6 +793,9 @@ void QHttpNetworkConnectionChannel::handleStatus()
|
||||
closeAndResendCurrentRequest();
|
||||
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
|
||||
}
|
||||
} else {
|
||||
//authentication cancelled, close the channel.
|
||||
close();
|
||||
}
|
||||
} else {
|
||||
emit reply->headerChanged();
|
||||
|
Loading…
Reference in New Issue
Block a user