diff options
Diffstat (limited to 'src/BtNotInterestedMessage.cc')
| -rw-r--r-- | src/BtNotInterestedMessage.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/BtNotInterestedMessage.cc b/src/BtNotInterestedMessage.cc index c79a27de..45c39de1 100644 --- a/src/BtNotInterestedMessage.cc +++ b/src/BtNotInterestedMessage.cc @@ -42,25 +42,25 @@ namespace aria2 { const char BtNotInterestedMessage::NAME[] = "not interested"; BtNotInterestedMessage::BtNotInterestedMessage() - : ZeroBtMessage(ID, NAME), - peerStorage_(nullptr) -{} + : ZeroBtMessage(ID, NAME), peerStorage_(nullptr) +{ +} BtNotInterestedMessage::~BtNotInterestedMessage() {} -std::unique_ptr<BtNotInterestedMessage> BtNotInterestedMessage::create -(const unsigned char* data, size_t dataLength) +std::unique_ptr<BtNotInterestedMessage> +BtNotInterestedMessage::create(const unsigned char* data, size_t dataLength) { return ZeroBtMessage::create<BtNotInterestedMessage>(data, dataLength); } void BtNotInterestedMessage::doReceivedAction() { - if(isMetadataGetMode()) { + if (isMetadataGetMode()) { return; } getPeer()->peerInterested(false); - if(!getPeer()->amChoking()) { + if (!getPeer()->amChoking()) { peerStorage_->executeChoke(); } } @@ -72,11 +72,10 @@ bool BtNotInterestedMessage::sendPredicate() const namespace { struct ThisProgressUpdate : public ProgressUpdate { - ThisProgressUpdate(std::shared_ptr<Peer> peer) - : peer(std::move(peer)) {} + ThisProgressUpdate(std::shared_ptr<Peer> peer) : peer(std::move(peer)) {} virtual void update(size_t length, bool complete) CXX11_OVERRIDE { - if(complete) { + if (complete) { peer->amInterested(false); } } |
