Skip to content

Commit b0c768d

Browse files
nodejs-github-bottargos
authored andcommittedAug 14, 2024
deps: update undici to 6.19.7
PR-URL: #54286 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent b897057 commit b0c768d

File tree

7 files changed

+34
-27
lines changed

7 files changed

+34
-27
lines changed
 

‎deps/undici/src/build/wasm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ if (process.argv[2] === '--prebuild') {
6262
}
6363

6464
if (process.argv[2] === '--docker') {
65-
let cmd = `docker run --rm -it --platform=${platform.toString().trim()}`
65+
let cmd = `docker run --rm -t --platform=${platform.toString().trim()}`
6666
if (process.platform === 'linux') {
6767
cmd += ` --user ${process.getuid()}:${process.getegid()}`
6868
}

‎deps/undici/src/lib/llhttp/wasm_build_env.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

2-
> undici@6.19.5 prebuild:wasm
2+
> undici@6.19.7 prebuild:wasm
33
> node build/wasm.js --prebuild
44

5-
> docker build --platform=linux/x86_64 -t llhttp_wasm_builder -f /home/midawson/test-undici/io.js/deps/undici/src/build/Dockerfile /home/midawson/test-undici/io.js/deps/undici/src
5+
> docker build --platform=linux/x86_64 -t llhttp_wasm_builder -f /home/runner/work/node/node/deps/undici/src/build/Dockerfile /home/runner/work/node/node/deps/undici/src
66

77

88

9-
> undici@6.19.5 build:wasm
9+
> undici@6.19.7 build:wasm
1010
> node build/wasm.js --docker
1111

12-
> docker run --rm -it --platform=linux/x86_64 --user 1003:1003 --mount type=bind,source=/home/midawson/test-undici/io.js/deps/undici/src/lib/llhttp,target=/home/node/undici/lib/llhttp llhttp_wasm_builder node build/wasm.js
12+
> docker run --rm -t --platform=linux/x86_64 --user 1001:127 --mount type=bind,source=/home/runner/work/node/node/deps/undici/src/lib/llhttp,target=/home/node/undici/lib/llhttp llhttp_wasm_builder node build/wasm.js
1313

1414

1515
alpine-baselayout-3.4.3-r2

‎deps/undici/src/lib/web/fetch/response.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ const hasFinalizationRegistry = globalThis.FinalizationRegistry && process.versi
3434
let registry
3535

3636
if (hasFinalizationRegistry) {
37-
registry = new FinalizationRegistry((stream) => {
38-
if (!stream.locked && !isDisturbed(stream) && !isErrored(stream)) {
37+
registry = new FinalizationRegistry((weakRef) => {
38+
const stream = weakRef.deref()
39+
if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {
3940
stream.cancel('Response object has been garbage collected').catch(noop)
4041
}
4142
})
@@ -526,7 +527,12 @@ function fromInnerResponse (innerResponse, guard) {
526527
setHeadersGuard(response[kHeaders], guard)
527528

528529
if (hasFinalizationRegistry && innerResponse.body?.stream) {
529-
registry.register(response, innerResponse.body.stream)
530+
// If the target (response) is reclaimed, the cleanup callback may be called at some point with
531+
// the held value provided for it (innerResponse.body.stream). The held value can be any value:
532+
// a primitive or an object, even undefined. If the held value is an object, the registry keeps
533+
// a strong reference to it (so it can pass it to the cleanup callback later). Reworded from
534+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry
535+
registry.register(response, new WeakRef(innerResponse.body.stream))
530536
}
531537

532538
return response

‎deps/undici/src/package-lock.json

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎deps/undici/src/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "undici",
3-
"version": "6.19.5",
3+
"version": "6.19.7",
44
"description": "An HTTP/1.1 client, written from scratch for Node.js",
55
"homepage": "https://undici.nodejs.org",
66
"bugs": {

‎deps/undici/undici.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -8749,8 +8749,9 @@ var require_response = __commonJS({
87498749
var hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf("v18") !== 0;
87508750
var registry;
87518751
if (hasFinalizationRegistry) {
8752-
registry = new FinalizationRegistry((stream) => {
8753-
if (!stream.locked && !isDisturbed(stream) && !isErrored(stream)) {
8752+
registry = new FinalizationRegistry((weakRef) => {
8753+
const stream = weakRef.deref();
8754+
if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {
87548755
stream.cancel("Response object has been garbage collected").catch(noop);
87558756
}
87568757
});
@@ -9064,7 +9065,7 @@ var require_response = __commonJS({
90649065
setHeadersList(response[kHeaders], innerResponse.headersList);
90659066
setHeadersGuard(response[kHeaders], guard);
90669067
if (hasFinalizationRegistry && innerResponse.body?.stream) {
9067-
registry.register(response, innerResponse.body.stream);
9068+
registry.register(response, new WeakRef(innerResponse.body.stream));
90689069
}
90699070
return response;
90709071
}

‎src/undici_version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
// Refer to tools/dep_updaters/update-undici.sh
33
#ifndef SRC_UNDICI_VERSION_H_
44
#define SRC_UNDICI_VERSION_H_
5-
#define UNDICI_VERSION "6.19.5"
5+
#define UNDICI_VERSION "6.19.7"
66
#endif // SRC_UNDICI_VERSION_H_

0 commit comments

Comments
 (0)
Please sign in to comment.