equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtNetwork module of the Qt Toolkit. |
7 ** This file is part of the QtNetwork module of the Qt Toolkit. |
8 ** |
8 ** |
177 } |
177 } |
178 |
178 |
179 QByteArray QHttpNetworkReply::readAny() |
179 QByteArray QHttpNetworkReply::readAny() |
180 { |
180 { |
181 Q_D(QHttpNetworkReply); |
181 Q_D(QHttpNetworkReply); |
|
182 // we'll take the last buffer, so schedule another read from http |
|
183 if (d->downstreamLimited && d->responseData.bufferCount() == 1) |
|
184 d->connection->d_func()->readMoreLater(this); |
182 return d->responseData.read(); |
185 return d->responseData.read(); |
|
186 } |
|
187 |
|
188 void QHttpNetworkReply::setDownstreamLimited(bool dsl) |
|
189 { |
|
190 Q_D(QHttpNetworkReply); |
|
191 d->downstreamLimited = dsl; |
|
192 d->connection->d_func()->readMoreLater(this); |
183 } |
193 } |
184 |
194 |
185 bool QHttpNetworkReply::isFinished() const |
195 bool QHttpNetworkReply::isFinished() const |
186 { |
196 { |
187 return d_func()->state == QHttpNetworkReplyPrivate::AllDoneState; |
197 return d_func()->state == QHttpNetworkReplyPrivate::AllDoneState; |
199 chunkedTransferEncoding(false), |
209 chunkedTransferEncoding(false), |
200 connectionCloseEnabled(true), |
210 connectionCloseEnabled(true), |
201 forceConnectionCloseEnabled(false), |
211 forceConnectionCloseEnabled(false), |
202 currentChunkSize(0), currentChunkRead(0), connection(0), initInflate(false), |
212 currentChunkSize(0), currentChunkRead(0), connection(0), initInflate(false), |
203 autoDecompress(false), responseData(), requestIsPrepared(false) |
213 autoDecompress(false), responseData(), requestIsPrepared(false) |
204 ,pipeliningUsed(false) |
214 ,pipeliningUsed(false), downstreamLimited(false) |
205 { |
215 { |
206 } |
216 } |
207 |
217 |
208 QHttpNetworkReplyPrivate::~QHttpNetworkReplyPrivate() |
218 QHttpNetworkReplyPrivate::~QHttpNetworkReplyPrivate() |
209 { |
219 { |