| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ee1c78a commit 162b282
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -73,6 +73,20 @@ class Pool extends PoolBase { | |||
| 73 | 73 | ? { ...options.interceptors } | |
| 74 | 74 | : undefined | |
| 75 | 75 | this[kFactory] = factory | |
| 76 | + | ||
| 77 | + this.on('connectionError', (origin, targets, error) => { | ||
| 78 | + // If a connection error occurs, we remove the client from the pool, | ||
| 79 | + // and emit a connectionError event. They will not be re-used. | ||
| 80 | + // Fixes https://github.com/nodejs/undici/issues/3895 | ||
| 81 | + for (const target of targets) { | ||
| 82 | + // Do not use kRemoveClient here, as it will close the client, | ||
| 83 | + // but the client cannot be closed in this state. | ||
| 84 | + const idx = this[kClients].indexOf(target) | ||
| 85 | + if (idx !== -1) { | ||
| 86 | + this[kClients].splice(idx, 1) | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + }) | ||
| 76 | 90 | } | |
| 77 | 91 | ||
| 78 | 92 | [kGetDispatcher] () { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,15 +1,15 @@ | |||
| 1 | 1 | ||
| 2 | - > undici@6.21.1 prebuild:wasm | ||
| 2 | + > undici@6.21.2 prebuild:wasm | ||
| 3 | 3 | > node build/wasm.js --prebuild | |
| 4 | 4 | ||
| 5 | - > docker build --platform=linux/aarch64 -t llhttp_wasm_builder -f /Users/matteo/repos/node-private/deps/undici/src/build/Dockerfile /Users/matteo/repos/node-private/deps/undici/src | ||
| 5 | + > docker build --platform=linux/aarch64 -t llhttp_wasm_builder -f /Users/matteo/repos/node/deps/undici/src/build/Dockerfile /Users/matteo/repos/node/deps/undici/src | ||
| 6 | 6 | ||
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | - > undici@6.21.1 build:wasm | ||
| 9 | + > undici@6.21.2 build:wasm | ||
| 10 | 10 | > node build/wasm.js --docker | |
| 11 | 11 | ||
| 12 | - > docker run --rm -t --platform=linux/aarch64 --mount type=bind,source=/Users/matteo/repos/node-private/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/aarch64 --mount type=bind,source=/Users/matteo/repos/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 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | { | |
| 2 | 2 | "name": "undici", | |
| 3 | - "version": "6.21.1", | ||
| 3 | + "version": "6.21.2", | ||
| 4 | 4 | "description": "An HTTP/1.1 client, written from scratch for Node.js", | |
| 5 | 5 | "homepage": "https://undici.nodejs.org", | |
| 6 | 6 | "bugs": { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,4 +28,5 @@ declare namespace Interceptors { | |||
| 28 | 28 | export function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor | |
| 29 | 29 | export function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor | |
| 30 | 30 | export function responseError(opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor | |
| 31 | + export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor | ||
| 31 | 32 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8123,6 +8123,14 @@ var require_pool = __commonJS({ | |||
| 8123 | 8123 | this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; | |
| 8124 | 8124 | this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; | |
| 8125 | 8125 | this[kFactory] = factory; | |
| 8126 | + this.on("connectionError", (origin2, targets, error) => { | ||
| 8127 | + for (const target of targets) { | ||
| 8128 | + const idx = this[kClients].indexOf(target); | ||
| 8129 | + if (idx !== -1) { | ||
| 8130 | + this[kClients].splice(idx, 1); | ||
| 8131 | + } | ||
| 8132 | + } | ||
| 8133 | + }); | ||
| 8126 | 8134 | } | |
| 8127 | 8135 | [kGetDispatcher]() { | |
| 8128 | 8136 | for (const client of this[kClients]) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,5 +2,5 @@ | |||
| 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.21.1" | ||
| 5 | + #define UNDICI_VERSION "6.21.2" | ||
| 6 | 6 | #endif // SRC_UNDICI_VERSION_H_ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments