2007-11-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Fixed: compilation fails without c-ares/ares
	* src/DownloadEngine.cc (addCommand): Moved outside #ifdef

	Generate http/ftp commands only when download is incomplete.
	* src/BtFileAllocationEntry.cc (prepareForNextAction)
pull/1/head
Tatsuhiro Tsujikawa 2007-11-24 11:32:22 +00:00
parent 6d544c5827
commit 355a91cdec
3 changed files with 17 additions and 9 deletions

View File

@ -1,3 +1,11 @@
2007-11-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed: compilation fails without c-ares/ares
* src/DownloadEngine.cc (addCommand): Moved outside #ifdef
Generate http/ftp commands only when download is incomplete.
* src/BtFileAllocationEntry.cc (prepareForNextAction)
2007-11-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Corrected typo. Examples are removed since they are available in man

View File

@ -46,8 +46,9 @@ BtFileAllocationEntry::~BtFileAllocationEntry() {}
Commands BtFileAllocationEntry::prepareForNextAction(DownloadEngine* e)
{
Commands commands = BtSetup().setup(_requestGroup, e, e->option);
// TODO don't integerate http/ftp when multi-file torrent
Commands streamCommands = _requestGroup->createNextCommandWithAdj(e, 0);
copy(streamCommands.begin(), streamCommands.end(), back_inserter(commands));
if(!_requestGroup->downloadFinished()) {
Commands streamCommands = _requestGroup->createNextCommandWithAdj(e, 0);
copy(streamCommands.begin(), streamCommands.end(), back_inserter(commands));
}
return commands;
}

View File

@ -292,6 +292,11 @@ void DownloadEngine::setStatCalc(const StatCalcHandle& statCalc)
_statCalc = statCalc;
}
void DownloadEngine::addCommand(const Commands& commands)
{
this->commands.insert(this->commands.end(), commands.begin(), commands.end());
}
#ifdef ENABLE_ASYNC_DNS
bool DownloadEngine::addNameResolverCheck(const NameResolverHandle& resolver,
Command* command) {
@ -322,10 +327,4 @@ bool DownloadEngine::deleteNameResolverCheck(const NameResolverHandle& resolver,
return true;
}
}
void DownloadEngine::addCommand(const Commands& commands)
{
this->commands.insert(this->commands.end(), commands.begin(), commands.end());
}
#endif // ENABLE_ASYNC_DNS