Skip to content

WIP: configurable body parser - #37

Draft
jech wants to merge 2 commits into
jart:masterfrom
jech:configurable-body-parser
Draft

WIP: configurable body parser#37
jech wants to merge 2 commits into
jart:masterfrom
jech:configurable-body-parser

Conversation

@jech

@jech jech commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator
  • Rename Payload.Data to Marshal.
  • Make body parsing customisable.

The SDP parser in gosip is very limited, and is only suitable for a single audio flow. Since we don't want to spend the rest of our lives working on SDP, this makes the body parser configurable, so that we can use the Pion implementation of SDP instead of gosip's.

This breaks compatibility, since it adds an error return to the Data method of Payload. While I was breaking compatibility, I renamed the Data method to Marshal, for consistency with Pion. @jart please let me know if you object, it is possible to retain compatibility at the cost of deficient error handling.

Most of gosip should work with Pion's implementation of SDP, but I haven't tested yet. There are unfortunately two places that hard-wire a dependency on gosip's SDP: rtp/session.go and dialog/dialog.go. The former is not an issue. The latter is, and I don't see a good idea for fixing it.

jech added 2 commits June 24, 2026 13:38
Also add error handling, in preparation for customisable payloads.
@jech
jech marked this pull request as ready for review June 24, 2026 15:35
@jech jech changed the title Configurable body parser WIP: configurable body parser Jun 24, 2026
@jech
jech marked this pull request as draft June 24, 2026 15:36
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