Commit 6bbeba27 authored by Fabrice Bellet's avatar Fabrice Bellet

conncheck: handle the consequence when a pair is not created

Since commit fcd6bc86 a pair is not always created, when its priority
is lower than the selected pair priority. We have to deal with this
possibility when calling the function priv_add_new_check_pair().

More precisely, the component state update really requires the addition
of a new pair.
parent 72ccb1a2
...@@ -2423,6 +2423,7 @@ static CandidateCheckPair *priv_conn_check_add_for_candidate_pair_matched ( ...@@ -2423,6 +2423,7 @@ static CandidateCheckPair *priv_conn_check_add_for_candidate_pair_matched (
pair = priv_add_new_check_pair (agent, stream_id, component, local, remote, pair = priv_add_new_check_pair (agent, stream_id, component, local, remote,
initial_state); initial_state);
if (pair) {
if (component->state == NICE_COMPONENT_STATE_CONNECTED || if (component->state == NICE_COMPONENT_STATE_CONNECTED ||
component->state == NICE_COMPONENT_STATE_READY) { component->state == NICE_COMPONENT_STATE_READY) {
agent_signal_component_state_change (agent, agent_signal_component_state_change (agent,
...@@ -2435,6 +2436,7 @@ static CandidateCheckPair *priv_conn_check_add_for_candidate_pair_matched ( ...@@ -2435,6 +2436,7 @@ static CandidateCheckPair *priv_conn_check_add_for_candidate_pair_matched (
component->id, component->id,
NICE_COMPONENT_STATE_CONNECTING); NICE_COMPONENT_STATE_CONNECTING);
} }
}
return pair; return pair;
} }
...@@ -2468,8 +2470,8 @@ gboolean conn_check_add_for_candidate_pair (NiceAgent *agent, ...@@ -2468,8 +2470,8 @@ gboolean conn_check_add_for_candidate_pair (NiceAgent *agent,
/* note: match pairs only if transport and address family are the same */ /* note: match pairs only if transport and address family are the same */
if (local->transport == conn_check_match_transport (remote->transport) && if (local->transport == conn_check_match_transport (remote->transport) &&
local->addr.s.addr.sa_family == remote->addr.s.addr.sa_family) { local->addr.s.addr.sa_family == remote->addr.s.addr.sa_family) {
priv_conn_check_add_for_candidate_pair_matched (agent, stream_id, component, if (priv_conn_check_add_for_candidate_pair_matched (agent, stream_id,
local, remote, NICE_CHECK_FROZEN); component, local, remote, NICE_CHECK_FROZEN))
ret = TRUE; ret = TRUE;
} }
......
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