Commit Graph

5 Commits

Author SHA1 Message Date
Matteo Collina
16920db55e Revert "http: align with stream.Writable"
This reverts commit e2f5bb7574.

Reverted as it caused a significant performance regression.

See: https://github.com/nodejs/node/issues/37937

PR-URL: https://github.com/nodejs/node/pull/37963
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-03-31 17:18:30 +02:00
Robert Nagy
e2f5bb7574 http: align with stream.Writable
Futher aligns OutgoingMessage with stream.Writable. In particular
re-uses the construct/destroy logic from streams.

Due to a lot of subtle assumptions this PR unfortunately touches
a lot of different parts.

PR-URL: https://github.com/nodejs/node/pull/36816
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-03-10 15:04:00 +01:00
Robert Nagy
1b669b2c12 http: don't cork noop .end()
Calling .end() a second time should be a noop and not
leave the socket corked.

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

PR-URL: https://github.com/nodejs/node/pull/36633
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
2021-01-12 11:00:02 +01:00
rickyes
e6e64f7a21 http: onFinish will not be triggered again when finished
PR-URL: https://github.com/nodejs/node/pull/35845
Fixes: https://github.com/nodejs/node/issues/35833
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-11-13 01:25:26 +08:00
Robert Nagy
db706da235 stream: disallow stream methods on finished stream
Invoke callback with ERR_STREAM_ALREADY_FINISHED error if `end()` is
called on a finished stream.

PR-URL: https://github.com/nodejs/node/pull/28687
Refs: https://github.com/nodejs/node/issues/28667
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-08-20 08:47:19 -07:00