Some fixes to doors using sockets. Works on Windows!
This commit is contained in:
16
core/door.js
16
core/door.js
@@ -46,6 +46,11 @@ Door.prototype.run = function() {
|
|||||||
self.client.term.write(decode(data, self.exeInfo.encoding));
|
self.client.term.write(decode(data, self.exeInfo.encoding));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var restore = function(piped) {
|
||||||
|
self.client.term.output.unpipe(piped);
|
||||||
|
self.client.term.output.resume();
|
||||||
|
}
|
||||||
|
|
||||||
var sockServer;
|
var sockServer;
|
||||||
|
|
||||||
async.series(
|
async.series(
|
||||||
@@ -63,8 +68,12 @@ Door.prototype.run = function() {
|
|||||||
conn.on('data', doorData);
|
conn.on('data', doorData);
|
||||||
|
|
||||||
conn.on('end', function ended() {
|
conn.on('end', function ended() {
|
||||||
self.client.term.output.unpipe(conn);
|
restore(conn);
|
||||||
self.client.term.output.resume();
|
});
|
||||||
|
|
||||||
|
conn.on('error', function error(err) {
|
||||||
|
self.client.log.info('Door socket server connection error: ' + err.message);
|
||||||
|
restore(conn);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -105,8 +114,7 @@ Door.prototype.run = function() {
|
|||||||
door.on('data', doorData);
|
door.on('data', doorData);
|
||||||
|
|
||||||
door.on('close', function closed() {
|
door.on('close', function closed() {
|
||||||
self.client.term.output.unpipe(door);
|
restore(door);
|
||||||
self.client.term.output.resume();
|
|
||||||
});
|
});
|
||||||
} else if('socket' === self.exeInfo.io) {
|
} else if('socket' === self.exeInfo.io) {
|
||||||
self.client.log.debug(
|
self.client.log.debug(
|
||||||
|
|||||||
Reference in New Issue
Block a user