diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 64b15c02..693d9335 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -475,15 +475,17 @@ class HttpCli(object): addr = self.ip.replace(":", ".") fn = "put-{:.6f}-{}.bin".format(time.time(), addr) path = os.path.join(fdir, fn) + if self.args.nw: + path = os.devnull with open(fsenc(path), "wb", 512 * 1024) as f: post_sz, _, sha_b64 = hashcopy(self.conn, reader, f) - vfs, vrem = vfs.get_dbv(rem) - - self.conn.hsrv.broker.put( - False, "up2k.hash_file", vfs.realpath, vfs.flags, vrem, fn - ) + if not self.args.nw: + vfs, vrem = vfs.get_dbv(rem) + self.conn.hsrv.broker.put( + False, "up2k.hash_file", vfs.realpath, vfs.flags, vrem, fn + ) return post_sz, sha_b64, remains, path diff --git a/tests/test_httpcli.py b/tests/test_httpcli.py index 52f52776..3f843eb8 100644 --- a/tests/test_httpcli.py +++ b/tests/test_httpcli.py @@ -30,6 +30,7 @@ class Cfg(Namespace): c=c, rproxy=0, ed=False, + nw=False, no_zip=False, no_scandir=False, no_sendfile=True, diff --git a/tests/test_vfs.py b/tests/test_vfs.py index 3ed4125a..66ff0151 100644 --- a/tests/test_vfs.py +++ b/tests/test_vfs.py @@ -17,7 +17,7 @@ from copyparty import util class Cfg(Namespace): def __init__(self, a=[], v=[], c=None): - ex = {k: False for k in "e2d e2ds e2dsa e2t e2ts e2tsr".split()} + ex = {k: False for k in "nw e2d e2ds e2dsa e2t e2ts e2tsr".split()} ex2 = { "mtp": [], "mte": "a",