Shivay-98
6586288a41
net: handle undefined parent in _unrefTimer and _destroy
...
The fix and approach are from #64491 by Shivay-98; this reopens it to
get it landed, since the original stalled awaiting requested changes.
`Socket.prototype._unrefTimer` and `Socket.prototype._destroy` both walk
the `_parent` chain with a strict `!== null` check. During connection
teardown a socket's `_parent` can be left `undefined` (for example a TLS
socket layered over another stream), so the loop steps onto `undefined`
and reads a property off it, throwing a TypeError:
Cannot read properties of undefined (reading 'Symbol(timeout)')
from an uncaught I/O callback and crashing the process.
Using a nullish (`!= null`) check terminates the walk on both `null` and
`undefined`.
[petter@hightouch.io: apply the same fix to the identical loop in
`_destroy`, which the original regression test already exercised via
`destroy()`; add direct unit coverage for both paths.]
Fixes: https://github.com/nodejs/node/issues/64490
Refs: https://github.com/nodejs/node/pull/64491
Signed-off-by: Petter Häggholm <petter@hightouch.io >
PR-URL: https://github.com/nodejs/node/pull/64644
Fixes: https://github.com/nodejs/node/issues/64490
Refs: https://github.com/nodejs/node/pull/64491
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2026-08-21 19:33:38 -07:00
Guilherme Araújo
a6e7e6a95e
net: runtime-deprecate Server.prototype._listen2
...
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/64794
Reviewed-By: Aviv Keller <me@aviv.sh >
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Filip Skokan <panva.ip@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
2026-08-02 13:54:45 +00:00
Ethan Arrowood
6d8baeabb0
net: add experimental net/promises API
...
Add an experimental `net/promises` namespace, accessible via
`require('node:net/promises')` or `net.promises`, mirroring the existing
`fs/promises` and `dns/promises` modules.
It provides promise-based variants of net's one-shot lifecycle
operations:
- `connect()` returns a promise that fulfills with a connected Socket
once the 'connect' event fires, and rejects on connection failure or
when an optional AbortSignal is aborted, destroying the socket.
- `listen()` creates a server, begins listening, and returns a promise
that fulfills with the listening Server once the 'listening' event
fires. It rejects if the server fails to bind or an optional
AbortSignal is aborted, closing the server.
The functions are named for the actions they await, forming a parallel
`connect()`/`listen()` pair. This is intentionally not the callback
API's factory taxonomy: there `createConnection()` is canonical because
it both creates a socket and initiates connecting, whereas
`createServer()` is a pure factory that does not listen. A
`createConnection`/`createServer` pairing would be inconsistent here
because `createServer` has no completion to await, so no
`createConnection` alias is provided.
Refs: https://github.com/nodejs/node/issues/21482
Assisted-by: Claude Opus 4.8 <noreply@anthropic.com >
Signed-off-by: Ethan Arrowood <ethan@arrowood.dev >
PR-URL: https://github.com/nodejs/node/pull/63965
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2026-07-28 19:29:48 +00:00
Matteo Collina
fdcb1de9fe
net: support TCP handle transfer on Windows
...
Signed-off-by: Matteo Collina <hello@matteocollina.com >
PR-URL: https://github.com/nodejs/node/pull/64460
Fixes: https://github.com/nodejs/node/issues/64456
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2026-07-24 17:25:38 -07:00
Guy Bedford
b420cb649d
net: support AF_UNIX paths in net.BoundSocket
...
Signed-off-by: Guy Bedford <guybedford@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/64399
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2026-07-24 16:11:39 -07:00
Guy Bedford
39ed68cd7c
net: support sync connect for BoundSocket
...
When a net.Socket is constructed from a net.BoundSocket, support
synchronous connect().
Signed-off-by: Guy Bedford <guybedford@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/64375
Reviewed-By: James M Snell <jasnell@gmail.com >
2026-07-16 00:56:40 +00:00
Matteo Collina
47b6ef28e6
net: make TCP Server and Socket transferable across worker threads
...
Allow a listening net.Server or an accepted net.Socket to be moved to
another thread by listing it in the transferList of a worker_threads
postMessage() call. Unix only; Windows throws.
Signed-off-by: Matteo Collina <hello@matteocollina.com >
PR-URL: https://github.com/nodejs/node/pull/64225
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
2026-07-12 15:11:28 +00:00
Guy Bedford
e3cdb14678
net: early TCP binding via synchronous net.BoundSocket
...
Signed-off-by: Guy Bedford <guybedford@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/63951
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2026-06-20 14:40:48 -07:00
Matteo Collina
7dafafa242
dns,net: reject hostnames with embedded NUL bytes
...
Refs: https://hackerone.com/reports/3656716
PR-URL: https://github.com/nodejs-private/node-private/pull/868
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
CVE-ID: CVE-2026-48930
2026-06-18 06:29:24 +02:00
Guy Bedford
1efdce3353
net: support TCP_KEEPINTVL and TCP_KEEPCNT in setKeepAlive
...
Signed-off-by: Guy Bedford <guybedford@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/63825
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2026-06-13 23:12:25 +00:00
Sergey Zelenov
6a3d358ca4
tls: forward keepAlive, keepAliveInitialDelay, noDelay to socket
...
`tls.connect()` silently ignores `keepAlive`, `keepAliveInitialDelay`,
and `noDelay` options. The documentation states it accepts any
`socket.connect()` option, and `net.createConnection()` with the same
options works correctly.
Forward the options through both code paths so `net.Socket`'s
constructor stores them on the internal symbols (`kSetNoDelay`,
`kSetKeepAlive`, `kSetKeepAliveInitialDelay`), which `afterConnect()`
then applies to the handle.
Fixes: https://github.com/nodejs/node/issues/62003
PR-URL: https://github.com/nodejs/node/pull/62004
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk >
2026-02-28 11:22:35 +00:00
RajeshKumar11
1523d66a69
http: attach error handler to socket synchronously in onSocket
...
Between onSocket and onSocketNT, the socket had no error handler,
meaning any errors emitted during that window (e.g. from a blocklist
check or custom lookup) would be unhandled even if the user had set up
a request error handler.
Fix this by attaching socketErrorListener synchronously in onSocket,
setting socket._httpMessage so the listener can forward errors to the
request. The _destroy path in onSocketNT is also guarded to prevent
double-firing if socketErrorListener already emitted the error.
Fixes: https://github.com/nodejs/node/issues/48771
Refs: https://github.com/nodejs/node/pull/61658
PR-URL: https://github.com/nodejs/node/pull/61770
Refs: https://github.com/nodejs/node/issues/48771
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2026-02-16 08:26:48 +00:00
RajeshKumar11
d8c00ad316
net: defer synchronous destroy calls in internalConnect
...
Defer socket.destroy() calls in internalConnect and
internalConnectMultiple to the next tick. This ensures that error
handlers have a chance to be set up before errors are emitted,
particularly important when using http.request with a custom
lookup function that returns synchronously.
Previously, if a synchronous lookup function returned an IP that
triggered an immediate error (e.g., via blockList), the error would
be emitted before the HTTP client had set up its error handler
(which happens via process.nextTick in onSocket). This caused
unhandled 'error' events.
Fixes: https://github.com/nodejs/node/issues/48771
PR-URL: https://github.com/nodejs/node/pull/61658
Refs: https://github.com/nodejs/node/pull/51038
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: Jason Zhang <xzha4350@gmail.com >
2026-02-06 14:30:07 +00:00
Amol Yadav
5212c07147
net: add setTOS and getTOS to Socket
...
PR-URL: https://github.com/nodejs/node/pull/61503
Fixes: https://github.com/nodejs/node/issues/61489
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2026-02-02 12:23:31 +01:00
Livia Medeiros
6c9a7cd61e
lib: make ERM functions into wrappers returning undefined
...
PR-URL: https://github.com/nodejs/node/pull/58400
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2025-05-25 13:44:43 +00:00
Darshan Sen
9eb9c26b26
net: always publish to 'net.client.socket' diagnostics channel
...
Previously, the 'net.client.socket' diagnostics channel was only
published to when `net.connect()` was called. This change ensures the
message is also published for the following calls:
- net.createConnection()
- net.Socket#connect()
- tls.connect()
Signed-off-by: Darshan Sen <raisinten@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/58349
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: theanarkh <theratliter@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
2025-05-18 09:05:17 +00:00
Yagiz Nizipli
ace5548ff0
net: make _setSimultaneousAccepts() end-of-life deprecated
...
PR-URL: https://github.com/nodejs/node/pull/57550
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2025-03-22 01:00:06 +00:00
Daeyeon Jeong
c3ed292d17
net: validate non-string host for socket.connect
...
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/57198
Reviewed-By: James M Snell <jasnell@gmail.com >
2025-03-11 14:48:27 +00:00
Yagiz Nizipli
3a497dc688
net: replace brand checks with identity checks
...
PR-URL: https://github.com/nodejs/node/pull/57341
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2025-03-07 21:46:02 +00:00
Edy Silva
71196c431f
net: emit an error when custom lookup resolves to a non-string address
...
PR-URL: https://github.com/nodejs/node/pull/57192
Fixes: https://github.com/nodejs/node/issues/57112
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: Jason Zhang <xzha4350@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2025-03-01 20:43:41 +00:00
theanarkh
f26a1da909
net: support blocklist in net.connect
...
PR-URL: https://github.com/nodejs/node/pull/56075
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-12-06 04:36:24 +00:00
theanarkh
d5d1e80763
net: support blocklist for net.Server
...
PR-URL: https://github.com/nodejs/node/pull/56079
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com >
2024-12-02 15:21:31 +00:00
theanarkh
7bc3e16da1
net: add UV_TCP_REUSEPORT for tcp
...
PR-URL: https://github.com/nodejs/node/pull/55408
Refs: https://github.com/libuv/libuv/pull/4407
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-10-21 13:10:53 +00:00
Aviv Keller
71785889c8
lib: prefer logical assignment
...
PR-URL: https://github.com/nodejs/node/pull/55044
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
2024-10-09 06:42:16 +00:00
Michaël Zasso
d5eb9a378e
lib: remove Symbol[Async]Dispose polyfills
...
PR-URL: https://github.com/nodejs/node/pull/55276
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2024-10-07 09:47:44 +00:00
Aviv Keller
574f2dd517
lib: prefer optional chaining
...
PR-URL: https://github.com/nodejs/node/pull/55045
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
2024-09-24 19:48:15 +00:00
Antoine du Hamel
7c58645aca
lib: move Symbol[Async]Dispose polyfills to internal/util
...
PR-URL: https://github.com/nodejs/node/pull/54853
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2024-09-10 21:24:56 +00:00
jakecastelli
4f14eb1545
Revert "net: validate host name for server listen"
...
This reverts commit 52322aa42a .
PR-URL: https://github.com/nodejs/node/pull/54554
Reviewed-By: Claudio Wunder <cwunder@gnome.org >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2024-08-28 17:27:19 +09:30
Jason Zhang and Luigi Pinca
52322aa42a
net: validate host name for server listen
...
Fixes: https://github.com/nodejs/node/issues/54441
Co-authored-by: Luigi Pinca <luigipinca@gmail.com >
PR-URL: https://github.com/nodejs/node/pull/54470
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com >
2024-08-25 12:36:40 +00:00
Giovanni Bucci
628469c7e1
net: exclude ipv6 loopback addresses from server.listen
...
Fixes: https://github.com/nodejs/node/issues/51732
PR-URL: https://github.com/nodejs/node/pull/54264
Reviewed-By: Tim Perry <pimterry@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-08-23 09:11:43 +00:00
Daniel Bayley
953abf4887
lib: refactor platform utility methods
...
PR-URL: https://github.com/nodejs/node/pull/53817
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
2024-07-15 18:58:11 +00:00
Paolo Insogna
a837886561
net: add new net.server.listen tracing channel
...
PR-URL: https://github.com/nodejs/node/pull/53136
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com >
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com >
2024-05-30 08:40:19 +00:00
Antoine du Hamel
231548b5cf
lib: enforce ASCII order in error code imports
...
PR-URL: https://github.com/nodejs/node/pull/52625
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Chemi Atlow <chemi@atlow.co.il >
2024-04-23 17:05:38 +00:00
Paolo Insogna
833e342f15
net: add CLI option for autoSelectFamilyAttemptTimeout
...
PR-URL: https://github.com/nodejs/node/pull/52474
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2024-04-17 09:06:12 +00:00
theanarkh
14de082ab4
lib: emit listening event once when call listen twice
...
PR-URL: https://github.com/nodejs/node/pull/52119
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-03-19 15:54:59 +00:00
atlowChemi
d89fc73d45
net: use internal addAbortListener
...
PR-URL: https://github.com/nodejs/node/pull/52081
Refs: https://github.com/nodejs/node/pull/48596
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2024-03-16 09:08:57 +00:00
theanarkh
20525f14b9
lib: fix listen with handle in cluster worker
...
PR-URL: https://github.com/nodejs/node/pull/52056
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2024-03-14 14:54:31 +00:00
theanarkh
29ec7e9331
lib: make sure close net server
...
PR-URL: https://github.com/nodejs/node/pull/51929
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2024-03-03 10:29:15 +00:00
theanarkh
292016c91e
net: fix connect crash when call destroy in lookup handler
...
PR-URL: https://github.com/nodejs/node/pull/51826
Fixes: https://github.com/nodejs/node/issues/50841
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Jiawen Geng <technicalcute@gmail.com >
2024-02-27 13:46:45 +00:00
Paolo Insogna
2cb94240f9
net: add connection attempt events
...
PR-URL: https://github.com/nodejs/node/pull/51045
Fixes: https://github.com/nodejs/node/issues/48763
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2023-12-21 10:43:15 +00:00
theanarkh
51abedecc5
net: check pipe mode and path
...
PR-URL: https://github.com/nodejs/node/pull/50770
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-11-21 12:21:57 +00:00
Aras Abbasi
83e6350b82
errors: improve hideStackFrames
...
PR-URL: https://github.com/nodejs/node/pull/49990
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2023-11-11 16:25:08 +00:00
atlowChemi
0e9138d173
net: server add asyncDispose
...
PR-URL: https://github.com/nodejs/node/pull/48717
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Moshe Atlow <moshe@atlow.co.il >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
2023-07-11 21:10:28 +00:00
atlowChemi
0325fa44ca
net: use addAbortListener
...
PR-URL: https://github.com/nodejs/node/pull/48550
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-07-11 19:50:23 +03:00
Paolo Insogna
fddd3ffa59
net: improve network family autoselection handle handling
...
PR-URL: https://github.com/nodejs/node/pull/48464
Fixes: https://github.com/npm/cli/issues/6409
Fixes: https://github.com/KararTY/dank-twitch-irc/issues/13
Fixes: https://github.com/nodejs/node/issues/47644
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
2023-06-27 09:17:16 +00:00
ignoramous
7202859402
net: do not treat server.maxConnections=0 as Infinity
...
Setting the `maxConnections` to 0 should result in no connection.
Instead, it was treated as if the option was not there.
PR-URL: https://github.com/nodejs/node/pull/48276
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
2023-06-26 06:17:51 +00:00
Yagiz Nizipli
5613e223d5
src: return uint32 for guessHandleType
...
PR-URL: https://github.com/nodejs/node/pull/48349
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com >
2023-06-15 19:21:49 +00:00
Fedor Indutny
403a72f8ec
net: fix address iteration with autoSelectFamily
...
When `autoSelectFamily` is set to `true`, `net.connect` is supposed to
try connecting to both IPv4 and IPv6, interleaving the address types.
Instead, it appears that the array that holds the addresses in the order
they should be attempted was never used after being populated.
PR-URL: https://github.com/nodejs/node/pull/48258
Reviewed-By: Paolo Insogna <paolo@cowtech.it >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com >
2023-06-01 20:53:56 +00:00
Paolo Insogna
2d24b29cf4
net: fix family autoselection timeout handling
...
PR-URL: https://github.com/nodejs/node/pull/47860
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2023-05-11 16:14:03 +00:00
Jason Zhang
c15bafdaf4
net: only defer _final call when connecting
...
Fixes: https://github.com/nodejs/node/issues/47322
PR-URL: https://github.com/nodejs/node/pull/47385
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
2023-05-08 07:47:48 +00:00