/* */ #include "PeerChokeCommand.h" #include "DownloadEngine.h" #include "BtRuntime.h" #include "PeerStorage.h" #include "RequestGroupMan.h" #include "FileAllocationEntry.h" #include "CheckIntegrityEntry.h" #include "ServerStatMan.h" #include "FileEntry.h" namespace aria2 { PeerChokeCommand::PeerChokeCommand(cuid_t cuid, DownloadEngine* e): Command(cuid), _e(e) {} PeerChokeCommand::~PeerChokeCommand() {} bool PeerChokeCommand::execute() { if(_btRuntime->isHalt()) { return true; } if(_peerStorage->chokeRoundIntervalElapsed()) { _peerStorage->executeChoke(); } _e->addCommand(this); return false; } void PeerChokeCommand::setBtRuntime (const SharedHandle& btRuntime) { _btRuntime = btRuntime; } void PeerChokeCommand::setPeerStorage (const SharedHandle& peerStorage) { _peerStorage = peerStorage; } } // namespace aria2