ignore dupe-chunk warnings; handshake takes care of it

This commit is contained in:
ed 2021-07-01 20:22:12 +02:00
parent d6b5351207
commit 765294c263
2 changed files with 18 additions and 14 deletions

View file

@ -141,11 +141,12 @@ class HttpSrv(object):
"shut({}): {}".format(fno, ex), "shut({}): {}".format(fno, ex),
c="1;30", c="1;30",
) )
if ex.errno not in [10038, 10054, 107, 57, 9]: if ex.errno not in [10038, 10054, 107, 57, 49, 9]:
# 10038 No longer considered a socket # 10038 No longer considered a socket
# 10054 Foribly closed by remote # 10054 Foribly closed by remote
# 107 Transport endpoint not connected # 107 Transport endpoint not connected
# 57 Socket is not connected # 57 Socket is not connected
# 49 Can't assign requested address (wifi down)
# 9 Bad file descriptor # 9 Bad file descriptor
raise raise
finally: finally:

View file

@ -1360,25 +1360,28 @@ function up2k_init(subtle) {
cdr = t.size; cdr = t.size;
function orz(xhr) { function orz(xhr) {
var txt = ((xhr.response && xhr.response.err) || xhr.responseText) + '';
if (xhr.status == 200) { if (xhr.status == 200) {
pvis.prog(t, npart, cdr - car); pvis.prog(t, npart, cdr - car);
st.bytes.uploaded += cdr - car; st.bytes.uploaded += cdr - car;
t.bytes_uploaded += cdr - car; t.bytes_uploaded += cdr - car;
st.busy.upload.splice(st.busy.upload.indexOf(upt), 1);
t.postlist.splice(t.postlist.indexOf(npart), 1);
if (t.postlist.length == 0) {
t.t4 = Date.now();
pvis.seth(t.n, 1, 'verifying');
st.todo.handshake.unshift(t);
}
tasker();
} }
else else if (txt.indexOf('already got that') !== -1) {
console.log("ignoring dupe-segment error");
}
else {
alert("server broke; cu-err {0} on file [{1}]:\n".format( alert("server broke; cu-err {0} on file [{1}]:\n".format(
xhr.status, t.name) + ( xhr.status, t.name) + (txt || "no further information"));
(xhr.response && xhr.response.err) || return;
(xhr.responseText && xhr.responseText) || }
"no further information")); st.busy.upload.splice(st.busy.upload.indexOf(upt), 1);
t.postlist.splice(t.postlist.indexOf(npart), 1);
if (t.postlist.length == 0) {
t.t4 = Date.now();
pvis.seth(t.n, 1, 'verifying');
st.todo.handshake.unshift(t);
}
tasker();
} }
function do_send() { function do_send() {
var xhr = new XMLHttpRequest(); var xhr = new XMLHttpRequest();