go.crypto/ssh: support OpenSSH keepalives

Fixes golang/go#4552.

R=minux.ma, agl
CC=golang-dev
https://golang.org/cl/6948059
This commit is contained in:
Eric Milliken
2012-12-18 11:33:58 -05:00
committed by Adam Langley
parent d95b28330d
commit 61ab4d36df
3 changed files with 46 additions and 1 deletions
+6
View File
@@ -309,6 +309,12 @@ func (c *ClientConn) mainLoop() {
// invalid window update
return
}
case *globalRequestMsg:
// This handles keepalive messages and matches
// the behaviour of OpenSSH.
if msg.WantReply {
c.writePacket(marshal(msgRequestFailure, globalRequestFailureMsg{}))
}
case *globalRequestSuccessMsg, *globalRequestFailureMsg:
c.globalRequest.response <- msg
case *disconnectMsg: