2007-12-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Fixed the bug that causes aria2 not to finish download. 
BUG#1855875.
	I could reproduce this bug in following procedure:
	1. Stop the download at the very beginning(1% or 100KB 
downloaded).
	2. Restart aria2.
	3. You see the download stopped around 99%.
	* src/HttpResponseCommand.cc (handleDefaultEncoding)
	* src/StreamFileAllocationEntry.cc: Removed the timeout 
handling.
	If timeout is reached, then _nextCommand is unused and it may 
contains
	segments and they won't be canceled. Actually, timeout is not 
needed
	here because if the server dropped connection, then retry is 
made.
pull/1/head
Tatsuhiro Tsujikawa 2007-12-22 05:45:59 +00:00
parent 286f34cb3f
commit ccd4a35096
3 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,16 @@
2007-12-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that causes aria2 not to finish download. BUG#1855875.
I could reproduce this bug in following procedure:
1. Stop the download at the very beginning(1% or 100KB downloaded).
2. Restart aria2.
3. You see the download stopped around 99%.
* src/HttpResponseCommand.cc (handleDefaultEncoding)
* src/StreamFileAllocationEntry.cc: Removed the timeout handling.
If timeout is reached, then _nextCommand is unused and it may contains
segments and they won't be canceled. Actually, timeout is not needed
here because if the server dropped connection, then retry is made.
2007-12-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added uTorrent compatible Peer Exchange.

View File

@ -139,6 +139,8 @@ bool HttpResponseCommand::handleDefaultEncoding(const HttpResponseHandle& httpRe
SegmentHandle segment = _requestGroup->getSegmentMan()->getSegment(cuid, 0);
if(!segment.isNull() && segment->getPositionToWrite() == 0) {
command = createHttpDownloadCommand(httpResponse);
} else {
_requestGroup->getSegmentMan()->cancelSegment(cuid);
}
prepareForNextAction(command);
e->noWait = true;

View File

@ -54,8 +54,7 @@ StreamFileAllocationEntry::~StreamFileAllocationEntry() {}
Commands StreamFileAllocationEntry::prepareForNextAction(DownloadEngine* e)
{
Commands commands;
if(_timer.difference() <= e->option->getAsInt(PREF_DIRECT_DOWNLOAD_TIMEOUT) &&
_nextCommand) {
if(_nextCommand) {
commands.push_back(popNextCommand());
// try remaining uris
Commands streamCommands = _requestGroup->createNextCommandWithAdj(e, -1);