I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 75261a0c authored by zzz's avatar zzz
Browse files

* EepGet: Used cached byte array in uncompressor

parent 7fc2cd9c
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,7 @@ import java.util.StringTokenizer;
import net.i2p.I2PAppContext;
import net.i2p.data.Base64;
import net.i2p.data.ByteArray;
import net.i2p.data.DataHelper;
import net.i2p.util.InternalSocket;
......@@ -1240,6 +1241,8 @@ public class EepGet {
protected class Gunzipper implements Runnable {
private final InputStream _inRaw;
private final OutputStream _out;
private static final int CACHE_SIZE = 8*1024;
private final ByteCache _cache = ByteCache.getInstance(8, CACHE_SIZE);
public Gunzipper(InputStream in, OutputStream out) {
_inRaw = in;
......@@ -1247,13 +1250,14 @@ public class EepGet {
}
public void run() {
ReusableGZIPInputStream in = null;
ReusableGZIPInputStream in = ReusableGZIPInputStream.acquire();
ByteArray ba = null;
long written = 0;
try {
in = ReusableGZIPInputStream.acquire();
// blocking
in.initialize(_inRaw);
byte buf[] = new byte[8*1024];
ba = _cache.acquire();
byte buf[] = ba.getData();
int read = -1;
while ( (read = in.read(buf)) != -1) {
_out.write(buf, 0, read);
......@@ -1269,8 +1273,9 @@ public class EepGet {
if (_out != null) try {
_out.close();
} catch (IOException ioe) {}
if (in != null)
ReusableGZIPInputStream.release(in);
ReusableGZIPInputStream.release(in);
if (ba != null)
_cache.release(ba);
}
}
}
......
2013-06-01 zzz
* EepGet: Used cached byte array in uncompressor
* i2psnark:
- Add idle detector, reduce tunnel count when idle (prep for torrent updates)
- Cancel CoordinatorAcceptor cleaner when halted
- Make PeerCoordinatorSet an Iterable
- Reduce max protocol errors to 1
- Disable unused PeerMonitorTask
2013-05-31 zzz
* configtunnels.jsp: Allow more hops and tunnels when routerconsole.advanced=true
* i2psnark: Fix details page on Windows
......
......@@ -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 = 3;
public final static long BUILD = 4;
/** for example "-test" */
public final static String EXTRA = "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment