forked from I2P_Developers/i2p.i2p
* i2psnark:
- Close connection immediately if bad protocol,
this makes blacklist work better too
- Stop adding peers when we hit the limit
- Lower limit for outbound connections so we give
new peers a better chance in large swarms
This commit is contained in:
@@ -298,7 +298,7 @@ public class TrackerClient extends I2PAppThread
|
||||
List<Peer> ordered = new ArrayList(peers);
|
||||
Collections.shuffle(ordered, r);
|
||||
Iterator<Peer> it = ordered.iterator();
|
||||
while ((!stop) && it.hasNext()) {
|
||||
while ((!stop) && it.hasNext() && coordinator.needOutboundPeers()) {
|
||||
Peer cur = it.next();
|
||||
// FIXME if id == us || dest == us continue;
|
||||
// only delay if we actually make an attempt to add peer
|
||||
@@ -351,7 +351,7 @@ public class TrackerClient extends I2PAppThread
|
||||
}
|
||||
Collections.shuffle(peers, r);
|
||||
Iterator<Peer> it = peers.iterator();
|
||||
while ((!stop) && it.hasNext()) {
|
||||
while ((!stop) && it.hasNext() && coordinator.needOutboundPeers()) {
|
||||
Peer cur = it.next();
|
||||
if (coordinator.addPeer(cur) && it.hasNext()) {
|
||||
int delay = (DELAY_MUL * r.nextInt(10)) + DELAY_MIN;
|
||||
@@ -387,7 +387,7 @@ public class TrackerClient extends I2PAppThread
|
||||
}
|
||||
Collections.shuffle(peers, r);
|
||||
Iterator<Peer> it = peers.iterator();
|
||||
while ((!stop) && it.hasNext()) {
|
||||
while ((!stop) && it.hasNext() && coordinator.needOutboundPeers()) {
|
||||
Peer cur = it.next();
|
||||
if (coordinator.addPeer(cur) && it.hasNext()) {
|
||||
int delay = (DELAY_MUL * r.nextInt(10)) + DELAY_MIN;
|
||||
|
||||
Reference in New Issue
Block a user