Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

can: remove keepOpenOnPeerClosed flag from Http.Register command #401

Closed
sirthias opened this issue Jul 26, 2013 · 0 comments
Closed

can: remove keepOpenOnPeerClosed flag from Http.Register command #401

sirthias opened this issue Jul 26, 2013 · 0 comments
Assignees

Comments

@sirthias
Copy link
Member

It doesn't make sense to be able to configure the keepOpenOnPeerClosed behavior for HTTP.

Here is how spray-can should behave:

Client side

The Tcp.Register command to the IO layer (in the HttpClientConnection) should have keepOpenOnPeerClosed = settings.sslEncryption.
Additionally, because the SslTlsSupport pipeline stage might be active but encryption still be disabled, we need to always actively close the connection whenever we see a PeerClosed event (this logic needs to go into the ClientFrontend stage).

Server side

On the server-side it might be that the client half-closes the connection before having received the response. So we always enable keepOpenOnPeerClosed.
When we see a PeerClosed event we can close the connection immediately if no response is currently pending. Otherwise we switch into a mode that causes the last pending response that goes out to have a Connection: close header (which causes the ResponseRendering stage to actively close the connection when the response has been dispatched to the IO layer.

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

No branches or pull requests

2 participants