From a997455b5a3d937f53ad40f431534a0e3865e9f7 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 16 Apr 2026 11:38:06 +0000 Subject: [PATCH] bup: skip lim for nullwrite/nameless (perf) --- copyparty/httpcli.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 3dcc2085..fab99948 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -3828,6 +3828,14 @@ class HttpCli(object): finally: f.close() + self.conn.nbyte += sz + if not abspath: + files.append( + (sz, sha_hex, sha_b64, p_file or "(discarded)", fname, "") + ) + tabspath = "" + continue + if lim: lim.nup(self.ip) lim.bup(self.ip, sz) @@ -3838,20 +3846,11 @@ class HttpCli(object): lim.chk_bup(self.ip) lim.chk_nup(self.ip) except: - if not nullwrite: - wunlink(self.log, tabspath, vfs.flags) - wunlink(self.log, abspath, vfs.flags) + wunlink(self.log, tabspath, vfs.flags) + wunlink(self.log, abspath, vfs.flags) fname = os.devnull raise - self.conn.nbyte += sz - if not abspath: - files.append( - (sz, sha_hex, sha_b64, p_file or "(discarded)", fname, "") - ) - tabspath = "" - continue - atomic_move(self.log, tabspath, abspath, vfs.flags) tabspath = ""