/* */ #include "BtChokeMessage.h" #include "Peer.h" #include "BtMessageDispatcher.h" #include "BtRequestFactory.h" namespace aria2 { const std::string BtChokeMessage::NAME("choke"); SharedHandle BtChokeMessage::create (const unsigned char* data, size_t dataLength) { return ZeroBtMessage::create(data, dataLength); } void BtChokeMessage::doReceivedAction() { peer->peerChoking(true); dispatcher->doChokedAction(); requestFactory->doChokedAction(); } bool BtChokeMessage::sendPredicate() const { return !peer->amChoking(); } void BtChokeMessage::onSendComplete() { peer->amChoking(true); dispatcher->doChokingAction(); } } // namespace aria2