diff --git a/README.md b/README.md index 9f397dc0..bd0430c8 100644 --- a/README.md +++ b/README.md @@ -964,6 +964,12 @@ quick outline of the up2k protocol, see [uploading](#uploading) for the web-clie up2k has saved a few uploads from becoming corrupted in-transfer already; caught an android phone on wifi redhanded in wireshark with a bitflip, however bup with https would *probably* have noticed as well (thanks to tls also functioning as an integrity check) +regarding the frequent server log message during uploads; +`6.0M 106M/s 2.77G 102.9M/s n948 thank 4/0/3/1 10042/7198` +* this chunk was `6 MiB`, uploaded at `106 MiB/s` +* on this http connection, `2.77 GiB` transferred, `102.9 MiB/s` average, `948` chunks handled +* client says `4` uploads OK, `0` failed, `3` busy, `1` queued, `10042 MiB` total size, `7198 MiB` left + ## why chunk-hashes diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index a54bce3e..924e1f95 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -1127,8 +1127,10 @@ class HttpCli(object): except: self.log("failed to utime ({}, {})".format(fin_path, times)) + cinf = self.headers.get("x-up2k-stat", "") + spd = self._spd(post_sz) - self.log("{} thank".format(spd)) + self.log("{} thank {}".format(spd, cinf)) self.reply(b"thank") return True diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 8eb5e299..237d3598 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -1924,7 +1924,10 @@ function up2k_init(subtle) { tasker(); } function do_send() { - var xhr = new XMLHttpRequest(); + var xhr = new XMLHttpRequest(), + bfin = Math.floor(st.bytes.finished / 1024 / 1024), + btot = Math.floor(st.bytes.total / 1024 / 1024); + xhr.upload.onprogress = function (xev) { pvis.prog(t, npart, xev.loaded); }; @@ -1944,6 +1947,8 @@ function up2k_init(subtle) { xhr.open('POST', t.purl, true); xhr.setRequestHeader("X-Up2k-Hash", t.hash[npart]); xhr.setRequestHeader("X-Up2k-Wark", t.wark); + xhr.setRequestHeader("X-Up2k-Stat", "{0}/{1}/{2}/{3} {4}/{5}".format( + pvis.ctr.ok, pvis.ctr.ng, pvis.ctr.bz, pvis.ctr.q, btot, btot - bfin)); xhr.setRequestHeader('Content-Type', 'application/octet-stream'); if (xhr.overrideMimeType) xhr.overrideMimeType('Content-Type', 'application/octet-stream');