Skip to content

Surface the peer, add interim responses, and close connections on stop - #80

Merged
benoitc merged 1 commit into
mainfrom
server-gaps-0.7.0
Aug 9, 2026
Merged

Surface the peer, add interim responses, and close connections on stop#80
benoitc merged 1 commit into
mainfrom
server-gaps-0.7.0

Conversation

@benoitc

@benoitc benoitc commented Aug 9, 2026

Copy link
Copy Markdown
Owner

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.

- 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.
@benoitc
benoitc merged commit 91af7f8 into main Aug 9, 2026
12 checks passed
@benoitc
benoitc deleted the server-gaps-0.7.0 branch August 9, 2026 06:52
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

Successfully merging this pull request may close these issues.

1 participant