gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r17556 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r17556 - gnunet/src/mesh
Date: Mon, 17 Oct 2011 18:43:24 +0200

Author: bartpolot
Date: 2011-10-17 18:43:24 +0200 (Mon, 17 Oct 2011)
New Revision: 17556

Modified:
   gnunet/src/mesh/gnunet-service-mesh.c
   gnunet/src/mesh/mesh_api_new.c
   gnunet/src/mesh/test_mesh_small_multicast.c
Log:
Added debug info for multicast

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2011-10-17 16:40:40 UTC (rev 
17555)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2011-10-17 16:43:24 UTC (rev 
17556)
@@ -1635,6 +1635,8 @@
   size_t size;
   void *data;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "MESH:  sending a multicast packet...\n");
   size = ntohs (msg->size);
   GNUNET_assert (NULL != t->tree->me);
   n = t->tree->me->children_head;
@@ -1643,6 +1645,7 @@
   copies = GNUNET_malloc (sizeof (unsigned int));
   for (*copies = 0; NULL != n; n = n->next)
     (*copies)++;
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH:  (%u copies)\n", copies);
   n = t->tree->me->children_head;
   data = GNUNET_malloc (size);
   memcpy (data, &msg, size);
@@ -1663,6 +1666,9 @@
     }
     info->destination = n->peer;
     neighbor = path_get_first_hop(t->tree, n->peer);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "MESH:  sending to %s...\n",
+              GNUNET_i2s (neighbor));
     info->peer = peer_info_get(neighbor);
     GNUNET_assert (NULL != info->peer);
     for (i = 0; NULL != info->peer->core_transmit[i]; i++)
@@ -2360,6 +2366,9 @@
   struct MeshTunnel *t;
   size_t size;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "MESH: got a multicast packet from %s\n",
+              GNUNET_i2s (peer));
   size = ntohs (message->size) - sizeof (struct GNUNET_MESH_Multicast);
   if (size < sizeof (struct GNUNET_MessageHeader))
   {
@@ -3540,6 +3549,9 @@
   struct GNUNET_MESH_Multicast *data_msg;
   MESH_TunnelNumber tid;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "MESH: Got a multicast request from a client!\n");
+
   /* Sanity check for client registration */
   if (NULL == (c = client_get (client)))
   {
@@ -3582,10 +3594,12 @@
     memcpy(buf, message, ntohs(message->size));
     copy->oid = my_full_id;
     copy->tid = htonl(t->id.tid);
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "MESH:   calling generic handler...\n");
     handle_mesh_data_multicast(client, &my_full_id, &copy->header, NULL);
   }
 
-  /* receive done gets called when last copy is sent */
+  /* receive done gets called when last copy is sent to a neighbor */
   return;
 }
 

Modified: gnunet/src/mesh/mesh_api_new.c
===================================================================
--- gnunet/src/mesh/mesh_api_new.c      2011-10-17 16:40:40 UTC (rev 17555)
+++ gnunet/src/mesh/mesh_api_new.c      2011-10-17 16:43:24 UTC (rev 17556)
@@ -1036,12 +1036,6 @@
   tsize = 0;
   while ((NULL != (th = h->th_head)) && (size >= th->size))
   {
-#if DEBUG
-    LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh:     type: %u\n",
-         ntohs (((struct GNUNET_MessageHeader *) &th[1])->type));
-    LOG (GNUNET_ERROR_TYPE_DEBUG, "mesh:     size: %u\n",
-         ntohs (((struct GNUNET_MessageHeader *) &th[1])->size));
-#endif
     if (NULL != th->notify)
     {
       if (th->tunnel->tid >= GNUNET_MESH_LOCAL_TUNNEL_ID_SERV)
@@ -1076,6 +1070,9 @@
         GNUNET_assert (size >= th->size);
         psize =
             th->notify (th->notify_cls, size - sizeof (mc), &cbuf[sizeof 
(mc)]);
+        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "mesh:   multicast, type %u\n",
+              ntohs (mh->type));
         if (psize > 0)
         {
           mc.header.size = htons (sizeof (mc) + th->size);
@@ -1468,12 +1465,17 @@
   uint32_t least_priority;
   size_t overhead;
 
+#if DEBUG
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "mesh: mesh notify transmit ready called\n");
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "mesh:     target %s\n",
-              GNUNET_i2s (target));
-
+  if (NULL != target)
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "mesh:     target %s\n",
+                GNUNET_i2s (target));
+  else
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                "mesh:     target multicast\n");
+#endif
   GNUNET_assert (NULL != notify);
   if (tunnel->mesh->npackets >= tunnel->mesh->max_queue_size &&
       tunnel->npackets > 0)

Modified: gnunet/src/mesh/test_mesh_small_multicast.c
===================================================================
--- gnunet/src/mesh/test_mesh_small_multicast.c 2011-10-17 16:40:40 UTC (rev 
17555)
+++ gnunet/src/mesh/test_mesh_small_multicast.c 2011-10-17 16:43:24 UTC (rev 
17556)
@@ -231,7 +231,7 @@
           void **tunnel_ctx,
           const struct GNUNET_PeerIdentity *sender,
           const struct GNUNET_MessageHeader *message,
-          const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+          const struct GNUNET_ATS_Information *atsi)
 {
   long client = (long) cls;
 
@@ -293,7 +293,7 @@
 incoming_tunnel (void *cls,
                  struct GNUNET_MESH_Tunnel * tunnel,
                  const struct GNUNET_PeerIdentity * initiator,
-                 const struct GNUNET_TRANSPORT_ATS_Information * atsi)
+                 const struct GNUNET_ATS_Information * atsi)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "test: Incoming tunnel from %s\n",
@@ -353,7 +353,7 @@
  */
 static void
 ch (void *cls, const struct GNUNET_PeerIdentity *peer,
-    const struct GNUNET_TRANSPORT_ATS_Information *atsi)
+    const struct GNUNET_ATS_Information *atsi)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "test: peer %s connected\n",




reply via email to

[Prev in Thread] Current Thread [Next in Thread]