mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 15:28:05 +03:00
set version to 2.4.5
backport the latest patch from main Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -211,6 +211,18 @@ func (t *BaseTransfer) SetCancelFn(cancelFn func()) {
|
||||
t.cancelFn = cancelFn
|
||||
}
|
||||
|
||||
// ConvertError accepts an error that occurs during a read or write and
|
||||
// converts it into a more understandable form for the client if it is a
|
||||
// well-known type of error
|
||||
func (t *BaseTransfer) ConvertError(err error) error {
|
||||
if t.Fs.IsNotExist(err) {
|
||||
return t.Connection.GetNotExistError()
|
||||
} else if t.Fs.IsPermission(err) {
|
||||
return t.Connection.GetPermissionDeniedError()
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CheckRead returns an error if read if not allowed
|
||||
func (t *BaseTransfer) CheckRead() error {
|
||||
if t.transferQuota.AllowedDLSize == 0 && t.transferQuota.AllowedTotalSize == 0 {
|
||||
|
||||
Reference in New Issue
Block a user