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