summaryrefslogtreecommitdiff
path: root/lib/zlib.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-10-13 16:37:49 -0700
committerisaacs <i@izs.me>2011-10-13 16:47:51 -0700
commit59a5262041dce0760b1f960a900eca8b8ca1138f (patch)
tree6ef8929ab3ddfb6a06d1491ed8c0ea0dac27e965 /lib/zlib.js
parent66a10b6e581a62fc3844624d1190b3a81af3e47c (diff)
downloadnode-59a5262041dce0760b1f960a900eca8b8ca1138f.tar.gz
Fix #1882 zlib Update 'availOutBefore' value, and test
Diffstat (limited to 'lib/zlib.js')
-rw-r--r--lib/zlib.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/zlib.js b/lib/zlib.js
index 43725bff2..b7d3900a5 100644
--- a/lib/zlib.js
+++ b/lib/zlib.js
@@ -303,7 +303,12 @@ Zlib.prototype._process = function() {
if (availOutAfter === 0) {
// Not actually done. Need to reprocess.
+ // Also, update the availInBefore to the availInAfter value,
+ // so that if we have to hit it a third (fourth, etc.) time,
+ // it'll have the correct byte counts.
inOff += (availInBefore - availInAfter);
+ availInBefore = availInAfter;
+
var newReq = self._binding.write(self._flush,
chunk,
inOff,