[telepathy-gabble/master] Use ice candidates' foundation as candidate_id
Will Thompson
will.thompson at collabora.co.uk
Sun Jun 28 08:23:53 PDT 2009
---
src/jingle-transport-iceudp.c | 9 +++++----
src/media-stream.c | 7 +++++--
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/jingle-transport-iceudp.c b/src/jingle-transport-iceudp.c
index b72154b..57598af 100644
--- a/src/jingle-transport-iceudp.c
+++ b/src/jingle-transport-iceudp.c
@@ -242,7 +242,7 @@ parse_candidates (GabbleJingleTransportIface *obj,
for (node = transport_node->children; node; node = node->next)
{
- const gchar *name, *address, *user, *pass, *str;
+ const gchar *id, *address, *user, *pass, *str;
guint port, net, gen, component = 1;
gdouble pref;
JingleTransportProtocol proto;
@@ -254,8 +254,9 @@ parse_candidates (GabbleJingleTransportIface *obj,
node_contains_a_candidate = TRUE;
- /* ICEUDP doesn't use rtp/rtcp naming */
- name = "";
+ id = lm_message_node_get_attribute (node, "foundation");
+ if (id == NULL)
+ continue;
address = lm_message_node_get_attribute (node, "ip");
if (address == NULL)
@@ -335,7 +336,7 @@ parse_candidates (GabbleJingleTransportIface *obj,
continue;
component = atoi (str);
- c = jingle_candidate_new (proto, ctype, NULL, component,
+ c = jingle_candidate_new (proto, ctype, id, component,
address, port, gen, pref, user, pass, net);
candidates = g_list_append (candidates, c);
diff --git a/src/media-stream.c b/src/media-stream.c
index 778b2f4..70833b1 100644
--- a/src/media-stream.c
+++ b/src/media-stream.c
@@ -1360,8 +1360,11 @@ new_remote_candidates_cb (GabbleJingleContent *content,
g_value_take_boxed (&candidate,
dbus_g_type_specialized_construct (candidate_struct_type));
- /* FIXME: is this naming scheme sensible? */
- candidate_id = g_strdup_printf ("R%d", ++priv->remote_candidate_count);
+ if (c->id == NULL)
+ /* FIXME: is this naming scheme sensible? */
+ candidate_id = g_strdup_printf ("R%d", ++priv->remote_candidate_count);
+ else
+ candidate_id = c->id;
dbus_g_type_struct_set (&candidate,
0, candidate_id,
--
1.5.6.5
More information about the telepathy-commits
mailing list