Skip to content

Conversation

ioquatix
Copy link
Member

@ioquatix ioquatix commented Jun 10, 2024

Use atomic operations for reading frames.

If reading the payload of a frame times out (after reading the header), it puts the stream in an odd state.

Fixes #14.

Types of Changes

  • Bug fix.

Contribution

@ioquatix
Copy link
Member Author

ioquatix commented Jun 10, 2024

@maruth-stripe @fables-tales I'm considering this PR again.

Not only do we have instances of read_header + read_payload, we also have instances where we have continuation frames on the wire, which have no meaning once the original frames are read. The latter case concerns me, as we can't easily protect against that. We can still do our best to only read full frames, but that won't correspond to a full semantic interpretation of headers + continuation frames - and it isn't possible to read continuation frames in isolation.

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.

Framer's sequential reads of frame header then payload can leave underlying async stream's @read_buffer in a corrupted state
2 participants