diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-06-24 13:18:38 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-06-24 13:18:38 +0000 |
commit | c5364d2068f04383e80165e1f105fecdccbeea0f (patch) | |
tree | 68276dc4929042def11c645e7f7cad7bd83a69ad /src/transport/gnunet-service-transport.c | |
parent | b657bebb43db87fa162ed44465bb4a0b6cd9165f (diff) | |
download | gnunet-c5364d2068f04383e80165e1f105fecdccbeea0f.tar.gz gnunet-c5364d2068f04383e80165e1f105fecdccbeea0f.zip |
better debug message
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r-- | src/transport/gnunet-service-transport.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index d39351e98..a2468441f 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -45,6 +45,8 @@ | |||
45 | 45 | ||
46 | #define SIGN_USELESS GNUNET_NO | 46 | #define SIGN_USELESS GNUNET_NO |
47 | 47 | ||
48 | #define DEBUG_TRANSPORT_HELLO GNUNET_YES | ||
49 | |||
48 | /** | 50 | /** |
49 | * Should we do some additional checks (to validate behavior | 51 | * Should we do some additional checks (to validate behavior |
50 | * of clients)? | 52 | * of clients)? |
@@ -3820,7 +3822,9 @@ process_hello (struct TransportPlugin *plugin, | |||
3820 | const struct GNUNET_HELLO_Message *hello; | 3822 | const struct GNUNET_HELLO_Message *hello; |
3821 | struct CheckHelloValidatedContext *chvc; | 3823 | struct CheckHelloValidatedContext *chvc; |
3822 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded publicKey; | 3824 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded publicKey; |
3823 | 3825 | #if DEBUG_TRANSPORT_HELLO | |
3826 | char *my_id; | ||
3827 | #endif | ||
3824 | hsize = ntohs (message->size); | 3828 | hsize = ntohs (message->size); |
3825 | if ((ntohs (message->type) != GNUNET_MESSAGE_TYPE_HELLO) || | 3829 | if ((ntohs (message->type) != GNUNET_MESSAGE_TYPE_HELLO) || |
3826 | (hsize < sizeof (struct GNUNET_MessageHeader))) | 3830 | (hsize < sizeof (struct GNUNET_MessageHeader))) |
@@ -3881,12 +3885,19 @@ process_hello (struct TransportPlugin *plugin, | |||
3881 | GNUNET_HELLO_size(hello))); | 3885 | GNUNET_HELLO_size(hello))); |
3882 | chvc = chvc->next; | 3886 | chvc = chvc->next; |
3883 | } | 3887 | } |
3884 | #if DEBUG_TRANSPORT | 3888 | #if DEBUG_TRANSPORT_HELLO |
3885 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3889 | if (plugin != NULL) |
3886 | "Starting validation of `%s' message for `%4s' of size %u\n", | 3890 | { |
3887 | "HELLO", | 3891 | my_id = GNUNET_strdup(GNUNET_i2s(plugin->env.my_identity)); |
3888 | GNUNET_i2s (&target), | 3892 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3889 | GNUNET_HELLO_size(hello)); | 3893 | "%s: Starting validation of `%s' message for `%4s' via '%s' of size %u\n", |
3894 | my_id, | ||
3895 | "HELLO", | ||
3896 | GNUNET_i2s (&target), | ||
3897 | (plugin == NULL) ? "???" : plugin->short_name, | ||
3898 | GNUNET_HELLO_size(hello)); | ||
3899 | GNUNET_free(my_id); | ||
3900 | } | ||
3890 | #endif | 3901 | #endif |
3891 | chvc = GNUNET_malloc (sizeof (struct CheckHelloValidatedContext) + hsize); | 3902 | chvc = GNUNET_malloc (sizeof (struct CheckHelloValidatedContext) + hsize); |
3892 | chvc->ve_count = 1; | 3903 | chvc->ve_count = 1; |