Browse Source

Partial revert "tls: keep track of stream that is closed"

This partually reverts commit 4cdb0e89d8.

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 <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
v7.x
Trevor Norris 8 years ago
committed by Myles Borins
parent
commit
51c8d8088a
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 6
      lib/_tls_wrap.js
  2. 9
      src/tls_wrap.cc
  3. 1
      src/tls_wrap.h

6
lib/_tls_wrap.js

@ -378,12 +378,6 @@ TLSSocket.prototype._wrapHandle = function(wrap) {
res = null;
});
if (wrap) {
wrap.on('close', function() {
res.onStreamClose();
});
}
return res;
};

9
src/tls_wrap.cc

@ -794,14 +794,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());
@ -932,7 +924,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);

1
src/tls_wrap.h

@ -140,7 +140,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);

Loading…
Cancel
Save