Merge branch 'master' of github.com:NuSkooler/enigma-bbs into 216-waiting-for-caller
This commit is contained in:
@@ -319,7 +319,7 @@ module.exports = class ArchiveUtil {
|
||||
}
|
||||
|
||||
let output = '';
|
||||
proc.on('data', data => {
|
||||
proc.onData(data => {
|
||||
// :TODO: hack for: execvp(3) failed.: No such file or directory
|
||||
|
||||
output += data;
|
||||
|
||||
17
core/door.js
17
core/door.js
@@ -3,12 +3,14 @@
|
||||
|
||||
const stringFormat = require('./string_format.js');
|
||||
const { Errors } = require('./enig_error.js');
|
||||
const Events = require('./events');
|
||||
|
||||
// deps
|
||||
const pty = require('node-pty');
|
||||
const decode = require('iconv-lite').decode;
|
||||
const createServer = require('net').createServer;
|
||||
const paths = require('path');
|
||||
const _ = require('lodash');
|
||||
|
||||
module.exports = class Door {
|
||||
constructor(client) {
|
||||
@@ -87,6 +89,19 @@ module.exports = class Door {
|
||||
return cb(e);
|
||||
}
|
||||
|
||||
//
|
||||
// PID is launched. Make sure it's killed off if the user disconnects.
|
||||
//
|
||||
Events.once(Events.getSystemEvents().ClientDisconnected, evt => {
|
||||
if (this.doorPty && this.client.session.uniqueId === _.get(evt, 'client.session.uniqueId')) {
|
||||
this.client.log.info(
|
||||
{ pid : this.doorPty.pid },
|
||||
'User has disconnected; Killing door process.'
|
||||
);
|
||||
this.doorPty.kill();
|
||||
}
|
||||
});
|
||||
|
||||
this.client.log.debug(
|
||||
{ processId : this.doorPty.pid }, 'External door process spawned'
|
||||
);
|
||||
@@ -96,7 +111,7 @@ module.exports = class Door {
|
||||
|
||||
this.client.term.output.pipe(this.doorPty);
|
||||
|
||||
this.doorPty.on('data', this.doorDataHandler.bind(this));
|
||||
this.doorPty.onData(this.doorDataHandler.bind(this));
|
||||
|
||||
this.doorPty.once('close', () => {
|
||||
return this.restoreIo(this.doorPty);
|
||||
|
||||
@@ -426,7 +426,7 @@ exports.getModule = class TransferFileModule extends MenuModule {
|
||||
}
|
||||
});
|
||||
|
||||
externalProc.on('data', data => {
|
||||
externalProc.onData(data => {
|
||||
updateActivity();
|
||||
|
||||
// needed for things like sz/rz
|
||||
|
||||
@@ -56,7 +56,7 @@ function stringToNullPaddedBuffer(s, bufLen) {
|
||||
//
|
||||
// Convert a FTN style DateTime string to a Date object
|
||||
//
|
||||
// :TODO: Name the next couple methods better - for FTN *packets*
|
||||
// :TODO: Name the next couple methods better - for FTN *packets* e.g. parsePacketDateTime()
|
||||
function getDateFromFtnDateTime(dateTime) {
|
||||
//
|
||||
// Examples seen in the wild (Working):
|
||||
@@ -66,7 +66,6 @@ function getDateFromFtnDateTime(dateTime) {
|
||||
//
|
||||
// :TODO: Use moment.js here
|
||||
return moment(Date.parse(dateTime)); // Date.parse() allows funky formats
|
||||
// return (new Date(Date.parse(dateTime))).toISOString();
|
||||
}
|
||||
|
||||
function getDateTimeString(m) {
|
||||
|
||||
Reference in New Issue
Block a user