mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-23 13:03:04 +00:00
I2PSnark: Use new BW Limits message, remove router.jar dependencies
This commit is contained in:
1 parent
5eda7c30fc
commit
5414d41de4
8 files changed
+72
-20
No files matched your search
@@ -280,15 +280,15 @@ class ClientMessageEventListener implements I2CPMessageReader.I2CPMessageEventLi
|
||||
}
|
||||
|
||||
/**
|
||||
* Divide router limit by 2 for overhead.
|
||||
* Divide router limit by 1.75 for overhead.
|
||||
* This could someday give a different answer to each client.
|
||||
* But it's not enforced anywhere.
|
||||
*/
|
||||
private void handleGetBWLimits(I2CPMessageReader reader, GetBandwidthLimitsMessage message) {
|
||||
if (_log.shouldLog(Log.INFO))
|
||||
_log.info("Got BW Limits request");
|
||||
int in = _context.bandwidthLimiter().getInboundKBytesPerSecond() / 2;
|
||||
int out = _context.bandwidthLimiter().getOutboundKBytesPerSecond() / 2;
|
||||
int in = _context.bandwidthLimiter().getInboundKBytesPerSecond() * 4 / 7;
|
||||
int out = _context.bandwidthLimiter().getOutboundKBytesPerSecond() * 4 / 7;
|
||||
BandwidthLimitsMessage msg = new BandwidthLimitsMessage(in, out);
|
||||
try {
|
||||
_runner.doSend(msg);
|
||||
|
||||
Reference in new issue
Block a user