GeezerVison is showing github.com — deps: update undici to 6.19.7 · nodejs/node@6e7de37
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/build/wasm.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -62,7 +62,7 @@ if (process.argv[2] === '--prebuild') { | 62 | 62 | } | 63 | 63 |
| 64 | 64 | 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()}` | 66 | 66 | if (process.platform === 'linux') { | 67 | 67 | cmd += ` --user ${process.getuid()}:${process.getegid()}` | 68 | 68 | } | |
Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/lib/llhttp/wasm_build_env.txt +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 |
| 2 | | - | | 2 | + | 3 | 3 | > node build/wasm.js --prebuild | 4 | 4 |
| 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 | 6 | 6 |
| 7 | 7 |
| 8 | 8 |
| 9 | | - | | 9 | + | 10 | 10 | > node build/wasm.js --docker | 11 | 11 |
| 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 | 13 | 13 |
| 14 | 14 |
| 15 | 15 | alpine-baselayout-3.4.3-r2 | |
Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/lib/web/fetch/response.js +9-3Lines changed: 9 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,8 +34,9 @@ const hasFinalizationRegistry = globalThis.FinalizationRegistry && process.versi | 34 | 34 | let registry | 35 | 35 |
| 36 | 36 | 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)) { | 39 | 40 | stream.cancel('Response object has been garbage collected').catch(noop) | 40 | 41 | } | 41 | 42 | }) | @@ -526,7 +527,12 @@ function fromInnerResponse (innerResponse, guard) { | 526 | 527 | setHeadersGuard(response[kHeaders], guard) | 527 | 528 |
| 528 | 529 | 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)) | 530 | 536 | } | 531 | 537 |
| 532 | 538 | return response | |
Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/package-lock.json +14-14Lines changed: 14 additions & 14 deletions Collapse file Copy file name to clipboardExpand all lines: deps/undici/src/package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | { | 2 | 2 | "name": "undici", | 3 | | - "version": "6.19.5", | | 3 | + "version": "6.19.7", | 4 | 4 | "description": "An HTTP/1.1 client, written from scratch for Node.js", | 5 | 5 | "homepage": "https://undici.nodejs.org", | 6 | 6 | "bugs": { | |
Collapse file Copy file name to clipboardExpand all lines: deps/undici/undici.js +4-3Lines changed: 4 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -8749,8 +8749,9 @@ var require_response = __commonJS({ | 8749 | 8749 | var hasFinalizationRegistry = globalThis.FinalizationRegistry && process.version.indexOf("v18") !== 0; | 8750 | 8750 | var registry; | 8751 | 8751 | 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)) { | 8754 | 8755 | stream.cancel("Response object has been garbage collected").catch(noop); | 8755 | 8756 | } | 8756 | 8757 | }); | @@ -9064,7 +9065,7 @@ var require_response = __commonJS({ | 9064 | 9065 | setHeadersList(response[kHeaders], innerResponse.headersList); | 9065 | 9066 | setHeadersGuard(response[kHeaders], guard); | 9066 | 9067 | if (hasFinalizationRegistry && innerResponse.body?.stream) { | 9067 | | - registry.register(response, innerResponse.body.stream); | | 9068 | + registry.register(response, new WeakRef(innerResponse.body.stream)); | 9068 | 9069 | } | 9069 | 9070 | return response; | 9070 | 9071 | } | |
Collapse file Copy file name to clipboardExpand all lines: src/undici_version.h +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | // Refer to tools/dep_updaters/update-undici.sh | 3 | 3 | #ifndef SRC_UNDICI_VERSION_H_ | 4 | 4 | #define SRC_UNDICI_VERSION_H_ | 5 | | -#define UNDICI_VERSION "6.19.5" | | 5 | +#define UNDICI_VERSION "6.19.7" | 6 | 6 | #endif // SRC_UNDICI_VERSION_H_ |
|