From 415e61c3c9f3fc4d8e2a3ab0aff8c1b4f1e63fbd Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 16 Sep 2022 23:51:55 +0200 Subject: [PATCH] prevent blanks from skipping ahead in the queue --- copyparty/web/browser.js | 2 +- copyparty/web/up2k.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 6ceede26..b9d72d9c 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -5040,7 +5040,7 @@ var treectl = (function () { if (r.trunc) { for (var a = r.lim; a < nodes.length; a++) { var tn = nodes[a], - tns = Object.keys(tn.tags); + tns = Object.keys(tn.tags || {}); plain.push(uricom_dec(tn.href.split('?')[0])); diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index e04ff66a..4c4098e4 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -1267,9 +1267,7 @@ function up2k_init(subtle) { st.bytes.total += entry.size; st.files.push(entry); - if (!entry.size) - push_t(st.todo.handshake, entry); - else if (uc.turbo) + if (uc.turbo) push_t(st.todo.head, entry); else push_t(st.todo.hash, entry); @@ -1713,6 +1711,9 @@ function up2k_init(subtle) { function exec_hash() { var t = st.todo.hash.shift(); + if (!t.size) + return st.todo.handshake.push(t); + st.busy.hash.push(t); st.nfile.hash = t.n; t.t_hashing = Date.now();