This commit is contained in:
Ylian Saint-Hilaire 2021-04-09 15:00:10 -07:00
parent f9924def62
commit c6e1a44581

View File

@ -76,7 +76,7 @@ var CreateWsmanComm = function (host, port, user, pass, tls, tlsoptions, mpsConn
function SerialTunnel(options) {
var obj = new require('stream').Duplex(options);
obj.forwardwrite = null;
obj.updateBuffer = function (chunk) { this.push(chunk); };
obj.updateBuffer = function (chunk) { try { this.push(chunk); } catch (ex) { } };
obj._write = function (chunk, encoding, callback) { if (obj.forwardwrite != null) { obj.forwardwrite(chunk); } else { console.err("Failed to fwd _write."); } if (callback) callback(); }; // Pass data written to forward
obj._read = function (size) { }; // Push nothing, anything to read should be pushed from updateBuffer()
return obj;