Commit acda4a08 authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête

agent: fix a regression when updating foundations

A previous commit c1fb6f28 introduced a regression in the way the
foundation of a selected pair is updated and signaled, when the
foundation of its remote candidate changes. The previous comparison was
made on *always* identical strings, so the update of the selected pair
was *never* signaled.
parent 1607f920
...@@ -3487,21 +3487,24 @@ static void priv_update_pair_foundations (NiceAgent *agent, ...@@ -3487,21 +3487,24 @@ static void priv_update_pair_foundations (NiceAgent *agent,
GSList *i; GSList *i;
for (i = stream->conncheck_list; i; i = i->next) { for (i = stream->conncheck_list; i; i = i->next) {
CandidateCheckPair *pair = i->data; CandidateCheckPair *pair = i->data;
if (pair->remote == remote && if (pair->remote == remote) {
(strncmp (pair->remote->foundation, remote->foundation, gchar foundation[NICE_CANDIDATE_PAIR_MAX_FOUNDATION];
NICE_CANDIDATE_MAX_FOUNDATION))) { g_snprintf (foundation, NICE_CANDIDATE_PAIR_MAX_FOUNDATION, "%s:%s",
g_snprintf (pair->foundation,
NICE_CANDIDATE_PAIR_MAX_FOUNDATION, "%s:%s",
pair->local->foundation, pair->remote->foundation); pair->local->foundation, pair->remote->foundation);
nice_debug ("Agent %p : Updating pair %p foundation to '%s'", if (strncmp (pair->foundation, foundation,
agent, pair, pair->foundation); NICE_CANDIDATE_PAIR_MAX_FOUNDATION)) {
if (component->selected_pair.local == pair->local && g_strlcpy (pair->foundation, foundation,
component->selected_pair.remote == pair->remote) { NICE_CANDIDATE_PAIR_MAX_FOUNDATION);
nice_debug ("Agent %p : updating SELECTED PAIR for component " nice_debug ("Agent %p : Updating pair %p foundation to '%s'",
"%u: %s:%s (prio:%" G_GUINT64_FORMAT ").", agent, component->id, agent, pair, pair->foundation);
pair->local->foundation, pair->remote->foundation, pair->priority); if (component->selected_pair.local == pair->local &&
agent_signal_new_selected_pair (agent, pair->stream_id, component->id, component->selected_pair.remote == pair->remote) {
pair->local, pair->remote); nice_debug ("Agent %p : updating SELECTED PAIR for component "
"%u: %s (prio:%" G_GUINT64_FORMAT ").", agent,
component->id, foundation, pair->priority);
agent_signal_new_selected_pair (agent, pair->stream_id,
component->id, pair->local, pair->remote);
}
} }
} }
} }
......
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