Changeset b1878d6


Ignore:
Timestamp:
Jan 16, 2012 8:09:34 PM (9 years ago)
Author:
dev <dev@…>
Branches:
master
Children:
38dba5d1
Parents:
2253ad1
Message:

Don't throttle tunnel creation if using a higher than default router.maxParticipatingTunnels setting.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • history.txt

    r2253ad1 rb1878d6  
     12012-01-16 hottuna
     2  * Router:
     3    - Don't throttle tunnel creation if using a higher
     4    - than default router.maxParticipatingTunnels setting.
     5
    162012-01-14 zzz
    27  * i2ptunnel: Partial fix for dest formatting (ticket #581)
  • router/java/src/net/i2p/router/RouterThrottleImpl.java

    r2253ad1 rb1878d6  
    179179            }
    180180        }
     181
    181182       
    182183        int numTunnels = _context.tunnelManager().getParticipatingCount();
    183 
    184         if (numTunnels > getMinThrottleTunnels()) {
     184        int maxTunnels = _context.getProperty(PROP_MAX_TUNNELS, DEFAULT_MAX_TUNNELS);
     185
     186        // Throttle tunnels if min. throttle level is exceeded and default max participating tunnels (or fewer) is used.
     187        if ((numTunnels > getMinThrottleTunnels()) && (DEFAULT_MAX_TUNNELS <= maxTunnels)) {
    185188            double tunnelGrowthFactor = getTunnelGrowthFactor();
    186189            Rate avgTunnels = _context.statManager().getRate("tunnel.participatingTunnels").getRate(10*60*1000);
     
    261264        }
    262265       
    263         int max = _context.getProperty(PROP_MAX_TUNNELS, DEFAULT_MAX_TUNNELS);
    264         if (numTunnels >= max) {
     266        if (numTunnels >= maxTunnels) {
    265267            if (_log.shouldLog(Log.WARN))
    266268                _log.warn("Refusing tunnel request since we are already participating in "
    267                           + numTunnels + " (our max is " + max + ")");
     269                          + numTunnels + " (our max is " + maxTunnels + ")");
    268270            _context.statManager().addRateData("router.throttleTunnelMaxExceeded", numTunnels, 0);
    269271            setTunnelStatus(_x("Rejecting tunnels: Limit reached"));
Note: See TracChangeset for help on using the changeset viewer.