This commit is contained in:
ed 2026-06-13 11:15:20 +00:00
parent 22c3a3dd46
commit 5a8949d595
4 changed files with 10 additions and 3 deletions

View file

@ -123,6 +123,7 @@ from .util import (
unescape_cookie, unescape_cookie,
unquotep, unquotep,
vjoin, vjoin,
vjoins,
vol_san, vol_san,
vroots, vroots,
vsplit, vsplit,
@ -1919,7 +1920,7 @@ class HttpCli(object):
df = {} df = {}
fgen = itertools.chain([topdir], fgen) fgen = itertools.chain([topdir], fgen)
vtop = vjoin(self.args.R, vjoin(vn.vpath, rem)) vtop = vjoins(self.args.R, vn.vpath, rem)
chunksz = 0x7FF8 # preferred by nginx or cf (dunno which) chunksz = 0x7FF8 # preferred by nginx or cf (dunno which)

View file

@ -22,6 +22,7 @@ from .util import (
quotep, quotep,
s3dec, s3dec,
vjoin, vjoin,
vjoins,
) )
if HAVE_SQLITE3: if HAVE_SQLITE3:
@ -437,7 +438,7 @@ class U2idx(object):
if rd.startswith("//") or fn.startswith("//"): if rd.startswith("//") or fn.startswith("//"):
rd, fn = s3dec(rd, fn) rd, fn = s3dec(rd, fn)
vp = vjoin(vjoin(vtop, rd), fn) vp = vjoins(vtop, rd, fn)
if vp in seen_rps: if vp in seen_rps:
continue continue

View file

@ -70,6 +70,7 @@ from .util import (
ub64enc, ub64enc,
unhumanize, unhumanize,
vjoin, vjoin,
vjoins,
vsplit, vsplit,
w8b64dec, w8b64dec,
w8b64enc, w8b64enc,
@ -3190,7 +3191,7 @@ class Up2k(object):
c2 = None c2 = None
for cur, dp_dir, dp_fn in lost: for cur, dp_dir, dp_fn in lost:
t = "forgetting desynced db entry: %r" t = "forgetting desynced db entry: %r"
self.log(t % ("/" + vjoin(vjoin(vfs.vpath, dp_dir), dp_fn))) self.log(t % ("/" + vjoins(vfs.vpath, dp_dir, dp_fn)))
self.db_rm(cur, vfs.flags, dp_dir, dp_fn, cj["size"]) self.db_rm(cur, vfs.flags, dp_dir, dp_fn, cj["size"])
if c2 and c2 != cur: if c2 and c2 != cur:
c2.connection.commit() c2.connection.commit()

View file

@ -2679,6 +2679,10 @@ def vjoin(rd: str, fn: str) -> str:
return rd or fn return rd or fn
def vjoins(*a: str) -> str:
return "/".join([x for x in a if x])
# url-join # url-join
def ujoin(rd: str, fn: str) -> str: def ujoin(rd: str, fn: str) -> str:
if rd and fn: if rd and fn: