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:
committed by
Adam Langley
parent
d95b28330d
commit
61ab4d36df
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user