Skip to content
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

Should 'timeout' middleware be cleared if client drops connection? #1043

Closed
jkirkwood opened this issue Jun 17, 2014 · 3 comments
Closed

Should 'timeout' middleware be cleared if client drops connection? #1043

jkirkwood opened this issue Jun 17, 2014 · 3 comments

Comments

@jkirkwood
Copy link

I recently stumbled across this observation with the timeout middleware:

If a client makes a request, but closes the connection before the server has a chance to respond, the timeout still expires after the allotted amount of time, and an error occurs.

For the sake of preventing irrelevant errors from being populated in log files, I'm wondering if request timeouts should be cleared if the connection is closed. For the time-being I've added the following before the 'timeout' middleware.

app.use(function(req, res, next) {
  res.on('close', function() {
    req.clearTimeout();
  });
  next();
});
@dougwilson
Copy link
Contributor

Hi! There is no source for timeout middleware in here, so there is nothing that can be done in this project. Please file the issue at connect-timeout library. Also, yes, it should be cleared.

@jkirkwood
Copy link
Author

Missed that. Thanks!

@dougwilson
Copy link
Contributor

No problem. I look forward to seeing your new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants