From ee84aba89f234835b436e9b7f4dab3597ca80b7c Mon Sep 17 00:00:00 2001 From: jeromew Date: Tue, 26 Jul 2016 21:39:33 +0200 Subject: [PATCH] Use `end` stream option instead of not calling _flush callback (#44) --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 6b16814..9873c1f 100644 --- a/index.js +++ b/index.js @@ -45,8 +45,7 @@ CopyStreamQuery.prototype._transform = function(chunk, enc, cb) { CopyStreamQuery.prototype._flush = function(cb) { var finBuffer = Buffer([code.c, 0, 0, 0, 4]) this.push(finBuffer) - //never call this callback, do not close underlying stream - //cb() + cb() } CopyStreamQuery.prototype.handleError = function(e) { @@ -54,7 +53,7 @@ CopyStreamQuery.prototype.handleError = function(e) { } CopyStreamQuery.prototype.handleCopyInResponse = function(connection) { - this.pipe(connection.stream) + this.pipe(connection.stream, { end: false }) } CopyStreamQuery.prototype.handleCommandComplete = function(msg) {