From ccf397d7f99b315e250d273468cccefc061f8448 Mon Sep 17 00:00:00 2001 From: mscdex Date: Sun, 21 Jul 2013 22:01:38 -0400 Subject: [PATCH] Connection: fix destroy() --- lib/Connection.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Connection.js b/lib/Connection.js index c6de769..5e8c6b1 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -231,13 +231,15 @@ Connection.prototype.serverSupports = function(cap) { Connection.prototype.destroy = function() { this._queue = []; this._curReq = undefined; - this._sock.end(); + this._sock.destroy(); }; Connection.prototype.end = function() { var self = this; this._enqueue('LOGOUT', function() { - self.destroy(); + self._queue = []; + self._curReq = undefined; + self._sock.end(); }); };