Commit 6e753679 authored by Youness Alaoui's avatar Youness Alaoui

refuse set remote candidates if we are still gathering

parent d4d81134
...@@ -1235,12 +1235,23 @@ nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint compo ...@@ -1235,12 +1235,23 @@ nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint compo
{ {
const GSList *i; const GSList *i;
int added = 0; int added = 0;
Stream *stream;
nice_debug ("Agent %p: set_remote_candidates %d %d", agent, stream_id, component_id);
g_static_rec_mutex_lock (&agent->mutex); g_static_rec_mutex_lock (&agent->mutex);
if (agent->discovery_unsched_items > 0) { stream = agent_find_stream (agent, stream_id);
g_static_rec_mutex_unlock (&agent->mutex); if (stream == NULL) {
return -1; added = -1;
goto done;
}
if (agent->discovery_unsched_items > 0 || stream->gathering) {
nice_debug ("Agent %p: Remote candidates refused for stream %d because "
"we are still gathering our own candidates", agent, stream_id);
added = -1;
goto done;
} }
for (i = candidates; i && added >= 0; i = i->next) { for (i = candidates; i && added >= 0; i = i->next) {
...@@ -1271,6 +1282,7 @@ nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint compo ...@@ -1271,6 +1282,7 @@ nice_agent_set_remote_candidates (NiceAgent *agent, guint stream_id, guint compo
nice_debug ("Agent %p : Warning: unable to schedule any conn checks!", agent); nice_debug ("Agent %p : Warning: unable to schedule any conn checks!", agent);
} }
done:
g_static_rec_mutex_unlock (&agent->mutex); g_static_rec_mutex_unlock (&agent->mutex);
return added; return added;
} }
......
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