pipe: add volflag to disable

This commit is contained in:
ed 2024-04-19 23:54:23 +00:00
parent 897ffbbbd0
commit c06126cc9d
3 changed files with 10 additions and 6 deletions

View file

@ -1091,6 +1091,7 @@ def add_optouts(ap):
ap2.add_argument("--no-zip", action="store_true", help="disable download as zip/tar") ap2.add_argument("--no-zip", action="store_true", help="disable download as zip/tar")
ap2.add_argument("--no-tarcmp", action="store_true", help="disable download as compressed tar (?tar=gz, ?tar=bz2, ?tar=xz, ?tar=gz:9, ...)") ap2.add_argument("--no-tarcmp", action="store_true", help="disable download as compressed tar (?tar=gz, ?tar=bz2, ?tar=xz, ?tar=gz:9, ...)")
ap2.add_argument("--no-lifetime", action="store_true", help="do not allow clients (or server config) to schedule an upload to be deleted after a given time") ap2.add_argument("--no-lifetime", action="store_true", help="do not allow clients (or server config) to schedule an upload to be deleted after a given time")
ap2.add_argument("--no-pipe", action="store_true", help="disable race-the-beam (lockstep download of files which are currently being uploaded) (volflag=nopipe)")
ap2.add_argument("--no-db-ip", action="store_true", help="do not write uploader IPs into the database") ap2.add_argument("--no-db-ip", action="store_true", help="do not write uploader IPs into the database")

View file

@ -16,6 +16,7 @@ def vf_bmap() -> dict[str, str]:
"no_dedup": "copydupes", "no_dedup": "copydupes",
"no_dupe": "nodupe", "no_dupe": "nodupe",
"no_forget": "noforget", "no_forget": "noforget",
"no_pipe": "nopipe",
"no_robots": "norobots", "no_robots": "norobots",
"no_thumb": "dthumb", "no_thumb": "dthumb",
"no_vthumb": "dvthumb", "no_vthumb": "dvthumb",

View file

@ -2936,12 +2936,12 @@ class HttpCli(object):
logtail = "" logtail = ""
if ptop is not None: if ptop is not None:
try:
dp, fn = os.path.split(req_path) dp, fn = os.path.split(req_path)
tnam = fn + ".PARTIAL" tnam = fn + ".PARTIAL"
if self.args.dotpart: if self.args.dotpart:
tnam = "." + tnam tnam = "." + tnam
ap_data = os.path.join(dp, tnam) ap_data = os.path.join(dp, tnam)
try:
st_data = bos.stat(ap_data) st_data = bos.stat(ap_data)
if not st_data.st_size: if not st_data.st_size:
raise Exception("partial is empty") raise Exception("partial is empty")
@ -4179,7 +4179,9 @@ class HttpCli(object):
): ):
return self.tx_md(vn, abspath) return self.tx_md(vn, abspath)
return self.tx_file(abspath, None if st.st_size else vn.realpath) return self.tx_file(
abspath, None if st.st_size or "nopipe" in vn.flags else vn.realpath
)
elif is_dir and not self.can_read: elif is_dir and not self.can_read:
if self._use_dirkey(abspath): if self._use_dirkey(abspath):