1
0
mirror of https://github.com/golang/go synced 2024-11-22 04:44:39 -07:00

exp/ssh: ensure initial window advertisement is not lost

Some remote servers send a 0 window size in the channel
open confirm msg, others send a non zero window size. Make
sure this initial advertisement is not lost.

R=agl, rsc, cw
CC=golang-dev
https://golang.org/cl/5372083
This commit is contained in:
Dave Cheney 2011-11-13 12:13:46 -05:00 committed by Adam Langley
parent 06ef97e15d
commit 90ec203318

View File

@ -195,6 +195,7 @@ func (c *ClientConn) openChan(typ string) (*clientChan, error) {
switch msg := (<-ch.msg).(type) { switch msg := (<-ch.msg).(type) {
case *channelOpenConfirmMsg: case *channelOpenConfirmMsg:
ch.peersId = msg.MyId ch.peersId = msg.MyId
ch.win <- int(msg.MyWindow)
case *channelOpenFailureMsg: case *channelOpenFailureMsg:
c.chanlist.remove(ch.id) c.chanlist.remove(ch.id)
return nil, errors.New(msg.Message) return nil, errors.New(msg.Message)