Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

serve sftp: fix spurious debugs on server close

Nick Craig-Wood62b769a0a7c1
diff --git a/cmd/serve/sftp/connection.go b/cmd/serve/sftp/connection.go
index 51408a8b5..5d50963ae 100644
--- a/cmd/serve/sftp/connection.go
+++ b/cmd/serve/sftp/connection.go
@@ -167,7 +167,7 @@ func (c *conn) handleChannel(newChannel ssh.NewChannel) {
}
defer func() {
err := channel.Close()
- if err != nil {
+ if err != nil && err != io.EOF {
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)
defer func() {
err := server.Close()
- if err != nil {
+ if err != nil && err != io.EOF {
fs.Debugf(c.what, "Failed to close server: %v", err)
}
}()