From 9193b6cc8505244a9f1af9706032f8c62142f75a Mon Sep 17 00:00:00 2001 From: Romain Pokrzywka Date: Thu, 3 Aug 2017 01:11:02 -0500 Subject: QNAM: requeue pipelined HTTP requests after unrecoverable socket errors If we reach the maximum reconnect attempts for an HTTP request with pipelining enabled, those also need to be requeued during cleanup for the connection channel. Otherwise future successful requests on that same channel will incorrectly assign the data to replies from the old pipelined requests, resulting in swapped data in the replies. Task-number: QTBUG-62286 Change-Id: I804b8ac280957b518d63b2341e469a13315a8c27 Reviewed-by: Markus Goetz (Woboq GmbH) --- src/network/access/qhttpnetworkconnectionchannel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/network') diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index c86cc9d8c9..e1084e0870 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -970,8 +970,11 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket // emit error for all waiting replies do { - // Need to dequeu the request so that we can emit the error. - if (!reply) + // First requeue the already pipelined requests for the current failed reply, + // then dequeue pending requests so we can also mark them as finished with error + if (reply) + requeueCurrentlyPipelinedRequests(); + else connection->d_func()->dequeueRequest(socket); if (reply) { -- cgit v1.2.3