forked from I2P_Developers/i2p.i2p
2005-02-24 jrandom
* Cache temporary memory allocation in the DSA's SHA1 impl, and the packet
data in the streaming lib.
* Fixed a streaming lib bug where the connection initiator would fail the
stream if the ACK to their SYN was lost.
This commit is contained in:
@@ -25,6 +25,7 @@ class PacketQueue {
|
||||
private I2PSession _session;
|
||||
private ConnectionManager _connectionManager;
|
||||
private ByteCache _cache = ByteCache.getInstance(64, 36*1024);
|
||||
private ByteCache _packetCache = ByteCache.getInstance(128, Packet.MAX_PAYLOAD_SIZE);
|
||||
|
||||
public PacketQueue(I2PAppContext context, I2PSession session, ConnectionManager mgr) {
|
||||
_context = context;
|
||||
@@ -125,6 +126,11 @@ class PacketQueue {
|
||||
String suffix = (c != null ? "wsize " + c.getOptions().getWindowSize() : null);
|
||||
_connectionManager.getPacketHandler().displayPacket(packet, "SEND", suffix);
|
||||
}
|
||||
|
||||
if ( (packet.getSequenceNum() == 0) && (!packet.isFlagSet(Packet.FLAG_SYNCHRONIZE)) ) {
|
||||
// ack only, so release it asap
|
||||
_packetCache.release(packet.getPayload());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user