- 修复ssh连接协程泄漏的问题
This commit is contained in:
parent
b73bef0c08
commit
f3a78761c8
@ -80,21 +80,21 @@ func (ret *NextTerminal) Write(p []byte) (int, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ret *NextTerminal) Close() error {
|
func (ret *NextTerminal) Close() error {
|
||||||
|
|
||||||
if ret.SftpClient != nil {
|
if ret.SftpClient != nil {
|
||||||
return ret.SftpClient.Close()
|
_ = ret.SftpClient.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ret.SshSession != nil {
|
if ret.SshSession != nil {
|
||||||
return ret.SshSession.Close()
|
_ = ret.SshSession.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ret.SshClient != nil {
|
if ret.SshClient != nil {
|
||||||
return ret.SshClient.Close()
|
_ = ret.SshClient.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
if ret.Recorder != nil {
|
if ret.Recorder != nil {
|
||||||
return ret.Close()
|
ret.Recorder.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user