/* */ #include "DHTTokenUpdateCommand.h" #include "DHTTokenTracker.h" #include "DownloadEngine.h" #include "RequestGroupMan.h" #include "RecoverableException.h" #include "message.h" #include "Logger.h" #include "FileEntry.h" #include "ServerStatMan.h" #include "FileAllocationEntry.h" #include "CheckIntegrityEntry.h" namespace aria2 { DHTTokenUpdateCommand::DHTTokenUpdateCommand(cuid_t cuid, DownloadEngine* e, time_t interval): TimeBasedCommand(cuid, e, interval) {} DHTTokenUpdateCommand::~DHTTokenUpdateCommand() {} void DHTTokenUpdateCommand::preProcess() { if(getDownloadEngine()->getRequestGroupMan()->downloadFinished() || getDownloadEngine()->isHaltRequested()) { enableExit(); } } void DHTTokenUpdateCommand::process() { try { _tokenTracker->updateTokenSecret(); } catch(RecoverableException& e) { getLogger()->error(EX_EXCEPTION_CAUGHT, e); } } void DHTTokenUpdateCommand::setTokenTracker(const SharedHandle& tokenTracker) { _tokenTracker = tokenTracker; } } // namespace aria2