diff --git a/apps/routerconsole/jsp/flags.jsp b/apps/routerconsole/jsp/flags.jsp index 7148782e3..92d180289 100644 --- a/apps/routerconsole/jsp/flags.jsp +++ b/apps/routerconsole/jsp/flags.jsp @@ -42,7 +42,8 @@ if (c != null && c.length() > 0) { if (!response.isCommitted()) { response.sendError(403, ioe.toString()); } else { - net.i2p.I2PAppContext.getGlobalContext().logManager().getLog(getClass()).error("Error serving flags/" + c + ".png", ioe); + // not an error, happens when the browser closes the stream + net.i2p.I2PAppContext.getGlobalContext().logManager().getLog(getClass()).warn("Error serving flags/" + c + ".png", ioe); // Jetty doesn't log this throw ioe; } diff --git a/apps/routerconsole/jsp/viewhistory.jsp b/apps/routerconsole/jsp/viewhistory.jsp index aa3ce4d54..f4a2cbbff 100644 --- a/apps/routerconsole/jsp/viewhistory.jsp +++ b/apps/routerconsole/jsp/viewhistory.jsp @@ -15,7 +15,8 @@ try { if (!response.isCommitted()) { response.sendError(403, ioe.toString()); } else { - net.i2p.I2PAppContext.getGlobalContext().logManager().getLog(getClass()).error("Error serving history.txt", ioe); + // not an error, happens when the browser closes the stream + net.i2p.I2PAppContext.getGlobalContext().logManager().getLog(getClass()).warn("Error serving history.txt", ioe); // Jetty doesn't log this throw ioe; } diff --git a/apps/routerconsole/jsp/viewtheme.jsp b/apps/routerconsole/jsp/viewtheme.jsp index ce1a6fe38..ae6551cff 100644 --- a/apps/routerconsole/jsp/viewtheme.jsp +++ b/apps/routerconsole/jsp/viewtheme.jsp @@ -67,7 +67,8 @@ try { if (!response.isCommitted()) { response.sendError(403, ioe.toString()); } else { - net.i2p.I2PAppContext.getGlobalContext().logManager().getLog(getClass()).error("Error serving " + uri, ioe); + // not an error, happens when the browser closes the stream + net.i2p.I2PAppContext.getGlobalContext().logManager().getLog(getClass()).warn("Error serving " + uri, ioe); // Jetty doesn't log this throw ioe; } diff --git a/history.txt b/history.txt index ea81b8c10..338a65a44 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,9 @@ +2011-07-01 zzz + * EepGet: + - Fix error output bug + - Output error data for 504 too + * Router, console, i2psnark: Change three errors to warns (tickets #479, #482, #487) + 2011-06-30 zzz * BlockfileNamingService: - Support readonly blockfiles diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 87e5bffca..282c18b42 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 = 1; + public final static long BUILD = 2; /** for example "-test" */ public final static String EXTRA = ""; diff --git a/router/java/src/net/i2p/router/tunnel/OutboundMessageDistributor.java b/router/java/src/net/i2p/router/tunnel/OutboundMessageDistributor.java index 88e4973ed..799b59b6b 100644 --- a/router/java/src/net/i2p/router/tunnel/OutboundMessageDistributor.java +++ b/router/java/src/net/i2p/router/tunnel/OutboundMessageDistributor.java @@ -15,9 +15,9 @@ import net.i2p.util.Log; * honors the instructions. */ public class OutboundMessageDistributor { - private RouterContext _context; - private int _priority; - private Log _log; + private final RouterContext _context; + private final int _priority; + private final Log _log; private static final int MAX_DISTRIBUTE_TIME = 10*1000; @@ -30,6 +30,7 @@ public class OutboundMessageDistributor { public void distribute(I2NPMessage msg, Hash target) { distribute(msg, target, null); } + public void distribute(I2NPMessage msg, Hash target, TunnelId tunnel) { RouterInfo info = _context.netDb().lookupRouterInfoLocally(target); if (info == null) { @@ -73,25 +74,31 @@ public class OutboundMessageDistributor { } private class DistributeJob extends JobImpl { - private I2NPMessage _message; - private Hash _target; - private TunnelId _tunnel; + private final I2NPMessage _message; + private final Hash _target; + private final TunnelId _tunnel; + public DistributeJob(RouterContext ctx, I2NPMessage msg, Hash target, TunnelId id) { super(ctx); _message = msg; _target = target; _tunnel = id; } + public String getName() { return "Distribute outbound message"; } + public void runJob() { RouterInfo info = getContext().netDb().lookupRouterInfoLocally(_target); if (info != null) { - _log.debug("outbound distributor to " + _target.toBase64().substring(0,4) + if (_log.shouldLog(Log.DEBUG)) + _log.debug("outbound distributor to " + _target.toBase64().substring(0,4) + "." + (_tunnel != null ? _tunnel.getTunnelId() + "" : "") + ": found on search"); distribute(_message, info, _tunnel); } else { - _log.error("outbound distributor to " + _target.toBase64().substring(0,4) + // TODO add a stat here + if (_log.shouldLog(Log.WARN)) + _log.warn("outbound distributor to " + _target.toBase64().substring(0,4) + "." + (_tunnel != null ? _tunnel.getTunnelId() + "" : "") + ": NOT found on search"); } diff --git a/router/java/src/net/i2p/router/tunnel/OutboundReceiver.java b/router/java/src/net/i2p/router/tunnel/OutboundReceiver.java index 962ebf683..02c3f0f16 100644 --- a/router/java/src/net/i2p/router/tunnel/OutboundReceiver.java +++ b/router/java/src/net/i2p/router/tunnel/OutboundReceiver.java @@ -13,9 +13,9 @@ import net.i2p.util.Log; * */ class OutboundReceiver implements TunnelGateway.Receiver { - private RouterContext _context; - private Log _log; - private TunnelCreatorConfig _config; + private final RouterContext _context; + private final Log _log; + private final TunnelCreatorConfig _config; private RouterInfo _nextHopCache; public OutboundReceiver(RouterContext ctx, TunnelCreatorConfig cfg) { @@ -40,8 +40,9 @@ class OutboundReceiver implements TunnelGateway.Receiver { send(msg, ri); return msg.getUniqueId(); } else { - if (_log.shouldLog(Log.ERROR)) - _log.error("lookup of " + _config.getPeer(1).toBase64().substring(0,4) + // TODO add a stat here + if (_log.shouldLog(Log.WARN)) + _log.warn("lookup of " + _config.getPeer(1).toBase64().substring(0,4) + " required for " + msg); _context.netDb().lookupRouterInfo(_config.getPeer(1), new SendJob(_context, msg), new FailedJob(_context), 10*1000); return -1; @@ -61,12 +62,15 @@ class OutboundReceiver implements TunnelGateway.Receiver { } private class SendJob extends JobImpl { - private TunnelDataMessage _msg; + private final TunnelDataMessage _msg; + public SendJob(RouterContext ctx, TunnelDataMessage msg) { super(ctx); _msg = msg; } + public String getName() { return "forward a tunnel message"; } + public void runJob() { RouterInfo ri = _context.netDb().lookupRouterInfoLocally(_config.getPeer(1)); if (_log.shouldLog(Log.DEBUG)) @@ -83,11 +87,14 @@ class OutboundReceiver implements TunnelGateway.Receiver { public FailedJob(RouterContext ctx) { super(ctx); } + public String getName() { return "failed looking for our outbound gateway"; } + public void runJob() { - if (_log.shouldLog(Log.ERROR)) - _log.error("lookup of " + _config.getPeer(1).toBase64().substring(0,4) + // TODO add a stat here + if (_log.shouldLog(Log.WARN)) + _log.warn("lookup of " + _config.getPeer(1).toBase64().substring(0,4) + " failed for " + _config); } } -} \ No newline at end of file +}