Commit 3647a7ae authored by Olivier Crête's avatar Olivier Crête
Browse files

conncheck: Remove useless checks from priv_add_new_check_pair

parent f4ae3ffc
......@@ -1254,11 +1254,9 @@ static gboolean priv_add_new_check_pair (NiceAgent *agent, guint stream_id, Comp
gboolean result = FALSE;
Stream *stream = agent_find_stream (agent, stream_id);
CandidateCheckPair *pair = g_slice_new0 (CandidateCheckPair);
if (pair) {
GSList *modified_list =
g_slist_insert_sorted (stream->conncheck_list, pair, (GCompareFunc)conn_check_compare);
if (modified_list) {
/* step: allocation and addition succesful, do rest of the work */
stream->conncheck_list = g_slist_insert_sorted (stream->conncheck_list, pair,
(GCompareFunc)conn_check_compare);
pair->agent = agent;
pair->stream_id = stream_id;
......@@ -1276,9 +1274,7 @@ static gboolean priv_add_new_check_pair (NiceAgent *agent, guint stream_id, Comp
/* note: for the first added check */
if (!stream->conncheck_list)
stream->conncheck_state = NICE_CHECKLIST_RUNNING;
stream->conncheck_list = modified_list;
result = TRUE;
nice_debug ("Agent %p : added a new conncheck %p with foundation of '%s' to list %u.", agent, pair, pair->foundation, stream_id);
/* implement the hard upper limit for number of
......@@ -1287,22 +1283,8 @@ static gboolean priv_add_new_check_pair (NiceAgent *agent, guint stream_id, Comp
stream->conncheck_list =
priv_limit_conn_check_list_size (stream->conncheck_list, agent->max_conn_checks);
}
if (!stream->conncheck_list) {
stream->conncheck_state = NICE_CHECKLIST_FAILED;
result = FALSE;
}
}
else {
/* memory alloc failed: list insert */
conn_check_free_item (pair, NULL);
stream->conncheck_state = NICE_CHECKLIST_FAILED;
}
}
else { /* memory alloc failed: new pair */
stream->conncheck_state = NICE_CHECKLIST_FAILED;
}
return result;
return 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