2007-01-20 zzz

* i2psnark: More choking rotation tweaks
    * Improve performance by not reading in the whole
      piece from disk for each request. A huge memory savings
      on 1MB torrents with many peers.
This commit is contained in:
zzz
2007-01-21 00:35:09 +00:00
committed by zzz
parent 8ca085bceb
commit 8a87df605b
7 changed files with 47 additions and 20 deletions

View File

@@ -127,6 +127,20 @@ class PeerCheckerTask extends TimerTask
coordinator.uploaders--;
removedCount++;
// Put it at the back of the list
it.remove();
removed.add(peer);
}
else if (!peer.isInteresting() && !coordinator.completed())
{
// If they aren't interesting make someone else a downloader
if (Snark.debug >= Snark.DEBUG)
Snark.debug("Choke uninteresting peer: " + peer, Snark.DEBUG);
peer.setChoking(true);
uploaders--;
coordinator.uploaders--;
removedCount++;
// Put it at the back of the list
it.remove();
removed.add(peer);