[telepathy-gabble/master] Ice: Don't signal empty lists of remote candidates

Will Thompson will.thompson at collabora.co.uk
Mon Jun 29 03:39:16 PDT 2009


---
 src/jingle-transport-iceudp.c |   29 +++++++++++++++++++----------
 1 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/jingle-transport-iceudp.c b/src/jingle-transport-iceudp.c
index 59355a8..5dbb8ea 100644
--- a/src/jingle-transport-iceudp.c
+++ b/src/jingle-transport-iceudp.c
@@ -340,20 +340,29 @@ parse_candidates (GabbleJingleTransportIface *obj,
       candidates = g_list_append (candidates, c);
     }
 
-  if (node_contains_a_candidate && candidates == NULL)
+  if (candidates == NULL)
     {
-      NODE_DEBUG (transport_node, "couldn't parse any of the given candidates");
-      g_set_error (error, GABBLE_XMPP_ERROR, XMPP_ERROR_BAD_REQUEST,
-          "could not parse any of the given candidates");
-      return;
+      if (node_contains_a_candidate)
+        {
+          NODE_DEBUG (transport_node,
+              "couldn't parse any of the given candidates");
+          g_set_error (error, GABBLE_XMPP_ERROR, XMPP_ERROR_BAD_REQUEST,
+              "could not parse any of the given candidates");
+        }
+      else
+        {
+          DEBUG ("no candidates in this stanza");
+        }
     }
+  else
+    {
+      DEBUG ("emitting %d new remote candidates", g_list_length (candidates));
 
-  DEBUG ("emitting %d new remote candidates", g_list_length (candidates));
-
-  g_signal_emit (obj, signals[NEW_CANDIDATES], 0, candidates);
+      g_signal_emit (obj, signals[NEW_CANDIDATES], 0, candidates);
 
-  /* append them to the known remote candidates */
-  priv->remote_candidates = g_list_concat (priv->remote_candidates, candidates);
+      priv->remote_candidates = g_list_concat (priv->remote_candidates,
+          candidates);
+    }
 }
 
 static void
-- 
1.5.6.5




More information about the telepathy-commits mailing list