forked from I2P_Developers/i2p.i2p
Merge branch 'i2p.i2p.congestion-caps' into 'master'
start implementing congestion caps handling by adding... See merge request i2p-hackers/i2p.i2p!89
This commit is contained in:
@@ -34,6 +34,11 @@ class CapacityCalculator {
|
||||
private static final double PENALTY_NO_R_CAP = 1;
|
||||
private static final double PENALTY_U_CAP = 2;
|
||||
private static final double PENALTY_LAST_SEND_FAIL = 4;
|
||||
// congestion cap penalty not yet applied
|
||||
//private static final double PENALTY_D_CAP = 0;
|
||||
// congestion cap penalty not yet applied
|
||||
//private static final double PENALTY_E_CAP = 0;
|
||||
//private static final double PENALTY_G_CAP = 0;
|
||||
private static final double PENALTY_RECENT_SEND_FAIL = 4;
|
||||
private static final double BONUS_LAST_SEND_SUCCESS = 1;
|
||||
private static final double BONUS_RECENT_SEND_SUCCESS = 1;
|
||||
@@ -124,11 +129,13 @@ class CapacityCalculator {
|
||||
capacity -= PENALTY_U_CAP;
|
||||
if (caps.indexOf(Router.CAPABILITY_BW32) >= 0)
|
||||
capacity -= PENALTY_L_CAP;
|
||||
/* TODO
|
||||
if (caps.indexOf(Router.CAPABILITY_CONGESTION_MODERATE) >= 0)
|
||||
/* TODO */
|
||||
/*if (caps.indexOf(Router.CAPABILITY_CONGESTION_MODERATE) >= 0)
|
||||
capacity -= PENALTY_D_CAP;
|
||||
else if (caps.indexOf(Router.CAPABILITY_CONGESTION_SEVERE) >= 0)
|
||||
capacity -= PENALTY_E_CAP;
|
||||
capacity -= PENALTY_E_CAP;*/
|
||||
/* TODO: G caps can be excluded in TunnelPeerSelector by adding it to DEFAULT_EXCLUDE_CAPS
|
||||
decide what other handling if any is needed here.
|
||||
else if (caps.indexOf(Router.CAPABILITY_NO_TUNNELS) >= 0)
|
||||
capacity -= PENALTY_G_CAP;
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,7 @@ import net.i2p.util.VersionComparator;
|
||||
*/
|
||||
public abstract class TunnelPeerSelector extends ConnectChecker {
|
||||
|
||||
private static final String DEFAULT_EXCLUDE_CAPS = String.valueOf(Router.CAPABILITY_BW12);
|
||||
private static final String DEFAULT_EXCLUDE_CAPS = String.valueOf(Router.CAPABILITY_BW12)+String.valueOf(Router.CAPABILITY_CONGESTION_SEVERE);
|
||||
|
||||
protected TunnelPeerSelector(RouterContext context) {
|
||||
super(context);
|
||||
|
||||
Reference in New Issue
Block a user