gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r15613 - gnunet/src/mesh
Date: Wed, 15 Jun 2011 09:15:42 +0200

Author: toelke
Date: 2011-06-15 09:15:42 +0200 (Wed, 15 Jun 2011)
New Revision: 15613

Modified:
   gnunet/src/mesh/mesh_api.c
Log:
debug the mock-mesh

Modified: gnunet/src/mesh/mesh_api.c
===================================================================
--- gnunet/src/mesh/mesh_api.c  2011-06-15 07:15:41 UTC (rev 15612)
+++ gnunet/src/mesh/mesh_api.c  2011-06-15 07:15:42 UTC (rev 15613)
@@ -177,6 +177,9 @@
 send_hello_message (void *cls, size_t size, void *buf)
 {
   if (cls == NULL) return 0;
+
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Sending hello\n");
+
   struct GNUNET_MESH_Handle *handle = cls;
   struct GNUNET_MessageHeader *hdr = buf;
 
@@ -203,6 +206,8 @@
 {
   struct GNUNET_MESH_Handle *handle = cls;
 
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Core tells us we are connected to peer 
%s\n", GNUNET_i2s(peer));
+
   /* Send a hello to this peer */
   GNUNET_CORE_notify_transmit_ready(handle->core,
                                     GNUNET_NO,
@@ -261,6 +266,8 @@
 {
   struct GNUNET_MESH_Handle *handle = cls;
 
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Core tells us we are no longer 
connected to peer %s\n", GNUNET_i2s(peer));
+
   struct peer_list_element *element = handle->connected_peers.head;
   while (element != NULL)
     {
@@ -323,6 +330,8 @@
   uint16_t *ports = num + 1;
   unsigned int i;
 
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "The peer %s tells us he supports %d 
application-types.\n", GNUNET_i2s(other), *num);
+
   struct peer_list_element *element = handle->connected_peers.head;
   while (element != NULL)
     {
@@ -400,7 +409,11 @@
 
   /* If no handler was found, drop the message but keep the channel open */
   if (handler->callback == NULL)
-    return GNUNET_OK;
+    {
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Received message of type %d from 
peer %s; dropping it.\n",
+                 ntohs(rmessage->type), GNUNET_i2s(other));
+      return GNUNET_OK;
+    }
 
   struct tunnel_list_element *tunnel = handle->established_tunnels.head;
 
@@ -420,6 +433,8 @@
   /* if no tunnel was found: create a new inbound tunnel */
   if (tunnel == NULL)
     {
+      GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "New inbound tunnel from peer %s; 
first message has type %d.\n",
+                 GNUNET_i2s(other), ntohs(rmessage->type));
       tunnel = GNUNET_malloc (sizeof (struct tunnel_list_element));
       tunnel->tunnel.connect_handler = NULL;
       tunnel->tunnel.disconnect_handler = NULL;
@@ -435,6 +450,9 @@
                                         handle->established_tunnels.tail,
                                         tunnel);
     }
+  else
+    GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Inbound message from peer %s; type 
%d.\n",
+               GNUNET_i2s(other), ntohs(rmessage->type));
 
   return handler->callback (handle->cls, &tunnel->tunnel,
                            &tunnel->tunnel.ctx, other, rmessage, atsi);
@@ -465,6 +483,8 @@
       element = element->next;
     }
 
+  GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Trying to connect by tupe %d.\n", 
application_type);
+
   /* Put into pending list */
   struct tunnel_list_element *tunnel =
     GNUNET_malloc (sizeof (struct tunnel_list_element));




reply via email to

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