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

Causes app crashes if response is closed #15

Open
Jimbly opened this issue Apr 3, 2014 · 0 comments
Open

Causes app crashes if response is closed #15

Jimbly opened this issue Apr 3, 2014 · 0 comments

Comments

@Jimbly
Copy link

Jimbly commented Apr 3, 2014

If the request handler is asynchronous (and anything other than a timer, which is cleaned up specially in domain.dispose() - an http request for a slow resource is a good example), and the client closes its connection (calling domain.dispose to be called, which calls res.end()), then when our request handler's async method returns, it runs in the app's domain, not the request domain (which no longer exists), and any calls to res.writeHead() will now cause an app-level crash (saying headers have already been written).

Fix is probably to just not call domain.dispose() in response to 'close' on the response object.

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

1 participant