Skip to content

Commit

Permalink
deps: update undici to 6.19.7
Browse files Browse the repository at this point in the history
PR-URL: #54286
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: Matthew Aitken <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
  • Loading branch information
nodejs-github-bot authored and targos committed Aug 14, 2024
1 parent b897057 commit b0c768d
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 27 deletions.
2 changes: 1 addition & 1 deletion deps/undici/src/build/wasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if (process.argv[2] === '--prebuild') {
}

if (process.argv[2] === '--docker') {
let cmd = `docker run --rm -it --platform=${platform.toString().trim()}`
let cmd = `docker run --rm -t --platform=${platform.toString().trim()}`
if (process.platform === 'linux') {
cmd += ` --user ${process.getuid()}:${process.getegid()}`
}
Expand Down
8 changes: 4 additions & 4 deletions deps/undici/src/lib/llhttp/wasm_build_env.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

> [email protected].5 prebuild:wasm
> [email protected].7 prebuild:wasm
> node build/wasm.js --prebuild

> 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
> 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



> [email protected].5 build:wasm
> [email protected].7 build:wasm
> node build/wasm.js --docker

> 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
> 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


alpine-baselayout-3.4.3-r2
Expand Down
12 changes: 9 additions & 3 deletions deps/undici/src/lib/web/fetch/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ const hasFinalizationRegistry = globalThis.FinalizationRegistry && process.versi
let registry

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

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

return response
Expand Down
28 changes: 14 additions & 14 deletions deps/undici/src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deps/undici/src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "undici",
"version": "6.19.5",
"version": "6.19.7",
"description": "An HTTP/1.1 client, written from scratch for Node.js",
"homepage": "https://undici.nodejs.org",
"bugs": {
Expand Down
7 changes: 4 additions & 3 deletions deps/undici/undici.js
Original file line number Diff line number Diff line change
Expand Up @@ -8749,8 +8749,9 @@ var require_response = __commonJS({
var hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf("v18") !== 0;
var registry;
if (hasFinalizationRegistry) {
registry = new FinalizationRegistry((stream) => {
if (!stream.locked && !isDisturbed(stream) && !isErrored(stream)) {
registry = new FinalizationRegistry((weakRef) => {
const stream = weakRef.deref();
if (stream && !stream.locked && !isDisturbed(stream) && !isErrored(stream)) {
stream.cancel("Response object has been garbage collected").catch(noop);
}
});
Expand Down Expand Up @@ -9064,7 +9065,7 @@ var require_response = __commonJS({
setHeadersList(response[kHeaders], innerResponse.headersList);
setHeadersGuard(response[kHeaders], guard);
if (hasFinalizationRegistry && innerResponse.body?.stream) {
registry.register(response, innerResponse.body.stream);
registry.register(response, new WeakRef(innerResponse.body.stream));
}
return response;
}
Expand Down
2 changes: 1 addition & 1 deletion src/undici_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
// Refer to tools/dep_updaters/update-undici.sh
#ifndef SRC_UNDICI_VERSION_H_
#define SRC_UNDICI_VERSION_H_
#define UNDICI_VERSION "6.19.5"
#define UNDICI_VERSION "6.19.7"
#endif // SRC_UNDICI_VERSION_H_

0 comments on commit b0c768d

Please sign in to comment.