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