From 75340ff5cde2f1c117b08e78e42b41bb72d65b2c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 16 Mar 2010 10:11:30 +0000 Subject: [PATCH] logging --- src/transport/transport_api.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index 469bc388c..d52e26027 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c @@ -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, -- 2.25.1