/* */ #include "StreamCheckIntegrityEntry.h" #include "RequestGroup.h" #include "DownloadEngine.h" #include "StreamFileAllocationEntry.h" #include "InitiateConnectionCommandFactory.h" #include "CUIDCounter.h" #include "PieceStorage.h" #include "FileAllocationMan.h" #include "DiskAdaptor.h" StreamCheckIntegrityEntry::StreamCheckIntegrityEntry(const RequestHandle& currentRequest, RequestGroup* requestGroup, Command* nextCommand): CheckIntegrityEntry(requestGroup, nextCommand), _currentRequest(currentRequest) {} StreamCheckIntegrityEntry::~StreamCheckIntegrityEntry() {} Commands StreamCheckIntegrityEntry::onDownloadIncomplete(DownloadEngine* e) { Commands commands; FileAllocationEntryHandle entry = new StreamFileAllocationEntry(_currentRequest, _requestGroup, popNextCommand()); if(_requestGroup->needsFileAllocation()) { e->_fileAllocationMan->pushFileAllocationEntry(entry); } else { commands = entry->prepareForNextAction(e); } return commands; } Commands StreamCheckIntegrityEntry::onDownloadFinished(DownloadEngine* e) { return Commands(); }