mirror of
https://github.com/9001/copyparty.git
synced 2025-08-19 01:42:20 -06:00
normalize collision suffix
This commit is contained in:
parent
42acc457af
commit
4f97d7cf8d
|
@ -1050,7 +1050,7 @@ class HttpCli(object):
|
|||
if not bos.path.isdir(fdir):
|
||||
raise Pebkac(404, "that folder does not exist")
|
||||
|
||||
suffix = ".{:.6f}-{}".format(time.time(), self.ip)
|
||||
suffix = "-{:.6f}-{}".format(time.time(), self.dip)
|
||||
open_args = {"fdir": fdir, "suffix": suffix}
|
||||
else:
|
||||
open_args = {}
|
||||
|
|
|
@ -1318,7 +1318,7 @@ class Up2k(object):
|
|||
|
||||
# TODO broker which avoid this race and
|
||||
# provides a new filename if taken (same as bup)
|
||||
suffix = ".{:.6f}-{}".format(ts, ip)
|
||||
suffix = "-{:.6f}-{}".format(ts, ip.replace(":", "."))
|
||||
with ren_open(fname, "wb", fdir=fdir, suffix=suffix) as f:
|
||||
return f["orz"][1]
|
||||
|
||||
|
@ -1877,7 +1877,8 @@ class Up2k(object):
|
|||
del self.registry[job["ptop"]][job["wark"]]
|
||||
return
|
||||
|
||||
suffix = ".{:.6f}-{}".format(job["t0"], job["addr"])
|
||||
dip = job["addr"].replace(":", ".")
|
||||
suffix = "-{:.6f}-{}".format(job["t0"], dip)
|
||||
with ren_open(tnam, "wb", fdir=pdir, suffix=suffix) as f:
|
||||
f, job["tnam"] = f["orz"]
|
||||
if (
|
||||
|
|
Loading…
Reference in a new issue