Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
  • Loading branch information
indutny committed Dec 14, 2015
commit f3e77d8b18540c84ad3241cf32c0d8e6055dc216
6 changes: 3 additions & 3 deletions src/tls_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions src/tls_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down