mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
Add support for graceful shutdown
Fixes #1014 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -496,18 +496,10 @@ func (c *scpCommand) handleDownload(filePath string) error {
|
||||
}
|
||||
var err error
|
||||
|
||||
fs, err := c.connection.User.GetFilesystemForPath(filePath, c.connection.ID)
|
||||
fs, p, err := c.connection.GetFsAndResolvedPath(filePath)
|
||||
if err != nil {
|
||||
c.connection.Log(logger.LevelError, "error downloading file %#v: %+v", filePath, err)
|
||||
c.sendErrorMessage(nil, fmt.Errorf("unable to get fs for path %#v", filePath))
|
||||
return err
|
||||
}
|
||||
|
||||
p, err := fs.ResolvePath(filePath)
|
||||
if err != nil {
|
||||
err := fmt.Errorf("invalid file path %#v", filePath)
|
||||
c.connection.Log(logger.LevelError, "error downloading file: %#v, invalid file path", filePath)
|
||||
c.sendErrorMessage(fs, err)
|
||||
c.connection.Log(logger.LevelError, "error downloading file %q: %+v", filePath, err)
|
||||
c.sendErrorMessage(nil, fmt.Errorf("unable to download file %q: %w", filePath, err))
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user