Skip to content

Decode SLIP packets across TCP stream boundaries - #203

Open
civilwarinfrance wants to merge 1 commit into
attwad:mainfrom
civilwarinfrance:fix/slip-stream-boundaries
Open

civilwarinfrance wants to merge 1 commit into
attwad:mainfrom
civilwarinfrance:fix/slip-stream-boundaries

Conversation

@civilwarinfrance

Copy link
Copy Markdown
Contributor

The SLIP stream decoder currently looks for two adjacent END bytes between packets. A valid stream with just one END between packets fails to decode, and splitting an encoded message across TCP reads can produce empty packets.

Scan individual END markers, skip empty frames, and keep incomplete packet bytes for the next read. Tests cover single-END streams, repeated delimiters, every two-part split and byte-by-byte delivery, including escaped END and ESC bytes.

All 201 tests pass locally, along with Ruff, mypy and the package build.

AI assistance: OpenAI Codex wrote and tested this patch.

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