Surface the peer, add interim responses, and close connections on stop - #80
Merged
Conversation
- livery_req:peer/1 is now set on plain requests on all three adapters
(it was only carried on the WebSocket handoff), and peer_info/1
returns the real peer. H1 reads it from the connection (h1 0.8.0).
- livery_req:inform/3 sends interim (1xx) responses, primarily 103
Early Hints, backed by the optional adapter callback
send_informational/3 and the informational capability. H1 and H2
send it; H3 returns {error, unsupported} until the QUIC stack
surfaces interim HEADERS.
- livery:stop_service/1 really cuts off kept-alive HTTP/1.1 clients:
h1 0.8.0 closes accepted connections synchronously on stop. During
livery:drain/2 the service now only stops accepting, so established
connections keep serving through the window and the idle ones are
closed at the end.
- livery_ws:upgrade/3 takes max_frame_size / max_message_size and
compress => true (permessage-deflate, ws 0.4.0), and WebSocket
handlers get the peer's close code in terminate/2 as
{remote, Code, Reason}.
Bump h1 to 0.8.0 and ws (erlang_ws) to 0.4.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes three server-side gaps. livery_req:peer/1 is now set on plain requests on all three adapters and peer_info/1 returns the real peer. livery_req:inform/3 sends interim (1xx) responses such as 103 Early Hints through the new optional adapter callback send_informational/3, advertised via the informational capability; H1 and H2 send it, H3 reports {error, unsupported} for now. livery:stop_service/1 really cuts off kept-alive HTTP/1.1 clients (h1 0.8.0 closes accepted connections synchronously), and livery:drain/2 keeps established connections serving through the window then closes the idle ones at the end. Alongside: livery_ws:upgrade/3 takes max_frame_size, max_message_size, and compress (permessage-deflate via ws 0.4.0), and WebSocket handlers receive the peer's close code in terminate/2 as {remote, Code, Reason}. Bumps h1 to 0.8.0 and erlang_ws to 0.4.0.