mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
cd2b9f542c
In the function that pre-emptively fills the Readable queue, it relies on a recursion through: stream.push(chunk) -> maybeReadMore(stream, state) -> if (not reading more and < hwm) stream.read(0) -> stream._read() -> stream.push(chunk) -> repeat. Since this was only calling read() a single time, and then relying on a future nextTick to collect more data, it ends up causing a nextTick recursion error (and potentially a RangeError, even) if you have a very high highWaterMark, and are getting very small chunks pushed synchronously in _read (as happens with TLS, or many simple test streams). This change implements a new approach, so that read(0) is called repeatedly as long as it is effective (that is, the length keeps increasing), and thus quickly fills up the buffer for streams such as these, without any stacks overflowing. |
||
---|---|---|
.. | ||
_debugger.js | ||
_linklist.js | ||
_stream_duplex.js | ||
_stream_passthrough.js | ||
_stream_readable.js | ||
_stream_transform.js | ||
_stream_writable.js | ||
assert.js | ||
buffer.js | ||
child_process.js | ||
cluster.js | ||
console.js | ||
constants.js | ||
crypto.js | ||
dgram.js | ||
dns.js | ||
domain.js | ||
events.js | ||
freelist.js | ||
fs.js | ||
http.js | ||
https.js | ||
module.js | ||
net.js | ||
os.js | ||
path.js | ||
punycode.js | ||
querystring.js | ||
readline.js | ||
repl.js | ||
stream.js | ||
string_decoder.js | ||
sys.js | ||
timers.js | ||
tls.js | ||
tty.js | ||
url.js | ||
util.js | ||
vm.js | ||
zlib.js |