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

Fix set_remote_description failing on description with rejected m-lines #145

Merged
merged 6 commits into from
Aug 6, 2024

Conversation

LVala
Copy link
Member

@LVala LVala commented Aug 5, 2024

Fixes:

  • set_remote_description won't try to use ICE credentials from rejected m-lines (and subsequently, won't fail if ICE credentials in rejected m-lines differ from credentials in active m-lines),
  • set_remote_description won't fail when all of the m-lines are rejected (so there's no valid ICE credentials in the description). In such case, it will either not connect (for the first description) or use credentials from previous descriptions (for the subsequent descriptions)

Other elements of rejected m-lines might need to be ignored as well (like MIDs, fingerprints, etc.), but it seems like browsers include them anyway, so for now this fix seems to be enough.

Close #144

@LVala LVala self-assigned this Aug 5, 2024
Copy link

codecov bot commented Aug 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.35%. Comparing base (af1fec4) to head (8de7614).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #145      +/-   ##
==========================================
+ Coverage   88.31%   88.35%   +0.03%     
==========================================
  Files          36       36              
  Lines        1891     1897       +6     
==========================================
+ Hits         1670     1676       +6     
  Misses        221      221              
Files Coverage Δ
lib/ex_webrtc/peer_connection.ex 85.16% <100.00%> (ø)
lib/ex_webrtc/sdp_utils.ex 92.76% <100.00%> (+0.98%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af1fec4...8de7614. Read the comment docs.

@LVala LVala marked this pull request as ready for review August 5, 2024 09:09
@LVala LVala requested review from mickel8 and sgfn August 5, 2024 09:21
Comment on lines 21 to 22
case length(sdp.media) do
0 -> {:error, :empty_sdp}
Copy link
Member

Choose a reason for hiding this comment

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

[nitpick] Enum.empty? would work in constant time


{ice_ufrag, ice_pwd} ->
:ok = state.ice_transport.set_remote_credentials(state.ice_pid, ice_ufrag, ice_pwd)
end

for candidate <- SDPUtils.get_ice_candidates(sdp) do
Copy link
Member

Choose a reason for hiding this comment

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

I think I would move this inside case, when we have ICE credentials, even though that ICE will ignore remote candidates when it does not have them.

@LVala LVala merged commit 15eee61 into master Aug 6, 2024
1 check passed
@LVala LVala deleted the fix/rejected-mline-ice-creds branch August 6, 2024 08:57
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.

Unable to apply answer with disabled mlines
3 participants