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: homogenize req_wrap_obj use #10184

Closed
wants to merge 7 commits into from

Conversation

indutny
Copy link
Member

@indutny indutny commented Dec 8, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

stream_base

Description of change

Always use req_wrap_obj to allow calling req->Done() in stream
implementations.

Always use `req_wrap_obj` to allow calling `req->Done()` in stream
implementations.
@indutny indutny added the c++ Issues and PRs that require attention from people who are familiar with C++. label Dec 8, 2016
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lts-watch-v6.x labels Dec 8, 2016
Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with Green CI

req_wrap->object()->Set(env->async(), True(env->isolate()));
req_wrap->object()->Set(env->bytes_string(),
req_wrap_obj->Set(env->async(), True(env->isolate()));
req_wrap_obj->Set(env->bytes_string(),
Number::New(env->isolate(), bytes));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation needs to be adjusted here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. Thank you!

@indutny
Copy link
Member Author

indutny commented Dec 8, 2016

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but you might as well change the one at line ~330 too.

@indutny
Copy link
Member Author

indutny commented Dec 8, 2016

@bnoordhuis good point, fixed it everywhere.

@indutny
Copy link
Member Author

indutny commented Dec 8, 2016

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with style nits. Please be less hasty next time.

@@ -82,7 +82,7 @@ void StreamBase::AfterShutdown(ShutdownWrap* req_wrap, int status) {
req_wrap_obj
};

if (req_wrap->object()->Has(env->context(),
if (req_wrap_obj->Has(env->context(),
env->oncomplete_string()).FromJust()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alignment. :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -383,7 +382,7 @@ void StreamBase::AfterWrite(WriteWrap* req_wrap, int status) {
wrap->ClearError();
}

if (req_wrap->object()->Has(env->context(),
if (req_wrap_obj->Has(env->context(),
env->oncomplete_string()).FromJust()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And again.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@indutny
Copy link
Member Author

indutny commented Dec 19, 2016

Landed in 729fecf, thank you!

@indutny indutny closed this Dec 19, 2016
@indutny indutny deleted the fix/homogenize-streambase branch December 19, 2016 22:20
indutny added a commit that referenced this pull request Dec 19, 2016
Always use `req_wrap_obj` to allow calling `req->Done()` in stream
implementations.

PR-URL: #10184
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
cjihrig pushed a commit to cjihrig/node that referenced this pull request Dec 20, 2016
Always use `req_wrap_obj` to allow calling `req->Done()` in stream
implementations.

PR-URL: nodejs#10184
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@italoacasas italoacasas mentioned this pull request Dec 20, 2016
cjihrig pushed a commit that referenced this pull request Dec 20, 2016
Always use `req_wrap_obj` to allow calling `req->Done()` in stream
implementations.

PR-URL: #10184
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins
Copy link
Contributor

@indutny I've gone ahead and backported to v6.x. It is not landing cleanly on v4.x though

please feel free to manually backport. If it should be backported please change the label appropriately.

MylesBorins pushed a commit that referenced this pull request Jan 22, 2017
Always use `req_wrap_obj` to allow calling `req->Done()` in stream
implementations.

PR-URL: #10184
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@indutny
Copy link
Member Author

indutny commented Jan 23, 2017

No need to backport it, but thanks for attempt!

@MylesBorins
Copy link
Contributor

@indutny should it be removed from v6.x?

@indutny
Copy link
Member Author

indutny commented Jan 23, 2017

No need to remove it either. It is very minor and has neglectable behavior changes for core internals.

MylesBorins pushed a commit that referenced this pull request Jan 24, 2017
Always use `req_wrap_obj` to allow calling `req->Done()` in stream
implementations.

PR-URL: #10184
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 24, 2017
MylesBorins pushed a commit that referenced this pull request Jan 31, 2017
Always use `req_wrap_obj` to allow calling `req->Done()` in stream
implementations.

PR-URL: #10184
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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.

8 participants