zlib: pass kind to recursive calls to flush
authorMyles Borins <mborins@us.ibm.com>
Mon, 26 Oct 2015 21:39:05 +0000 (14:39 -0700)
committerJames M Snell <jasnell@gmail.com>
Wed, 23 Dec 2015 16:38:33 +0000 (08:38 -0800)
Bug spotted by @bnoordhuis while doing code review on #3534

Refs: https://github.com/nodejs/node/pull/3534#discussion_r43047477
PR-URL: https://github.com/nodejs/node/pull/3534
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
lib/zlib.js

index a10d911..1151b2c 100644 (file)
@@ -446,7 +446,7 @@ Zlib.prototype.flush = function(kind, callback) {
   } else if (ws.needDrain) {
     var self = this;
     this.once('drain', function() {
-      self.flush(callback);
+      self.flush(kind, callback);
     });
   } else {
     this._flushFlag = kind;