-
-
Save bnoordhuis/cf200af99b4ae26eb5a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/tls.js b/lib/tls.js | |
index 63d6bd0..96074c5 100644 | |
--- a/lib/tls.js | |
+++ b/lib/tls.js | |
@@ -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'); | |
}); | |
@@ -1017,7 +1019,7 @@ function pipe(pair, socket) { | |
function onclose() { | |
socket.removeListener('error', onerror); | |
- socket.removeListener('close', onclose); | |
+ socket.removeListener('end', onclose); | |
socket.removeListener('timeout', ontimeout); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment