diff --git a/copyparty/__version__.py b/copyparty/__version__.py index 71530054..ceafd9aa 100644 --- a/copyparty/__version__.py +++ b/copyparty/__version__.py @@ -1,8 +1,8 @@ # coding: utf-8 -VERSION = (1, 3, 7) +VERSION = (1, 3, 8) CODENAME = "god dag" -BUILD_DT = (2022, 7, 16) +BUILD_DT = (2022, 7, 27) S_VERSION = ".".join(map(str, VERSION)) S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index af497365..b8d001d3 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -378,7 +378,10 @@ class HttpCli(object): em = str(ex) msg = em if pex == ex else min_ex() - self.log("{}\033[0m, {}".format(msg, self.vpath), 3) + self.log( + "{}\033[0m, {}".format(msg, self.vpath), + 6 if em.startswith("client d/c ") else 3, + ) msg = "{}\r\nURL: {}\r\n".format(em, self.vpath) if self.hint: diff --git a/copyparty/httpsrv.py b/copyparty/httpsrv.py index 3f40b5e9..a6923e9d 100644 --- a/copyparty/httpsrv.py +++ b/copyparty/httpsrv.py @@ -261,8 +261,11 @@ class HttpSrv(object): ) self.thr_client(sck, addr) me.name = self.name + "-poolw" - except: - self.log(self.name, "thr_client: " + min_ex(), 3) + except Exception as ex: + if str(ex).startswith("client d/c "): + self.log(self.name, "thr_client: " + str(ex), 6) + else: + self.log(self.name, "thr_client: " + min_ex(), 3) def shutdown(self) -> None: self.stopping = True diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 3b444d55..a0a84012 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -952,7 +952,7 @@ class Up2k(object): def _verify_integrity(self, vol: VFS) -> int: """expensive; blocks database access until finished""" ptop = vol.realpath - assert self.pp and self.mtag + assert self.pp cur = self.cur[ptop] rei = vol.flags.get("noidx") @@ -1068,8 +1068,7 @@ class Up2k(object): with self.mutex: reg = self.register_vpath(ptop, vol.flags) - assert reg and self.pp and self.mtag - _, db_path = reg + assert reg and self.pp entags = self.entags[ptop] flags = self.flags[ptop] cur = self.cur[ptop] diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index ab7dc318..5a4befed 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -921,8 +921,14 @@ function up2k_init(subtle) { catch (ex) { } ev(e); - e.dataTransfer.dropEffect = 'copy'; - e.dataTransfer.effectAllowed = 'copy'; + try { + e.dataTransfer.dropEffect = 'copy'; + e.dataTransfer.effectAllowed = 'copy'; + } + catch (ex) { + document.body.ondragenter = document.body.ondragleave = document.body.ondragover = null; + return modal.alert('your browser does not support drag-and-drop uploading'); + } clmod(ebi('drops'), 'vis', 1); var v = this.getAttribute('v'); if (v) @@ -1369,6 +1375,10 @@ function up2k_init(subtle) { st.busy.handshake.length) return false; + if (t.n - st.car > 8) + // prevent runahead from a stuck upload (slow server hdd) + return false; + if ((uc.multitask ? 1 : 0) < st.todo.upload.length + st.busy.upload.length)