From 63cf5d3d26a6f65938c3cdec1734eac9faaaf8cb Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 22 Sep 2015 14:26:24 -0400 Subject: QNAM: Assign proper channel before sslErrors() emission There can be a race condition where another channel connects and gets the sslErrors() from the socket first. Then the QSslConfiguration from the wrong socket (the default channel 0's socket) was used. Task-number: QTBUG-18722 Change-Id: Ibbfa48c27f181563745daf540fa792a57cc09682 Reviewed-by: Richard J. Moore --- src/network/access/qhttpnetworkconnectionchannel.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/network/access/qhttpnetworkconnectionchannel.cpp') diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 257aa13718..477cba267b 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -1066,6 +1066,8 @@ void QHttpNetworkConnectionChannel::_q_sslErrors(const QList &errors) connection->d_func()->pauseConnection(); if (pendingEncrypt && !reply) connection->d_func()->dequeueRequest(socket); + if (reply) // a reply was actually dequeued. + reply->d_func()->connectionChannel = this; // set correct channel like in sendRequest() and queueRequest(); if (connection->connectionType() == QHttpNetworkConnection::ConnectionTypeHTTP) { if (reply) emit reply->sslErrors(errors); -- cgit v1.2.3