/* */ #include "FillRequestGroupCommand.h" #include "DownloadEngine.h" #include "RequestGroupMan.h" #include "RequestGroup.h" #include "RecoverableException.h" #include "message.h" #include "Logger.h" namespace aria2 { FillRequestGroupCommand::FillRequestGroupCommand(int32_t cuid, DownloadEngine* e, time_t interval): Command(cuid), _e(e), _interval(interval) { setStatusRealtime(); } FillRequestGroupCommand::~FillRequestGroupCommand() {} bool FillRequestGroupCommand::execute() { if(_e->isHaltRequested()) { return true; } try { _e->_requestGroupMan->fillRequestGroupFromReserver(_e); } catch(RecoverableException* ex) { logger->error(EX_EXCEPTION_CAUGHT, ex); delete ex; } if(_e->_requestGroupMan->downloadFinished()) { return true; } _e->addRoutineCommand(this); return false; } } // namespace aria2