-
Notifications
You must be signed in to change notification settings - Fork 30k
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
net: make writeAfterFIN() return false #27996
Conversation
If `false` is not returned a readable stream piped into the socket might continue reading indefinitely until the process goes out of memory.
'use strict';
const net = require('net');
const { Readable } = require('stream');
const chunk = Buffer.alloc(1024);
const readable = new Readable({
read() {
this.push(chunk);
}
});
const server = net.createServer(function(socket) {
server.close();
socket.resume();
setTimeout(function() {
socket.end();
}, 100);
});
server.listen(function() {
const socket = net.connect(this.address().port, function() {
socket.resume();
socket.on('error', function() {});
readable.pipe(socket);
});
}); |
Does the documentation for
|
@Trott I think it's not needed. When |
Landed in 714a32c. |
If `false` is not returned a readable stream piped into the socket might continue reading indefinitely until the process goes out of memory. PR-URL: #27996 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
If `false` is not returned a readable stream piped into the socket might continue reading indefinitely until the process goes out of memory. PR-URL: #27996 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
If
false
is not returned a readable stream piped into the socketmight continue reading indefinitely until the process goes out of
memory.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes