gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r32230 - gnunet/src/mesh
Date: Wed, 5 Feb 2014 18:24:26 +0100

Author: bartpolot
Date: 2014-02-05 18:24:26 +0100 (Wed, 05 Feb 2014)
New Revision: 32230

Modified:
   gnunet/src/mesh/gnunet-service-mesh_hello.c
   gnunet/src/mesh/gnunet-service-mesh_peer.c
Log:
- log

Modified: gnunet/src/mesh/gnunet-service-mesh_hello.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_hello.c 2014-02-05 17:24:25 UTC (rev 
32229)
+++ gnunet/src/mesh/gnunet-service-mesh_hello.c 2014-02-05 17:24:26 UTC (rev 
32230)
@@ -105,7 +105,9 @@
     LOG (GNUNET_ERROR_TYPE_ERROR, " hello with NULL id\n");
     return;
   }
-  LOG (GNUNET_ERROR_TYPE_DEBUG, " hello for %s\n", GNUNET_i2s (id));
+  LOG (GNUNET_ERROR_TYPE_INFO, " hello for %s (%d bytes), expires on %s\n",
+       GNUNET_i2s (id), NULL != hello ? GNUNET_HELLO_size (hello) : -1,
+       
GNUNET_STRINGS_absolute_time_to_string(GNUNET_HELLO_get_last_expiration(hello)));
   if (NULL == hello)
   {
     LOG (GNUNET_ERROR_TYPE_DEBUG, " hello is NULL\n");
@@ -115,7 +117,10 @@
   GMP_set_hello (peer, hello);
 
   if (GMP_get_short_id (peer) == myid)
-    mine = hello;
+  {
+    mine = GMP_get_hello (peer);
+    LOG (GNUNET_ERROR_TYPE_DEBUG, " updated mine to %p\n", mine);
+  }
 }
 
 
@@ -165,6 +170,7 @@
 const struct GNUNET_HELLO_Message *
 GMH_get_mine (void)
 {
+  LOG (GNUNET_ERROR_TYPE_DEBUG, " mine is %p\n", mine);
   return mine;
 }
 

Modified: gnunet/src/mesh/gnunet-service-mesh_peer.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_peer.c  2014-02-05 17:24:25 UTC (rev 
32229)
+++ gnunet/src/mesh/gnunet-service-mesh_peer.c  2014-02-05 17:24:26 UTC (rev 
32230)
@@ -1888,20 +1888,23 @@
   struct GNUNET_HELLO_Message *old;
   size_t size;
 
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "New hello for %s\n", GMP_2s (peer));
   if (NULL == hello)
     return;
 
   old = GMP_get_hello (peer);
+  LOG (GNUNET_ERROR_TYPE_DEBUG, " old hello %p\n", old);
   if (NULL == old)
   {
     size = GNUNET_HELLO_size (hello);
+    LOG (GNUNET_ERROR_TYPE_DEBUG, " new size: %u\n", size);
     peer->hello = GNUNET_malloc (size);
     memcpy (peer->hello, hello, size);
-    return;
   }
   else
   {
     peer->hello = GNUNET_HELLO_merge (old, hello);
+    LOG (GNUNET_ERROR_TYPE_DEBUG, " merge! %p\n", peer->hello);
     GNUNET_free (old);
   }
 }
@@ -1920,6 +1923,7 @@
   struct GNUNET_TIME_Absolute expiration;
   struct GNUNET_TIME_Relative remaining;
 
+  LOG (GNUNET_ERROR_TYPE_DEBUG, "Get hello\n");
   if (NULL == peer->hello)
     return NULL;
 
@@ -1927,6 +1931,8 @@
   remaining = GNUNET_TIME_absolute_get_remaining (expiration);
   if (0 == remaining.rel_value_us)
   {
+    LOG (GNUNET_ERROR_TYPE_DEBUG, " expired on %s\n",
+         GNUNET_STRINGS_absolute_time_to_string (expiration));
     GNUNET_free (peer->hello);
     peer->hello = NULL;
   }




reply via email to

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