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
This commit is contained in:
Nicola Murino 2019-07-28 13:40:12 +02:00
parent c547c5c9ee
commit 88fedd577d

View file

@ -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