summaryrefslogtreecommitdiffstats
path: root/src/network/access/qhttpnetworkreply.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/access/qhttpnetworkreply.cpp')
-rw-r--r--src/network/access/qhttpnetworkreply.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp
index 7025f1d..a5223d1 100644
--- a/src/network/access/qhttpnetworkreply.cpp
+++ b/src/network/access/qhttpnetworkreply.cpp
@@ -179,9 +179,19 @@ qint64 QHttpNetworkReply::bytesAvailableNextBlock() const
QByteArray QHttpNetworkReply::readAny()
{
Q_D(QHttpNetworkReply);
+ // we'll take the last buffer, so schedule another read from http
+ if (d->downstreamLimited && d->responseData.bufferCount() == 1)
+ d->connection->d_func()->readMoreLater(this);
return d->responseData.read();
}
+void QHttpNetworkReply::setDownstreamLimited(bool dsl)
+{
+ Q_D(QHttpNetworkReply);
+ d->downstreamLimited = dsl;
+ d->connection->d_func()->readMoreLater(this);
+}
+
bool QHttpNetworkReply::isFinished() const
{
return d_func()->state == QHttpNetworkReplyPrivate::AllDoneState;
@@ -201,7 +211,7 @@ QHttpNetworkReplyPrivate::QHttpNetworkReplyPrivate(const QUrl &newUrl)
forceConnectionCloseEnabled(false),
currentChunkSize(0), currentChunkRead(0), connection(0), initInflate(false),
autoDecompress(false), responseData(), requestIsPrepared(false)
- ,pipeliningUsed(false)
+ ,pipeliningUsed(false), downstreamLimited(false)
{
}