Message:
Hello golan...@googlegroups.com (cc: a...@golang.org,
golan...@googlegroups.com),
I'd like you to review this change to
http://code.google.com/p/go.crypto
Description:
go.crypto/ssh: respect adjust window msg on server.
Please review this at http://codereview.appspot.com/5908048/
Affected files:
M ssh/channel.go
M ssh/server.go
Index: ssh/channel.go
===================================================================
--- a/ssh/channel.go
+++ b/ssh/channel.go
@@ -149,6 +149,9 @@
case *channelEOFMsg:
c.theySentEOF = true
c.cond.Signal()
+ case *windowAdjustMsg:
+ c.theirWindow += packet.AdditionalBytes
+ c.cond.Signal()
default:
panic("unknown packet type")
}
Index: ssh/server.go
===================================================================
--- a/ssh/server.go
+++ b/ssh/server.go
@@ -570,6 +570,16 @@
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]
This appears to me to partially solve a problem I've been having with
the ssh server package. Reference unit test code here:
https://gist.github.com/2188648
Although this appears to expand how large of a continuous read the
server can sustain, it will still dead-lock on a larger message (again
see test code).
This is related to, but doesn't appear to fully fix issue 3204.
-Daniel
go.crypto/ssh: respect adjust window msg on server.
R=golang-dev
CC=agl, golang-dev
http://codereview.appspot.com/5908048
Committer: Adam Langley <a...@golang.org>