-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
http: missing close after finish #27480
Labels
http
Issues or PRs related to the http subsystem.
Comments
A bit more nodejs testy: const http = require('http')
const send = require('send')
const server = http
.createServer(common.mustCall((req, res) => {
send(req, '/Users/ronagy/Desktop/old/AFT2/Start_060918_40.mov')
.pipe(res)
.on('finish', common.mustCall())
.on('close', common.mustCall());
}));
server.listen(9000, common.mustCall(() => {
http.get({ port: server.address().port }, res => {
res.on('data', buf => {
// drain
});
});
})); |
I can't reproduce:
|
dd if=/dev/urandom of=data.bin count=1024 bs=1024
1024+0 records in
1024+0 records out
1048576 bytes transferred in 0.029004 secs (36152686 bytes/sec) const http = require('http')
const { createReadStream } = require('fs')
const server = http
.createServer((req, res) => {
createReadStream('./data.bin')
.pipe(res)
.on('finish', () => console.log('finish'))
.on('close', () => console.log('close'))
})
server.listen(9000, () => {
http.get({ port: server.address().port }, res => {
res.resume()
})
}) storage$ node --version
v10.13.0
storage$ node tmp.js
finish
^C |
storage$ node --version && node tmp.js
v10.15.3
finish
^C |
Works in node 11 and later. Not sure what commit fixed it? storage$ node --version && node tmp.js
v12.1.0
finish
close node --version && node tmp.js
v11.14.0
finish
close |
@mcollina is this something we want to fix in LTS or should I just drop it? |
aah! yes, then it is as it should be |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Node 10.13
Would expect it to print 'finish' and then 'close'.
The text was updated successfully, but these errors were encountered: