diff --git a/README.md b/README.md index 1f681e1d..8535bea5 100644 --- a/README.md +++ b/README.md @@ -209,7 +209,7 @@ also see [comparison to similar software](./docs/versus.md) * upload * ☑ basic: plain multipart, ie6 support * ☑ [up2k](#uploading): js, resumable, multithreaded - * unaffected by cloudflare's max-upload-size (100 MiB) + * **no filesize limit!** ...unless you use Cloudflare, then it's 383.9 GiB * ☑ stash: simple PUT filedropper * ☑ filename randomizer * ☑ write-only folders @@ -646,6 +646,7 @@ up2k has several advantages: * uploads resume if you reboot your browser or pc, just upload the same files again * server detects any corruption; the client reuploads affected chunks * the client doesn't upload anything that already exists on the server + * no filesize limit unless imposed by a proxy, for example Cloudflare, which blocks uploads over 383.9 GiB * much higher speeds than ftp/scp/tarpipe on some internet connections (mainly american ones) thanks to parallel connections * the last-modified timestamp of the file is preserved diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 83ebb634..54ce564e 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -2228,7 +2228,10 @@ class HttpCli(object): t = "your client is sending %d bytes which is too much (server expected %d bytes at most)" raise Pebkac(400, t % (remains, maxsize)) - self.log("writing {} {} @{} len {}".format(path, chashes, cstart0, remains)) + t = "writing %s %s+%d #%d+%d %s" + chunkno = cstart0[0] // chunksize + zs = " ".join([chashes[0][:15]] + [x[:9] for x in chashes[1:]]) + self.log(t % (path, cstart0, remains, chunkno, len(chashes), zs)) f = None fpool = not self.args.no_fpool and sprs diff --git a/copyparty/up2k.py b/copyparty/up2k.py index ea739441..70a9bcb2 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -3052,7 +3052,7 @@ class Up2k(object): gap = (ofs2[0] - ofs1[0]) - chunksize if gap: t = "only sibling chunks can be stitched; gap of %d bytes between offsets %d and %d in %s" - raise Pebkac(400, t % (ofs1, ofs2, gap, job["name"])) + raise Pebkac(400, t % (gap, ofs1[0], ofs2[0], job["name"])) path = djoin(job["ptop"], job["prel"], job["tnam"]) diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index fdca15ce..3845ccc1 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -658,7 +658,9 @@ function Donut(uc, st) { } function pos() { - return uc.fsearch ? Math.max(st.bytes.hashed, st.bytes.finished) : st.bytes.finished; + return uc.fsearch ? + Math.max(st.bytes.hashed, st.bytes.finished) : + st.bytes.inflight + st.bytes.finished; } r.on = function (ya) { @@ -1737,6 +1739,11 @@ function up2k_init(subtle) { } } + if (st.bytes.inflight && (st.bytes.inflight < 0 || !st.busy.upload.length)) { + console.log('insane inflight ' + st.bytes.inflight); + st.bytes.inflight = 0; + } + var mou_ikkai = false; if (st.busy.handshake.length && @@ -2768,7 +2775,11 @@ function up2k_init(subtle) { var read_u2sz = function () { var el = ebi('u2szg'), n = parseInt(el.value), dv = u2sz.split(','); - n = isNaN(n) ? dv[1] : n < dv[0] ? dv[0] : n > dv[2] ? dv[2] : n; + stitch_tgt = n = ( + isNaN(n) ? dv[1] : + n < dv[0] ? dv[0] : + n > dv[2] ? dv[2] : n + ); if (n == dv[1]) sdrop('u2sz'); else swrite('u2sz', n); if (el.value != n) el.value = n; };