summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2011-01-21 00:13:35 (GMT)
committerYouness Alaoui <youness.alaoui@collabora.co.uk>2011-01-21 00:13:35 (GMT)
commitbed24e7211a8e420f5640eb96bcc75b35b49a51c (patch)
tree36420a4b52404ea7cc24f8995930171e0b30318f
parentbd11e72d406453e18cf28e5869a4b4c0de6f224d (diff)
downloadlibnice-bed24e7211a8e420f5640eb96bcc75b35b49a51c.tar.gz
libnice-bed24e7211a8e420f5640eb96bcc75b35b49a51c.tar.xz
Send new-candidate signals for host cands only if the gathering was successful
-rw-r--r--agent/agent.c10
-rw-r--r--agent/discovery.c1
2 files changed, 10 insertions, 1 deletions
diff --git a/agent/agent.c b/agent/agent.c
index b0b5cf3..8eedc0c 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -1856,6 +1856,16 @@ nice_agent_gather_candidates (
stream->gathering = TRUE;
+ /* Only signal the new candidates after we're sure that the gathering was
+ * succesfful. But before sending gathering-done */
+ for (n = 0; n < stream->n_components; n++) {
+ Component *component = stream_find_component_by_id (stream, n + 1);
+ for (i = component->local_candidates; i; i = i->next) {
+ NiceCandidate *candidate = i->data;
+ agent_signal_new_candidate (agent, candidate);
+ }
+ }
+
/* note: no async discoveries pending, signal that we are ready */
if (agent->discovery_unsched_items == 0) {
nice_debug ("Agent %p: Candidate gathering FINISHED, no scheduled items.",
diff --git a/agent/discovery.c b/agent/discovery.c
index 38789cf..00afd5c 100644
--- a/agent/discovery.c
+++ b/agent/discovery.c
@@ -491,7 +491,6 @@ NiceCandidate *discovery_add_local_host_candidate (
goto errors;
component->sockets = g_slist_append (component->sockets, udp_socket);
- agent_signal_new_candidate (agent, candidate);
return candidate;