(conn ssh.Conn, ticker *time.Ticker, stopCh chan struct{})
| 397 | } |
| 398 | |
| 399 | func keepalive(conn ssh.Conn, ticker *time.Ticker, stopCh chan struct{}) { |
| 400 | for { |
| 401 | select { |
| 402 | case <-ticker.C: |
| 403 | _, _, err := conn.SendRequest("keepalive@cloudfoundry.org", true, nil) |
| 404 | if err != nil { |
| 405 | log.Errorln("err sending keep alive:", err) |
| 406 | } |
| 407 | case <-stopCh: |
| 408 | ticker.Stop() |
| 409 | return |
| 410 | } |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | func md5Fingerprint(key ssh.PublicKey) string { |
| 415 | sum := md5.Sum(key.Marshal()) |
no test coverage detected