diff options
author | Florrie <towerofnix@gmail.com> | 2020-04-16 16:50:22 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2020-04-16 16:50:22 -0300 |
commit | 17963e2e9f3bf99f2b261cd522e5b6d5ad053171 (patch) | |
tree | 92277df20eb01d98011a478f55e4b8793d4b74fe | |
parent | 204368aedc92b54b15b0ef2790925f9b7755d0e0 (diff) |
be even more careful with socat
-rw-r--r-- | socat.js | 5 |
1 files changed, 4 insertions, 1 deletions
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 { |