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) <markus@woboq.com>
This commit is contained in:
Romain Pokrzywka 2017-08-03 01:11:02 -05:00
parent 0273391dbe
commit 9193b6cc85

View File

@ -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) {