mirror of https://github.com/aria2/aria2
2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use createRequestGroupForBitTorrent() * src/BtPostDownloadHandler.ccpull/1/head
parent
12145ef4c6
commit
591e9fa843
|
@ -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().
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue