net: make holding the buffer in memory more robust (v4.x backport) #8300
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.
Set the
req.buffer
property, which serves as a way of keepinga
Buffer
alive that is being written to a stream, on the C++side instead of the JS side.
This closes a hole where buffers that were temporarily created
in order to write strings with uncommon encodings (e.g.
hex
)were passed to the native side without being set as
req.buffer
.Fixes: #8251
PR-URL: #8252
(@thealphanerd my instinct has become to automatically assign v4.x backports to you, in part because that makes it very easy to discern them visually in PR lists… if you think that’s cool I’ll keep doing it?)