mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
up2k: gotta go faster
This commit is contained in:
parent
746a8208aa
commit
2b2415a7d8
|
@ -1223,6 +1223,8 @@ function up2k_init(have_crypto) {
|
||||||
|
|
||||||
var npart = upt.npart;
|
var npart = upt.npart;
|
||||||
var t = st.files[upt.nfile];
|
var t = st.files[upt.nfile];
|
||||||
|
if (!t.t3)
|
||||||
|
t.t3 = new Date().getTime();
|
||||||
|
|
||||||
pvis.seth(t.n, 1, "🚀 send");
|
pvis.seth(t.n, 1, "🚀 send");
|
||||||
|
|
||||||
|
@ -1232,13 +1234,6 @@ function up2k_init(have_crypto) {
|
||||||
if (cdr >= t.size)
|
if (cdr >= t.size)
|
||||||
cdr = t.size;
|
cdr = t.size;
|
||||||
|
|
||||||
var reader = new FileReader();
|
|
||||||
|
|
||||||
reader.onerror = function () {
|
|
||||||
alert('y o u b r o k e i t\nerror: ' + reader.error);
|
|
||||||
};
|
|
||||||
|
|
||||||
reader.onload = function (e) {
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.upload.onprogress = function (xev) {
|
xhr.upload.onprogress = function (xev) {
|
||||||
pvis.prog(t, npart, xev.loaded);
|
pvis.prog(t, npart, xev.loaded);
|
||||||
|
@ -1265,7 +1260,6 @@ function up2k_init(have_crypto) {
|
||||||
"no further information"));
|
"no further information"));
|
||||||
};
|
};
|
||||||
xhr.open('POST', t.purl + 'chunkpit.php', true);
|
xhr.open('POST', t.purl + 'chunkpit.php', true);
|
||||||
//xhr.setRequestHeader("X-Up2k-Hash", t.hash[npart].substr(1) + "x");
|
|
||||||
xhr.setRequestHeader("X-Up2k-Hash", t.hash[npart]);
|
xhr.setRequestHeader("X-Up2k-Hash", t.hash[npart]);
|
||||||
xhr.setRequestHeader("X-Up2k-Wark", t.wark);
|
xhr.setRequestHeader("X-Up2k-Wark", t.wark);
|
||||||
xhr.setRequestHeader('Content-Type', 'application/octet-stream');
|
xhr.setRequestHeader('Content-Type', 'application/octet-stream');
|
||||||
|
@ -1273,13 +1267,7 @@ function up2k_init(have_crypto) {
|
||||||
xhr.overrideMimeType('Content-Type', 'application/octet-stream');
|
xhr.overrideMimeType('Content-Type', 'application/octet-stream');
|
||||||
|
|
||||||
xhr.responseType = 'text';
|
xhr.responseType = 'text';
|
||||||
xhr.send(e.target.result);
|
xhr.send(bobslice.call(t.fobj, car, cdr));
|
||||||
|
|
||||||
if (!t.t3)
|
|
||||||
t.t3 = new Date().getTime();
|
|
||||||
};
|
|
||||||
|
|
||||||
reader.readAsArrayBuffer(bobslice.call(t.fobj, car, cdr));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////
|
/////
|
||||||
|
|
Loading…
Reference in a new issue