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