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

Add support for remote mdns candidates #13

Merged
merged 4 commits into from
May 21, 2021
Merged

Add support for remote mdns candidates #13

merged 4 commits into from
May 21, 2021

Conversation

mickel8
Copy link
Member

@mickel8 mickel8 commented May 10, 2021

@mickel8 mickel8 self-assigned this May 10, 2021
@mickel8 mickel8 added the enhancement New feature or request label May 10, 2021
@mickel8 mickel8 force-pushed the mdns-candidates branch 6 times, most recently from 539b2fd to e328194 Compare May 11, 2021 11:27
@mickel8
Copy link
Member Author

mickel8 commented May 13, 2021

depends on rosetta-home/mdns#19

@mickel8 mickel8 force-pushed the mdns-candidates branch 4 times, most recently from 33d6e03 to 778224c Compare May 14, 2021 15:45
@mickel8 mickel8 marked this pull request as ready for review May 14, 2021 15:46
@mickel8 mickel8 requested review from mat-hek and Qizot May 14, 2021 15:46
Comment on lines 420 to 423
state = %{
state
| mdns_queries: Map.put(state.mdns_queries, address, {candidate, stream_id, component_id})
}
Copy link
Member

Choose a reason for hiding this comment

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

use put_in

Comment on lines 544 to 546

state =
case Map.pop(state.mdns_queries, dev.domain) do
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
state =
case Map.pop(state.mdns_queries, dev.domain) do
{query, state} = pop_in(state, [:mdns_queries, dev.domain])
case query do

lib/ex_libnice.ex Outdated Show resolved Hide resolved
| mdns_queries: Map.put(state.mdns_queries, address, {candidate, stream_id, component_id})
}

state = Struct.put_in(state, [:mdns_queries, address], {candidate, stream_id, component_id})
Copy link
Member

Choose a reason for hiding this comment

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

better use Bunch.Access in the state

Comment on lines 418 to 420
withl address_error: address when address != nil <- Enum.at(candidate_sp, 4),
parse_error: 6 <- length(candidate_sp),
not_mdns: true <- String.ends_with?(address, ".local") do
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
withl address_error: address when address != nil <- Enum.at(candidate_sp, 4),
parse_error: 6 <- length(candidate_sp),
not_mdns: true <- String.ends_with?(address, ".local") do
withl candidate_check: 6 <- length(candidate_sp),
do: address = Enum.at(candidate_sp, 4),
mdns_check: true <- String.ends_with?(address, ".local") do

Comment on lines 426 to 428
address_error: _ -> {:reply, {:error, :failed_to_parse_sdp_string}, state}
parse_error: _ -> {:reply, {:error, :failed_to_parse_sdp_string}, state}
not_mdns: _ -> do_set_remote_candidate(candidate, stream_id, component_id, state)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
address_error: _ -> {:reply, {:error, :failed_to_parse_sdp_string}, state}
parse_error: _ -> {:reply, {:error, :failed_to_parse_sdp_string}, state}
not_mdns: _ -> do_set_remote_candidate(candidate, stream_id, component_id, state)
candidate_check: _ -> {:reply, {:error, :failed_to_parse_sdp_string}, state}
mdns_check: false -> do_set_remote_candidate(candidate, stream_id, component_id, state)

@mickel8 mickel8 requested a review from mat-hek May 20, 2021 10:47
@mickel8 mickel8 merged commit 97641db into master May 21, 2021
@mickel8 mickel8 deleted the mdns-candidates branch May 21, 2021 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants