mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-09 00:18:39 +03:00
Lower the ceiling on max remote packet size (so we don't allocate huge buffers) & spell it out mor explicitly
This commit is contained in:
@@ -61,6 +61,8 @@ import java.util.concurrent.locks.ReentrantLock;
|
|||||||
public abstract class AbstractChannel
|
public abstract class AbstractChannel
|
||||||
implements Channel {
|
implements Channel {
|
||||||
|
|
||||||
|
private static final int REMOTE_MAX_PACKET_SIZE_CEILING = 1024 * 1024;
|
||||||
|
|
||||||
/** Logger */
|
/** Logger */
|
||||||
protected final Logger log = LoggerFactory.getLogger(getClass());
|
protected final Logger log = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
@@ -118,7 +120,7 @@ public abstract class AbstractChannel
|
|||||||
|
|
||||||
protected void init(int recipient, long remoteWinSize, long remoteMaxPacketSize) {
|
protected void init(int recipient, long remoteWinSize, long remoteMaxPacketSize) {
|
||||||
this.recipient = recipient;
|
this.recipient = recipient;
|
||||||
rwin = new Window.Remote(remoteWinSize, (int) Math.min(remoteMaxPacketSize, Integer.MAX_VALUE));
|
rwin = new Window.Remote(remoteWinSize, (int) Math.min(remoteMaxPacketSize, REMOTE_MAX_PACKET_SIZE_CEILING));
|
||||||
out = new ChannelOutputStream(this, trans, rwin);
|
out = new ChannelOutputStream(this, trans, rwin);
|
||||||
log.info("Initialized - {}", this);
|
log.info("Initialized - {}", this);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user