GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add config option to limit decompressed message size by twiss · Pull Request #1933 · openpgpjs/openpgpjs

Conversation

@twiss

@twiss twiss commented Nov 26, 2025

Copy link
Copy Markdown
Member

Since decompression can increase the memory usage non-linearly, add a config option to limit the decompressed message size.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@twiss
twiss requested a review from larabr November 26, 2025 12:25
@twiss
twiss force-pushed the max-decompressed-msg-size branch from d5e757c to 8ba8161 Compare November 26, 2025 12:27
larabr
larabr reviewed Nov 26, 2025
View reviewed changes
Comment thread test/general/decompression.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@twiss
twiss force-pushed the max-decompressed-msg-size branch from 8ba8161 to 6e63ad0 Compare November 26, 2025 12:44
larabr
larabr reviewed Nov 26, 2025
View reviewed changes
Comment thread test/general/decompression.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@twiss
twiss force-pushed the max-decompressed-msg-size branch 5 times, most recently from 47256ce to 74d4004 Compare November 26, 2025 19:45
This was referenced Nov 26, 2025
Test native web streams in modern browsers #1934
Merged
Use native CompressionStream/DecompressionStream when not streaming #1935
Merged
@twiss
twiss force-pushed the max-decompressed-msg-size branch 3 times, most recently from 37b8c96 to 78d8ea8 Compare December 3, 2025 15:50
@larabr
larabr force-pushed the max-decompressed-msg-size branch from 78d8ea8 to 6bfe39f Compare December 5, 2025 13:02
twiss added 3 commits December 5, 2025 14:09
@twiss
Add config option to limit decompressed message size
0b65390
@twiss
Handle backpressure in fflate fallback
aee2d74
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.
@twiss
Split input stream for native Compression API
c4be83b
WebKit seems to require this, as it decompresses the entire input chunk
before producing an output chunk, instead of producing output chunks
incrementally.
@twiss
twiss force-pushed the max-decompressed-msg-size branch from 6bfe39f to c4be83b Compare December 5, 2025 13:09
@twiss
Set highWaterMark in (de)compression streams to 0
30f91aa
Remove internal queue in streams while (de)compressing.
larabr
larabr approved these changes Dec 8, 2025
View reviewed changes
@twiss
twiss merged commit a61cf1f into openpgpjs:main Dec 9, 2025
@twiss
twiss deleted the max-decompressed-msg-size branch December 9, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@larabr larabr larabr approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@twiss @larabr
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.