Repository navigation
HTMLRewriter: no more write promise chaining - #3776
Merged
Merged
Conversation
npaun
force-pushed
the
npaun/htmlrewriter-stack-fix
branch
2 times, most recently
from
March 21, 2025 21:11
18460fb to
cc97d90
Compare
danlapid
reviewed
Mar 22, 2025
danlapid
reviewed
Mar 22, 2025
harrishancock
approved these changes
Mar 24, 2025
npaun
force-pushed
the
npaun/htmlrewriter-stack-fix
branch
from
March 25, 2025 20:43
cc97d90 to
2d9d4e5
Compare
Member
Author
|
rebasin' |
npaun
force-pushed
the
npaun/htmlrewriter-stack-fix
branch
3 times, most recently
from
March 31, 2025 14:03
2d9d4e5 to
f3d5c88
Compare
jclee
reviewed
Apr 1, 2025
npaun
force-pushed
the
npaun/htmlrewriter-stack-fix
branch
from
April 8, 2025 01:40
f3d5c88 to
be6826d
Compare
Member
Author
|
rebased |
npaun
force-pushed
the
npaun/htmlrewriter-stack-fix
branch
from
April 8, 2025 01:48
be6826d to
0875fc1
Compare
npaun
force-pushed
the
npaun/htmlrewriter-stack-fix
branch
from
April 8, 2025 01:51
0875fc1 to
59e1f9d
Compare
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.
This PR follows up on #3758 to provide a more solid fix.
The chained
writePromiseis no longer used. Instead, every time lol_html generates output, we store it inoutputBuffer(just akj::Vector).outputBufferis flushed to the output sink after each handler thunk. If more than 128 MB accumulates inoutputBuffer, we poison theRewriter, preventing users from causing arbitrary memory usage.As a result of this PR, the test
stackOverflow1now passes (lots of output from one handler), andstackOverflow2continues to pass.