serve sftp: fix spurious debugs on server close

This commit is contained in:
Nick Craig-Wood 2019-08-07 16:38:50 +01:00
parent 84b5da089e
commit 62b769a0a7

View File

@ -167,7 +167,7 @@ func (c *conn) handleChannel(newChannel ssh.NewChannel) {
} }
defer func() { defer func() {
err := channel.Close() err := channel.Close()
if err != nil { if err != nil && err != io.EOF {
fs.Debugf(c.what, "Failed to close channel: %v", err) fs.Debugf(c.what, "Failed to close channel: %v", err)
} }
}() }()
@ -218,7 +218,7 @@ func (c *conn) handleChannel(newChannel ssh.NewChannel) {
server := sftp.NewRequestServer(channel, c.handlers) server := sftp.NewRequestServer(channel, c.handlers)
defer func() { defer func() {
err := server.Close() err := server.Close()
if err != nil { if err != nil && err != io.EOF {
fs.Debugf(c.what, "Failed to close server: %v", err) fs.Debugf(c.what, "Failed to close server: %v", err)
} }
}() }()