go.crypto/ssh: Increase window size.

Increase window size for channels (session and tcpip) to 64 *
max packet size (32 KB), which is the same value that OpenSSH
uses. Also breaks out the relevant harcoded constants into named
constants in channel.go.

Fixes golang/go#6675.

R=golang-dev, dave, hanwen, agl
CC=golang-dev
https://golang.org/cl/18120043
This commit is contained in:
Jakob Borg
2013-11-01 04:24:39 +11:00
committed by Dave Cheney
parent 577ae2abf9
commit 4758fe8ce4
4 changed files with 14 additions and 10 deletions
+4 -6
View File
@@ -356,12 +356,10 @@ func (c *ClientConn) handleChanOpen(msg *channelOpenMsg) {
ch.maxPacket = msg.MaxPacketSize
m := channelOpenConfirmMsg{
PeersId: ch.remoteId,
MyId: ch.localId,
MyWindow: 1 << 14,
// As per RFC 4253 6.1, 32k is also the minimum.
MaxPacketSize: 1 << 15,
PeersId: ch.remoteId,
MyId: ch.localId,
MyWindow: channelWindowSize,
MaxPacketSize: channelMaxPacketSize,
}
c.transport.writePacket(marshal(msgChannelOpenConfirm, m))