PR-URL: https://github.com/nodejs/node/pull/43967
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Rewrite FindDiffieHellmanGroup() using OpenSSL helper functions to
obtain the required constants directly, instead of loading them from
our own crypto_groups.h and converting them to BIGNUMs.
This also removes the need for the struct modp_group, so we can delete
crypto_groups.h altogether.
PR-URL: https://github.com/nodejs/node/pull/43896
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
In the main thread, `inspector.close` is defined as `process._debugEnd`:
```
> inspector.close
[Function: _debugEnd]
```
It's not defined in worker threads:
```
> const {Worker} = require("worker_threads");
> new Worker("console.log(require(\"inspector\").close)", {eval:true})
undefined
```
(As far as I can tell this is intentional and has existed for quite some
time.)
PR-URL: https://github.com/nodejs/node/pull/43867
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
If mode == Base64Mode::NORMAL, then the function has already returned.
Refs: https://github.com/nodejs/node/pull/39775
PR-URL: https://github.com/nodejs/node/pull/43979
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
Per the comments in #43924, almost everyone uses `git-node-v8`. I
included example steps for using `git-node-v8`.
I ran through both of these instructions on a clean Linux machine (I had
to fudge the patch SHA of course) and they seemed to work.
Refs: https://github.com/nodejs/node/pull/43924
PR-URL: https://github.com/nodejs/node/pull/43934
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Original commit log follows:
darwin: translate EPROTOTYPE to ECONNRESET (libuv/libuv#3413)
macOS versions 10.10 and 10.15 - and presumbaly 10.11 to 10.14, too -
have a bug where a race condition causes the kernel to return EPROTOTYPE
because the socket isn't fully constructed.
It's probably the result of the peer closing the connection and that is
why libuv translates it to ECONNRESET.
Previously, libuv retried until the EPROTOTYPE error went away but some
VPN software causes the same behavior except the error is permanent, not
transient, turning the retry mechanism into an infinite loop.
Refs: https://github.com/libuv/libuv/pull/482
Refs: https://github.com/libuv/libuv/pull/3405
Fixes: https://github.com/nodejs/node/issues/43916
PR-URL: https://github.com/nodejs/node/pull/43950
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Original commit log follows:
darwin: remove EPROTOTYPE error workaround (libuv/libuv#3405)
It's been reported in the past that OS X 10.10, because of a race
condition in the XNU kernel, sometimes returns a transient EPROTOTYPE
error when trying to write to a socket. Libuv handles that by retrying
the operation until it succeeds or fails with a different error.
Recently it's been reported that current versions of the operating
system formerly known as OS X fail permanently with EPROTOTYPE under
certain conditions, resulting in an infinite loop.
Because Apple isn't exactly forthcoming with bug fixes or even details,
I'm opting to simply remove the workaround and have the error bubble up.
Refs: https://github.com/libuv/libuv/pull/482
Fixes: https://github.com/nodejs/node/issues/43916
PR-URL: https://github.com/nodejs/node/pull/43950
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Fixes: https://github.com/nodejs/node/issues/43009
If calling `this._handle.getpeername` returns an error at the first
call, its result shouldn't be cached to `this._peername`.
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
PR-URL: https://github.com/nodejs/node/pull/43010
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
A recent pull request changed this method to throw when the buffer was
too big, but this meant that the `free` finalizer would never get
called, leading to a memory leak.
A previous version of this diff included a test provoking this behavior
with `v8.serialize`, but it unfortunately kept triggering the OOM
killer, so it was removed.
Refs: https://github.com/nodejs/node/pull/40243
PR-URL: https://github.com/nodejs/node/pull/43938
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This fixes validating an ArrayBufferView given to
ReadableStreamBYOBRequest.respondWithNewView() to improve the web
streams compatibility.
Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
PR-URL: https://github.com/nodejs/node/pull/43866
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Instead of recursively scheduling makeRemainingRequests and ignoring its
outcome, safely loop within the async function.
Avoid unncessary async lambda functions passed to assert.rejects.
Use events.once() to simplify control flow in makeRequest, instead of
manually constructing a Promise.
PR-URL: https://github.com/nodejs/node/pull/43878
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/43910
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
PR-URL: https://github.com/nodejs/node/pull/43911
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/43965
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
There's already a reminder earlier in the instructions, but not in the
worked example, so it's easy to miss while skimming.
PR-URL: https://github.com/nodejs/node/pull/43924
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/43889
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
the returns need to be lowercase
PR-URL: https://github.com/nodejs/node/pull/43933
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
`FunctionTemplate` and `ObjectTemplate` can be shared across realms.
They should be per-isolate eternal handles and can not be modified.
As these templates are lazily initialized, their setters are still
exposed with DCHECK on their value presence.
PR-URL: https://github.com/nodejs/node/pull/43802
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>