Skip to content

Commit a9cecff

Browse files
committed
support android retries
1 parent cd6468c commit a9cecff

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

client/client_connect.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,19 @@ func (c *Client) connectionOnce(ctx context.Context) (connected, retry bool, err
9292
c.Debugf("Handshaking...")
9393
sshConn, chans, reqs, err := ssh.NewClientConn(conn, "", c.sshConfig)
9494
if err != nil {
95-
if strings.Contains(err.Error(), "unable to authenticate") {
95+
e := err.Error()
96+
if strings.Contains(e, "unable to authenticate") {
9697
c.Infof("Authentication failed")
97-
c.Debugf(err.Error())
98+
c.Debugf(e)
9899
retry = false
100+
} else if strings.Contains(e, "connection abort") {
101+
c.Infof("retriable: %s", e)
102+
retry = true
99103
} else if n, ok := err.(net.Error); ok && !n.Temporary() {
100-
c.Infof(err.Error())
104+
c.Infof(e)
101105
retry = false
102106
} else {
103-
c.Infof("retriable: %s", err.Error())
107+
c.Infof("retriable: %s", e)
104108
retry = true
105109
}
106110
return false, retry, err

0 commit comments

Comments
 (0)