diff options
Diffstat (limited to 'src/jingle-transport-iceudp.c')
-rw-r--r-- | src/jingle-transport-iceudp.c | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/src/jingle-transport-iceudp.c b/src/jingle-transport-iceudp.c index d676f3a83..13bf6468a 100644 --- a/src/jingle-transport-iceudp.c +++ b/src/jingle-transport-iceudp.c @@ -25,8 +25,6 @@ #include <string.h> #include <glib.h> -#include <loudmouth/loudmouth.h> - #define DEBUG_FLAG GABBLE_DEBUG_MEDIA #include "connection.h" @@ -237,19 +235,20 @@ gabble_jingle_transport_iceudp_class_init (GabbleJingleTransportIceUdpClass *cls static void parse_candidates (GabbleJingleTransportIface *obj, - LmMessageNode *transport_node, GError **error) + WockyNode *transport_node, GError **error) { GabbleJingleTransportIceUdp *t = GABBLE_JINGLE_TRANSPORT_ICEUDP (obj); GabbleJingleTransportIceUdpPrivate *priv = t->priv; gboolean node_contains_a_candidate = FALSE; GList *candidates = NULL; - NodeIter i; + WockyNodeIter i; + WockyNode *node; DEBUG ("called"); - for (i = node_iter (transport_node); i; i = node_iter_next (i)) + wocky_node_iter_init (&i, transport_node, "candidate", NULL); + while (wocky_node_iter_next (&i, &node)) { - LmMessageNode *node = node_iter_data (i); const gchar *id, *address, *user, *pass, *str; guint port, net, gen, component = 1; gdouble pref; @@ -257,26 +256,23 @@ parse_candidates (GabbleJingleTransportIface *obj, JingleCandidateType ctype; JingleCandidate *c; - if (tp_strdiff (lm_message_node_get_name (node), "candidate")) - continue; - node_contains_a_candidate = TRUE; - id = lm_message_node_get_attribute (node, "foundation"); + id = wocky_node_get_attribute (node, "foundation"); if (id == NULL) { DEBUG ("candidate doesn't contain foundation"); continue; } - address = lm_message_node_get_attribute (node, "ip"); + address = wocky_node_get_attribute (node, "ip"); if (address == NULL) { DEBUG ("candidate doesn't contain ip"); continue; } - str = lm_message_node_get_attribute (node, "port"); + str = wocky_node_get_attribute (node, "port"); if (str == NULL) { DEBUG ("candidate doesn't contain port"); @@ -284,7 +280,7 @@ parse_candidates (GabbleJingleTransportIface *obj, } port = atoi (str); - str = lm_message_node_get_attribute (node, "protocol"); + str = wocky_node_get_attribute (node, "protocol"); if (str == NULL) { DEBUG ("candidate doesn't contain protocol"); @@ -302,7 +298,7 @@ parse_candidates (GabbleJingleTransportIface *obj, continue; } - str = lm_message_node_get_attribute (node, "priority"); + str = wocky_node_get_attribute (node, "priority"); if (str == NULL) { DEBUG ("candidate doesn't contain priority"); @@ -310,7 +306,7 @@ parse_candidates (GabbleJingleTransportIface *obj, } pref = g_ascii_strtod (str, NULL); - str = lm_message_node_get_attribute (node, "type"); + str = wocky_node_get_attribute (node, "type"); if (str == NULL) { DEBUG ("candidate doesn't contain type"); @@ -339,21 +335,21 @@ parse_candidates (GabbleJingleTransportIface *obj, continue; } - user = lm_message_node_get_attribute (transport_node, "ufrag"); + user = wocky_node_get_attribute (transport_node, "ufrag"); if (user == NULL) { DEBUG ("transport doesn't contain ufrag"); continue; } - pass = lm_message_node_get_attribute (transport_node, "pwd"); + pass = wocky_node_get_attribute (transport_node, "pwd"); if (pass == NULL) { DEBUG ("transport doesn't contain pwd"); continue; } - str = lm_message_node_get_attribute (node, "network"); + str = wocky_node_get_attribute (node, "network"); if (str == NULL) { DEBUG ("candidate doesn't contain network"); @@ -361,7 +357,7 @@ parse_candidates (GabbleJingleTransportIface *obj, } net = atoi (str); - str = lm_message_node_get_attribute (node, "generation"); + str = wocky_node_get_attribute (node, "generation"); if (str == NULL) { DEBUG ("candidate doesn't contain generation"); @@ -369,7 +365,7 @@ parse_candidates (GabbleJingleTransportIface *obj, } gen = atoi (str); - str = lm_message_node_get_attribute (node, "component"); + str = wocky_node_get_attribute (node, "component"); if (str == NULL) { DEBUG ("candidate doesn't contain component"); @@ -401,7 +397,7 @@ parse_candidates (GabbleJingleTransportIface *obj, { NODE_DEBUG (transport_node, "couldn't parse any of the given candidates"); - g_set_error (error, GABBLE_XMPP_ERROR, XMPP_ERROR_BAD_REQUEST, + g_set_error (error, WOCKY_XMPP_ERROR, WOCKY_XMPP_ERROR_BAD_REQUEST, "could not parse any of the given candidates"); } else @@ -422,7 +418,7 @@ parse_candidates (GabbleJingleTransportIface *obj, static void inject_candidates (GabbleJingleTransportIface *obj, - LmMessageNode *transport_node) + WockyNode *transport_node) { GabbleJingleTransportIceUdp *self = GABBLE_JINGLE_TRANSPORT_ICEUDP (obj); GabbleJingleTransportIceUdpPrivate *priv = self->priv; @@ -434,7 +430,7 @@ inject_candidates (GabbleJingleTransportIface *obj, JingleCandidate *c = (JingleCandidate *) priv->pending_candidates->data; gchar port_str[16], pref_str[16], comp_str[16], id_str[16], *type_str, *proto_str; - LmMessageNode *cnode; + WockyNode *cnode; if (username == NULL) { @@ -479,13 +475,13 @@ inject_candidates (GabbleJingleTransportIface *obj, continue; } - lm_message_node_set_attributes (transport_node, + wocky_node_set_attributes (transport_node, "ufrag", c->username, "pwd", c->password, NULL); - cnode = lm_message_node_add_child (transport_node, "candidate", NULL); - lm_message_node_set_attributes (cnode, + cnode = wocky_node_add_child_with_content (transport_node, "candidate", NULL); + wocky_node_set_attributes (cnode, "ip", c->address, "port", port_str, "priority", pref_str, @@ -512,8 +508,8 @@ send_candidates (GabbleJingleTransportIface *iface, while (priv->pending_candidates != NULL) { - LmMessageNode *trans_node, *sess_node; - LmMessage *msg; + WockyNode *trans_node, *sess_node; + WockyStanza *msg; msg = gabble_jingle_session_new_message (priv->content->session, JINGLE_ACTION_TRANSPORT_INFO, &sess_node); @@ -524,7 +520,7 @@ send_candidates (GabbleJingleTransportIface *iface, _gabble_connection_send_with_reply (priv->content->conn, msg, NULL, NULL, NULL, NULL); - lm_message_unref (msg); + g_object_unref (msg); } DEBUG ("sent all pending candidates"); |