{
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 (%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");
return;
}
-
peer = GMP_get (id);
GMP_set_hello (peer, hello);
+
+ if (GMP_get_short_id (peer) == myid)
+ {
+ mine = GMP_get_hello (peer);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " updated mine to %p\n", mine);
+ }
}
GMH_init (const struct GNUNET_CONFIGURATION_Handle *c)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "init\n");
- GNUNET_assert (NULL != nc);
+ GNUNET_assert (NULL == nc);
peerinfo = GNUNET_PEERINFO_connect (c);
nc = GNUNET_PEERINFO_notify (c, GNUNET_NO, &got_hello, NULL);
}
const struct GNUNET_HELLO_Message *
GMH_get_mine (void)
{
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " mine is %p\n", mine);
return mine;
}