tls: support Uint8Arrays for protocol list buffers#11984
tls: support Uint8Arrays for protocol list buffers#11984addaleax wants to merge 1 commit intonodejs:masterfrom
Conversation
b29667f to
5849db1
Compare
|
Why is this one semver-minor when the others are labeled as semver-major? |
|
@mscdex .. the other PRs had error message changes, this one does not. |
There was a problem hiding this comment.
Why using the spread operator? If I'm not wrong passing a buffer to the Uint8Array constructor (new Uint8Array(Buffer.from('abcd'))) works.
There was a problem hiding this comment.
For this case, indeed it would work. Passing a Buffer to Uint8Array makes the Uint8Array use the identical underlying ArrayBuffer, which at times may not be desirable. But in this case we are creating a new Buffer every time so it should be fine.
There was a problem hiding this comment.
@TimothyGu AFAIK memory is copied to the TypedArray not shared.
There was a problem hiding this comment.
@lpinca, heh I was mistaken. In that case, yeah there's no reason to use spread syntax...
There was a problem hiding this comment.
@lpinca @TimothyGu right, thanks for pointing out. fixed!
5849db1 to
dd07fc0
Compare
|
Landed in c3efe72 |
PR-URL: #11984 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
This needs to be manually backported to v7.x |
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)