Commit 503568b0 authored by rui.zheng's avatar rui.zheng

fix SSH ping timeout

parent 7ce6fa53
...@@ -279,10 +279,12 @@ func (s *sshSession) Ping(interval time.Duration, retries int) { ...@@ -279,10 +279,12 @@ func (s *sshSession) Ping(interval time.Duration, retries int) {
func (s *sshSession) sendPing() <-chan error { func (s *sshSession) sendPing() <-chan error {
ch := make(chan error, 1) ch := make(chan error, 1)
if _, _, err := s.client.SendRequest("ping", true, nil); err != nil { go func() {
ch <- err if _, _, err := s.client.SendRequest("ping", true, nil); err != nil {
} ch <- err
close(ch) }
close(ch)
}()
return ch return ch
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment