summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpprotocolhandler.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-08-27 20:20:34 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-08-27 22:29:28 +0000
commit6d51697f1d4a5b1d0d57efca29a8d81a591567bd (patch)
treeb4cc5ab53bf3e8ce4c1ce02106f17df0bd8699e6 /src/network/access/qhttpprotocolhandler.cpp
parent3fe645ecc9aaf4522183c39f5c9a78ebc1c90674 (diff)
parentafab1546a7665bac2a8d7a6452e6aea46bfd2127 (diff)
Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6
Diffstat (limited to 'src/network/access/qhttpprotocolhandler.cpp')
-rw-r--r--src/network/access/qhttpprotocolhandler.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/network/access/qhttpprotocolhandler.cpp b/src/network/access/qhttpprotocolhandler.cpp
index 55187755bf..a2083158f1 100644
--- a/src/network/access/qhttpprotocolhandler.cpp
+++ b/src/network/access/qhttpprotocolhandler.cpp
@@ -237,7 +237,12 @@ void QHttpProtocolHandler::_q_readyRead()
}
if (m_channel->isSocketWaiting() || m_channel->isSocketReading()) {
- m_channel->state = QHttpNetworkConnectionChannel::ReadingState;
+ if (m_socket->bytesAvailable()) {
+ // We might get a spurious call from readMoreLater()
+ // call of the QHttpNetworkConnection even while the socket is disconnecting.
+ // Therefore check if there is actually bytes available before changing the channel state.
+ m_channel->state = QHttpNetworkConnectionChannel::ReadingState;
+ }
if (m_reply)
_q_receiveReply();
}
@@ -250,7 +255,6 @@ bool QHttpProtocolHandler::sendRequest()
if (!m_reply) {
// heh, how should that happen!
qWarning() << "QAbstractProtocolHandler::sendRequest() called without QHttpNetworkReply";
- m_channel->state = QHttpNetworkConnectionChannel::IdleState;
return false;
}