-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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.IncomingMessage doesn't fire callback on 'timeout' #33734
Comments
That doesn't sound right. Can you post a test case (no third-party dependencies) that demonstrates the issue you're seeing? |
Test case: server.js: const http = require('http');
const hostname = 'localhost';
const port = 8080;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.flushHeaders();
});
server.listen(port, hostname); client.js: const http = require('http');
const host = 'localhost';
const port = 8080;
http.get({host: host, port: port}, (res) => {
res.setTimeout(1000, () => console.log('timeout from IncomingMessage'));//not fired
res.socket.setTimeout(1000, () => console.log('timeout from socket')); //fired
}); EDIT(trivikr): put code in code block |
@bnoordhuis is the fix above not ready or did you forget to open a PR with it? |
Fixes: nodejs#33734 PR-URL: nodejs#34913 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
What steps will reproduce the bug?
Source code from
lib/_http_incoming.js
:IncomingMessage doesn't emit 'timeout' so callback will never be fired
How often does it reproduce? Is there a required condition?
What is the expected behavior?
EDIT(trivikr): put code in a code block
The text was updated successfully, but these errors were encountered: