logging
authorChristian Grothoff <christian@grothoff.org>
Tue, 16 Mar 2010 10:11:30 +0000 (10:11 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 16 Mar 2010 10:11:30 +0000 (10:11 +0000)
src/transport/transport_api.c

index 469bc388ce71bdbb8da8e005cd77d24c8e710570..d52e26027f8ecdea1c6c99d9de3f11df36e5de8d 100644 (file)
@@ -983,15 +983,23 @@ GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
 {
   struct GNUNET_MessageHeader *hc;
   uint16_t size;
+  struct GNUNET_PeerIdentity peer;
 
-#if DEBUG_TRANSPORT
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-             "Offering `%s' message to transport for validation.\n",
-             "HELLO");
-#endif
   GNUNET_break (ntohs (hello->type) == GNUNET_MESSAGE_TYPE_HELLO);
   size = ntohs (hello->size);
   GNUNET_break (size >= sizeof (struct GNUNET_MessageHeader));
+  if (GNUNET_OK != GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message*) hello,
+                                       &peer))
+    {
+      GNUNET_break (0);
+      return;
+    }
+#if DEBUG_TRANSPORT 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Offering `%s' message of `%4s' to transport for validation.\n",
+             "HELLO",
+             GNUNET_i2s (&peer));
+#endif
   hc = GNUNET_malloc (size);
   memcpy (hc, hello, size);
   schedule_control_transmit (handle,