I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 997644a0 authored by idk's avatar idk
Browse files

Merge branch 'i2p.i2p.congestion-caps' into 'master'

start implementing congestion caps handling by adding...

See merge request !89
parents f308ebee 43b43649
No related branches found
No related tags found
1 merge request!89start implementing congestion caps handling by adding...
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment