up2k-client: ignore rejected dupes

This commit is contained in:
ed 2020-12-12 00:55:42 +01:00
parent 19bcf90e9f
commit 29286e159b

View file

@ -667,12 +667,26 @@ function up2k_init(have_crypto) {
}
tasker();
}
else
else {
var err = "";
var rsp = (xhr.responseText + '');
if (rsp.indexOf('partial upload exists') !== -1) {
err = rsp.slice(5);
}
if (err != "") {
ebi('f{0}t'.format(t.n)).innerHTML = "ERROR";
ebi('f{0}p'.format(t.n)).innerHTML = err;
st.busy.handshake.splice(st.busy.handshake.indexOf(t), 1);
tasker();
return;
}
alert("server broke (error {0}):\n\"{1}\"\n".format(
xhr.status,
(xhr.response && xhr.response.err) ||
(xhr.responseText && xhr.responseText) ||
"no further information"));
}
};
xhr.open('POST', post_url + 'handshake.php', true);
xhr.responseType = 'text';