diff options
author | Romain Pokrzywka <romain.pokrzywka@gmail.com> | 2017-08-03 01:11:02 -0500 |
---|---|---|
committer | Romain Pokrzywka <romain.pokrzywka@gmail.com> | 2017-08-14 14:20:52 +0000 |
commit | 9193b6cc8505244a9f1af9706032f8c62142f75a (patch) | |
tree | 0ee08ef8acb51987127d33f1396d47d065872291 /src/network/access | |
parent | 0273391dbe94bd76ba9022e6ae7a314a0a6decdd (diff) |
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>
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qhttpnetworkconnectionchannel.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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) { |