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

detect if the client terminated the connection #105

Open
doome opened this issue Oct 20, 2014 · 0 comments
Open

detect if the client terminated the connection #105

doome opened this issue Oct 20, 2014 · 0 comments

Comments

@doome
Copy link

doome commented Oct 20, 2014

When a client terminates the underlying TCP connection (even for GET requests), Starman should detect it, and notify the running app of this event, so it can stop processing the request, and wasting resources.

The best way would be a delivered signal (a SIGPIPE maybe?), but if it is easier to implement, the ability to detect EOF in the psgi.input handle would be sufficient. Unfortunately, right now the psgi.input handle is not necessarily the handle of the TCP socket (it is either a null io handle or a Plack::TempBuffer, or something alike), so it is impossible to detect if the peer is still listening to our answer or terminated the connection.

In fact, this should be the part of the PSGI specification. mod_fastcgi uses SIGPIPE for this purpose.

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