Skip to content

Commit 51c8d80

Browse files
trevnorrisMylesBorins
authored andcommitted
Partial revert "tls: keep track of stream that is closed"
This partually reverts commit 4cdb0e8. A nullptr check in TSLWrap::IsAlive() and the added test were left. PR-URL: #11947 Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 4051184 commit 51c8d80

File tree

3 files changed

+0
-16
lines changed

3 files changed

+0
-16
lines changed

lib/_tls_wrap.js

-6
Original file line numberDiff line numberDiff line change
@@ -378,12 +378,6 @@ TLSSocket.prototype._wrapHandle = function(wrap) {
378378
res = null;
379379
});
380380

381-
if (wrap) {
382-
wrap.on('close', function() {
383-
res.onStreamClose();
384-
});
385-
}
386-
387381
return res;
388382
};
389383

src/tls_wrap.cc

-9
Original file line numberDiff line numberDiff line change
@@ -794,14 +794,6 @@ void TLSWrap::EnableSessionCallbacks(
794794
}
795795

796796

797-
void TLSWrap::OnStreamClose(const FunctionCallbackInfo<Value>& args) {
798-
TLSWrap* wrap;
799-
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
800-
801-
wrap->stream_ = nullptr;
802-
}
803-
804-
805797
void TLSWrap::DestroySSL(const FunctionCallbackInfo<Value>& args) {
806798
TLSWrap* wrap;
807799
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
@@ -932,7 +924,6 @@ void TLSWrap::Initialize(Local<Object> target,
932924
env->SetProtoMethod(t, "enableSessionCallbacks", EnableSessionCallbacks);
933925
env->SetProtoMethod(t, "destroySSL", DestroySSL);
934926
env->SetProtoMethod(t, "enableCertCb", EnableCertCb);
935-
env->SetProtoMethod(t, "onStreamClose", OnStreamClose);
936927

937928
StreamBase::AddMethods<TLSWrap>(env, t, StreamBase::kFlagHasWritev);
938929
SSLWrap<TLSWrap>::AddMethods(env, t);

src/tls_wrap.h

-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ class TLSWrap : public AsyncWrap,
140140
static void EnableCertCb(
141141
const v8::FunctionCallbackInfo<v8::Value>& args);
142142
static void DestroySSL(const v8::FunctionCallbackInfo<v8::Value>& args);
143-
static void OnStreamClose(const v8::FunctionCallbackInfo<v8::Value>& args);
144143

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

0 commit comments

Comments
 (0)