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_base: dispatch reqs in the stream impl #1558

Closed
wants to merge 2 commits into from

Conversation

indutny
Copy link
Member

@indutny indutny commented Apr 29, 2015

Dispatch requests in the implementation of the stream, not in the code
creating these requests. The requests might be piled up and invoked
internally in the implementation, so it should know better when it is
the time to dispatch them.

In fact, TLS was doing exactly this thing which led us to...

Fix: #1512

@indutny
Copy link
Member Author

indutny commented Apr 29, 2015

@mscdex mscdex added the c++ Issues and PRs that require attention from people who are familiar with C++. label Apr 29, 2015
@Fishrock123
Copy link
Contributor

@indutny into v1.x? Shouldn't this target master and then be backported?

@indutny
Copy link
Member Author

indutny commented Apr 29, 2015

Yeah, right. I'm bad at this thing.

Dispatch requests in the implementation of the stream, not in the code
creating these requests. The requests might be piled up and invoked
internally in the implementation, so it should know better when it is
the time to dispatch them.

In fact, TLS was doing exactly this thing which led us to...

Fix: nodejs#1512
Make sure that no WriteItem's callback will be invoked synchronously.
Doing so may lead to the use of uninitialized `req` object, or even
worse use-after-free in the caller code.

Fix: nodejs#1512
@silverwind
Copy link
Contributor

#1512 looks to be fixed with the last commit, probaby best to run another CI now. I think this fix may have to go in without a test, unless someone has an idea.

@indutny
Copy link
Member Author

indutny commented Apr 29, 2015

I'll probably do it a better way... will reopen this PR to target a master branch.

@silverwind
Copy link
Contributor

Does the target branch really matter? With our manual merge process, it shouldn't have any significance :)

@Fishrock123
Copy link
Contributor

@silverwind means the CI will work properly. (see #1560)

@indutny indutny closed this Apr 29, 2015
@indutny indutny deleted the fix/gh-1512 branch April 29, 2015 18:57
@indutny indutny mentioned this pull request Apr 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants