2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Use createRequestGroupForBitTorrent()
	* src/BtPostDownloadHandler.cc
pull/1/head
Tatsuhiro Tsujikawa 2009-11-28 09:10:20 +00:00
parent 12145ef4c6
commit 591e9fa843
2 changed files with 9 additions and 12 deletions

View File

@ -1,3 +1,8 @@
2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use createRequestGroupForBitTorrent()
* src/BtPostDownloadHandler.cc
2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added remove().

View File

@ -45,7 +45,7 @@
#include "ContentTypeRequestGroupCriteria.h"
#include "Exception.h"
#include "DownloadContext.h"
#include "bittorrent_helper.h"
#include "download_helper.h"
namespace aria2 {
@ -66,11 +66,8 @@ void BtPostDownloadHandler::getNextRequestGroups
(std::deque<SharedHandle<RequestGroup> >& groups,
RequestGroup* requestGroup)
{
const SharedHandle<Option>& op = requestGroup->getOption();
_logger->debug("Generating RequestGroups for Torrent file %s",
requestGroup->getFirstFilePath().c_str());
RequestGroupHandle rg(new RequestGroup(op));
std::string content;
try {
requestGroup->getPieceStorage()->getDiskAdaptor()->openExistingFile();
@ -80,14 +77,9 @@ void BtPostDownloadHandler::getNextRequestGroups
requestGroup->getPieceStorage()->getDiskAdaptor()->closeFile();
throw;
}
SharedHandle<DownloadContext> context(new DownloadContext());
context->setDir(requestGroup->getDownloadContext()->getDir());
bittorrent::loadFromMemory
(content, context, File(requestGroup->getFirstFilePath()).getBasename());
rg->setDownloadContext(context);
context->setOwnerRequestGroup(rg.get());
groups.push_back(rg);
createRequestGroupForBitTorrent(groups, requestGroup->getOption(),
std::deque<std::string>(),
content);
}
} // namespace aria2