up2k fixes:

* progress donuts should include inflight bytes
* changes to stitch-size in settings didn't apply until next refresh
* serverlog was too verbose; truncate chunk hashes
* mention absolute cloudflare limit in readme
This commit is contained in:
ed 2024-07-22 19:06:01 +00:00
parent 132a83501e
commit b511d686f0
4 changed files with 20 additions and 5 deletions

View file

@ -209,7 +209,7 @@ also see [comparison to similar software](./docs/versus.md)
* upload * upload
* ☑ basic: plain multipart, ie6 support * ☑ basic: plain multipart, ie6 support
* ☑ [up2k](#uploading): js, resumable, multithreaded * ☑ [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 * ☑ stash: simple PUT filedropper
* ☑ filename randomizer * ☑ filename randomizer
* ☑ write-only folders * ☑ 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 * uploads resume if you reboot your browser or pc, just upload the same files again
* server detects any corruption; the client reuploads affected chunks * server detects any corruption; the client reuploads affected chunks
* the client doesn't upload anything that already exists on the server * 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 * 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 * the last-modified timestamp of the file is preserved

View file

@ -2228,7 +2228,10 @@ class HttpCli(object):
t = "your client is sending %d bytes which is too much (server expected %d bytes at most)" t = "your client is sending %d bytes which is too much (server expected %d bytes at most)"
raise Pebkac(400, t % (remains, maxsize)) 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 f = None
fpool = not self.args.no_fpool and sprs fpool = not self.args.no_fpool and sprs

View file

@ -3052,7 +3052,7 @@ class Up2k(object):
gap = (ofs2[0] - ofs1[0]) - chunksize gap = (ofs2[0] - ofs1[0]) - chunksize
if gap: if gap:
t = "only sibling chunks can be stitched; gap of %d bytes between offsets %d and %d in %s" 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"]) path = djoin(job["ptop"], job["prel"], job["tnam"])

View file

@ -658,7 +658,9 @@ function Donut(uc, st) {
} }
function pos() { 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) { 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; var mou_ikkai = false;
if (st.busy.handshake.length && if (st.busy.handshake.length &&
@ -2768,7 +2775,11 @@ function up2k_init(subtle) {
var read_u2sz = function () { var read_u2sz = function () {
var el = ebi('u2szg'), n = parseInt(el.value), dv = u2sz.split(','); 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 (n == dv[1]) sdrop('u2sz'); else swrite('u2sz', n);
if (el.value != n) el.value = n; if (el.value != n) el.value = n;
}; };