webdav: reply with vmaxb as disk size (#1120)

if vmaxb smaller than available disk space, then reply with vmaxb instead
This commit is contained in:
Rabid
2025-12-23 21:06:36 +01:00
committed by GitHub
parent fa32e15958
commit 511dc01615

View File

@@ -1833,6 +1833,14 @@ class HttpCli(object):
):
bfree, btot, _ = get_df(vn.realpath, False)
if btot:
if "vmaxb" in vn.flags:
try:
zi, _ = self.conn.hsrv.broker.ask(
"up2k.get_volsizes", [vn.realpath]
).get()[0]
bfree = min(bfree, max(0, vn.lim.vbmax - zi))
except:
pass
df = {
"quota-available-bytes": str(bfree),
"quota-used-bytes": str(btot - bfree),