Commit 02a352c9 authored by Youness Alaoui's avatar Youness Alaoui

Make sure the address of the remote candidate is valid when we add it

parent 2796330b
......@@ -2023,7 +2023,7 @@ static gboolean priv_add_remote_candidate (
GSList *modified_list = g_slist_append (component->remote_candidates, candidate);
if (modified_list) {
component->remote_candidates = modified_list;
candidate->stream_id = stream_id;
candidate->component_id = component_id;
......@@ -2165,22 +2165,25 @@ nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint compo
for (i = candidates; i && added >= 0; i = i->next) {
NiceCandidate *d = (NiceCandidate*) i->data;
gboolean res =
priv_add_remote_candidate (agent,
stream_id,
component_id,
d->type,
&d->addr,
&d->base_addr,
d->transport,
d->priority,
d->username,
d->password,
d->foundation);
if (res)
++added;
else
added = -1;
if (nice_address_is_valid (&d->addr) == TRUE) {
gboolean res =
priv_add_remote_candidate (agent,
stream_id,
component_id,
d->type,
&d->addr,
&d->base_addr,
d->transport,
d->priority,
d->username,
d->password,
d->foundation);
if (res)
++added;
else
added = -1;
}
}
conn_check_remote_candidates_set(agent);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment