summaryrefslogtreecommitdiff
path: root/lib/zlib.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/zlib.js')
-rw-r--r--lib/zlib.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/zlib.js b/lib/zlib.js
index b267fda4ea..5e49ba40db 100644
--- a/lib/zlib.js
+++ b/lib/zlib.js
@@ -546,6 +546,16 @@ function processCallback() {
return;
}
+ if (availInAfter > 0) {
+ // If we have more input that should be written, but we also have output
+ // space available, that means that the compression library was not
+ // interested in receiving more data, and in particular that the input
+ // stream has ended early.
+ // This applies to streams where we don't check data past the end of
+ // what was consumed; that is, everything except Gunzip/Unzip.
+ self.push(null);
+ }
+
// finished with the chunk.
this.buffer = null;
this.cb();