diff --git a/apps/routerconsole/java/src/net/i2p/router/web/WebAppConfiguration.java b/apps/routerconsole/java/src/net/i2p/router/web/WebAppConfiguration.java index 249ae4582..ac84d937a 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/WebAppConfiguration.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/WebAppConfiguration.java @@ -7,6 +7,7 @@ import java.util.StringTokenizer; import net.i2p.I2PAppContext; import org.mortbay.jetty.webapp.Configuration; +import org.mortbay.jetty.webapp.WebAppClassLoader; import org.mortbay.jetty.webapp.WebAppContext; @@ -45,7 +46,10 @@ public class WebAppConfiguration implements Configuration { return _wac; } - public void configureClassPath() throws Exception { + /** + * This was the interface in Jetty 5, now it's configureClassLoader() + */ + private void configureClassPath() throws Exception { String ctxPath = _wac.getContextPath(); //System.err.println("Configure Class Path " + ctxPath); if (ctxPath.equals("/")) @@ -78,7 +82,10 @@ public class WebAppConfiguration implements Configuration { if (cp == null) return; StringTokenizer tok = new StringTokenizer(cp, " ,"); + StringBuilder buf = new StringBuilder(); while (tok.hasMoreTokens()) { + if (buf.length() > 0) + buf.append(','); String elem = tok.nextToken().trim(); String path; if (elem.startsWith("$I2P")) @@ -88,7 +95,17 @@ public class WebAppConfiguration implements Configuration { else path = dir.getAbsolutePath() + '/' + elem; System.err.println("Adding " + path + " to classpath for " + appName); - _wac.setExtraClasspath(path); + buf.append(path); + } + ClassLoader cl = _wac.getClassLoader(); + if (cl != null && cl instanceof WebAppClassLoader) { + WebAppClassLoader wacl = (WebAppClassLoader) cl; + wacl.addClassPath(buf.toString()); + } else { + // This was not working because the WebAppClassLoader already exists + // and it calls getExtraClasspath in its constructor + // Not sure why WACL already exists... + _wac.setExtraClasspath(buf.toString()); } } @@ -99,5 +116,7 @@ public class WebAppConfiguration implements Configuration { public void deconfigureWebApp() {} /** @since Jetty 6 */ - public void configureClassLoader() {} + public void configureClassLoader() throws Exception { + configureClassPath(); + } } diff --git a/apps/routerconsole/jsp/configclients.jsp b/apps/routerconsole/jsp/configclients.jsp index 6a700deda..9034d909e 100644 --- a/apps/routerconsole/jsp/configclients.jsp +++ b/apps/routerconsole/jsp/configclients.jsp @@ -101,7 +101,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }

<%=intl._("A web app may also be disabled by removing the .war file from the webapps directory; however the .war file and web app will reappear when you update your router to a newer version, so disabling the web app here is the preferred method.")%>

-
+

<%=intl._("All changes require restart to take effect.")%> @@ -125,7 +125,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }

<%=intl._("Plugin Installation")%>

<%=intl._("To install a plugin, enter the download URL:")%>

- +

diff --git a/apps/routerconsole/jsp/viewstat.jsp b/apps/routerconsole/jsp/viewstat.jsp index af7b2944c..0a716cb9d 100644 --- a/apps/routerconsole/jsp/viewstat.jsp +++ b/apps/routerconsole/jsp/viewstat.jsp @@ -44,6 +44,10 @@ if ( !rendered && ((rs != null) || fakeBw) ) { response.setContentType("image/png"); // very brief 45 sec expire response.setDateHeader("Expires", net.i2p.I2PAppContext.getGlobalContext().clock().now() + (45*1000)); + // http://jira.codehaus.org/browse/JETTY-1346 + // This doesn't actually appear in the response, but it fixes the problem, + // so Jetty must look for this header and close the connection. + response.setHeader("Connection", "Close"); int width = -1; int height = -1; int periodCount = -1; diff --git a/build.xml b/build.xml index 2d4f85cae..57bb5bcce 100644 --- a/build.xml +++ b/build.xml @@ -1141,7 +1141,7 @@ basedir="${basedir}/installer/lib/izpack/patches" /> - + @@ -1172,6 +1172,9 @@ + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1388,7 +1361,7 @@ - + @@ -1407,7 +1380,8 @@ - + + @@ -1506,12 +1480,17 @@ + + + + + @@ -1523,11 +1502,13 @@ + + @@ -1535,17 +1516,20 @@ + + + diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java index 55829cb5d..314f8253b 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java @@ -26,7 +26,7 @@ class FloodfillMonitorJob extends JobImpl { private static final int REQUEUE_DELAY = 60*60*1000; private static final long MIN_UPTIME = 2*60*60*1000; private static final long MIN_CHANGE_DELAY = 6*60*60*1000; - private static final int MIN_FF = 200; + private static final int MIN_FF = 250; private static final int MAX_FF = 999999; private static final String PROP_FLOODFILL_PARTICIPANT = "router.floodfillParticipant"; diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java index 11b3e29d0..e049c0a91 100644 --- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java +++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java @@ -477,7 +477,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority boolean explicitSpecified = explicitAddressSpecified(); boolean inboundRecent = _lastInboundReceivedOn + ALLOW_IP_CHANGE_INTERVAL > System.currentTimeMillis(); if (_log.shouldLog(Log.INFO)) - _log.info("External address received: " + RemoteHostId.toString(ourIP) + ":" + ourPort + " from " + _log.info("External address received: " + Addresses.toString(ourIP, ourPort) + " from " + from.toBase64() + ", isValid? " + isValid + ", explicitSpecified? " + explicitSpecified + ", receivedInboundRecent? " + inboundRecent + " status " + _reachabilityStatus); @@ -491,7 +491,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority // ignore them if (_log.shouldLog(Log.ERROR)) _log.error("The router " + from.toBase64() + " told us we have an invalid IP - " - + RemoteHostId.toString(ourIP) + " port " + ourPort + ". Lets throw tomatoes at them"); + + Addresses.toString(ourIP, ourPort) + ". Lets throw tomatoes at them"); markUnreachable(from); //_context.shitlist().shitlistRouter(from, "They said we had an invalid IP", STYLE); return; @@ -506,13 +506,13 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority _lastFrom = from; _lastOurIP = ourIP; _lastOurPort = ourPort; - if (_log.shouldLog(Log.WARN)) - _log.warn("The router " + from.toBase64() + " told us we have a new IP - " - + RemoteHostId.toString(ourIP) + " port " + ourPort + ". Wait until somebody else tells us the same thing."); + if (_log.shouldLog(Log.INFO)) + _log.info("The router " + from.toBase64() + " told us we have a new IP - " + + Addresses.toString(ourIP, ourPort) + ". Wait until somebody else tells us the same thing."); } else { - if (_log.shouldLog(Log.WARN)) - _log.warn(from.toBase64() + " and " + _lastFrom.toBase64() + " agree we have a new IP - " - + RemoteHostId.toString(ourIP) + " port " + ourPort + ". Changing address."); + if (_log.shouldLog(Log.INFO)) + _log.info(from.toBase64() + " and " + _lastFrom.toBase64() + " agree we have a new IP - " + + Addresses.toString(ourIP, ourPort) + ". Changing address."); _lastFrom = from; _lastOurIP = ourIP; _lastOurPort = ourPort; @@ -530,11 +530,11 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority boolean updated = false; boolean fireTest = false; - if (_log.shouldLog(Log.WARN)) - _log.warn("Change address? status = " + _reachabilityStatus + + if (_log.shouldLog(Log.INFO)) + _log.info("Change address? status = " + _reachabilityStatus + " diff = " + (_context.clock().now() - _reachabilityStatusLastUpdated) + " old = " + _externalListenHost + ':' + _externalListenPort + - " new = " + RemoteHostId.toString(ourIP) + ':' + ourPort); + " new = " + Addresses.toString(ourIP, ourPort)); synchronized (this) { if ( (_externalListenHost == null) || @@ -544,13 +544,14 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority // (_externalListenHost == null) || (_externalListenPort <= 0) || // (_context.clock().now() - _reachabilityStatusLastUpdated > 2*TEST_FREQUENCY) ) { // they told us something different and our tests are either old or failing - if (_log.shouldLog(Log.WARN)) - _log.warn("Trying to change our external address..."); try { _externalListenHost = InetAddress.getByAddress(ourIP); // fixed port defaults to true so we never do this if (ourPort >= MIN_EXTERNAL_PORT && !fixedPort) _externalListenPort = ourPort; + if (_log.shouldLog(Log.WARN)) + _log.warn("Trying to change our external address to " + + Addresses.toString(ourIP, _externalListenPort)); if (_externalListenPort > 0) { rebuildExternalAddress(); replaceAddress(_externalAddress); @@ -559,7 +560,8 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority } catch (UnknownHostException uhe) { _externalListenHost = null; if (_log.shouldLog(Log.WARN)) - _log.warn("Error trying to change our external address", uhe); + _log.warn("Error trying to change our external address to " + + Addresses.toString(ourIP, ourPort), uhe); } //} else { // // they told us something different, but our tests are recent and positive,