Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! fixup! tls: fix session and keylog add listener segfault
  • Loading branch information
Linkgoron committed Apr 10, 2021
commit 82ffbae4e3901281a95258e57cbd1b70d2e245fd
18 changes: 8 additions & 10 deletions test/parallel/test-tls-tlswrap-segfault-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ if (!common.hasCrypto)

const tls = require('tls');
const tlsSocketKeyLog = tls.connect('cause-error');
tlsSocketKeyLog.on('error', () => {
setTimeout(() => {
tlsSocketKeyLog.on('keylog', () => { });
}, 10);
});
tlsSocketKeyLog.on('error', common.mustCall());
tlsSocketKeyLog.on('close', common.mustCall(() => {
tlsSocketKeyLog.on('keylog', common.mustNotCall());
}));

const tlsSocketSession = tls.connect('cause-error-2');
tlsSocketSession.on('error', (e) => {
setTimeout(() => {
tlsSocketSession.on('session', () => { });
}, 10);
});
tlsSocketSession.on('error', common.mustCall());
tlsSocketSession.on('close', common.mustCall(() => {
tlsSocketSession.on('session', common.mustNotCall());
}));