mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-21 23:20:24 +00:00
fix check for used quota
remove unused data provider from sftpd configuration struct
This commit is contained in:
parent
1348862e52
commit
ff8fb80e3c
1 changed files with 1 additions and 2 deletions
|
@ -30,7 +30,6 @@ type Connection struct {
|
||||||
lastActivity time.Time
|
lastActivity time.Time
|
||||||
lock *sync.Mutex
|
lock *sync.Mutex
|
||||||
sshConn *ssh.ServerConn
|
sshConn *ssh.ServerConn
|
||||||
dataProvider dataprovider.Provider
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fileread creates a reader for a file on the system and returns the reader back.
|
// Fileread creates a reader for a file on the system and returns the reader back.
|
||||||
|
@ -401,7 +400,7 @@ func (c Connection) handleSFTPRemove(path string) error {
|
||||||
|
|
||||||
func (c Connection) hasSpace(checkFiles bool) bool {
|
func (c Connection) hasSpace(checkFiles bool) bool {
|
||||||
if (checkFiles && c.User.QuotaFiles > 0) || c.User.QuotaSize > 0 {
|
if (checkFiles && c.User.QuotaFiles > 0) || c.User.QuotaSize > 0 {
|
||||||
numFile, size, err := dataprovider.GetUsedQuota(c.dataProvider, c.User.Username)
|
numFile, size, err := dataprovider.GetUsedQuota(dataProvider, c.User.Username)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if _, ok := err.(*dataprovider.MethodDisabledError); ok {
|
if _, ok := err.(*dataprovider.MethodDisabledError); ok {
|
||||||
logger.Warn(logSender, "quota enforcement not possible for user %v: %v", c.User.Username, err)
|
logger.Warn(logSender, "quota enforcement not possible for user %v: %v", c.User.Username, err)
|
||||||
|
|
Loading…
Reference in a new issue