diff options
author | Mikko Rantanen <jubjub@jubjubnest.net> | 2018-12-09 11:09:01 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-12-14 09:23:56 -0800 |
commit | 37a5e01bda104eacca78da31afb9f9ec05da180c (patch) | |
tree | ed33ad724a1033a516c0773a877432195869b127 /lib/querystring.js | |
parent | adf5083647c3bbe2f0873a3bc6d5614a07468a94 (diff) | |
download | android-node-v8-37a5e01bda104eacca78da31afb9f9ec05da180c.tar.gz android-node-v8-37a5e01bda104eacca78da31afb9f9ec05da180c.tar.bz2 android-node-v8-37a5e01bda104eacca78da31afb9f9ec05da180c.zip |
lib: ensure readable stream flows to end
If a readable stream was set up with `highWaterMark 0`, the while-loop
in `maybeReadMore_` function would never execute.
The while loop now has an extra or-condition for the case where the
stream is flowing and there are no items. The or-condition is adapted
from the emit-condition of the `addChunk` function.
The `addChunk` also contains a check for `state.sync`. However that part
of the check was omitted here because the `maybeReadMore_` is executed
using `process.nextTick`. `state.sync` is set and then unset within the
`read()` function so it should never be in effect in `maybeReadMore_`.
Fixes: https://github.com/nodejs/node/issues/24915
PR-URL: https://github.com/nodejs/node/pull/24918
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'lib/querystring.js')
0 files changed, 0 insertions, 0 deletions