i2psnark: Initial support for ut_comment, no UI yet

This commit is contained in:
zzz
2017-05-05 12:08:49 +00:00
parent f3d931d090
commit cd76457128
16 changed files with 1047 additions and 11 deletions

View File

@@ -81,7 +81,9 @@ class PeerCheckerTask implements Runnable
" interested: " + coordinator.getInterestedUploaders() +
" limit: " + uploadLimit + " overBW? " + overBWLimit);
DHT dht = _util.getDHT();
int i = 0;
for (Peer peer : peerList) {
i++;
// Remove dying peers
if (!peer.isConnected())
@@ -226,9 +228,12 @@ class PeerCheckerTask implements Runnable
}
}
peer.retransmitRequests();
// send PEX
if ((_runCount % 17) == 0 && !peer.isCompleted())
// send PEX, about every 12 minutes
if (((_runCount + i) % 17) == 0 && !peer.isCompleted())
coordinator.sendPeers(peer);
// send Comment Request, about every 30 minutes
if ( /* comments enabled && */ ((_runCount + i) % 47) == 0)
coordinator.sendCommentReq(peer);
// cheap failsafe for seeds connected to seeds, stop pinging and hopefully
// the inactive checker (above) will eventually disconnect it
if (coordinator.getNeededLength() > 0 || !peer.isCompleted())
@@ -238,7 +243,7 @@ class PeerCheckerTask implements Runnable
dht.announce(coordinator.getInfoHash(), peer.getPeerID().getDestHash(),
peer.isCompleted());
}
}
} // for peer
// Resync actual uploaders value
// (can shift a bit by disconnecting peers)