0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/lib
Robert Nagy eeccd52b4e net: make readable/writable start as true
`net.Socket` is slightly breaking stream invariants by
having readable/writable going from `false` to `true`.
Streams assume that readable/writable starts out `true`
and then goes to `false` through `push(null)`/`end()`
after which it never goes back to `true`, e.g. once a
stream is `writable == false` it is assumed it will
never become `true`.

This PR changes 2 things:

Unless explicitly set to `false` through options:

- starts as `readable`/`writable` `true` by default.
- uses `push(null)`/`end()` to set `readable`/`writable`
  to `false`. Note that this would cause the socket to
  emit the `'end'`/`'finish'` events, which it did not
  do previously.

In the case it is explicitly set to `false` through
options` it is assumed to never become `true`.

PR-URL: https://github.com/nodejs/node/pull/32272
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-24 09:45:25 +01:00
..
fs fs: add fs/promises alias module 2020-02-18 22:15:50 -08:00
internal module: add hook for global preload code 2020-03-23 08:39:37 -05:00
_http_agent.js http, async_hooks: remove unneeded reference to wrapping resource 2020-03-11 17:31:18 +01:00
_http_client.js http: detach socket from IncomingMessage on keep-alive 2020-03-10 23:44:49 +01:00
_http_common.js http: llhttp opt-in insecure HTTP header parsing 2019-12-09 09:56:16 -08:00
_http_incoming.js stream: make readable & writable computed 2020-02-08 23:23:12 +01:00
_http_outgoing.js http: don't emit 'finish' after 'error' 2020-03-18 13:09:26 +01:00
_http_server.js http: make --insecure-http-parser configurable per-stream or per-server 2020-01-24 17:54:23 +01:00
_stream_duplex.js stream: make readable & writable computed 2020-02-08 23:23:12 +01:00
_stream_passthrough.js
_stream_readable.js net: make readable/writable start as true 2020-03-24 09:45:25 +01:00
_stream_transform.js http,stream: make virtual methods throw an error 2020-03-07 07:27:02 +01:00
_stream_wrap.js
_stream_writable.js net: make readable/writable start as true 2020-03-24 09:45:25 +01:00
_tls_common.js tls: for...of in _tls_common.js 2019-12-17 08:11:13 -05:00
_tls_wrap.js net: make readable/writable start as true 2020-03-24 09:45:25 +01:00
.eslintrc.yaml lib: replace BigInt64Array global by the primordials 2020-01-13 12:42:21 +01:00
assert.js Revert "assert: fix line number calculation after V8 upgrade" 2020-03-18 16:35:41 -07:00
async_hooks.js async_hooks: add sync enterWith to ALS 2020-03-09 14:24:21 -04:00
buffer.js buffer: improve from() performance 2020-02-08 21:40:49 -05:00
child_process.js lib: replace use of Error with primordials 2020-01-04 14:50:18 -08:00
cluster.js
console.js
constants.js
crypto.js crypto: add crypto.diffieHellman 2020-01-21 10:49:20 -04:00
dgram.js lib: move isLegalPort to validators, refactor 2020-03-05 11:52:53 -08:00
dns.js lib: move isLegalPort to validators, refactor 2020-03-05 11:52:53 -08:00
domain.js lib: replace Map global by the primordials 2020-01-04 14:56:52 -08:00
events.js events: fix removeListener for Symbols 2020-03-07 10:47:12 -08:00
fs.js fs: make fs.read params optional 2020-03-11 16:47:29 +01:00
http2.js
http.js
https.js https: prevent options object from being mutated 2020-01-03 20:09:27 -08:00
inspector.js lib: replace Map global by the primordials 2020-01-04 14:56:52 -08:00
module.js module: add API for interacting with source maps 2020-01-14 12:39:06 -08:00
net.js net: make readable/writable start as true 2020-03-24 09:45:25 +01:00
os.js src: create a getter for kernel version 2020-03-09 12:44:16 +01:00
path.js
perf_hooks.js perf,src: add HistogramBase and internal/histogram.js 2020-03-02 11:01:00 -08:00
process.js
punycode.js lib: use strict equality comparison 2019-12-14 08:57:36 -05:00
querystring.js
readline.js readline: remove intermediate variable 2020-02-09 11:06:07 -05:00
repl.js repl: eager-evaluate input in parens 2020-02-26 21:10:36 -08:00
stream.js
string_decoder.js lib: replace Symbol global by the primordials Symbol 2019-12-08 13:38:58 +01:00
sys.js
timers.js timers: fix refresh for expired timers 2019-12-25 12:45:24 +01:00
tls.js
trace_events.js lib: replace Set global by the primordials 2020-01-04 12:41:09 -08:00
tty.js
url.js url: declare iterator inside loop 2019-12-11 16:38:06 -06:00
util.js lib: replace use of Error with primordials 2020-01-04 14:50:18 -08:00
v8.js worker: add ability to take heap snapshot from parent thread 2020-02-03 07:04:13 -08:00
vm.js vm: implement vm.measureMemory() for per-context memory measurement 2020-02-26 17:52:39 +08:00
wasi.js wasi: add returnOnExit option 2020-03-08 11:05:23 -04:00
worker_threads.js
zlib.js zlib: align with streams 2020-03-19 10:56:45 +01:00