[Telepathy-commits] [telepathy-gabble/master] simplified debugging messages in jingle code

Senko Rasic senko at phyrexia.lan
Tue Dec 2 04:34:02 PST 2008


---
 src/jingle-content.c          |   28 +++-------------------------
 src/jingle-factory.c          |    1 -
 src/jingle-media-rtp.c        |    2 --
 src/jingle-session.c          |   22 +++-------------------
 src/jingle-transport-google.c |   26 --------------------------
 src/media-channel.c           |    7 -------
 src/media-stream.c            |    1 -
 7 files changed, 6 insertions(+), 81 deletions(-)

diff --git a/src/jingle-content.c b/src/jingle-content.c
index 02197b5..fd826c9 100644
--- a/src/jingle-content.c
+++ b/src/jingle-content.c
@@ -201,7 +201,6 @@ gabble_jingle_content_set_property (GObject *object,
   switch (property_id) {
     case PROP_CONNECTION:
       self->conn = g_value_get_object (value);
-      DEBUG ("setting self->conn to %p", self->conn);
       break;
     case PROP_SESSION:
       self->session = g_value_get_object (value);
@@ -225,8 +224,6 @@ gabble_jingle_content_set_property (GObject *object,
 
           g_assert (transport_type != 0);
 
-          DEBUG ("using transport: %s", priv->transport_ns);
-
           priv->transport = g_object_new (transport_type,
               "content", self, "transport-ns", priv->transport_ns, NULL);
 
@@ -245,7 +242,6 @@ gabble_jingle_content_set_property (GObject *object,
       break;
     case PROP_STATE:
       priv->state = g_value_get_uint (value);
-      DEBUG ("setting content state to %u", priv->state);
       break;
     case PROP_READY:
       g_assert_not_reached ();
@@ -441,8 +437,6 @@ static void
 new_transport_candidates_cb (GabbleJingleTransportIface *trans,
     GList *candidates, GabbleJingleContent *content)
 {
-  DEBUG ("JingleContent %p: passing the signal on", content);
-
   /* just pass the signal on */
   g_signal_emit (content, signals[NEW_CANDIDATES], 0, candidates);
 }
@@ -499,7 +493,6 @@ gabble_jingle_content_parse_add (GabbleJingleContent *c,
 
   if (google_mode)
     {
-      DEBUG ("content in google mode!");
       if (creator == NULL)
           creator = "initiator";
 
@@ -512,7 +505,7 @@ gabble_jingle_content_parse_add (GabbleJingleContent *c,
       if (trans_node == NULL)
         {
           /* gtalk lj0.3 assumes google-p2p transport */
-          DEBUG ("detecting GTalk3 dialect");
+          DEBUG ("detected GTalk3 dialect");
 
           dialect = JINGLE_DIALECT_GTALK3;
           g_object_set (c->session, "dialect", JINGLE_DIALECT_GTALK3, NULL);
@@ -541,7 +534,6 @@ gabble_jingle_content_parse_add (GabbleJingleContent *c,
   if (transport_type == 0)
     {
       const gchar *ns = lm_message_node_get_attribute (trans_node, "xmlns");
-      DEBUG ("ns is %s", ns);
 
       transport_type = GPOINTER_TO_INT (
           g_hash_table_lookup (c->conn->jingle_factory->transports, ns));
@@ -629,11 +621,9 @@ gabble_jingle_content_parse_accept (GabbleJingleContent *c,
 
   g_object_get (c->session, "dialect", &dialect, NULL);
 
-  /* FIXME: if we examine dialect manually, we don't need google_modeparamflag */
+  /* FIXME: if we examine dialect manually, we don't need google_mode param flag */
   if (google_mode)
     {
-      DEBUG ("parsing content-accept in google mode");
-
       if (trans_node == NULL)
         {
           DEBUG ("no transport node, assuming GTalk3 dialect");
@@ -684,8 +674,6 @@ gabble_jingle_content_produce_node (GabbleJingleContent *c,
   if ((dialect == JINGLE_DIALECT_GTALK3) ||
       (dialect == JINGLE_DIALECT_GTALK4))
     {
-      DEBUG ("content node setting to parent??");
-
       /* content-* isn't used in GTalk anyways, so we always have to include
        * the full content description */
       g_assert (full == TRUE);
@@ -694,17 +682,12 @@ gabble_jingle_content_produce_node (GabbleJingleContent *c,
     }
   else
     {
-      DEBUG ("creator: %s", priv->creator);
-      DEBUG ("name: %s", priv->name);
-      DEBUG ("senders: %s", produce_senders (priv->senders));
-
       content_node = lm_message_node_add_child (parent, "content", NULL);
       lm_message_node_set_attributes (content_node,
           "creator", priv->created_by_initiator ? "initiator" : "responder",
           "name", priv->name,
           "senders", produce_senders (priv->senders),
           NULL);
-      DEBUG ("created new content node %p", content_node);
     }
 
   if (!full)
@@ -816,8 +799,6 @@ _maybe_ready (GabbleJingleContent *self)
   if (!gabble_jingle_content_is_ready (self))
       return;
 
-  DEBUG ("called, and is ready");
-
   /* If content disposition is session and session
    * is not yet acknowledged/active, we signall
    * the readiness to the session and let it take
@@ -826,12 +807,9 @@ _maybe_ready (GabbleJingleContent *self)
 
   g_object_get (self->session, "state", &state, NULL);
 
-  DEBUG ("session state == %d", state);
-
   if (!tp_strdiff (priv->disposition, "session") &&
       (state < JS_STATE_PENDING_ACCEPT_SENT))
     {
-      DEBUG ("disposition == 'session' and session not active, signalling");
       /* Notify the session that we're ready for
        * session-initiate/session-accept */
       g_signal_emit (self, signals[READY], 0);
@@ -840,9 +818,9 @@ _maybe_ready (GabbleJingleContent *self)
     {
       if (state >= JS_STATE_PENDING_INITIATE_SENT)
         {
-          DEBUG ("disposition != 'session', sending add/accept");
           send_content_add_or_accept (self);
         }
+      else
         {
           /* non session-disposition content ready without session
            * being initiated at all? */
diff --git a/src/jingle-factory.c b/src/jingle-factory.c
index 1844903..d28c392 100644
--- a/src/jingle-factory.c
+++ b/src/jingle-factory.c
@@ -377,7 +377,6 @@ connection_status_changed_cb (GabbleConnection *conn,
       g_assert (priv->conn != NULL);
       g_assert (priv->conn->lmconn != NULL);
 
-      DEBUG ("adding callbacks");
       g_assert (priv->jingle_cb == NULL);
       g_assert (priv->jingle_info_cb == NULL);
 
diff --git a/src/jingle-media-rtp.c b/src/jingle-media-rtp.c
index 425c519..86d9829 100644
--- a/src/jingle-media-rtp.c
+++ b/src/jingle-media-rtp.c
@@ -367,8 +367,6 @@ produce_description (GabbleJingleContent *obj, LmMessageNode *content_node)
   g_object_get (obj, "session", &sess, NULL);
   g_object_get (sess, "dialect", &dialect, NULL);
 
-  DEBUG ("using content node %p", content_node);
-
   desc_node = lm_message_node_add_child (content_node, "description", NULL);
 
   switch (dialect)
diff --git a/src/jingle-session.c b/src/jingle-session.c
index 4ebcbc6..99bc2ea 100644
--- a/src/jingle-session.c
+++ b/src/jingle-session.c
@@ -148,7 +148,7 @@ gabble_jingle_session_dispose (GObject *object)
   if (priv->dispose_has_run)
     return;
 
-  DEBUG ("dispose called");
+  DEBUG ("called");
   priv->dispose_has_run = TRUE;
 
   g_assert ((priv->state == JS_STATE_PENDING_CREATED) ||
@@ -254,7 +254,6 @@ gabble_jingle_session_set_property (GObject *object,
     case PROP_PEER_RESOURCE:
       g_free (priv->peer_resource);
       priv->peer_resource = g_value_dup_string (value);
-      DEBUG ("setting peer resource to %s", priv->peer_resource);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -368,15 +367,10 @@ parse_action (const gchar *txt)
   if (txt == NULL)
       return JINGLE_ACTION_UNKNOWN;
 
-  DEBUG ("with %s", txt);
-
   /* synonyms, best deal with them right now */
   if (!tp_strdiff (txt, "initiate") ||
       !tp_strdiff (txt, "session-initiate"))
-    {
-        DEBUG ("it's initiate");
         return JINGLE_ACTION_SESSION_INITIATE;
-    }
   else if (!tp_strdiff (txt, "terminate") ||
       !tp_strdiff (txt, "session-terminate") ||
       !tp_strdiff (txt, "reject"))
@@ -582,8 +576,6 @@ _each_content_add (GabbleJingleSession *sess, GabbleJingleContent *c,
       return;
     }
 
-  DEBUG ("remote end adds new content named '%s' of type %s", name, g_type_name (content_type));
-
   if (c != NULL)
     {
       JingleContentState state;
@@ -1087,8 +1079,6 @@ gabble_jingle_session_parse (GabbleJingleSession *sess, JingleAction action, LmM
   if (*error != NULL)
     return FALSE;
 
-  DEBUG ("parsed properly");
-
   return TRUE;
 }
 
@@ -1139,8 +1129,6 @@ gabble_jingle_session_new_message (GabbleJingleSession *sess,
   gchar *el = NULL, *ns = NULL;
   gboolean gtalk_mode = FALSE;
 
-  DEBUG ("creating new message to peer: %s", priv->peer_jid);
-
   g_assert ((action == JINGLE_ACTION_SESSION_INITIATE) || (priv->state > JS_STATE_PENDING_CREATED));
 
   /* possibly this is the first message in an outgoing session,
@@ -1250,7 +1238,7 @@ _fill_content (GabbleJingleSession *sess,
     }
   else
     {
-      DEBUG ("weird, content %p is in stata %u", c, state);
+      DEBUG ("content %p is in state %u", c, state);
       g_assert_not_reached ();
     }
 }
@@ -1293,7 +1281,6 @@ gabble_jingle_session_send (GabbleJingleSession *sess, LmMessage *msg,
       ctx->handler = cb;
       ctx->user_data = user_data;
 
-      DEBUG ("sending with reply %p", cb);
       _gabble_connection_send_with_reply (priv->conn, msg,
           _process_reply, G_OBJECT (sess), ctx, NULL);
     }
@@ -1448,8 +1435,7 @@ gabble_jingle_session_terminate (GabbleJingleSession *sess)
    * it, bringing refcount to 0, so dispose will be called, and it
    * takes care of cleanup */
 
-  DEBUG ("we are terminating this session, our refcount is %d",
-      G_OBJECT (sess)->ref_count);
+  DEBUG ("we are terminating this session");
   set_state (sess, JS_STATE_ENDED);
 }
 
@@ -1493,8 +1479,6 @@ content_removed_cb (GabbleJingleContent *c, gpointer user_data)
   GabbleJingleSessionPrivate *priv = GABBLE_JINGLE_SESSION_GET_PRIVATE (sess);
   const gchar *name;
 
-  DEBUG ("JingleSession:contant_removed_cb() called");
-
   g_object_get (c, "name", &name, NULL);
   g_hash_table_remove (priv->contents, name);
 
diff --git a/src/jingle-transport-google.c b/src/jingle-transport-google.c
index e6ae7db..c58aeed 100644
--- a/src/jingle-transport-google.c
+++ b/src/jingle-transport-google.c
@@ -262,26 +262,6 @@ parse_candidates (GabbleJingleTransportIface *obj,
 
   DEBUG ("called");
 
-#if 0
-  // FIXME do we need this?
-  if (!tp_strdiff (transport_node->name, "candidate"))
-    {
-      JingleDialect dialect;
-
-      g_object_get (priv->content->session, "dialect", &dialect, NULL);
-
-      if (dialect == JINGLE_DIALECT_GTALK4)
-        {
-          /* FIXME: do we need to do anything more than retransmit
-           * local candidates and mode switch? */
-          g_object_set (priv->content->session, "dialect",
-              JINGLE_DIALECT_GTALK3, NULL);
-
-          transmit_candidates (t, priv->local_candidates);
-        }
-    }
-#endif
-
   for (node = transport_node->children; node; node = node->next)
     {
       const gchar *name, *address, *user, *pass, *str;
@@ -291,8 +271,6 @@ parse_candidates (GabbleJingleTransportIface *obj,
       JingleCandidateType ctype;
       JingleCandidate *c;
 
-      DEBUG ("Parsing node %s", node->name);
-
       if (tp_strdiff (node->name, "candidate"))
           continue;
 
@@ -303,7 +281,6 @@ parse_candidates (GabbleJingleTransportIface *obj,
       address = lm_message_node_get_attribute (node, "address");
       if (address == NULL)
           break;
-      DEBUG ("AAA");
 
       str = lm_message_node_get_attribute (node, "port");
       if (str == NULL)
@@ -371,7 +348,6 @@ parse_candidates (GabbleJingleTransportIface *obj,
           break;
         }
 
-      DEBUG ("XXX");
       user = lm_message_node_get_attribute (node, "username");
       if (user == NULL)
           break;
@@ -384,7 +360,6 @@ parse_candidates (GabbleJingleTransportIface *obj,
       if (str == NULL)
           break;
       net = atoi (str);
-      DEBUG ("YYY");
 
       str = lm_message_node_get_attribute (node, "generation");
       if (str == NULL)
@@ -403,7 +378,6 @@ parse_candidates (GabbleJingleTransportIface *obj,
       c->network = net;
       c->generation = gen;
 
-      DEBUG ("all well, adding candidate %s:%d!", c->address, c->port);
       candidates = g_list_append (candidates, c);
     }
 
diff --git a/src/media-channel.c b/src/media-channel.c
index 86a474c..c2e076d 100644
--- a/src/media-channel.c
+++ b/src/media-channel.c
@@ -1730,11 +1730,8 @@ session_terminated_cb (GabbleJingleSession *session,
   if (priv->streams != NULL)
     {
       GPtrArray *tmp = priv->streams;
-      GabbleMediaStream *s = g_ptr_array_index (tmp, 0);
 
       DEBUG ("unreffing streams");
-      DEBUG ("%p with refcount %d",
-          s, G_OBJECT(s)->ref_count);
 
       /* move priv->streams aside so that the stream_close_cb
        * doesn't double unref */
@@ -2016,8 +2013,6 @@ stream_close_cb (GabbleMediaStream *stream,
   GabbleMediaChannelPrivate *priv = GABBLE_MEDIA_CHANNEL_GET_PRIVATE (chan);
   guint id;
 
-  DEBUG ("%p called", chan);
-
   g_assert (GABBLE_IS_MEDIA_CHANNEL (chan));
 
   g_object_get (stream,
@@ -2049,8 +2044,6 @@ stream_error_cb (GabbleMediaStream *stream,
   GabbleJingleContent *c;
   guint id;
 
-  DEBUG ("%p called", chan);
-
   /* emit signal */
   g_object_get (stream, "id", &id, "content", &c, NULL);
   tp_svc_channel_type_streamed_media_emit_stream_error (chan, id, errno,
diff --git a/src/media-stream.c b/src/media-stream.c
index 0e591f7..644df2f 100644
--- a/src/media-stream.c
+++ b/src/media-stream.c
@@ -1459,7 +1459,6 @@ content_senders_changed_cb (GabbleJingleContent *c,
 static void
 content_removed_cb (GabbleJingleContent *content, GabbleMediaStream *stream)
 {
-  DEBUG ("MediaStream:content_removed_cb() called");
   _gabble_media_stream_close (stream);
 }
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list