Skip to content

Commit

Permalink
Partial revert "tls: keep track of stream that is closed"
Browse files Browse the repository at this point in the history
This partually reverts commit 4cdb0e8.

A nullptr check in TSLWrap::IsAlive() and the added test were left.

PR-URL: #11947
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
trevnorris authored and MylesBorins committed Apr 19, 2017
1 parent ff1d61c commit 4426080
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
6 changes: 0 additions & 6 deletions lib/_tls_wrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,6 @@ TLSSocket.prototype._wrapHandle = function(wrap) {
res = null;
});

if (wrap) {
wrap.on('close', function() {
res.onStreamClose();
});
}

return res;
};

Expand Down
9 changes: 0 additions & 9 deletions src/tls_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -790,14 +790,6 @@ void TLSWrap::EnableSessionCallbacks(
}


void TLSWrap::OnStreamClose(const FunctionCallbackInfo<Value>& args) {
TLSWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());

wrap->stream_ = nullptr;
}


void TLSWrap::DestroySSL(const FunctionCallbackInfo<Value>& args) {
TLSWrap* wrap;
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
Expand Down Expand Up @@ -928,7 +920,6 @@ void TLSWrap::Initialize(Local<Object> target,
env->SetProtoMethod(t, "enableSessionCallbacks", EnableSessionCallbacks);
env->SetProtoMethod(t, "destroySSL", DestroySSL);
env->SetProtoMethod(t, "enableCertCb", EnableCertCb);
env->SetProtoMethod(t, "onStreamClose", OnStreamClose);

StreamBase::AddMethods<TLSWrap>(env, t, StreamBase::kFlagHasWritev);
SSLWrap<TLSWrap>::AddMethods(env, t);
Expand Down
1 change: 0 additions & 1 deletion src/tls_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class TLSWrap : public AsyncWrap,
static void EnableCertCb(
const v8::FunctionCallbackInfo<v8::Value>& args);
static void DestroySSL(const v8::FunctionCallbackInfo<v8::Value>& args);
static void OnStreamClose(const v8::FunctionCallbackInfo<v8::Value>& args);

#ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
static void GetServername(const v8::FunctionCallbackInfo<v8::Value>& args);
Expand Down

0 comments on commit 4426080

Please sign in to comment.