Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse Candidate Extensions (RFC5245) #754

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joeturki
Copy link
Member

@joeturki joeturki commented Jan 14, 2025

Description

  • Rewrote UnmarshalCandidate to better align with RFC5245.
  • Added new methods for extracting candidate extensions.
  • Updated Equal and Marshal to accommodate these changes.
  • Added tests for everything.
  • Fixed a "bug" where tcptype would appear before raddr .
  • Made a minor change to gather.go; because we can't use the config struct as a map key anymore.
  • Added CandidateExtension.

I'm aware this is a breaking change but this change is required for many issues like pion/webrtc#2993

Edit: I'll make it non breaking change tomorrow.

Reference issue

#753

@joeturki joeturki requested review from edaniels and Sean-Der January 14, 2025 18:10
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.98%. Comparing base (abdc0ca) to head (dddadd5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #754      +/-   ##
==========================================
+ Coverage   78.63%   79.98%   +1.35%     
==========================================
  Files          41       41              
  Lines        4769     5017     +248     
==========================================
+ Hits         3750     4013     +263     
+ Misses        785      775      -10     
+ Partials      234      229       -5     
Flag Coverage Δ
go 79.98% <100.00%> (+1.35%) ⬆️
wasm 27.78% <100.00%> (+4.68%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@joeturki joeturki marked this pull request as draft January 14, 2025 18:18
Copy link

@nils-ohlmeier nils-ohlmeier left a comment

Choose a reason for hiding this comment

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

Just a few minor suggestions. But looks good otherwise.

candidate_base.go Outdated Show resolved Hide resolved
candidate_base.go Outdated Show resolved Hide resolved
candidate_base.go Outdated Show resolved Hide resolved
candidate_base.go Outdated Show resolved Hide resolved
candidate_base.go Outdated Show resolved Hide resolved
candidate_base.go Show resolved Hide resolved
candidate_base.go Outdated Show resolved Hide resolved
candidate_base.go Outdated Show resolved Hide resolved
candidate.go Outdated Show resolved Hide resolved
candidate_base.go Outdated Show resolved Hide resolved
@Sean-Der
Copy link
Member

Nice, love these improvements :)

Glad we can do this without API break. It means people don’t update and new versions don’t get improved :(

@joeturki joeturki force-pushed the add/candidate-extensions branch 2 times, most recently from a2e7c06 to 6528f3e Compare January 15, 2025 03:21
@joeturki joeturki marked this pull request as ready for review January 15, 2025 03:30
@joeturki
Copy link
Member Author

I added CandidateExtensions and CandidateExtension, And fixed all the other issues.

@Sean-Der @nils-ohlmeier let me know if there are other problems :)

Thanks.

@joeturki joeturki linked an issue Jan 15, 2025 that may be closed by this pull request
candidate_base.go Outdated Show resolved Hide resolved
Copy link

@nils-ohlmeier nils-ohlmeier left a comment

Choose a reason for hiding this comment

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

Looks good to me.

candidateextensions.go Outdated Show resolved Hide resolved
Copy link
Member

@Sean-Der Sean-Der left a comment

Choose a reason for hiding this comment

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

Fantastic! This is great.

Sorry about the stress of APIs. It’s just so hard to fix them. We can always fix/improve code though.

Its nice to expose as little as possible until someone requests it :)

- Rewrote `UnmarshalCandidate` to better align with RFC5245.
- Added new methods for extracting candidate extensions.
- Updated `Equal` and `Marshal` to accommodate these changes.
- New Type `CandidateExtension` to handle.

Signed-off-by: Joe Turki <[email protected]>
@joeturki joeturki force-pushed the add/candidate-extensions branch from 2b64677 to dddadd5 Compare January 15, 2025 06:19
@joeturki
Copy link
Member Author

@Sean-Der When you have a time can you take a look.

Sorry about the stress of APIs. It’s just so hard to fix them. We can always fix/improve code though.

It's not stressing at all for me :)

Its nice to expose as little as possible until someone requests it :)

This makes sense, Noted :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add Support for Parsing Extensions in Candidates
3 participants