Commit d68bb4a5 authored by deuce's avatar deuce
Browse files

Push an M_SKIP into the failed_sent_files() from the pending_ack array, not

from the currently sending file, since the pending ack should always be there,
but sending often won't be.  Also, log a warning when pending_ack isn't empty
and we get an M_EOB.
parent a4422056
...@@ -715,8 +715,12 @@ BinkP.prototype.session = function() ...@@ -715,8 +715,12 @@ BinkP.prototype.session = function()
if (!(this.sentempty && this.gotempty)) if (!(this.sentempty && this.gotempty))
this.senteob = false; this.senteob = false;
} }
if (this.senteob && this.pending_ack.length === 0) if (this.senteob) {
break outer; if (this.pending_ack.length === 0)
break outer;
else
log(LOG_WARNING, "We got an M_EOB, but there are still "+this.pending_ack.length+" files pending M_GOT");
}
this.gotempty = true; this.gotempty = true;
break; break;
case this.command.M_GOT: case this.command.M_GOT:
...@@ -775,13 +779,13 @@ BinkP.prototype.session = function() ...@@ -775,13 +779,13 @@ BinkP.prototype.session = function()
args = this.parseArgs(pkt.data); args = this.parseArgs(pkt.data);
for (i=0; i<this.pending_ack.length; i++) { for (i=0; i<this.pending_ack.length; i++) {
if (this.pending_ack[i].sendas == args[0]) { if (this.pending_ack[i].sendas == args[0]) {
this.failed_sent_files.push({path:this.pending_ack[i].file.name, sendas:this.pending_ack[i].sendas});
this.pending_ack.splice(i, 1); this.pending_ack.splice(i, 1);
i--; i--;
} }
} }
if (this.sending !== undefined && this.sending.sendas === args[0]) { if (this.sending !== undefined && this.sending.sendas === args[0]) {
this.sending.file.close(); this.sending.file.close();
this.failed_sent_files.push({path:this.sending.file.name, sendas:this.sending.sendas});
this.sending = undefined; this.sending = undefined;
} }
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment