go.crypto/ssh: allow zero sized window adjustments

The RFC doesn't prohibit zero sized window adjustments and
there is evidence of well known clients using them in the
wild.

R=agl, kardianos, gustav.paul
CC=golang-dev
https://golang.org/cl/6209082
This commit is contained in:
Dave Cheney
2012-05-22 12:04:51 +10:00
parent 36d74d6fed
commit 55aa08130e
2 changed files with 55 additions and 1 deletions
+2 -1
View File
@@ -300,8 +300,9 @@ type window struct {
// add adds win to the amount of window available
// for consumers.
func (w *window) add(win uint32) bool {
// a zero sized window adjust is a noop.
if win == 0 {
return false
return true
}
w.L.Lock()
if w.win+win < win {