Skip to content

Conversation

czechboy0
Copy link
Contributor

Motivation

Start landing the parts of the multipart machinery that is unlikely to change as part of the multipart proposal that's finishing review tomorrow.

Modifications

Introduce a bytes -> frames parser and an async sequence that wraps it.

A "frame" is either the full header fields section or a single chunk of a part body.

Result

We can now frame bytes of a multipart body.

Test Plan

Added unit tests for the state machine, the parser, and the async sequence.

Copy link
Collaborator

@simonjbeaumont simonjbeaumont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really great to me. Only one blocking comment (a typo in the character codes).

@czechboy0 czechboy0 merged commit cefdc80 into apple:main Nov 15, 2023
@czechboy0 czechboy0 deleted the hd-multipart-parser branch November 15, 2023 08:48
czechboy0 added a commit that referenced this pull request Nov 16, 2023
### Motivation

Second state machine, doing the inverse of #72, serializes frames into
bytes.

### Modifications

- A new state machine.
- A new serializer wrapping the state machine.
- An async sequence wrapping the serializer.

### Result

We can now serialize multipart frames into bytes.

### Test Plan

Unit tests for all 3 layers.
@czechboy0 czechboy0 added the 🔨 semver/patch No public API change. label Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants