From 6084484218ec386a2b86320a6a68720bc2814031 Mon Sep 17 00:00:00 2001 From: Brian White Date: Wed, 30 Oct 2013 19:29:26 -0400 Subject: [PATCH] Connection: for NOOP, make sure to re-NOOP when still idle --- lib/Connection.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Connection.js b/lib/Connection.js index ebcbc5f..b0a25ba 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -196,11 +196,9 @@ Connection.prototype.connect = function() { parser.on('other', function(line) { var m; if (m = RE_IDLENOOPRES.exec(line)) { - if (m[1] === 'IDLE') { - // no longer idling - self._idle.enabled = false; - self._idle.started = undefined; - } + // no longer idling + self._idle.enabled = false; + self._idle.started = undefined; self._curReq = undefined; @@ -209,7 +207,10 @@ Connection.prototype.connect = function() { && self.state === 'authenticated' && !self._idle.enabled) { self._idle.enabled = true; - self._doKeepaliveTimer(true); + if (m[1] === 'NOOP') + self._doKeepaliveTimer(); + else + self._doKeepaliveTimer(true); } self._processQueue();