Commit 714f1ee6 authored by Olivier Crête's avatar Olivier Crête

discovery: Remove useless checks from discovery_add_reflexive_candidate

parent 231943d2
...@@ -542,34 +542,33 @@ discovery_add_server_reflexive_candidate ( ...@@ -542,34 +542,33 @@ discovery_add_server_reflexive_candidate (
return NULL; return NULL;
candidate = nice_candidate_new (NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE); candidate = nice_candidate_new (NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE);
if (candidate) {
if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) { if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) {
candidate->priority = nice_candidate_jingle_priority (candidate); candidate->priority = nice_candidate_jingle_priority (candidate);
} else if (agent->compatibility == NICE_COMPATIBILITY_MSN) { } else if (agent->compatibility == NICE_COMPATIBILITY_MSN) {
candidate->priority = nice_candidate_msn_priority (candidate); candidate->priority = nice_candidate_msn_priority (candidate);
} else { } else {
candidate->priority = nice_candidate_ice_priority_full candidate->priority = nice_candidate_ice_priority_full
(NICE_CANDIDATE_TYPE_PREF_SERVER_REFLEXIVE, 0, component_id); (NICE_CANDIDATE_TYPE_PREF_SERVER_REFLEXIVE, 0, component_id);
} }
candidate->stream_id = stream_id; candidate->stream_id = stream_id;
candidate->component_id = component_id; candidate->component_id = component_id;
candidate->addr = *address; candidate->addr = *address;
/* step: link to the base candidate+socket */ /* step: link to the base candidate+socket */
candidate->sockptr = base_socket; candidate->sockptr = base_socket;
candidate->base_addr = base_socket->addr; candidate->base_addr = base_socket->addr;
priv_generate_candidate_credentials (agent, candidate); priv_generate_candidate_credentials (agent, candidate);
priv_assign_foundation (agent, candidate); priv_assign_foundation (agent, candidate);
result = priv_add_local_candidate_pruned (component, candidate); result = priv_add_local_candidate_pruned (component, candidate);
if (result) { if (result) {
agent_signal_new_candidate (agent, candidate); agent_signal_new_candidate (agent, candidate);
} }
else { else {
/* error: memory allocation, or duplicate candidatet */ /* error: duplicate candidate */
nice_candidate_free (candidate), candidate = NULL; nice_candidate_free (candidate), candidate = NULL;
}
} }
return candidate; return candidate;
......
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