From 357e7333cc23b157e8fa51910662aa56a8f9ca58 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 4 Nov 2022 20:27:16 +0000 Subject: [PATCH] cleanup --- README.md | 3 +-- copyparty/__main__.py | 4 ++-- copyparty/svchub.py | 2 +- copyparty/util.py | 2 +- copyparty/web/up2k.js | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9b8e428d..1a17e1d7 100644 --- a/README.md +++ b/README.md @@ -144,8 +144,7 @@ recommended additional steps on debian which enable audio metadata and thumbnai ## features * backend stuff - * ☑ sanic multipart parser - * ☑ multiprocessing (actual multithreading) + * ☑ [multiprocessing](#performance) (actual multithreading) * ☑ volumes (mountpoints) * ☑ [accounts](#accounts-and-volumes) * ☑ [ftp server](#ftp-server) diff --git a/copyparty/__main__.py b/copyparty/__main__.py index e00108eb..28e7a169 100755 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -598,8 +598,8 @@ def run_argparse( ap2.add_argument("--plain-ip", action="store_true", help="when avoiding filename collisions by appending the uploader's ip to the filename: append the plaintext ip instead of salting and hashing the ip") ap2.add_argument("--unpost", metavar="SEC", type=int, default=3600*12, help="grace period where uploads can be deleted by the uploader, even without delete permissions; 0=disabled") ap2.add_argument("--reg-cap", metavar="N", type=int, default=38400, help="max number of uploads to keep in memory when running without -e2d; roughly 1 MiB RAM per 600") - ap2.add_argument("--no-fpool", action="store_true", help="disable file-handle pooling -- instead, repeatedly close and reopen files during upload") - ap2.add_argument("--use-fpool", action="store_true", help="force file-handle pooling, even if copyparty thinks you're better off without -- probably useful on nfs and cow filesystems (zfs, btrfs)") + ap2.add_argument("--no-fpool", action="store_true", help="disable file-handle pooling -- instead, repeatedly close and reopen files during upload (very slow on windows)") + ap2.add_argument("--use-fpool", action="store_true", help="force file-handle pooling, even when it might be dangerous (multiprocessing, filesystems lacking sparse-files support, ...)") ap2.add_argument("--hardlink", action="store_true", help="prefer hardlinks instead of symlinks when possible (within same filesystem)") ap2.add_argument("--never-symlink", action="store_true", help="do not fallback to symlinks when a hardlink cannot be made") ap2.add_argument("--no-dedup", action="store_true", help="disable symlink/hardlink creation; copy file contents instead") diff --git a/copyparty/svchub.py b/copyparty/svchub.py index 40f54def..23cf7c4e 100644 --- a/copyparty/svchub.py +++ b/copyparty/svchub.py @@ -413,7 +413,7 @@ class SvcHub(object): def kill9(self, delay: float = 0.0) -> None: if delay > 0.01: time.sleep(delay) - print("component stuck; performing sigkill") + print("component stuck; issuing sigkill") time.sleep(0.1) if ANYWIN: diff --git a/copyparty/util.py b/copyparty/util.py index f1c85521..76c1bdda 100644 --- a/copyparty/util.py +++ b/copyparty/util.py @@ -1169,7 +1169,7 @@ class MultipartParser(object): return field, None try: - is_webkit = self.headers["user-agent"].lower().find("applewebkit") >= 0 + is_webkit = "applewebkit" in self.headers["user-agent"].lower() except: is_webkit = False diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index a837e36a..ccaff43a 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -1237,7 +1237,7 @@ function up2k_init(subtle) { if (name.startsWith('/')) name = name.slice(1); - bad.push([dn, name]); + bad.push([dn, name + '/']); read_dirs(null, pf, dirs.slice(1), good, nil, bad, spins); }); }