forked from I2P_Developers/i2p.i2p
merge of 'a5d2fae48cf001c84ff5cea42466e1f3ed7d5f0a'
and 'c52409bf5d7b422c23a62eecfa50b98d7c74f8df'
This commit is contained in:
@ -1,3 +1,8 @@
|
||||
2012-01-16 hottuna
|
||||
* Router:
|
||||
- Don't throttle tunnel creation if using a higher
|
||||
- than default router.maxParticipatingTunnels setting.
|
||||
|
||||
2012-01-16 zzz
|
||||
* Build: Put Implementation-Version in manifests
|
||||
* NetDB: Hopefully fix rare NPE (ticket #589)
|
||||
|
@ -178,10 +178,13 @@ class RouterThrottleImpl implements RouterThrottle {
|
||||
return TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int numTunnels = _context.tunnelManager().getParticipatingCount();
|
||||
int maxTunnels = _context.getProperty(PROP_MAX_TUNNELS, DEFAULT_MAX_TUNNELS);
|
||||
|
||||
if (numTunnels > getMinThrottleTunnels()) {
|
||||
// Throttle tunnels if min. throttle level is exceeded and default max participating tunnels (or fewer) is used.
|
||||
if ((numTunnels > getMinThrottleTunnels()) && (DEFAULT_MAX_TUNNELS <= maxTunnels)) {
|
||||
double tunnelGrowthFactor = getTunnelGrowthFactor();
|
||||
Rate avgTunnels = _context.statManager().getRate("tunnel.participatingTunnels").getRate(10*60*1000);
|
||||
if (avgTunnels != null) {
|
||||
@ -260,11 +263,10 @@ class RouterThrottleImpl implements RouterThrottle {
|
||||
}
|
||||
}
|
||||
|
||||
int max = _context.getProperty(PROP_MAX_TUNNELS, DEFAULT_MAX_TUNNELS);
|
||||
if (numTunnels >= max) {
|
||||
if (numTunnels >= maxTunnels) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Refusing tunnel request since we are already participating in "
|
||||
+ numTunnels + " (our max is " + max + ")");
|
||||
+ numTunnels + " (our max is " + maxTunnels + ")");
|
||||
_context.statManager().addRateData("router.throttleTunnelMaxExceeded", numTunnels, 0);
|
||||
setTunnelStatus(_x("Rejecting tunnels: Limit reached"));
|
||||
return TunnelHistory.TUNNEL_REJECT_BANDWIDTH;
|
||||
|
Reference in New Issue
Block a user