/* */ #include "BtNotInterestedMessage.h" #include "Peer.h" #include "PeerStorage.h" #include "SocketBuffer.h" namespace aria2 { const char BtNotInterestedMessage::NAME[] = "not interested"; BtNotInterestedMessage::BtNotInterestedMessage() : ZeroBtMessage(ID, NAME), peerStorage_(nullptr) { } BtNotInterestedMessage::~BtNotInterestedMessage() = default; std::unique_ptr 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(); } } void BtNotInterestedMessage::setPeerStorage(PeerStorage* peerStorage) { peerStorage_ = peerStorage; } } // namespace aria2