2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Execute choking algorithm when unchoked and interested peer is
	disconected.
	* src/DefaultPeerStorage.cc
pull/1/head
Tatsuhiro Tsujikawa 2008-11-03 12:07:52 +00:00
parent 0b7033abb7
commit 223621b5bc
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Execute choking algorithm when unchoked and interested peer is
disconected.
* src/DefaultPeerStorage.cc
2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added testcase for BtNotInterestedMessage from unchoked peer.

View File

@ -233,6 +233,11 @@ void DefaultPeerStorage::onReturningPeer(const SharedHandle<Peer>& peer)
if(peer->isActive()) {
removedPeerSessionDownloadLength += peer->getSessionDownloadLength();
removedPeerSessionUploadLength += peer->getSessionUploadLength();
// Execute choking algorithm if unchoked and interested peer is
// disconnected.
if(!peer->amChoking() && peer->peerInterested()) {
executeChoke();
}
}
}