go.crypto/ssh: respect adjust window msg on server.

R=golang-dev
CC=agl, golang-dev
https://golang.org/cl/5908048
This commit is contained in:
Daniel Theophanes
2012-03-26 12:44:23 -04:00
committed by Adam Langley
parent a1a1826210
commit 452b645a37
2 changed files with 13 additions and 0 deletions
+3
View File
@@ -149,6 +149,9 @@ func (c *channel) handlePacket(packet interface{}) {
case *channelEOFMsg:
c.theySentEOF = true
c.cond.Signal()
case *windowAdjustMsg:
c.theirWindow += packet.AdditionalBytes
c.cond.Signal()
default:
panic("unknown packet type")
}
+10
View File
@@ -570,6 +570,16 @@ func (s *ServerConn) Accept() (Channel, error) {
c.handlePacket(msg)
s.lock.Unlock()
case *windowAdjustMsg:
s.lock.Lock()
c, ok := s.channels[msg.PeersId]
if !ok {
s.lock.Unlock()
continue
}
c.handlePacket(msg)
s.lock.Unlock()
case *channelEOFMsg:
s.lock.Lock()
c, ok := s.channels[msg.PeersId]