/* */ #include "PeerChokeCommand.h" #include "DownloadEngine.h" #include "BtRuntime.h" #include "PeerStorage.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