From 4cea9e023aa9a4519c481bb39989e7eff3525b14 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 21 Feb 2017 21:26:56 -0700 Subject: [PATCH 1/2] Fix bug with FTN export scheduler --- core/scanner_tossers/ftn_bso.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/core/scanner_tossers/ftn_bso.js b/core/scanner_tossers/ftn_bso.js index 874e17d4..e4add699 100644 --- a/core/scanner_tossers/ftn_bso.js +++ b/core/scanner_tossers/ftn_bso.js @@ -803,6 +803,9 @@ function FTNMessageScanTossModule() { ], err => { // :TODO: do something with |err| ? + if(err) { + Log.warn(err.message); + } nextUplink(); } ); @@ -1214,7 +1217,7 @@ function FTNMessageScanTossModule() { return false; }; - + // ends an export block this.exportingEnd = function() { this.exportRunning = false; @@ -1263,14 +1266,15 @@ FTNMessageScanTossModule.prototype.startup = function(cb) { 'Export schedule loaded' ); - if(exportSchedule.sched && this.exportingStart()) { + if(exportSchedule.sched) { this.exportTimer = later.setInterval( () => { - - Log.info( { module : exports.moduleInfo.name }, 'Performing scheduled message scan/export...'); - - this.performExport( () => { - this.exportingEnd(); - }); + if(this.exportingStart()) { + Log.info( { module : exports.moduleInfo.name }, 'Performing scheduled message scan/export...'); + + this.performExport( () => { + this.exportingEnd(); + }); + } }, exportSchedule.sched); } From 3f873f58776963a3cccaa9027c1de0599937c9a9 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 21 Feb 2017 21:27:32 -0700 Subject: [PATCH 2/2] Fix writing packet headers for origins that have dot addresses --- core/ftn_mail_packet.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/ftn_mail_packet.js b/core/ftn_mail_packet.js index f4810ea5..a98d8c6b 100644 --- a/core/ftn_mail_packet.js +++ b/core/ftn_mail_packet.js @@ -296,7 +296,7 @@ function Packet(options) { buffer.writeUInt16LE(packetHeader.baud, 16); buffer.writeUInt16LE(FTN_PACKET_HEADER_TYPE, 18); - buffer.writeUInt16LE(packetHeader.origNet, 20); + buffer.writeUInt16LE(-1 === packetHeader.origNet ? 0xff : packetHeader.origNet, 20); buffer.writeUInt16LE(packetHeader.destNet, 22); buffer.writeUInt8(packetHeader.prodCodeLo, 24); buffer.writeUInt8(packetHeader.prodRevHi, 25); @@ -318,7 +318,7 @@ function Packet(options) { buffer.writeUInt32LE(packetHeader.prodData, 54); return buffer; - } + }; this.writePacketHeader = function(packetHeader, ws) { let buffer = new Buffer(FTN_PACKET_HEADER_SIZE); @@ -334,7 +334,7 @@ function Packet(options) { buffer.writeUInt16LE(packetHeader.baud, 16); buffer.writeUInt16LE(FTN_PACKET_HEADER_TYPE, 18); - buffer.writeUInt16LE(packetHeader.origNet, 20); + buffer.writeUInt16LE(-1 === packetHeader.origNet ? 0xff : packetHeader.origNet, 20); buffer.writeUInt16LE(packetHeader.destNet, 22); buffer.writeUInt8(packetHeader.prodCodeLo, 24); buffer.writeUInt8(packetHeader.prodRevHi, 25);