From de1ca4aea46de4986d3b4060903fc04d7568241b Mon Sep 17 00:00:00 2001 From: complication Date: Thu, 18 May 2006 03:42:55 +0000 Subject: [PATCH] 2006-05-17 Complication * Fix some oversights in my previous changes: adjust some loglevels, make a few statements less wasteful, make one comparison less confusing and more likely to log unexpected values --- history.txt | 7 ++++++- router/java/src/net/i2p/router/RouterVersion.java | 4 ++-- .../src/net/i2p/router/tunnel/TunnelDispatcher.java | 12 ++++++------ .../net/i2p/router/tunnel/pool/BuildExecutor.java | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/history.txt b/history.txt index a4083a29a..950f754bf 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,9 @@ -$Id: history.txt,v 1.476 2006-05-16 13:34:28 jrandom Exp $ +$Id: history.txt,v 1.477 2006-05-17 22:01:21 jrandom Exp $ + +2006-05-17 Complication + * Fix some oversights in my previous changes: + adjust some loglevels, make a few statements less wasteful, + make one comparison less confusing and more likely to log unexpected values 2006-05-17 jrandom * Make the peer page sortable diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index fb1012a05..fce369b14 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ public class RouterVersion { - public final static String ID = "$Revision: 1.416 $ $Date: 2006-05-16 13:34:08 $"; + public final static String ID = "$Revision: 1.417 $ $Date: 2006-05-17 22:00:49 $"; public final static String VERSION = "0.6.1.18"; - public final static long BUILD = 5; + public final static long BUILD = 6; public static void main(String args[]) { System.out.println("I2P Router version: " + VERSION + "-" + BUILD); System.out.println("Router ID: " + RouterVersion.ID); diff --git a/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java b/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java index 2c21a7719..2805ff95a 100644 --- a/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java +++ b/router/java/src/net/i2p/router/tunnel/TunnelDispatcher.java @@ -552,7 +552,7 @@ public class TunnelDispatcher implements Service { long periodWithoutDrop = _context.clock().now() - _lastDropTime; if (periodWithoutDrop < DROP_BASE_INTERVAL) { if (_log.shouldLog(Log.WARN)) - _log.error("Not dropping tunnel, since last drop was " + periodWithoutDrop + " ms ago!"); + _log.warn("Not dropping tunnel, since last drop was " + periodWithoutDrop + " ms ago!"); return; } @@ -576,9 +576,9 @@ public class TunnelDispatcher implements Service { if ((currentMessages > 20) && ((biggest == null) || (currentRate > biggestRate))) { // Update our profile of the biggest biggest = current; - biggestMessages = biggest.getProcessedMessagesCount(); - biggestAge = (_context.clock().now() - current.getCreation()); - biggestRate = ((double) biggestMessages / (biggestAge / 1000)); + biggestMessages = currentMessages; + biggestAge = currentAge; + biggestRate = currentRate; } } @@ -588,8 +588,8 @@ public class TunnelDispatcher implements Service { return; } - if (_log.shouldLog(Log.ERROR)) - _log.error("Dropping tunnel with " + biggestRate + " messages/s and " + biggestMessages + + if (_log.shouldLog(Log.WARN)) + _log.warn("Dropping tunnel with " + biggestRate + " messages/s and " + biggestMessages + " messages, last drop was " + (periodWithoutDrop / 1000) + " s ago."); remove(biggest); _lastDropTime = _context.clock().now() + _context.random().nextInt(DROP_RANDOM_BOOST); diff --git a/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java b/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java index c6abcf20e..45f980c94 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java +++ b/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java @@ -166,7 +166,7 @@ class BuildExecutor implements Runnable { return(0); } else { // Mild overload, check if we already build tunnels - if (concurrent <= 0) { + if (concurrent == 0) { // We aren't building, allow 1 if (_log.shouldLog(Log.WARN)) _log.warn("Mild overload, allow building 1.");