- oops, store leaseset locally even when shutting down
        (fix -16)
      - Java 5 cleanups
    * PRNG:
      - Rename config option to prng.buffers (was router.prng.buffers)
      - Change the default from 16 to 2 for I2PAppContext (saves 3.5MB)
    * TunnelPool:
      - Don't test tunnels when shutting down
      - Less rates
      - Java 5 cleanups
This commit is contained in:
zzz
2009-08-25 13:12:24 +00:00
parent 51fd4d70da
commit df4143f036
8 changed files with 75 additions and 50 deletions

View File

@ -12,7 +12,11 @@ import net.i2p.util.Log;
* has been eaten)
*/
public class AsyncFortunaStandalone extends FortunaStandalone implements Runnable {
private static final int DEFAULT_BUFFERS = 16;
/**
* This is set to 2 to minimize memory usage for standalone apps.
* The router must override this via the prng.buffers property in the router context.
*/
private static final int DEFAULT_BUFFERS = 2;
private static final int BUFSIZE = 256*1024;
private int _bufferCount;
private final byte asyncBuffers[][];
@ -28,7 +32,7 @@ public class AsyncFortunaStandalone extends FortunaStandalone implements Runnabl
public AsyncFortunaStandalone(I2PAppContext context) {
super();
_bufferCount = context.getProperty("router.prng.buffers", DEFAULT_BUFFERS);
_bufferCount = Math.max(context.getProperty("prng.buffers", DEFAULT_BUFFERS), 2);
asyncBuffers = new byte[_bufferCount][BUFSIZE];
status = new int[_bufferCount];
for (int i = 0; i < _bufferCount; i++)

View File

@ -91,6 +91,8 @@ class I2PSessionImpl2 extends I2PSessionImpl {
* Perhaps the http server (which does its own compression)
* and P2P apps (with generally uncompressible data) should
* set to false.
*
* Todo: don't compress if destination is local?
*/
private static final int DONT_COMPRESS_SIZE = 66;
protected boolean shouldCompress(int size) {