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> 2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added remove(). Added remove().

View File

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