Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v9.x] stream: always reset awaitDrain when emitting data #18911

Closed
wants to merge 1 commit into from

Commits on Feb 27, 2018

  1. stream: always reset awaitDrain when emitting data

    The complicated `awaitDrain` machinery can be made a bit
    slimmer, and more correct, by just resetting the value
    each time `stream.emit('data')` is called.
    
    By resetting the value before emitting the data chunk, and
    seeing whether any pipe destinations return `.write() === false`,
    we always end up in a consistent state and don’t need to worry
    about odd situations (like `dest.write(chunk)` emitting more data).
    
    PR-URL: nodejs#18516
    Fixes: nodejs#18484
    Fixes: nodejs#18512
    Refs: nodejs#18515
    Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: James M Snell <jasnell@gmail.com>
    Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
    Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
    addaleax committed Feb 27, 2018
    Configuration menu
    Copy the full SHA
    b26d272 View commit details
    Browse the repository at this point in the history