From 17963e2e9f3bf99f2b261cd522e5b6d5ad053171 Mon Sep 17 00:00:00 2001 From: Florrie Date: Thu, 16 Apr 2020 16:50:22 -0300 Subject: be even more careful with socat --- socat.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/socat.js b/socat.js index 95ee889..8871c7e 100644 --- a/socat.js +++ b/socat.js @@ -30,6 +30,9 @@ module.exports = class Socat extends EventEmitter { this.subprocess.on('close', () => { this.subprocess = null }) + this.subprocess.stdin.on('error', err => { + this.stop() + }) } } @@ -62,7 +65,7 @@ module.exports = class Socat extends EventEmitter { // or pipe we're writing to could have closed unexpectedly. If that // happens, unestablish the socat process; it'll try to reconnect if // we send another message. - this.stop(); + this.stop() } } else { try { -- cgit 1.3.0-6-gf8a5