diff options
author | Peter Hartmann <phartmann@blackberry.com> | 2014-03-13 16:55:28 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-15 10:44:16 +0100 |
commit | 2bbdc6358f73ce167140bace821d606e720c0ded (patch) | |
tree | d59a0b5847770b0621daa44dd5c4873f098e8e0d /src/network/access | |
parent | 61fda89cd1c1f95c408059c33a651407ff243ee1 (diff) |
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 <rich@kde.org>
Diffstat (limited to 'src/network/access')
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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; |