fix SSH ping timeout
This commit is contained in:
parent
7ce6fa537b
commit
503568b093
10
gost/ssh.go
10
gost/ssh.go
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user