/* */ #include "BtCheckIntegrityEntry.h" #include "BtFileAllocationEntry.h" #include "RequestGroup.h" #include "PieceStorage.h" #include "DownloadEngine.h" #include "FileAllocationMan.h" #include "DiskAdaptor.h" namespace aria2 { BtCheckIntegrityEntry::BtCheckIntegrityEntry(RequestGroup* requestGroup): PieceHashCheckIntegrityEntry(requestGroup, 0) {} BtCheckIntegrityEntry::~BtCheckIntegrityEntry() {} void BtCheckIntegrityEntry::onDownloadIncomplete(std::deque& commands, DownloadEngine* e) { FileAllocationEntryHandle entry(new BtFileAllocationEntry(_requestGroup)); if(_requestGroup->needsFileAllocation()) { e->_fileAllocationMan->pushFileAllocationEntry(entry); } else { entry->prepareForNextAction(commands, e); } } void BtCheckIntegrityEntry::onDownloadFinished(std::deque& commands, DownloadEngine* e) { _requestGroup->getPieceStorage()->getDiskAdaptor()->onDownloadComplete(); // TODO Currently,when all the checksums // are valid, then aira2 goes to seeding mode. Sometimes it is better // to exit rather than doing seeding. So, it would be good to toggle this // behavior. onDownloadIncomplete(commands, e); } } // namespace aria2