[telepathy-gabble/master] don't add relay as streamhost when we are in a muc

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Apr 3 08:41:38 PDT 2009


---
 src/bytestream-socks5.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/bytestream-socks5.c b/src/bytestream-socks5.c
index c24ae41..0366f92 100644
--- a/src/bytestream-socks5.c
+++ b/src/bytestream-socks5.c
@@ -642,11 +642,13 @@ socks5_error (GabbleBytestreamSocks5 *self)
         /* The attempt for connect to the streamhost failed */
         socks5_close_transport (self);
 
-        /* Remove the failed streamhost */
-        g_assert (priv->streamhosts);
-        streamhost_free (priv->streamhosts->data);
-        priv->streamhosts = g_slist_delete_link (priv->streamhosts,
-            priv->streamhosts);
+        if (priv->streamhosts != NULL)
+          {
+            /* Remove the failed streamhost */
+            streamhost_free (priv->streamhosts->data);
+            priv->streamhosts = g_slist_delete_link (priv->streamhosts,
+                priv->streamhosts);
+          }
 
         if (priv->streamhosts != NULL)
           {
@@ -1298,6 +1300,13 @@ gabble_bytestream_socks5_add_streamhost (GabbleBytestreamSocks5 *self,
       return;
     }
 
+  if (tp_strdiff (jid, priv->peer_jid) && priv->muc_contact)
+    {
+      DEBUG ("skip streamhost %s (%s:%s); we don't support relay with muc "
+          "contact", jid, host, port);
+      return;
+    }
+
   DEBUG ("streamhost with jid %s, host %s and port %s added", jid, host,
       port);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list