From 88fedd577d7f96fb71420557bc2a31f760da6c31 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Sun, 28 Jul 2019 13:40:12 +0200 Subject: [PATCH] sftpd handler: remove eccessive logging and prepare the code to support upload resume Upload resume is currently disabled for this upstream bug: https://github.com/pkg/sftp/issues/295 --- sftpd/handler.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sftpd/handler.go b/sftpd/handler.go index 1b857440..0cbebb77 100644 --- a/sftpd/handler.go +++ b/sftpd/handler.go @@ -119,8 +119,6 @@ func (c Connection) Filewrite(request *sftp.Request) (io.WriterAt, error) { utils.SetPathPermissions(p, c.User.GetUID(), c.User.GetGID()) - logger.Debug(logSender, "file upload/replace started for path \"%v\" user: %v", p, c.User.Username) - transfer := Transfer{ file: file, path: p, @@ -175,8 +173,6 @@ func (c Connection) Filewrite(request *sftp.Request) (io.WriterAt, error) { utils.SetPathPermissions(p, c.User.GetUID(), c.User.GetGID()) - logger.Debug(logSender, "file upload started for path \"%v\" user: %v", p, c.User.Username) - transfer := Transfer{ file: file, path: p, @@ -186,7 +182,7 @@ func (c Connection) Filewrite(request *sftp.Request) (io.WriterAt, error) { user: c.User, connectionID: c.ID, transferType: transferUpload, - isNewFile: !trunc, + isNewFile: false, } addTransfer(&transfer) return &transfer, nil