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
  • Loading branch information
trevnorris committed Mar 23, 2017
1 parent d943cb7 commit ab67615
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 @@ -399,12 +399,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 @@ -815,14 +815,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 @@ -953,7 +945,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 @@ -161,7 +161,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 ab67615

Please sign in to comment.