Skip to content

Commit

Permalink
Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
nirui committed Dec 3, 2023
1 parent b1e3888 commit 77fc7b8
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions application/commands/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,6 @@ type sshRemoteConnWrapper struct {
}

func (s *sshRemoteConnWrapper) Read(b []byte) (int, error) {
rLen, rErr := s.Conn.Read(b)

if rErr == nil {
return rLen, nil
}

netErr, isNetErr := rErr.(net.Error)

if !isNetErr || !netErr.Timeout() || !s.requestTimeoutRetry(s) {
return rLen, rErr
}

for {
rLen, rErr := s.Conn.Read(b)

Expand Down Expand Up @@ -341,7 +329,7 @@ func (d *sshClient) buildAuthMethod(
return nil, ErrSSHInvalidAuthMethod
}

func (d *sshClient) comfirmRemoteFingerprint(
func (d *sshClient) confirmRemoteFingerprint(
hostname string,
remote net.Addr,
key ssh.PublicKey,
Expand Down Expand Up @@ -461,7 +449,7 @@ func (d *sshClient) remote(
User: user,
Auth: authMethodBuilder(buf[:]),
HostKeyCallback: func(h string, r net.Addr, k ssh.PublicKey) error {
return d.comfirmRemoteFingerprint(h, r, k, buf[:])
return d.confirmRemoteFingerprint(h, r, k, buf[:])
},
Timeout: d.cfg.DialTimeout,
})
Expand Down

0 comments on commit 77fc7b8

Please sign in to comment.