diff --git a/history.txt b/history.txt index 4f8d945097..bee10d1a8a 100644 --- a/history.txt +++ b/history.txt @@ -1,7 +1,8 @@ 2011-07-08 zzz + * Findbugs: Several fixes and cleanups * I2NP: Consolidate common code from TunnelBuildMessage and TunnelBuildReplyMessage into a common base class - * NetDB: Fix NPE at startup (ticket #493) + * NetDB, TestJob: Fix NPEs at startup (ticket #493) * Sha256Standalone: - Use system SHA-256 MessageDigest instead of Sha256Standalone in PRNG - Deprecate DataHelper functions using Sha256Standalone arguments; diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index fecba78d69..a6204817e3 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 7; + public final static long BUILD = 8; /** for example "-test" */ public final static String EXTRA = ""; diff --git a/router/java/src/net/i2p/router/tunnel/pool/TestJob.java b/router/java/src/net/i2p/router/tunnel/pool/TestJob.java index a1588776db..ade04a94bb 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/TestJob.java +++ b/router/java/src/net/i2p/router/tunnel/pool/TestJob.java @@ -19,6 +19,8 @@ import net.i2p.router.RouterContext; import net.i2p.router.TunnelInfo; import net.i2p.router.message.GarlicMessageBuilder; import net.i2p.router.message.PayloadGarlicConfig; +import net.i2p.stat.Rate; +import net.i2p.stat.RateStat; import net.i2p.util.Log; class TestJob extends JobImpl { @@ -219,8 +221,15 @@ class TestJob extends JobImpl { // // Try to prevent congestion collapse (failing all our tunnels and then clogging our outbound // with new tunnel build requests) by adding in three times the average outbound delay. - int delay = 3 * (int) getContext().statManager().getRate("transport.sendProcessingTime").getRate(60*1000).getAverageValue(); - return delay + (2500 * (_outTunnel.getLength() + _replyTunnel.getLength())); + RateStat tspt = getContext().statManager().getRate("transport.sendProcessingTime"); + if (tspt != null) { + Rate r = tspt.getRate(60*1000); + if (r != null) { + int delay = 3 * (int) r.getAverageValue(); + return delay + (2500 * (_outTunnel.getLength() + _replyTunnel.getLength())); + } + } + return 15*1000; } private void scheduleRetest() { scheduleRetest(false); }