Skip to content

refactor(http3): delegate H3 stack to erlang_quic / quic_h3#841

Merged
benoitc merged 5 commits intomasterfrom
refactor/h3-via-erlang-quic
Apr 15, 2026
Merged

refactor(http3): delegate H3 stack to erlang_quic / quic_h3#841
benoitc merged 5 commits intomasterfrom
refactor/h3-via-erlang-quic

Conversation

@benoitc
Copy link
Copy Markdown
Owner

@benoitc benoitc commented Apr 13, 2026

Replaces hackney's HTTP/3 framing, QPACK and control-stream code (~1.8k LOC) with quic_h3 from erlang_quic, now pinned to hex quic 1.0.0.

Further cleanup in this branch:

  • hackney_quic.erl merged into hackney_h3.erl; single module holds both the high-level request API and the gen_server adapter over quic_h3.
  • Public low-level message tag renamed {quic, ConnRef, _}{h3, ConnRef, _}; public low-level API moves from hackney_quic: to hackney_h3: (connect/4, send_request/3, send_data/4, reset_stream/3, close/2, process/1).
  • H3 peername/sockname/setopts/peercert return {error, not_supported} (not exposed by quic_h3).

xref, dialyzer green. H3 eunit suite 50/50; broader eunit 886/886.

benoitc added 5 commits April 13, 2026 17:00
Hackney's hand-rolled HTTP/3 framing, QPACK codec, control stream and
QPACK encoder/decoder stream handling are removed in favour of the
quic_h3 module shipped in erlang_quic's feat/http3 branch.

- src/hackney_quic.erl rewritten as a ~270 LOC gen_server adapter that
  translates {quic_h3, Conn, _} events into the existing
  {quic, ConnRef, _} protocol consumed by hackney_conn.
- Public hackney_quic API now exposes send_request/3 (atomic stream
  open + HEADERS) instead of the open_stream/1 + send_headers/4 pair;
  hackney_h3 updated accordingly.
- src/hackney_qpack.erl removed (~622 LOC); QPACK lives in quic_qpack.
- H3 peername/sockname/setopts/peercert now return {error, not_supported}
  since quic_h3 does not expose them.
- rebar.config: quic dep tracks erlang_quic feat/http3 branch.
Collapses the thin quic adapter and the h3 high-level module into a
single hackney_h3. Public low-level message tag renamed from
{quic, ConnRef, _} to {h3, ConnRef, _}; public low-level API moves
from hackney_quic: to hackney_h3:. Updates hackney_conn, tests, xref
config, and docs accordingly.
Switch the quic dep from the feat/http3 git branch to the first hex
release of erlang_quic (1.0.0). No source changes required; H3 eunit
suite passes unchanged.
Wires the three calls through to the underlying quic connection via
quic_h3:get_quic_conn/1 (available since quic 1.0.0). setopts still
returns {error, not_supported} since QUIC has no {active, once}-style
socket model.
@benoitc benoitc merged commit b98ebcd into master Apr 15, 2026
5 checks passed
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