Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/Connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ Connection.prototype.connect = function() {
stream.resume(); // a body we didn't ask for?
});
parser.on('continue', function(info) {
var type = self._curReq.type;
if(self._curReq){
var type = self._curReq.type;
if (type === 'IDLE') {
if (self._queue.length
&& self._idle.started === 0
Expand All @@ -253,7 +254,12 @@ Connection.prototype.connect = function() {
self.debug && self.debug('=> ' + inspect(line));
self._sock.write(line, 'latin1');
}
}
else{
return;
}
});

parser.on('other', function(line) {
var m;
if (m = RE_IDLENOOPRES.exec(line)) {
Expand All @@ -276,8 +282,8 @@ Connection.prototype.connect = function() {
}

self._processQueue();
}
});



this._tmrConn = setTimeout(function() {
var err = new Error('Timed out while connecting to server');
Expand Down