From 9160597513ba5924cb52cf2b0a38f2dc297ac0bd Mon Sep 17 00:00:00 2001 From: Sam Tobia Date: Thu, 3 Feb 2022 01:52:10 -0800 Subject: [PATCH] Fix: Destroys socket so long as it exists https://github.com/mscdex/ssh2/issues/1124 Seems as though the socket can still receive data. If there's a specific reason why destroy isn't called regardless of writable state I'm willing to listen --- lib/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index 80f372a8..49f98c72 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1086,7 +1086,7 @@ class Client extends EventEmitter { } destroy() { - this._sock && isWritable(this._sock) && this._sock.destroy(); + this._sock && this._sock.destroy(); return this; }