Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e0bb118

Browse filesBrowse files
committed
tls_wrap: inherit from the AsyncWrap first
`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>
1 parent d3c498b commit e0bb118
Copy full SHA for e0bb118

File tree

Expand file treeCollapse file tree

2 files changed

+6
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-6
lines changed
Open diff view settings
Collapse file

‎src/tls_wrap.cc‎

Copy file name to clipboardExpand all lines: src/tls_wrap.cc
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ TLSWrap::TLSWrap(Environment* env,
3636
Kind kind,
3737
StreamBase* stream,
3838
SecureContext* sc)
39-
: SSLWrap<TLSWrap>(env, sc, kind),
40-
StreamBase(env),
41-
AsyncWrap(env,
39+
: AsyncWrap(env,
4240
env->tls_wrap_constructor_function()->NewInstance(),
4341
AsyncWrap::PROVIDER_TLSWRAP),
42+
SSLWrap<TLSWrap>(env, sc, kind),
43+
StreamBase(env),
4444
sc_(sc),
4545
stream_(stream),
4646
enc_in_(nullptr),
Collapse file

‎src/tls_wrap.h‎

Copy file name to clipboardExpand all lines: src/tls_wrap.h
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ namespace crypto {
2121
class SecureContext;
2222
}
2323

24-
class TLSWrap : public crypto::SSLWrap<TLSWrap>,
25-
public StreamBase,
26-
public AsyncWrap {
24+
class TLSWrap : public AsyncWrap,
25+
public crypto::SSLWrap<TLSWrap>,
26+
public StreamBase {
2727
public:
2828
~TLSWrap() override;
2929

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.