[Telepathy-commits] [telepathy-salut/master] Improve debug info when a incoming connection is rejected because we can't identify it

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Fri Nov 7 03:38:37 PST 2008


---
 src/salut-xmpp-connection-manager.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/src/salut-xmpp-connection-manager.c b/src/salut-xmpp-connection-manager.c
index a3bd549..c90f08f 100644
--- a/src/salut-xmpp-connection-manager.c
+++ b/src/salut-xmpp-connection-manager.c
@@ -702,6 +702,7 @@ incoming_pending_connection_stream_opened_cb (GibberXmppConnection *conn,
   SalutXmppConnectionManagerPrivate *priv =
     SALUT_XMPP_CONNECTION_MANAGER_GET_PRIVATE (self);
   GList *contacts;
+  guint contacts_len;
 
   DEBUG ("incoming pending connection with %s opened. Open it too", from);
   gibber_xmpp_connection_open (conn, from, priv->connection->name, "1.0");
@@ -728,7 +729,8 @@ incoming_pending_connection_stream_opened_cb (GibberXmppConnection *conn,
    * from data...
    */
   contacts = g_hash_table_lookup (priv->incoming_pending_connections, conn);
-  if (g_list_length (contacts) == 1)
+  contacts_len = g_list_length (contacts);
+  if (contacts_len == 1)
     {
       SalutContact *contact = contacts->data;
 
@@ -736,6 +738,21 @@ incoming_pending_connection_stream_opened_cb (GibberXmppConnection *conn,
           "Assuming it's a connection from that contact", contact->name);
       incoming_connection_found_contact (self, conn, contact);
     }
+  else
+    {
+      GList *l;
+
+      DEBUG ("Incoming connection from a machine with more than one "
+          "contact (%d). Can't assume its identity. Possible contacts are:",
+          contacts_len);
+
+      for (l = contacts; l != NULL; l = g_list_next (l))
+        {
+          SalutContact *contact = l->data;
+
+          DEBUG ("--> %s\n", contact->name);
+        }
+    }
 }
 
 static void
-- 
1.5.6.5




More information about the Telepathy-commits mailing list