mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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: https://github.com/nodejs/node/issues/4250 PR-URL: https://github.com/nodejs/node/pull/4268 Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
d3c498b1b7
commit
e0bb118a1d
2 files changed
+6
-6
No files matched your search
+3
-3
@@ -36,11 +36,11 @@ TLSWrap::TLSWrap(Environment* env,
|
||||
Kind kind,
|
||||
StreamBase* stream,
|
||||
SecureContext* sc)
|
||||
: SSLWrap<TLSWrap>(env, sc, kind),
|
||||
StreamBase(env),
|
||||
AsyncWrap(env,
|
||||
: AsyncWrap(env,
|
||||
env->tls_wrap_constructor_function()->NewInstance(),
|
||||
AsyncWrap::PROVIDER_TLSWRAP),
|
||||
SSLWrap<TLSWrap>(env, sc, kind),
|
||||
StreamBase(env),
|
||||
sc_(sc),
|
||||
stream_(stream),
|
||||
enc_in_(nullptr),
|
||||
|
||||
+3
-3
@@ -21,9 +21,9 @@ namespace crypto {
|
||||
class SecureContext;
|
||||
}
|
||||
|
||||
class TLSWrap : public crypto::SSLWrap<TLSWrap>,
|
||||
public StreamBase,
|
||||
public AsyncWrap {
|
||||
class TLSWrap : public AsyncWrap,
|
||||
public crypto::SSLWrap<TLSWrap>,
|
||||
public StreamBase {
|
||||
public:
|
||||
~TLSWrap() override;
|
||||
|
||||
|
||||
Reference in new issue
Block a user