-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
http: unref socket timer on parser execute #6286
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| 'use strict'; | ||
|
|
||
| const common = require('../common'); | ||
| const assert = require('assert'); | ||
| const http = require('http'); | ||
|
|
||
| const server = http.createServer((req, res) => { | ||
| server.close(); | ||
|
|
||
| res.writeHead(200); | ||
| res.flushHeaders(); | ||
|
|
||
| req.setTimeout(200, () => { | ||
| assert(false, 'Should not happen'); | ||
| }); | ||
| req.resume(); | ||
| req.once('end', () => { | ||
| res.end(); | ||
| }); | ||
| }); | ||
|
|
||
| server.listen(common.PORT, () => { | ||
|
||
| const req = http.request({ | ||
| port: common.PORT, | ||
| method: 'POST' | ||
| }, (res) => { | ||
| const interval = setInterval(() => { | ||
| req.write('a'); | ||
| }, 25); | ||
| setTimeout(() => { | ||
| clearInterval(interval); | ||
| req.end(); | ||
| }, 400); | ||
|
||
| }); | ||
| req.write('.'); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: wrap this in
common.mustCall()?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack.