cloudproxy: agent: ssh: cancel on return from Start

This commit is contained in:
Yousong Zhou
2021-04-02 18:11:57 +08:00
parent 43f48e6b3a
commit a4697d081b

View File

@@ -143,6 +143,9 @@ func (c *Client) Stop(ctx context.Context) {
}
func (c *Client) Start(ctx context.Context) {
ctx, cancelFunc := context.WithCancel(ctx)
defer cancelFunc()
pingT := time.NewTimer(17 * time.Second)
pingFailCount := 0
const pingMaxFail = 3