mirror of
https://github.com/rclone/rclone.git
synced 2025-01-11 08:49:37 +01:00
webdav: fix About/df when reading the available/total returns 0
Some WebDAV servers return an empty Available and Used which parses as 0. This caused About to return the Total as 0 which can confused mounted file systems. After this change we ignore the result if Available and Used are both 0. See: https://forum.rclone.org/t/windows-mounted-webdav-drive-has-no-free-space/8938
This commit is contained in:
parent
2b58d1a46f
commit
2fbb504b66
@ -916,12 +916,14 @@ func (f *Fs) About() (*fs.Usage, error) {
|
|||||||
return nil, errors.Wrap(err, "about call failed")
|
return nil, errors.Wrap(err, "about call failed")
|
||||||
}
|
}
|
||||||
usage := &fs.Usage{}
|
usage := &fs.Usage{}
|
||||||
|
if q.Available != 0 || q.Used != 0 {
|
||||||
if q.Available >= 0 && q.Used >= 0 {
|
if q.Available >= 0 && q.Used >= 0 {
|
||||||
usage.Total = fs.NewUsageValue(q.Available + q.Used)
|
usage.Total = fs.NewUsageValue(q.Available + q.Used)
|
||||||
}
|
}
|
||||||
if q.Used >= 0 {
|
if q.Used >= 0 {
|
||||||
usage.Used = fs.NewUsageValue(q.Used)
|
usage.Used = fs.NewUsageValue(q.Used)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return usage, nil
|
return usage, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user