mirror of https://github.com/aria2/aria2
2009-05-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Supported segmented downloading with chunked transfer encoding and content-length. * src/DownloadCommand.cc * src/HttpResponseCommand.ccpull/1/head
parent
7893340cb3
commit
3c877a9df4
|
@ -1,3 +1,10 @@
|
|||
2009-05-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Supported segmented downloading with chunked transfer encoding and
|
||||
content-length.
|
||||
* src/DownloadCommand.cc
|
||||
* src/HttpResponseCommand.cc
|
||||
|
||||
2009-05-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Bump up version number to 1.3.3
|
||||
|
|
|
@ -165,6 +165,7 @@ bool DownloadCommand::executeInternal() {
|
|||
_requestGroup->getSegmentMan()->updateDownloadSpeedFor(peerStat);
|
||||
|
||||
bool segmentComplete = false;
|
||||
// Note that GrowSegment::complete() always returns false.
|
||||
if(_transferEncodingDecoder.isNull() && _contentEncodingDecoder.isNull()) {
|
||||
if(segment->complete()) {
|
||||
segmentComplete = true;
|
||||
|
@ -172,6 +173,8 @@ bool DownloadCommand::executeInternal() {
|
|||
!socket->wantRead() && !socket->wantWrite()) {
|
||||
segmentComplete = true;
|
||||
}
|
||||
} else if(!_transferEncodingDecoder.isNull() && segment->complete()) {
|
||||
segmentComplete = true;
|
||||
} else if((_transferEncodingDecoder.isNull() ||
|
||||
_transferEncodingDecoder->finished()) &&
|
||||
(_contentEncodingDecoder.isNull() ||
|
||||
|
|
|
@ -146,9 +146,10 @@ bool HttpResponseCommand::executeInternal()
|
|||
// update last modified time
|
||||
updateLastModifiedTime(httpResponse->getLastModifiedTime());
|
||||
|
||||
if(totalLength == 0 || httpResponse->isTransferEncodingSpecified() ||
|
||||
shouldInflateContentEncoding(httpResponse)) {
|
||||
// we ignore content-length when transfer-encoding is set
|
||||
// If both transfer-encoding and total length is specified, we
|
||||
// assume we can do segmented downloading
|
||||
if(totalLength == 0 || shouldInflateContentEncoding(httpResponse)) {
|
||||
// we ignore content-length when inflate is required
|
||||
dctx->setTotalLength(0);
|
||||
if(req->getMethod() == Request::METHOD_GET &&
|
||||
(totalLength != 0 ||
|
||||
|
@ -177,7 +178,8 @@ bool HttpResponseCommand::executeInternal()
|
|||
getTransferEncodingDecoder(httpResponse),
|
||||
getContentEncodingDecoder(httpResponse)));
|
||||
} else {
|
||||
e->commands.push_back(createHttpDownloadCommand(httpResponse));
|
||||
e->commands.push_back(createHttpDownloadCommand(httpResponse,
|
||||
getTransferEncodingDecoder(httpResponse)));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue