소스 검색

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

R=golang-dev
CC=agl, golang-dev
https://golang.org/cl/5908048
Daniel Theophanes 13 년 전
부모
커밋
452b645a37
2개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      ssh/channel.go
  2. 10 0
      ssh/server.go

+ 3 - 0
ssh/channel.go

@@ -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 - 0
ssh/server.go

@@ -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]