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

Dedupe remote ICE candidates #576

Merged
merged 2 commits into from
Oct 23, 2024
Merged

Dedupe remote ICE candidates #576

merged 2 commits into from
Oct 23, 2024

Conversation

k0nserv
Copy link
Collaborator

@k0nserv k0nserv commented Oct 23, 2024

The changes in 5c4c9d5 caused problems because we'd end up creating new identical pairs. For example, if an existing pair, 0-0, exists as local: 192.168.1.33:5445, remote: 192.168.1.33:63461. Then, after processing a new offer another remote candidate would be added for 192.168.1.33:63461, call this pair 0-1. When determining which pair an incoming binding request belonged too we'd then identify 0-1 instead of 0-0(because max_by_key) returns the last value on ties. In Chrome this would work correctly, but in Firefox connectivity would be lost.

Ultimately adding a new remote candidate that is exactly the same as one that's already part of a viable pair is redundant, so we resolve this issue by simply skipping such candidates.

The changes in `5c4c9d5` caused problems because we'd end up creating
new identical pairs. For example, if an existing pair, `0-0`, exists as
local: 192.168.1.33:5445, remote: 192.168.1.33:63461. Then, after
processing a new offer another remote candidate would be added for
192.168.1.33:63461, call this pair `0-1`. When determining which pair an
incoming binding request belonged too we'd then identify `0-1` instead
of `0-0`(because `max_by_key`) returns the last value on ties. In Chrome
this would work correctly, but in Firefox connectivity would be lost.

Ultimately adding a new remote candidate that is exactly the same as one
that's already part of a viable pair is redundant, so we resolve this
issue by simply skipping such candidates.
src/ice/agent.rs Outdated Show resolved Hide resolved
@algesten algesten merged commit 41ce6cf into main Oct 23, 2024
22 checks passed
@algesten algesten deleted the dedupe-remote-ice-candidates branch October 23, 2024 17:45
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.

3 participants