- don-t re-scheduler, destroy immediately (comes from scheduler)
[oweals/gnunet.git] / src / mesh / gnunet-service-mesh_hello.c
index bde6592d6526ea42702b4595db1f040b81e865c2..723989bf8b473bd55e576c7e8b926eba4b1bb7d2 100644 (file)
@@ -100,12 +100,14 @@ got_hello (void *cls, const struct GNUNET_PeerIdentity *id,
 {
   struct MeshPeer *peer;
 
-  if (NULL == id)
+  if (NULL == id || NULL == hello)
   {
-    LOG (GNUNET_ERROR_TYPE_ERROR, " hello with NULL id\n");
+    LOG (GNUNET_ERROR_TYPE_DEBUG, " hello with id %p and msg %p\n", id, hello);
     return;
   }
-  LOG (GNUNET_ERROR_TYPE_DEBUG, " hello for %s\n", GNUNET_i2s (id));
+  LOG (GNUNET_ERROR_TYPE_DEBUG, " 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 @@ got_hello (void *cls, const struct GNUNET_PeerIdentity *id,
   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 @@ GMH_shutdown ()
 const struct GNUNET_HELLO_Message *
 GMH_get_mine (void)
 {
+  LOG (GNUNET_ERROR_TYPE_DEBUG, " mine is %p\n", mine);
   return mine;
 }