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
+7
-1
@@ -404,7 +404,13 @@ func (s *Session) wait() error {
|
||||
}
|
||||
wm.lang = safeString(string(lang))
|
||||
default:
|
||||
return fmt.Errorf("wait: unexpected channel request: %v", msg)
|
||||
// This handles keepalives and matches
|
||||
// OpenSSH's behaviour.
|
||||
if msg.WantReply {
|
||||
s.writePacket(marshal(msgChannelFailure, channelRequestFailureMsg{
|
||||
PeersId: s.remoteId,
|
||||
}))
|
||||
}
|
||||
}
|
||||
default:
|
||||
return fmt.Errorf("wait: unexpected packet %T received: %v", msg, msg)
|
||||
|
||||
Reference in New Issue
Block a user