Commit Graph

13 Commits

Author SHA1 Message Date
Robert Nagy
f2f6872b5c stream: cleanup async handling
Cleanup async stream method handling.

PR-URL: https://github.com/nodejs/node/pull/39329
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-07-11 19:20:01 +02:00
Robert Nagy
7a7ba82234 stream: don't emit prefinish after error or close
PR-URL: https://github.com/nodejs/node/pull/39332
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-07-11 18:41:17 +02:00
Antoine du Hamel
ee9e2a2eb6 lib: revert primordials in a hot path
Evidence has shown that use of primordials have sometimes an impact of
performance. This commit reverts the changes who are most likely to be
responsible for performance regression in the HTTP response path.

PR-URL: https://github.com/nodejs/node/pull/38248
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-04-19 10:23:01 +02:00
Robert Nagy
369f239503 stream: fix multiple Writable.destroy() calls
Calling Writable.destroy() multiple times in the same tick
could cause an assertion error.

Fixes: https://github.com/nodejs/node/issues/38189

PR-URL: https://github.com/nodejs/node/pull/38221
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-04-16 12:00:19 +02:00
Antoine du Hamel
4ad46e2fef stream: refactor to avoid unsafe array iteration
PR-URL: https://github.com/nodejs/node/pull/37126
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-02-01 15:20:35 +01:00
Antoine du Hamel
419686cdfb stream: refactor to use more primordials
PR-URL: https://github.com/nodejs/node/pull/36346
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-02-01 15:18:25 +01:00
Robert Nagy
a4fce32eab stream: fix .end() error propagation
PR-URL: https://github.com/nodejs/node/pull/36817
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-01-11 17:57:05 +01:00
Benjamin Gruenbaum
040a27ae5f stream: support abortsignal in constructor
PR-URL: https://github.com/nodejs/node/pull/36431
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2020-12-10 23:39:18 +02:00
Michaël Zasso
bf31d3c3b1
tools: enable no-unused-expressions lint rule
Fixes: https://github.com/nodejs/node/issues/36246

PR-URL: https://github.com/nodejs/node/pull/36248
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-07 20:33:45 +01:00
Robert Nagy
dd0f8f18c2 stream: writableNeedDrain
Don't write to a stream which already has a full buffer.

Fixes: https://github.com/nodejs/node/issues/35341

PR-URL: https://github.com/nodejs/node/pull/35348
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-11-10 10:44:16 +01:00
Momtchil Momtchev
5a3f43b255 stream: fix regression on duplex end
Decide the return status of writeOrBuffer before
calling stream.write which can reset state.length

Add unit test for #35926

Refs: https://github.com/nodejs/node/issues/35926

PR-URL: https://github.com/nodejs/node/pull/35941
Fixes: https://github.com/nodejs/node/issues/35926
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-11-04 05:12:38 -08:00
Robert Nagy
6be80e1893 stream: fix legacy pipe error handling
Fixes: https://github.com/nodejs/node/issues/35237

PR-URL: https://github.com/nodejs/node/pull/35257
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-23 04:33:05 -07:00
Matteo Collina
9c62e0e384 stream: move to internal/streams
Move all the streams constructors to internal/streams
and avoid a circular dependencies between the modules.

See: https://github.com/nodejs/readable-stream/issues/348

PR-URL: https://github.com/nodejs/node/pull/35239
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2020-09-21 08:23:06 +00:00