i2psnark: Don't count unchoked but uninterested peers as uploaders

when calculating global uploader limit, to allow more upload slots,
especially when some torrents are stalled.
Convert some shared fields to atomics for concurrency.
This commit is contained in:
zzz committed 2016-10-25 22:30:55 +00:00
1 parent 8a8452290c
commit d2569fa446
5 files changed
+156 -41

No files matched your search

@@ -1337,7 +1337,7 @@ public class Snark
int totalUploaders = 0;
for (PeerCoordinator c : _peerCoordinatorSet) {
if (!c.halted())
totalUploaders += c.uploaders;
totalUploaders += c.getInterestedUploaders();
}
int limit = _util.getMaxUploaders();
if (_log.shouldLog(Log.DEBUG))