Skip to content
Snippets Groups Projects
Commit f797d2b9 authored by rswindell's avatar rswindell
Browse files

Added some helpful log messages when starting/finishing the transfer of

files (sending or receiving).
parent 38c3b2a9
No related branches found
No related tags found
No related merge requests found
......@@ -347,6 +347,7 @@ function rx_callback(fname, bp)
if (secure_inbound == undefined)
secure_inbound = inbound;
log(LOG_INFO, "Received file: " + fname + format(" (%1.1fKB)", file_size(fname) / 1024.0));
if (fname.search(/\.(?:pkt|su.|mo.|tu.|we.|th.|fr.|sa.)$/i) !== -1) {
semname = system.data_dir + 'fidoin.now';
if (bp.cb_data.binkit_create_semaphores.indexOf(semname) == -1)
......
......@@ -678,6 +678,7 @@ BinkP.prototype.session = function()
this.receiving_name = args[0];
this.receiving_len = parseInt(args[1], 10);
this.receiving_date = parseInt(args[2], 10);
log(LOG_INFO, "Receiving file: " + this.receiving.name + format(" (%1.1fKB)", this.receiving_len / 1024.0));
}
break;
default:
......@@ -792,6 +793,7 @@ BinkP.prototype.session = function()
else {
this.sentempty = false;
this.pending_ack.push(this.sending);
log(LOG_INFO, "Sending file: " + this.sending.file.name + format(" (%1.1fKB)", this.sending.file.length / 1024.0));
if (this.nonreliable && (this.sending.waitingForGet === undefined || this.sending.waitingForGet)) {
this.sendCmd(this.command.M_FILE, this.escapeFileName(this.sending.sendas)+' '+this.sending.file.length+' '+this.sending.file.date+' -1');
this.sending.waitingForGet = true;
......@@ -809,6 +811,7 @@ BinkP.prototype.session = function()
if(this.sendData(this.sending.file.read(32767)))
last = Date.now();
if (this.eof || this.sending.file.position >= this.sending.file.length) {
log(LOG_INFO, "Sent file: " + this.sending.file.name + format(" (%1.1fKB)", this.sending.file.position / 1024.0));
this.sending.file.close();
this.sending = undefined;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment