From 2bbdc6358f73ce167140bace821d606e720c0ded Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Thu, 13 Mar 2014 16:55:28 +0100 Subject: HTTP internals: keep consistent state in channel and protocol handler It could be that the channel has its reply already reset to 0, while the protocol handler thinks the reply is still active, which might lead to weird behavior including hard to reproduce crashes. Task-number: QTBUG-37424 Change-Id: I89b65d34caaa546a343edc2ee205aa76425de88f Reviewed-by: Richard J. Moore --- src/network/access/qhttpnetworkconnection.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/network/access/qhttpnetworkconnection.cpp') diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 87511076d3..32b6d902d0 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -377,6 +377,8 @@ void QHttpNetworkConnectionPrivate::emitReplyError(QAbstractSocket *socket, // Clean the channel channels[i].close(); channels[i].reply = 0; + if (channels[i].protocolHandler) + channels[i].protocolHandler->setReply(0); channels[i].request = QHttpNetworkRequest(); if (socket) channels[i].requeueCurrentlyPipelinedRequests(); @@ -826,6 +828,8 @@ void QHttpNetworkConnectionPrivate::removeReply(QHttpNetworkReply *reply) // is the reply associated the currently processing of this channel? if (channels[i].reply == reply) { channels[i].reply = 0; + if (channels[i].protocolHandler) + channels[i].protocolHandler->setReply(0); channels[i].request = QHttpNetworkRequest(); channels[i].resendCurrent = false; -- cgit v1.2.3