Skip to content

Design document for the new parser #287

Open

Description

@ashtum

The http parser in the burl project are improved versions of those in this project. We need a design document that explains the rationale behind each change.

The document should include (not limited to) changes like:

  • The per-message buffer compaction is gone. head_parser continues building the next header at a lower address inside the circular buffer, so pipelined messages no longer pay a memmove between messages.
  • The parser is now sans-I/O and public: a state machine that never suspends and never touches a stream, usable from any I/O model. Bodies can be retrieved without copying: pull hands out descriptors into the parser's own buffer, and commit_direct lets the stream read straight into caller-supplied memory, bypassing the parser's buffer entirely.
  • message_reader binds a stream to a parser and drives it, satisfying capy::ReadStream, http::ReadSource, and http::BufferSource over the message body. The client is rebuilt on top of it, so users driving the parser themselves get the exact same implementation the library uses.
  • The trailer fields of a chunked payload are now accessible: parse_trailer appends them, in the order received, to any fields container.
  • Body limit management is reduced to a single remaining-octets counter. Every body operation parses the header implicitly when it has not been parsed yet, and flatten_body de-chunks the body in place incrementally instead of requiring it complete up front.
  • The compression documentation is updated for the built-in decoders.

Activity

  1. self-assigned this
    on Aug 22, 2026
  2. linked a pull request that will close this issueParser redesign doc #286on Aug 22, 2026
  3. moved this from Backlog to In review in Beast2on Aug 22, 2026
  4. moved this from In review to In progress in Beast2on Aug 22, 2026
  5. moved this from In progress to Backlog in Beast2on Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

  • Status
    Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions