Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Emit 'end' from crypto streams on close
Browse files Browse the repository at this point in the history
Fixes test/simple/test-tls-peer-certificate.js on Windows

Patch from bnoordhuis.

See also 75a0cf9
  • Loading branch information
ry committed Oct 21, 2011
1 parent 2d02e6a commit de09168
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/tls.js
Expand Up @@ -679,6 +679,8 @@ SecurePair.prototype.destroy = function() {
self.cleartext.writable = self.cleartext.readable = false;

process.nextTick(function() {
self.encrypted.emit('end');
self.cleartext.emit('end');
self.encrypted.emit('close');
self.cleartext.emit('close');
});
Expand Down Expand Up @@ -1025,7 +1027,7 @@ function pipe(pair, socket) {

function onclose() {
socket.removeListener('error', onerror);
socket.removeListener('close', onclose);
socket.removeListener('end', onclose);
socket.removeListener('timeout', ontimeout);
}

Expand Down

0 comments on commit de09168

Please sign in to comment.