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

tls_wrap: inherit from the AsyncWrap first #4268

Closed
wants to merge 1 commit into from

Conversation

indutny
Copy link
Member

@indutny indutny commented Dec 14, 2015

WrapperInfo casts pointer in JS object's internal field to
AsyncWrap. This approach fails miserably for TLSWrap because it was
inhereted from the StreamBase first, creating different kind of
vtable for the whole class.

Reorder parent classes to put AsyncWrap first.

Fix: #4250

`WrapperInfo` casts pointer in JS object's internal field to
`AsyncWrap`. This approach fails miserably for `TLSWrap` because it was
inhereted from the `StreamBase` first, creating different kind of
`vtable` for the whole class.

Reorder parent classes to put `AsyncWrap` first.

Fix: nodejs#4250
@indutny
Copy link
Member Author

indutny commented Dec 14, 2015

@indutny
Copy link
Member Author

indutny commented Dec 14, 2015

I'm not exactly sure how to test it, perhaps @bnoordhuis has some suggestions?

R=@trevnorris or @bnoordhuis

@indutny indutny added tls Issues and PRs related to the tls subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. lts-watch-v4.x labels Dec 14, 2015
@paddybyers
Copy link
Contributor

@indutny Thanks

@indutny
Copy link
Member Author

indutny commented Dec 14, 2015

CI is green

@jasnell
Copy link
Member

jasnell commented Dec 14, 2015

LGTM

I am curious tho, could changing the order here potentially break anything?

@indutny
Copy link
Member Author

indutny commented Dec 14, 2015

@jasnell I don't think so. From user perspective this class is not exposed, from the core perspective all casts seems to be proper on C++ side.

@indutny
Copy link
Member Author

indutny commented Dec 14, 2015

Landed in e0bb118, thank you!

@indutny indutny closed this Dec 14, 2015
@indutny indutny deleted the fix/async-wrap-unwrap-tlswrap branch December 14, 2015 20:48
indutny added a commit that referenced this pull request Dec 14, 2015
`WrapperInfo` casts pointer in JS object's internal field to
`AsyncWrap`. This approach fails miserably for `TLSWrap` because it was
inhereted from the `StreamBase` first, creating different kind of
`vtable` for the whole class.

Reorder parent classes to put `AsyncWrap` first.

Fix: #4250
PR-URL: #4268
Reviewed-By: James M Snell <jasnell@gmail.com>
@paddybyers
Copy link
Contributor

I am curious tho, could changing the order here potentially break anything?

Presumably it's a simple check that there's no static cast elsewhere to a SSLWrap<TLSWrap>*.

indutny added a commit that referenced this pull request Dec 15, 2015
`WrapperInfo` casts pointer in JS object's internal field to
`AsyncWrap`. This approach fails miserably for `TLSWrap` because it was
inhereted from the `StreamBase` first, creating different kind of
`vtable` for the whole class.

Reorder parent classes to put `AsyncWrap` first.

Fix: #4250
PR-URL: #4268
Reviewed-By: James M Snell <jasnell@gmail.com>
@rvagg rvagg mentioned this pull request Dec 17, 2015
indutny added a commit that referenced this pull request Dec 30, 2015
`WrapperInfo` casts pointer in JS object's internal field to
`AsyncWrap`. This approach fails miserably for `TLSWrap` because it was
inhereted from the `StreamBase` first, creating different kind of
`vtable` for the whole class.

Reorder parent classes to put `AsyncWrap` first.

Fix: #4250
PR-URL: #4268
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 19, 2016
`WrapperInfo` casts pointer in JS object's internal field to
`AsyncWrap`. This approach fails miserably for `TLSWrap` because it was
inhereted from the `StreamBase` first, creating different kind of
`vtable` for the whole class.

Reorder parent classes to put `AsyncWrap` first.

Fix: #4250
PR-URL: #4268
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 19, 2016
scovetta pushed a commit to scovetta/node that referenced this pull request Apr 2, 2016
`WrapperInfo` casts pointer in JS object's internal field to
`AsyncWrap`. This approach fails miserably for `TLSWrap` because it was
inhereted from the `StreamBase` first, creating different kind of
`vtable` for the whole class.

Reorder parent classes to put `AsyncWrap` first.

Fix: nodejs#4250
PR-URL: nodejs#4268
Reviewed-By: James M Snell <jasnell@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++. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants