Skip to content
This repository has been archived by the owner on Aug 17, 2024. It is now read-only.

Commit

Permalink
释放服务器上面sftp-server进程 (#247)
Browse files Browse the repository at this point in the history
如果不关闭,会在服务器上面产生大量的 /usr/libexec/openssh/sftp-server 进程
  • Loading branch information
xyuer authored Apr 20, 2022
1 parent 0c2b8dd commit 0d0cf1b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/term/next_terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ func (ret *NextTerminal) Write(p []byte) (int, error) {
}

func (ret *NextTerminal) Close() error {

if ret.SftpClient != nil {
return ret.SftpClient.Close()
}

if ret.SshSession != nil {
return ret.SshSession.Close()
}
Expand Down

0 comments on commit 0d0cf1b

Please sign in to comment.