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

src: pull AfterConnect from pipe_wrap and tcp_wrap #8448

Closed
wants to merge 1 commit into from

Conversation

danbev
Copy link
Contributor

@danbev danbev commented Sep 8, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

src

Description of change

This commit attempts to address one of the items in
#4641 which is related to
src/pipe_wrap.cc and src/tcp_wrap.cc.

Currently both pipe_wrap.cc and tcp_wrap.cc contain an AfterConnect
function that are almost identical. This commit extracts this function
into ConnectionWrap so that that both can share it.

This commit attempts to address one of the items in
nodejs#4641 which is related to
src/pipe_wrap.cc and src/tcp_wrap.cc.

Currently both pipe_wrap.cc and tcp_wrap.cc contain an AfterConnect
function that are almost identical. This commit extracts this function
into ConnectionWrap so that that both can share it.
@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Sep 8, 2016
@danbev
Copy link
Contributor Author

danbev commented Sep 8, 2016

} else {
readable = uv_is_readable(req->handle) != 0;
writable = uv_is_writable(req->handle) != 0;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm uncertain if this is alright for TCPWrap or not (TCPWrap always set these arguments to true) and wanted to open the PR to get some feedback.

Copy link
Member

Choose a reason for hiding this comment

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

It should be alright. The TCP sockets that libuv creates are always readable+writable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks!

@bnoordhuis
Copy link
Member

LGTM

@Trott
Copy link
Member

Trott commented Sep 8, 2016

CI failure looks infra related and unrelated to this change.

@cjihrig
Copy link
Contributor

cjihrig commented Sep 9, 2016

LGTM

2 similar comments
@addaleax
Copy link
Member

addaleax commented Sep 9, 2016

LGTM

@thefourtheye
Copy link
Contributor

LGTM

danbev added a commit to danbev/node that referenced this pull request Sep 11, 2016
This commit attempts to address one of the items in
nodejs#4641 which is related to
src/pipe_wrap.cc and src/tcp_wrap.cc.

Currently both pipe_wrap.cc and tcp_wrap.cc contain an AfterConnect
function that are almost identical. This commit extracts this function
into ConnectionWrap so that that both can share it.

PR-URL: nodejs#8448
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
@danbev
Copy link
Contributor Author

danbev commented Sep 11, 2016

Thanks for the reviews!

Landed in 83a354c

@danbev danbev closed this Sep 11, 2016
@danbev danbev deleted the extracting-afterconnect branch September 11, 2016 12:55
Fishrock123 pushed a commit that referenced this pull request Sep 14, 2016
This commit attempts to address one of the items in
#4641 which is related to
src/pipe_wrap.cc and src/tcp_wrap.cc.

Currently both pipe_wrap.cc and tcp_wrap.cc contain an AfterConnect
function that are almost identical. This commit extracts this function
into ConnectionWrap so that that both can share it.

PR-URL: #8448
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
@MylesBorins
Copy link
Contributor

should this be backported to v4?

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