diff --git a/lib/index.js b/lib/index.js index a712ab37..01c36bc8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -48,11 +48,12 @@ Client.prototype.connect = function() { this.stream.on('data', function(data) { var parser = new Parser(data); - var result = parser.parse(); - result.forEach(function(msg) { + var msg = parser.parseMessage(); + while(msg) { self.emit('message', msg); self.emit(msg.name, msg); - }); + msg = parser.parseMessage(); + } }); this.on('ReadyForQuery', function() { diff --git a/test/unit/test-helper.js b/test/unit/test-helper.js index de2836bf..d715caf1 100644 --- a/test/unit/test-helper.js +++ b/test/unit/test-helper.js @@ -51,8 +51,6 @@ test = function(name, action) { console.log(name); console.log(e.toString()); } - - test.tabout -= 2; }; test.tabout = 0;