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

http - res.closed #15523

Closed
ronag opened this issue Sep 21, 2017 · 5 comments
Closed

http - res.closed #15523

ronag opened this issue Sep 21, 2017 · 5 comments
Labels
feature request Issues that request new features to be added to Node.js. http Issues or PRs related to the http subsystem.

Comments

@ronag
Copy link
Member

ronag commented Sep 21, 2017

h2 compat has a great prop called closed which makes it easy to decide whether it is safe to call writeHead or not. I don't think there is anything corresponding in h1. Would be nice to have though?

You can use headersSent. However, that will not work in the case where the connection was closed before headers were sent. Maybe #15285 would be enough? Not sure?

@mscdex mscdex added the http Issues or PRs related to the http subsystem. label Sep 21, 2017
@mscdex
Copy link
Contributor

mscdex commented Sep 21, 2017

This is why having an updated .writable would have been nice to have.

@ronag
Copy link
Member Author

ronag commented Sep 21, 2017

@mscdex: Could closed be implemented as !this.writable || this.finished?

@mscdex
Copy link
Contributor

mscdex commented Sep 21, 2017

No, you can't rely on .writable because of the revert I linked to (it's no longer updated to false).

@ronag
Copy link
Member Author

ronag commented Sep 21, 2017

@mscdex: Which is why I also added || this.finished which is set to true when writable should have been set to false?

@apapirovski apapirovski added the feature request Issues that request new features to be added to Node.js. label Apr 13, 2018
@ronag
Copy link
Member Author

ronag commented Apr 27, 2018

closed property was removed.

@ronag ronag closed this as completed Apr 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants