/* */ #include "PeerChokeCommand.h" #include "DownloadEngine.h" #include "BtContext.h" #include "BtRuntime.h" #include "PeerStorage.h" namespace aria2 { PeerChokeCommand::PeerChokeCommand(int32_t cuid, DownloadEngine* e, const BtContextHandle& btContext): Command(cuid), BtContextAwareCommand(btContext), e(e) {} PeerChokeCommand::~PeerChokeCommand() {} bool PeerChokeCommand::execute() { if(btRuntime->isHalt()) { return true; } if(peerStorage->chokeRoundIntervalElapsed()) { peerStorage->executeChoke(); } e->commands.push_back(this); return false; } } // namespace aria2