Skip to content

Commit 8732977

Browse files
committed
tls: fix references to undefined cb
5795e83 introduced unintentional copy-paste bug. `cb` is not actually present in those functions and should not be called, the socket should be destroy instead. PR-URL: #1951 Reviewed-By: Roman Reiss <[email protected]>
1 parent 0f68377 commit 8732977

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/_tls_wrap.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ function oncertcb(info) {
167167
return self.destroy(err);
168168

169169
if (!self._handle)
170-
return cb(new Error('Socket is closed'));
170+
return self.destroy(new Error('Socket is closed'));
171171

172172
self._handle.certCbDone();
173173
});
@@ -192,7 +192,7 @@ function onnewsession(key, session) {
192192
once = true;
193193

194194
if (!self._handle)
195-
return cb(new Error('Socket is closed'));
195+
return self.destroy(new Error('Socket is closed'));
196196

197197
self._handle.newSessionDone();
198198

0 commit comments

Comments
 (0)