summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-11-04 14:24:32 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-11-04 14:35:45 (GMT)
commit6bf640a7600132c02742a2581402e04f75b60962 (patch)
tree9609de4ac52dd063ece0a151ac81c38078423573 /src
parent440888de851daad78d89f2958aa95e9193832fb5 (diff)
downloadQt-6bf640a7600132c02742a2581402e04f75b60962.zip
Qt-6bf640a7600132c02742a2581402e04f75b60962.tar.gz
Qt-6bf640a7600132c02742a2581402e04f75b60962.tar.bz2
QNAM HTTP: Download last chunk properly when readBufferSize() limited
Task-number: QTBUG-13431 Task-number: QTBUG-6276 Reviewed-by: ogoffart
Diffstat (limited to 'src')
-rw-r--r--src/network/access/qhttpnetworkconnectionchannel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp
index 4e5de53..02daa50 100644
--- a/src/network/access/qhttpnetworkconnectionchannel.cpp
+++ b/src/network/access/qhttpnetworkconnectionchannel.cpp
@@ -412,7 +412,9 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
}
case QHttpNetworkReplyPrivate::ReadingDataState: {
QHttpNetworkReplyPrivate *replyPrivate = reply->d_func();
- if (replyPrivate->downstreamLimited && !replyPrivate->responseData.isEmpty() && replyPrivate->shouldEmitSignals()) {
+ if (socket->state() == QAbstractSocket::ConnectedState &&
+ replyPrivate->downstreamLimited && !replyPrivate->responseData.isEmpty() && replyPrivate->shouldEmitSignals()) {
+ // (only do the following when still connected, not when we have already been disconnected and there is still data)
// We already have some HTTP body data. We don't read more from the socket until
// this is fetched by QHttpNetworkAccessHttpBackend. If we would read more,
// we could not limit our read buffer usage.
@@ -421,7 +423,6 @@ void QHttpNetworkConnectionChannel::_q_receiveReply()
// to the read buffer maximum size, but we don't care since they should be small.
return;
}
-
if (!replyPrivate->isChunked() && !replyPrivate->autoDecompress
&& replyPrivate->bodyLength > 0) {
// bulk files like images should fulfill these properties and