* Tunnels: Reduce the drop probability for TunnelBuildMessages at the OBEP

This commit is contained in:
zzz
2009-12-19 16:54:59 +00:00
parent f226392c9d
commit 72eafe0920

View File

@ -605,12 +605,17 @@ public class TunnelDispatcher implements Service {
if (pctDrop <= 0)
return false;
// increase the drop probability for OBEP,
// (except lower it for tunnel build messages (type 21)),
// and lower it for IBGW, for network efficiency
double len = length;
if (type.startsWith("OBEP"))
len *= 1.5;
else if (type.startsWith("IBGW"))
if (type.startsWith("OBEP")) {
if (type.equals("OBEP 21"))
len /= 1.5;
else
len *= 1.5;
} else if (type.startsWith("IBGW")) {
len /= 1.5;
}
// drop in proportion to size w.r.t. a standard 1024-byte message
// this is a little expensive but we want to adjust the curve between 0 and 1
// Most messages are 1024, only at the OBEP do we see other sizes