[Pkg-telepathy-commits] [libnice] 189/265: agent: Make it possible to set the relays after gathering

Simon McVittie smcv at debian.org
Wed May 14 12:05:06 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository libnice.

commit 2979fcc8afb9a145b03e17453eb0ece76efc6cab
Author: Olivier Crête <olivier.crete at collabora.com>
Date:   Thu Mar 27 21:10:33 2014 -0400

    agent: Make it possible to set the relays after gathering
    
    This allows finding the relays asynchronously while trying to connect
    with other methods.
---
 agent/agent.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/agent/agent.c b/agent/agent.c
index 7673e0f..b9253a1 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -1921,6 +1921,7 @@ nice_agent_set_relay_info(NiceAgent *agent,
 {
 
   Component *component = NULL;
+  Stream *stream = NULL;
   gboolean ret = TRUE;
   TurnServer *turn;
 
@@ -1932,7 +1933,7 @@ nice_agent_set_relay_info(NiceAgent *agent,
 
   agent_lock();
 
-  if (!agent_find_component (agent, stream_id, component_id, NULL,
+  if (!agent_find_component (agent, stream_id, component_id, &stream,
           &component)) {
     ret = FALSE;
     goto done;
@@ -1959,6 +1960,23 @@ nice_agent_set_relay_info(NiceAgent *agent,
 
   component->turn_servers = g_list_append (component->turn_servers, turn);
 
+ if (stream->gathering_started) {
+    GSList *i;
+
+    for (i = component->local_candidates; i; i = i->next) {
+      NiceCandidate *candidate = i->data;
+
+      if  (candidate->type == NICE_CANDIDATE_TYPE_HOST)
+        priv_add_new_candidate_discovery_turn (agent,
+            candidate->sockptr, turn, stream,
+            component_id);
+    }
+
+    if (agent->discovery_unsched_items)
+      discovery_schedule (agent);
+  }
+
+
  done:
 
   agent_unlock_and_emit (agent);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/libnice.git



More information about the Pkg-telepathy-commits mailing list