diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java index b42376dbf..8e5ef9f4d 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java @@ -185,7 +185,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable /** * create the default options (using the default timeout, etc) - * + * unused? */ protected I2PSocketOptions getDefaultOptions() { Properties defaultOpts = getTunnel().getClientOptions(); @@ -210,6 +210,9 @@ public class I2PTunnelHTTPClient extends I2PTunnelClientBase implements Runnable defaultOpts.setProperty(I2PSocketOptions.PROP_READ_TIMEOUT, ""+DEFAULT_READ_TIMEOUT); if (!defaultOpts.contains("i2p.streaming.inactivityTimeout")) defaultOpts.setProperty("i2p.streaming.inactivityTimeout", ""+DEFAULT_READ_TIMEOUT); + // delayed start + if (sockMgr == null) + sockMgr = getSocketManager(); I2PSocketOptions opts = sockMgr.buildOptions(defaultOpts); if (!defaultOpts.containsKey(I2PSocketOptions.PROP_CONNECT_TIMEOUT)) opts.setConnectTimeout(DEFAULT_CONNECT_TIMEOUT); diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java index 536844af9..d6cb40a25 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java @@ -171,7 +171,24 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer { sender.start(); browserout = _browser.getOutputStream(); - serverin = _webserver.getInputStream(); + // NPE seen here in 0.7-7, caused by addition of socket.close() in the + // catch (IOException ioe) block above in blockingHandle() ??? + // CRIT [ad-130280.hc] net.i2p.util.I2PThread : Killing thread Thread-130280.hc + // java.lang.NullPointerException + // at java.io.FileInputStream.(FileInputStream.java:131) + // at java.net.SocketInputStream.(SocketInputStream.java:44) + // at java.net.PlainSocketImpl.getInputStream(PlainSocketImpl.java:401) + // at java.net.Socket$2.run(Socket.java:779) + // at java.security.AccessController.doPrivileged(Native Method) + // at java.net.Socket.getInputStream(Socket.java:776) + // at net.i2p.i2ptunnel.I2PTunnelHTTPServer$CompressedRequestor.run(I2PTunnelHTTPServer.java:174) + // at java.lang.Thread.run(Thread.java:619) + // at net.i2p.util.I2PThread.run(I2PThread.java:71) + try { + serverin = _webserver.getInputStream(); + } catch (NullPointerException npe) { + throw new IOException("getInputStream NPE"); + } CompressedResponseOutputStream compressedOut = new CompressedResponseOutputStream(browserout); Sender s = new Sender(compressedOut, serverin, "server: server to browser"); if (_log.shouldLog(Log.INFO)) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java index 2745cb0fa..23ec70c3f 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/socks/SOCKS4aServer.java @@ -198,7 +198,8 @@ public class SOCKS4aServer extends SOCKSServer { I2PSocket destSock; try { - if (connHostName.toLowerCase().endsWith(".i2p")) { + if (connHostName.toLowerCase().endsWith(".i2p") || + connHostName.toLowerCase().endsWith(".onion")) { _log.debug("connecting to " + connHostName + "..."); // Let's not due a new Dest for every request, huh? //I2PSocketManager sm = I2PSocketManagerFactory.createManager(); @@ -224,7 +225,7 @@ public class SOCKS4aServer extends SOCKSServer { } else { List proxies = t.getProxies(connPort); if (proxies == null || proxies.size() <= 0) { - String err = "No outproxy configured for port " + connPort + " and no default configured either"; + String err = "No outproxy configured for port " + connPort + " and no default configured either - host: " + connHostName; _log.error(err); try { sendRequestReply(Reply.CONNECTION_REFUSED, InetAddress.getByName("127.0.0.1"), 0, out); diff --git a/apps/i2ptunnel/jsp/editClient.jsp b/apps/i2ptunnel/jsp/editClient.jsp index d20c9f58d..6dd839d97 100644 --- a/apps/i2ptunnel/jsp/editClient.jsp +++ b/apps/i2ptunnel/jsp/editClient.jsp @@ -307,7 +307,7 @@
@@ -329,7 +329,7 @@
diff --git a/apps/i2ptunnel/jsp/editServer.jsp b/apps/i2ptunnel/jsp/editServer.jsp index eb407ec16..b3917cced 100644 --- a/apps/i2ptunnel/jsp/editServer.jsp +++ b/apps/i2ptunnel/jsp/editServer.jsp @@ -326,7 +326,7 @@
@@ -354,7 +354,7 @@
diff --git a/apps/routerconsole/jsp/help.jsp b/apps/routerconsole/jsp/help.jsp index d53f93a88..279df95dd 100644 --- a/apps/routerconsole/jsp/help.jsp +++ b/apps/routerconsole/jsp/help.jsp @@ -12,12 +12,126 @@

Help

-Sorry, there's no help text here yet, so check out the +Sorry, there's not much help text here yet, so also check out the FAQ on www.i2p2.i2p or the Deutsch FAQ. +You may also try the +forum +or IRC.
+

Summary Bar Information

+

General

+
    +
  • Ident: +The first four characters (24 bits) of your 44-character (256-bit) Base64 router hash. +The full hash is shown on your router info page. +Never reveal this to anyone, as your router info contains your IP. +
  • Version: +The version of the I2P software you are running. +
  • Now: +The current time (UTC) and the skew, if any. I2P requires your computer's time be accurate. +If the skew is more than a few seconds, please correct the problem by adjusting +your computer's time. +
  • Reachability: +The router's view of whether it can be contacted by other routers. +Further information is on the configuration page. +
+ +

Peers

+
    +
  • Active: +The first number is the number of peers you've sent or received a message from in the last few minutes. +This may range from 8-10 to several hundred, depending on your total bandwidth, +shared bandwidth, and locally-generated traffic. +The second number is the number of peers seen in the last hour or so. +Do not be concerned if these numbers vary widely. +
  • Fast: +This is the number of peers you use for building client tunnels. It is generally in the +range 8-15. Your fast peers are shown on the profiles page. +
  • High Capacity: +This is the number of peers you use for building some of your exploratory tunnels. It is generally in the +range 8-25. The fast peers are included in the high capacity tier. +Your high capacity peers are shown on the profiles page. +
  • Well Integrated: +This is the number of peers you use for network database inquiries. +These are usually the "floodfill" peers. +Your well integrated peers are shown on the bottom of the profiles page. +
  • Known: +This is the total number of routers you know about. +They are listed on the network database page. +This may range from under 100 to 1000 or more. +This number is not the total size of the network; +it may vary widely depending on your total bandwidth, +shared bandwidth, and locally-generated traffic. +I2P does not require a router to know every other router. +
+ +

Bandwidth in/out

+Should be self-explanatory. All values are in bytes per second, not bits per second. +Change your bandwidth limits on the configuration page. + +

Local destinations

+The local applications connecting through your router. +These may be clients started through I2PTunnel +or external programs connecting through SAM, BOB, or directly to I2CP. + +

Tunnels in/out

+The actual tunnels are shown on the the tunnels page. +
    +
  • Exploratory: +Tunnels built by your router and used for communication with the floodfill peers, +building new tunnels, and testing existing tunnels. +
  • Client: +Tunnels built by your router for each client's use. +
  • Participating: +Tunnels built by other routers through your router. +This may vary widely depending on network demand, your +shared bandwidth, and amount of locally-generated traffic. +The recommended method for limiting participating tunnels is +to change your share percentage on the configuration page. +You may also limit the total number by setting router.maxParticipatingTunnels=nnn on +the advanced configuration page. +
+ +

Congestion

+Some basic indications of router overload. +
  • Job lag: +How long jobs are waiting before execution. The job queue is listed on the jobs page. +Unfortunately, there are several other job queues in the router that may be congested, +and their status is not available in the router console. +The job lag should generally be zero. +If it is consistently higher than 500ms, your computer is very slow, or the +router has serious problems. +
  • Message delay: +How long an outbound message waits in the queue. +This should generally be a few hundred milliseconds or less. +If it is consistently higher than 1000ms, your computer is very slow, +or you should adjust your bandwidth limits, or your (bittorrent?) clients +may be sending too much data and should have their transmit bandwidth limit reduced. +
  • Tunnel lag: +This is the round trip time for a tunnel test, which sends a single message +out a client tunnel and in an exploratory tunnel, or vice versa. +It should usually be less than 5 seconds. +If it is consistently higher than that, your computer is very slow, +or you should adjust your bandwidth limits, or there are network problems. +
  • Handle backlog: +This is the number of pending requests from other routers to build a +participating tunnel through your router. +It should usually be close to zero. +If it is consistently high, your computer is too slow, +and you should reduce your share bandwidth limits. +
  • Accepting/Rejecting: +Your routers' status on accepting or rejecting +requests from other routers to build a +participating tunnel through your router. +Your router may accept all requests, accept or reject a percentage of requests, +or reject all requests for a number of reasons, to control +the bandwidth and CPU demands and maintain capacity for +local clients. + +

    Legal stuff

    The I2P router (router.jar) and SDK (i2p.jar) are almost entirely public domain, with a few notable exceptions:
      diff --git a/router/java/src/net/i2p/router/tunnel/FragmentHandler.java b/router/java/src/net/i2p/router/tunnel/FragmentHandler.java index 5a97956b9..dbe256ebd 100644 --- a/router/java/src/net/i2p/router/tunnel/FragmentHandler.java +++ b/router/java/src/net/i2p/router/tunnel/FragmentHandler.java @@ -74,6 +74,12 @@ public class FragmentHandler { int padding = 0; while (preprocessed[offset] != (byte)0x00) { offset++; // skip the padding + // AIOOBE http://forum.i2p/viewtopic.php?t=3187 + if (offset >= TrivialPreprocessor.PREPROCESSED_SIZE) { + _cache.release(new ByteArray(preprocessed)); + _context.statManager().addRateData("tunnel.corruptMessage", 1, 1); + return; + } padding++; } offset++; // skip the final 0x00, terminating the padding