Add config option to limit decompressed message size#1933
Merged
twiss merged 4 commits intoopenpgpjs:mainfrom Dec 9, 2025
Merged
Add config option to limit decompressed message size#1933twiss merged 4 commits intoopenpgpjs:mainfrom
twiss merged 4 commits intoopenpgpjs:mainfrom
Conversation
d5e757c to
8ba8161
Compare
larabr
reviewed
Nov 26, 2025
8ba8161 to
6e63ad0
Compare
larabr
reviewed
Nov 26, 2025
47256ce to
74d4004
Compare
This was referenced Nov 26, 2025
37b8c96 to
78d8ea8
Compare
78d8ea8 to
6bfe39f
Compare
Don't start (de)compressing more data if the (de)compressed data stream reader hasn't asked for more data yet. Also, split the input chunks so that we don't overwhelm the output stream with a lot of data if the input chunks are very large, as fflate seems to decompress the input chunks completely before calling `ondata`, which doesn't give us a chance to cancel the decompression if too much data is provided.
WebKit seems to require this, as it decompresses the entire input chunk before producing an output chunk, instead of producing output chunks incrementally.
6bfe39f to
c4be83b
Compare
Remove internal queue in streams while (de)compressing.
larabr
approved these changes
Dec 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since decompression can increase the memory usage non-linearly, add a config option to limit the decompressed message size.