From 7ab85a0a20bf48e010a2d5d440a8f86ca8e3ab1c Mon Sep 17 00:00:00 2001 From: zzz Date: Wed, 27 May 2015 21:05:44 +0000 Subject: [PATCH] Graphs: prevent NaNs if we are skewed ahead of system time --- .../java/src/net/i2p/router/web/SummaryRenderer.java | 3 ++- history.txt | 10 ++++++++++ router/java/src/net/i2p/router/RouterVersion.java | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java index 9644b8e3f5..06d6e9af51 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java @@ -109,7 +109,8 @@ class SummaryRenderer { public void render(OutputStream out, int width, int height, boolean hideLegend, boolean hideGrid, boolean hideTitle, boolean showEvents, int periodCount, int endp, boolean showCredit, SummaryListener lsnr2, String titleOverride) throws IOException { - long end = _listener.now() - 75*1000; + // prevent NaNs if we are skewed ahead of system time + long end = Math.min(_listener.now(), System.currentTimeMillis()) - 75*1000; long period = _listener.getRate().getPeriod(); if (endp > 0) end -= period * endp; diff --git a/history.txt b/history.txt index b18039cfe1..f538cacb35 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,13 @@ +2015-05-27 zzz + * Banlist: Ban all-zero hash + * DataHelper: Add year output to formatDuration() + * Graphs: prevent NaNs if we are skewed ahead of system time + * NetDb: Drop all-zero lookups and stores, add stats + * SSU: + - Fix debug logging of dumped packets + - Drop sessions with bad clock skew, banlist peer, add stats + - Drop sessions with corrupt DSM, banlist peer, add stats + 2015-05-23 zzz * I2CP: Add an INIT state for session, so a newly created session isn't treated as CLOSED and immediately replaced by i2ptunnel, diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 5fd579e05b..a06babd519 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 = 30; + public final static long BUILD = 31; /** for example "-test" */ public final static String EXTRA = "-rc";