Calling destroy() on a completed ClientRequest, i.e.
once 'close' will be emitted should be a noop. Also
before emitting 'close' destroyed === true.
Fixes: https://github.com/nodejs/node/issues/32851
PR-URL: https://github.com/nodejs/node/pull/33120
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Added .destroyed property to OutgoingMessage and ClientRequest
to align with streams.
Fixed ClientRequest.destroy to dump res and re-use socket in agent
pool aligning it with abort.
PR-URL: https://github.com/nodejs/node/pull/32148
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Emit close event after all other events in the client, e.g.
error will be emitted before close.
PR-URL: https://github.com/nodejs/node/pull/15588
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>