2007-03-08 zzz

* i2psnark changes to improve upload performance:
    *  Implement total uploader limit (10)
    *  Don't timeout non-piece messages out
    *  Change chunk size to 32K (was 64K)
    *  Change request limit to 64K (was 256K)
    * i2psnark: Disconnect from seeds when complete
This commit is contained in:
zzz
2007-03-08 18:55:17 +00:00
committed by zzz
parent 0aa0cd330f
commit 8e2849b7e5
8 changed files with 109 additions and 21 deletions

View File

@ -507,6 +507,21 @@ public class Peer implements Comparable
return count;
}
/**
* Return if a peer is a seeder
* Quite inefficient - a byte lookup table or counter in Bitfield would be much better
*/
public boolean isCompleted()
{
PeerState s = state;
if (s == null || s.bitfield == null)
return false;
for (int i = 0; i < s.bitfield.size(); i++)
if (!s.bitfield.get(i))
return false;
return true;
}
/**
* Push the total uploaded/downloaded onto a RATE_DEPTH deep stack
*/