Changeset ffda7f63


Ignore:
Timestamp:
Jul 25, 2013 6:49:22 PM (7 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
19faa35
Parents:
8ebacf4c
Message:
  • Tunnels:
    • Make expl. default 3 hops (ticket #966)
    • Allow expl. fallback up to -2 hops
Location:
router/java/src/net/i2p/router
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/TunnelPoolSettings.java

    r8ebacf4c rffda7f63  
    5454    // public static final int     DEFAULT_REBUILD_PERIOD = 60*1000;
    5555    public static final int     DEFAULT_DURATION = 10*60*1000;
    56     public static final int     DEFAULT_LENGTH = 2;
     56    public static final int     DEFAULT_LENGTH = 3;
    5757    public static final int     DEFAULT_LENGTH_VARIANCE = 0;
    5858    public static final boolean DEFAULT_ALLOW_ZERO_HOP = true;
  • router/java/src/net/i2p/router/tunnel/pool/TunnelPool.java

    r8ebacf4c rffda7f63  
    5151    private static final int BUILD_TRIES_QUANTITY_OVERRIDE = 12;
    5252    /** if less than one success in this many, reduce length (exploratory only) */
    53     private static final int BUILD_TRIES_LENGTH_OVERRIDE = 18;
     53    private static final int BUILD_TRIES_LENGTH_OVERRIDE_1 = 10;
     54    private static final int BUILD_TRIES_LENGTH_OVERRIDE_2 = 18;
    5455   
    5556    TunnelPool(RouterContext ctx, TunnelPoolManager mgr, TunnelPoolSettings settings, TunnelPeerSelector sel) {
     
    375376                    long sc = sr.computeAverages(ra, false).getTotalEventCount();
    376377                    long tot = ec + rc + sc;
    377                     if (tot >= BUILD_TRIES_LENGTH_OVERRIDE) {
    378                         if (1000 * sc / tot <=  1000 / BUILD_TRIES_LENGTH_OVERRIDE)
    379                             _settings.setLengthOverride(len - 1);
     378                    if (tot >= BUILD_TRIES_LENGTH_OVERRIDE_1) {
     379                        long succ = 1000 * sc / tot;
     380                        if (succ <=  1000 / BUILD_TRIES_LENGTH_OVERRIDE_1) {
     381                            if (len > 2 && succ <= 1000 / BUILD_TRIES_LENGTH_OVERRIDE_2)
     382                                _settings.setLengthOverride(len - 2);
     383                            else
     384                                _settings.setLengthOverride(len - 1);
    380385                            return;
     386                        }
    381387                    }
    382388                }
Note: See TracChangeset for help on using the changeset viewer.