From c47663223e6bd36ccfda6534f0709fe3a1e30c3f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Thu, 20 May 2010 22:30:21 -0400 Subject: [PATCH] conncheck: Remove useless checks from priv_add_peer_reflexive_pair --- agent/conncheck.c | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/agent/conncheck.c b/agent/conncheck.c index 432ddc0..d83b2a2 100644 --- a/agent/conncheck.c +++ b/agent/conncheck.c @@ -1905,31 +1905,29 @@ static int priv_store_pending_check (NiceAgent *agent, Component *component, static CandidateCheckPair *priv_add_peer_reflexive_pair (NiceAgent *agent, guint stream_id, guint component_id, NiceCandidate *local_cand, CandidateCheckPair *parent_pair) { CandidateCheckPair *pair = g_slice_new0 (CandidateCheckPair); - if (pair) { - Stream *stream = agent_find_stream (agent, stream_id); - GSList *modified_list = g_slist_append (stream->conncheck_list, pair); - if (modified_list) { - stream->conncheck_list = modified_list; - pair->agent = agent; - pair->stream_id = stream_id; - pair->component_id = component_id;; - pair->local = local_cand; - pair->remote = parent_pair->remote; - pair->state = NICE_CHECK_DISCOVERED; - nice_debug ("Agent %p : pair %p state DISCOVERED", agent, pair); - g_snprintf (pair->foundation, NICE_CANDIDATE_PAIR_MAX_FOUNDATION, "%s:%s", local_cand->foundation, parent_pair->remote->foundation); - if (agent->controlling_mode == TRUE) - pair->priority = nice_candidate_pair_priority (local_cand->priority, parent_pair->priority); - else - pair->priority = nice_candidate_pair_priority (parent_pair->priority, local_cand->priority); - pair->nominated = FALSE; - pair->controlling = agent->controlling_mode; - nice_debug ("Agent %p : added a new peer-discovered pair with foundation of '%s'.", agent, pair->foundation); - return pair; - } - } + Stream *stream = agent_find_stream (agent, stream_id); - return NULL; + stream->conncheck_list = g_slist_append (stream->conncheck_list, pair); + pair->agent = agent; + pair->stream_id = stream_id; + pair->component_id = component_id;; + pair->local = local_cand; + pair->remote = parent_pair->remote; + pair->state = NICE_CHECK_DISCOVERED; + nice_debug ("Agent %p : pair %p state DISCOVERED", agent, pair); + g_snprintf (pair->foundation, NICE_CANDIDATE_PAIR_MAX_FOUNDATION, "%s:%s", + local_cand->foundation, parent_pair->remote->foundation); + if (agent->controlling_mode == TRUE) + pair->priority = nice_candidate_pair_priority (local_cand->priority, + parent_pair->priority); + else + pair->priority = nice_candidate_pair_priority (parent_pair->priority, + local_cand->priority); + pair->nominated = FALSE; + pair->controlling = agent->controlling_mode; + nice_debug ("Agent %p : added a new peer-discovered pair with foundation of '%s'.", agent, pair->foundation); + + return pair; } /* -- 2.11.4.GIT