go.crypto/ssh: add support for client side global requests

* Add support for RFC4254 section 4 global requests.
* Improve clientConn.Listen to process responses properly.

R=agl, gustav.paul
CC=golang-dev
https://golang.org/cl/6130050
This commit is contained in:
Dave Cheney
2012-05-01 15:43:58 +10:00
parent 2e60680932
commit b4b42222af
3 changed files with 101 additions and 51 deletions
+12 -2
View File
@@ -177,6 +177,16 @@ type globalRequestMsg struct {
WantReply bool
}
// See RFC 4254, section 4
type globalRequestSuccessMsg struct {
Data []byte `ssh:"rest"`
}
// See RFC 4254, section 4
type globalRequestFailureMsg struct {
Data []byte `ssh:"rest"`
}
// See RFC 4254, section 5.2
type windowAdjustMsg struct {
PeersId uint32
@@ -584,9 +594,9 @@ func decode(packet []byte) interface{} {
case msgGlobalRequest:
msg = new(globalRequestMsg)
case msgRequestSuccess:
msg = new(channelRequestSuccessMsg)
msg = new(globalRequestSuccessMsg)
case msgRequestFailure:
msg = new(channelRequestFailureMsg)
msg = new(globalRequestFailureMsg)
case msgChannelOpen:
msg = new(channelOpenMsg)
case msgChannelOpenConfirm: