From 72eafe0920d5b0a48663a4dffbf27701428fa9f6 Mon Sep 17 00:00:00 2001 From: zzz Date: Sat, 19 Dec 2009 16:54:59 +0000 Subject: [PATCH] * Tunnels: Reduce the drop probability for TunnelBuildMessages at the OBEP --- .../src/net/i2p/router/tunnel/TunnelDispatcher.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java b/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java index 681dadec1..6b5457719 100644 --- a/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java +++ b/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java @@ -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