diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 15ca799c..7349baa7 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -3041,6 +3041,7 @@ class Up2k(object): chunksize = up2k_chunksize(job["size"]) coffsets = [] + nchunks = [] for chash in chashes: nchunk = [n for n, v in enumerate(job["hash"]) if v == chash] if not nchunk: @@ -3048,6 +3049,7 @@ class Up2k(object): ofs = [chunksize * x for x in nchunk] coffsets.append(ofs) + nchunks.append(nchunk) for ofs1, ofs2 in zip(coffsets, coffsets[1:]): gap = (ofs2[0] - ofs1[0]) - chunksize @@ -3059,9 +3061,9 @@ class Up2k(object): if not job["sprs"]: cur_sz = bos.path.getsize(path) - if ofs[0] > cur_sz: + if coffsets[0][0] > cur_sz: t = "please upload sequentially using one thread;\nserver filesystem does not support sparse files.\n file: {}\n chunk: {}\n cofs: {}\n flen: {}" - t = t.format(job["name"], nchunk[0], ofs[0], cur_sz) + t = t.format(job["name"], nchunks[0][0], coffsets[0][0], cur_sz) raise Pebkac(400, t) job["busy"][chash] = 1 diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 48927eb7..95ef9b0b 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -2400,6 +2400,7 @@ function up2k_init(subtle) { 'nparts': nparts }); } + t.nojoin = 0; msg = null; done = false; @@ -2606,7 +2607,7 @@ function up2k_init(subtle) { } else if (txt.indexOf('already got that') + 1 || txt.indexOf('already being written') + 1) { - t.nojoin = t.postlist.length; + t.nojoin = t.nojoin || t.postlist.length; console.log("ignoring dupe-segment with backoff", t.nojoin, t.name, t); if (!toast.visible && st.todo.upload.length < 4) toast.msg(10, L.u_cbusy); @@ -2657,6 +2658,7 @@ function up2k_init(subtle) { if (!toast.visible) toast.warn(9.98, L.u_cuerr.format(snpart, Math.ceil(t.size / chunksize), t.name), t); + t.nojoin = t.nojoin || t.postlist.length; // maybe rproxy postsize limit console.log('chunkpit onerror,', ++tries, t.name, t); orz2(xhr); };