Skip to content

Commit 595efd8

Browse files
trevnorrisaddaleax
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 ee463d3 commit 595efd8

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
@@ -399,12 +399,6 @@ TLSSocket.prototype._wrapHandle = function(wrap) {
399399
res = null;
400400
});
401401

402-
if (wrap) {
403-
wrap.on('close', function() {
404-
res.onStreamClose();
405-
});
406-
}
407-
408402
return res;
409403
};
410404

src/tls_wrap.cc

-9
Original file line numberDiff line numberDiff line change
@@ -815,14 +815,6 @@ void TLSWrap::EnableSessionCallbacks(
815815
}
816816

817817

818-
void TLSWrap::OnStreamClose(const FunctionCallbackInfo<Value>& args) {
819-
TLSWrap* wrap;
820-
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
821-
822-
wrap->stream_ = nullptr;
823-
}
824-
825-
826818
void TLSWrap::DestroySSL(const FunctionCallbackInfo<Value>& args) {
827819
TLSWrap* wrap;
828820
ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
@@ -953,7 +945,6 @@ void TLSWrap::Initialize(Local<Object> target,
953945
env->SetProtoMethod(t, "enableSessionCallbacks", EnableSessionCallbacks);
954946
env->SetProtoMethod(t, "destroySSL", DestroySSL);
955947
env->SetProtoMethod(t, "enableCertCb", EnableCertCb);
956-
env->SetProtoMethod(t, "onStreamClose", OnStreamClose);
957948

958949
StreamBase::AddMethods<TLSWrap>(env, t, StreamBase::kFlagHasWritev);
959950
SSLWrap<TLSWrap>::AddMethods(env, t);

src/tls_wrap.h

-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ class TLSWrap : public AsyncWrap,
161161
static void EnableCertCb(
162162
const v8::FunctionCallbackInfo<v8::Value>& args);
163163
static void DestroySSL(const v8::FunctionCallbackInfo<v8::Value>& args);
164-
static void OnStreamClose(const v8::FunctionCallbackInfo<v8::Value>& args);
165164

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

0 commit comments

Comments
 (0)