-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
close event emitted on net socket but not tls #24984
Labels
Comments
They both don't emit |
OS TCP buffer size perhaps then |
@lpinca what about this? I don't get a const fs = require('fs');
const path = require('path');
const tls = require('tls');
const server = tls.createServer({
key: fs.readFileSync(path.join(__dirname, 'server.key')),
cert: fs.readFileSync(path.join(__dirname, 'server.pem'))
});
let cconn = null;
let sconn = null;
function doit() {
if (cconn && sconn) {
cconn.resume();
sconn.resume();
sconn.end(Buffer.alloc(1024*1024));
cconn.end();
}
}
server.on('secureConnection', function (conn) {
conn.on('close', function () {
console.log("CLOSE");
});
sconn = conn;
doit();
});
server.listen(7000, function () {
tls.connect({
ca: fs.readFileSync(path.join(__dirname, 'ca.pem')),
port: 7000
}, function () {
cconn = this;
doit();
});
}); |
This fixes it: diff --git a/lib/net.js b/lib/net.js
index 0229e450fc..377dd202af 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -371,8 +371,8 @@ Socket.prototype._final = function(cb) {
};
-function afterShutdown(status, handle) {
- var self = handle[owner_symbol];
+function afterShutdown(status) {
+ var self = this.handle[owner_symbol];
debug('afterShutdown destroyed=%j', self.destroyed,
self._readableState); |
I can reproduce the issue, both |
lpinca
added
confirmed-bug
Issues with confirmed bugs.
net
Issues and PRs related to the net subsystem.
labels
Dec 13, 2018
cc: @addaleax |
lpinca
added
tls
Issues and PRs related to the tls subsystem.
and removed
net
Issues and PRs related to the net subsystem.
labels
Dec 13, 2018
The first bad commit seems to be e82f67d710. |
2 tasks
refack
pushed a commit
to refack/node
that referenced
this issue
Jan 14, 2019
'close' event isn't emitted on a TLS connection if it's been written to (but 'end' and 'finish' events are). PR-URL: nodejs#25026 Fixes: nodejs#24984 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
davedoesdev
added a commit
to davedoesdev/centro
that referenced
this issue
Feb 8, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Why does this emit a
close
event:but this does not emit a close event:
?
The text was updated successfully, but these errors were encountered: