Skip to content

Commit

Permalink
fromBuffer limits maxChunkSize. closes #87
Browse files Browse the repository at this point in the history
  • Loading branch information
thejoshwolfe committed Jun 3, 2018
1 parent 6d50d2f commit 12d0bc6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -594,8 +594,9 @@ This library makes no attempt to interpret the Language Encoding Flag.

## Change History

* 2.10.0
* 2.9.2
* Removed `tools/hexdump-zip.js` and `tools/hex2bin.js`. Those tools are now located here: [thejoshwolfe/hexdump-zip](https://github.com/thejoshwolfe/hexdump-zip) and [thejoshwolfe/hex2bin](https://github.com/thejoshwolfe/hex2bin)
* Worked around performance problem with zlib when using `fromBuffer()` and `readStream.destroy()` for large compressed files. [issue #87](https://github.com/thejoshwolfe/yauzl/issues/87)
* 2.9.1
* Removed `console.log()` accidentally introduced in 2.9.0. [issue #64](https://github.com/thejoshwolfe/yauzl/issues/64)
* 2.9.0
Expand Down
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -66,8 +66,8 @@ function fromBuffer(buffer, options, callback) {
if (options.lazyEntries == null) options.lazyEntries = false;
if (options.decodeStrings == null) options.decodeStrings = true;
if (options.validateEntrySizes == null) options.validateEntrySizes = true;
// i got your open file right here.
var reader = fd_slicer.createFromBuffer(buffer);
// limit the max chunk size. see https://github.com/thejoshwolfe/yauzl/issues/87
var reader = fd_slicer.createFromBuffer(buffer, {maxChunkSize: 0x10000});
fromRandomAccessReader(reader, buffer.length, options, callback);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -26,7 +26,7 @@
},
"homepage": "https://github.com/thejoshwolfe/yauzl",
"dependencies": {
"fd-slicer": "~1.0.1",
"fd-slicer": "~1.1.0",
"buffer-crc32": "~0.2.3"
},
"devDependencies": {
Expand Down

0 comments on commit 12d0bc6

Please sign in to comment.