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: propagate end's cb to write #33788

Closed
wants to merge 3 commits into from

Conversation

zhangwinning
Copy link
Contributor

@zhangwinning zhangwinning commented Jun 8, 2020

Fixes: #33684

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Jun 8, 2020
@mscdex
Copy link
Contributor

mscdex commented Jun 8, 2020

The callback is already being called. Having it called multiple times would be unexpected.

@zhangwinning
Copy link
Contributor Author

@mscdex thanks, I will check it, you can provide a example?

@mscdex
Copy link
Contributor

mscdex commented Jun 8, 2020

If you look at the end of the function you'll see this:

  if (typeof cb === 'function') {
    if (err || state.finished)
      process.nextTick(cb, err);
    else
      onFinished(this, cb);
  }

@zhangwinning
Copy link
Contributor Author

cc @ronag @mscdex. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stream: end(callback) does not propagate write after end to callback
4 participants