diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java index d1dec5248..66f853ca2 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPServer.java @@ -21,7 +21,9 @@ import java.util.zip.GZIPOutputStream; import net.i2p.client.streaming.I2PSocket; import net.i2p.I2PAppContext; +import net.i2p.data.ByteArray; import net.i2p.data.DataHelper; +import net.i2p.util.ByteCache; import net.i2p.util.EventDispatcher; import net.i2p.util.I2PAppThread; import net.i2p.util.Log; @@ -221,7 +223,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer { // shadows _log in super() private final Log _log; - private static final int BUF_SIZE = 16*1024; + private static final int BUF_SIZE = 8*1024; public CompressedRequestor(Socket webserver, I2PSocket browser, String headers, I2PAppContext ctx, Log log) { _webserver = webserver; @@ -245,6 +247,9 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer { _log.info("request headers: " + _headers); serverout.write(_headers.getBytes()); browserin = _browser.getInputStream(); + // TODO don't spin off a thread for this except for POSTs + // beware interference with Tahoe-LAFS, Shoutcast, etc.? + // if (browserin.available() == 0) ? I2PAppThread sender = new I2PAppThread(new Sender(serverout, browserin, "server: browser to server", _log), Thread.currentThread().getName() + "hcs"); sender.start(); @@ -300,6 +305,8 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer { private final String _name; // shadows _log in super() private final Log _log; + private static final int BUF_SIZE = 8*1024; + private static final ByteCache _cache = ByteCache.getInstance(16, BUF_SIZE); public Sender(OutputStream out, InputStream in, String name, Log log) { _out = out; @@ -311,10 +318,11 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer { public void run() { if (_log.shouldLog(Log.INFO)) _log.info(_name + ": Begin sending"); + ByteArray ba = _cache.acquire(); try { - byte buf[] = new byte[16*1024]; + byte buf[] = ba.getData(); int read = 0; - int total = 0; + long total = 0; while ( (read = _in.read(buf)) != -1) { if (_log.shouldLog(Log.INFO)) _log.info(_name + ": read " + read + " and sending through the stream"); @@ -328,6 +336,7 @@ public class I2PTunnelHTTPServer extends I2PTunnelServer { if (_log.shouldLog(Log.DEBUG)) _log.debug("Error sending", ioe); } finally { + _cache.release(ba); if (_out != null) try { _out.close(); } catch (IOException ioe) {} if (_in != null) try { _in.close(); } catch (IOException ioe) {} } diff --git a/history.txt b/history.txt index 7a5f81589..0bd5d3741 100644 --- a/history.txt +++ b/history.txt @@ -1,11 +1,21 @@ +2013-09-03 zzz + * configui: Change pw restart warning to error so people dont miss it + * Data: deprecate most of LeaseSetKeys + * i2ptunnel: Reduce buffer size and use cache in HTTPServer + * Jetty: Increase maxIdleTime + * profiles: use different sort for floodfill profiles display + * Utils: Consolidate maxMemory() calls + 2013-08-31 zab * Streaming: Use only non-retransmitted packets when sampling RTT (Ticket 1007, RFC 6298) 2013-08-30 zzz + * Addressbook: Don't write to log file on Android (ticket #859) * Addresses: Treat Teredo addresses 2001:0::/32 as local * Console: Display "accepting tunnels" instead of "rejecting tunnels" after 20 minutes (ticket #902) + * i2psnark: Highlight table rows on hover * NTCP: Handle race where peer's NTCP address goes away * SSU, confignet: Add support for specifiying multiple addresses * SusiDNS: Don't require last subscription to be terminated by newline (ticket #1000) diff --git a/installer/resources/eepsite/jetty-ssl.xml b/installer/resources/eepsite/jetty-ssl.xml index f86c02507..c6d91cc83 100644 --- a/installer/resources/eepsite/jetty-ssl.xml +++ b/installer/resources/eepsite/jetty-ssl.xml @@ -26,7 +26,7 @@ 8443 - 30000 + 600000 false 2 100 diff --git a/installer/resources/eepsite/jetty.xml b/installer/resources/eepsite/jetty.xml index 5dfa74d5b..41ebe5b7d 100644 --- a/installer/resources/eepsite/jetty.xml +++ b/installer/resources/eepsite/jetty.xml @@ -105,7 +105,7 @@ 127.0.0.1 7658 - 60000 + 600000 1 false 8443 @@ -125,7 +125,7 @@ 127.0.0.1 7658 - 60000 + 600000 1 false 8443 diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 9319fc01c..0bd65feeb 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 = 22; + public final static long BUILD = 23; /** for example "-test" */ public final static String EXTRA = "";