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

stream: always reset awaitDrain when emitting data #18516

Merged
merged 2 commits into from Feb 6, 2018

Commits on Feb 6, 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 6, 2018
    Configuration menu
    Copy the full SHA
    e7cb694 View commit details
    Browse the repository at this point in the history
  2. test: add test for stream unpipe with 'data' listeners

    PR-URL: nodejs#18516
    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 6, 2018
    Configuration menu
    Copy the full SHA
    ee67dd0 View commit details
    Browse the repository at this point in the history