Mercurial > pidgin.yaz
diff libpurple/protocols/jabber/jingle/iceudp.c @ 26369:26cf297796a5
Update Jingle Ice-Udp according to the XEP.
This mainly includes sending and receiving candidates in
session-initiate and session-accept packets. It also includes a few
memory leak fixes.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Tue, 17 Mar 2009 11:57:22 +0000 |
parents | 20c16e29f364 |
children | 44684f0d2e42 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jingle/iceudp.c Tue Mar 17 10:13:10 2009 +0000 +++ b/libpurple/protocols/jabber/jingle/iceudp.c Tue Mar 17 11:57:22 2009 +0000 @@ -332,21 +332,19 @@ { xmlnode *node = parent_class->to_xml(transport, content, action); - if (action == JINGLE_SESSION_INITIATE || action == JINGLE_TRANSPORT_INFO || - action == JINGLE_CONTENT_ADD || action == JINGLE_TRANSPORT_REPLACE) { - JingleIceUdpPrivate *icetransport = - JINGLE_ICEUDP_GET_PRIVATE(transport); - if (icetransport && icetransport->local_candidates) { - JingleIceUdpCandidate *candidate = - icetransport->local_candidates->data; + if (action == JINGLE_SESSION_INITIATE || + action == JINGLE_SESSION_ACCEPT || + action == JINGLE_TRANSPORT_INFO || + action == JINGLE_CONTENT_ADD || + action == JINGLE_TRANSPORT_REPLACE) { + JingleIceUdpPrivate *priv = JINGLE_ICEUDP_GET_PRIVATE(transport); + GList *iter = priv->local_candidates; + + if (iter && iter->data) { + JingleIceUdpCandidate *candidate = iter->data; xmlnode_set_attrib(node, "pwd", candidate->password); xmlnode_set_attrib(node, "ufrag", candidate->username); } - } - - if (action == JINGLE_TRANSPORT_INFO || action == JINGLE_SESSION_ACCEPT) { - JingleIceUdpPrivate *priv = JINGLE_ICEUDP_GET_PRIVATE(transport); - GList *iter = priv->local_candidates; for (; iter; iter = g_list_next(iter)) { JingleIceUdpCandidate *candidate = iter->data;