2009-07-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Added assertion fileEntries.size() == 1 if BitTorrent is not
	involved.
	* src/RequestGroup.cc
pull/1/head
Tatsuhiro Tsujikawa 2009-07-11 15:50:21 +00:00
parent 67a23f615a
commit eafa19748e
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2009-07-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added assertion fileEntries.size() == 1 if BitTorrent is not
involved.
* src/RequestGroup.cc
2009-07-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Eliminated duplicated filterBitfield initialization code.

View File

@ -346,6 +346,12 @@ void RequestGroup::createInitialCommand(std::deque<Command*>& commands,
}
}
#endif // ENABLE_BITTORRENT
// TODO Currently, BitTorrent+WEB-Seeding is only way to download
// multiple files in one RequestGroup. In this context, we don't
// have BitTorrent, so add assertion here. This situation will be
// changed if Metalink spec is formalized to support multi-file
// torrent.
assert(_downloadContext->getFileEntries().size() == 1);
// TODO I assume here when totallength is set to DownloadContext and it is
// not 0, then filepath is also set DownloadContext correctly....
if(_option->getAsBool(PREF_DRY_RUN) ||
@ -357,8 +363,6 @@ void RequestGroup::createInitialCommand(std::deque<Command*>& commands,
(StringFormat(EX_DUPLICATE_FILE_DOWNLOAD,
_downloadContext->getBasePath().c_str()).str());
}
// TODO1.5 Renaming filename doesn't take into account of
// multi-file download.
adjustFilename
(SharedHandle<BtProgressInfoFile>(new DefaultBtProgressInfoFile
(_downloadContext,