/* */ #include "BtNotInterestedMessage.h" #include "Peer.h" #include "PeerStorage.h" namespace aria2 { const std::string BtNotInterestedMessage::NAME("not interested"); SharedHandle BtNotInterestedMessage::create (const unsigned char* data, size_t dataLength) { return ZeroBtMessage::create(data, dataLength); } void BtNotInterestedMessage::doReceivedAction() { peer->peerInterested(false); if(!peer->amChoking()) { _peerStorage->executeChoke(); } } bool BtNotInterestedMessage::sendPredicate() const { return peer->amInterested(); } void BtNotInterestedMessage::onSendComplete() { peer->amInterested(false); } void BtNotInterestedMessage::setPeerStorage (const SharedHandle& peerStorage) { _peerStorage = peerStorage; } } // namespace aria2