From 595efd8b9a463886c20fb04103c508bd9c3630e7 Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Mon, 20 Mar 2017 16:26:10 -0600 Subject: [PATCH] Partial revert "tls: keep track of stream that is closed" This partually reverts commit 4cdb0e89d8daf7e1371c3b8d3f057940aa327d4a. A nullptr check in TSLWrap::IsAlive() and the added test were left. PR-URL: https://github.com/nodejs/node/pull/11947 Reviewed-By: Franziska Hinkelmann Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- lib/_tls_wrap.js | 6 ------ src/tls_wrap.cc | 9 --------- src/tls_wrap.h | 1 - 3 files changed, 16 deletions(-) diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 288f82e05b3d12..511ff3557a6e23 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -399,12 +399,6 @@ TLSSocket.prototype._wrapHandle = function(wrap) { res = null; }); - if (wrap) { - wrap.on('close', function() { - res.onStreamClose(); - }); - } - return res; }; diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 3dad65011ff85b..6f2d0e4c16d576 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -815,14 +815,6 @@ void TLSWrap::EnableSessionCallbacks( } -void TLSWrap::OnStreamClose(const FunctionCallbackInfo& args) { - TLSWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); - - wrap->stream_ = nullptr; -} - - void TLSWrap::DestroySSL(const FunctionCallbackInfo& args) { TLSWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); @@ -953,7 +945,6 @@ void TLSWrap::Initialize(Local target, env->SetProtoMethod(t, "enableSessionCallbacks", EnableSessionCallbacks); env->SetProtoMethod(t, "destroySSL", DestroySSL); env->SetProtoMethod(t, "enableCertCb", EnableCertCb); - env->SetProtoMethod(t, "onStreamClose", OnStreamClose); StreamBase::AddMethods(env, t, StreamBase::kFlagHasWritev); SSLWrap::AddMethods(env, t); diff --git a/src/tls_wrap.h b/src/tls_wrap.h index f1d53f3e2f5da1..19633ea8667fff 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -161,7 +161,6 @@ class TLSWrap : public AsyncWrap, static void EnableCertCb( const v8::FunctionCallbackInfo& args); static void DestroySSL(const v8::FunctionCallbackInfo& args); - static void OnStreamClose(const v8::FunctionCallbackInfo& args); #ifdef SSL_CTRL_SET_TLSEXT_SERVERNAME_CB static void GetServername(const v8::FunctionCallbackInfo& args);