From d13c416a945c996316b314999d73511ea3b1ab8a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 13 Apr 2008 01:25:36 +0000 Subject: 2008-04-13 Tatsuhiro Tsujikawa Rewritten choking algorithm. * src/PeerChokeCommand.{cc, h} * src/BtInterestedMessage.cc * src/PeerSessionResource.{cc, h} * src/DefaultPeerStorage.{cc, h} * src/BtNotInterestedMessage.cc * src/DefaultBtMessageDispatcher.{cc, h} * src/BtMessageDispatcher.h * src/Peer.{cc, h} * src/BtLeecherStateChoke.{cc, h} * src/BtSetup.cc * src/BtSeederStateChoke.{cc, h} * src/PeerStorage.h * test/MockPeerStorage.h * test/MockBtMessageDispatcher.h --- src/BtNotInterestedMessage.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/BtNotInterestedMessage.cc') diff --git a/src/BtNotInterestedMessage.cc b/src/BtNotInterestedMessage.cc index 1c79d1de..c72556d4 100644 --- a/src/BtNotInterestedMessage.cc +++ b/src/BtNotInterestedMessage.cc @@ -37,6 +37,9 @@ #include "DlAbortEx.h" #include "message.h" #include "Peer.h" +#include "BtRegistry.h" +#include "BtContext.h" +#include "PeerStorage.h" namespace aria2 { @@ -54,6 +57,9 @@ BtNotInterestedMessageHandle BtNotInterestedMessage::create(const unsigned char* void BtNotInterestedMessage::doReceivedAction() { peer->peerInterested(false); + if(!peer->amChoking()) { + PEER_STORAGE(btContext)->executeChoke(); + } } bool BtNotInterestedMessage::sendPredicate() const { -- cgit