diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-06-07 17:55:39 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-06-07 17:55:39 +0000 |
commit | 8fc6aab8c74124130c95d58192072a7eba59028c (patch) | |
tree | c0c0fa21d0c0cfe441c20cbc60ccdaaa0b3853da | |
parent | 9c9d95dc931d6fb083b229c45bbe49eef6e60791 (diff) | |
download | gnunet-8fc6aab8c74124130c95d58192072a7eba59028c.tar.gz gnunet-8fc6aab8c74124130c95d58192072a7eba59028c.zip |
-nicer logging
-rw-r--r-- | src/transport/gnunet-service-transport_clients.c | 7 | ||||
-rw-r--r-- | src/transport/gnunet-service-transport_plugins.c | 2 | ||||
-rw-r--r-- | src/transport/plugin_transport_tcp.c | 8 | ||||
-rw-r--r-- | src/transport/transport_api_address_to_string.c | 10 |
4 files changed, 25 insertions, 2 deletions
diff --git a/src/transport/gnunet-service-transport_clients.c b/src/transport/gnunet-service-transport_clients.c index e8c85c6d3..53c029eed 100644 --- a/src/transport/gnunet-service-transport_clients.c +++ b/src/transport/gnunet-service-transport_clients.c | |||
@@ -1009,6 +1009,9 @@ clients_handle_address_to_string (void *cls, | |||
1009 | papi = GST_plugins_printer_find (plugin_name); | 1009 | papi = GST_plugins_printer_find (plugin_name); |
1010 | if (NULL == papi) | 1010 | if (NULL == papi) |
1011 | { | 1011 | { |
1012 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
1013 | "Failed to find plugin `%s'\n", | ||
1014 | plugin_name); | ||
1012 | atsm.header.size = ntohs (sizeof (struct AddressToStringResultMessage)); | 1015 | atsm.header.size = ntohs (sizeof (struct AddressToStringResultMessage)); |
1013 | atsm.header.type = ntohs (GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING_REPLY); | 1016 | atsm.header.type = ntohs (GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING_REPLY); |
1014 | atsm.res = htonl (GNUNET_SYSERR); | 1017 | atsm.res = htonl (GNUNET_SYSERR); |
@@ -1028,6 +1031,10 @@ clients_handle_address_to_string (void *cls, | |||
1028 | actx->tc = tc; | 1031 | actx->tc = tc; |
1029 | GNUNET_CONTAINER_DLL_insert (a2s_head, a2s_tail, actx); | 1032 | GNUNET_CONTAINER_DLL_insert (a2s_head, a2s_tail, actx); |
1030 | GNUNET_SERVER_disable_receive_done_warning (client); | 1033 | GNUNET_SERVER_disable_receive_done_warning (client); |
1034 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1035 | "Pretty-printing address of %u bytes using plugin `%s'\n", | ||
1036 | address_len, | ||
1037 | plugin_name); | ||
1031 | papi->address_pretty_printer (papi->cls, | 1038 | papi->address_pretty_printer (papi->cls, |
1032 | plugin_name, | 1039 | plugin_name, |
1033 | address, address_len, | 1040 | address, address_len, |
diff --git a/src/transport/gnunet-service-transport_plugins.c b/src/transport/gnunet-service-transport_plugins.c index e96f1b7f8..473bf3524 100644 --- a/src/transport/gnunet-service-transport_plugins.c +++ b/src/transport/gnunet-service-transport_plugins.c | |||
@@ -410,7 +410,7 @@ GST_plugins_a2s (const struct GNUNET_HELLO_Address *address) | |||
410 | api = GST_plugins_printer_find (address->transport_name); | 410 | api = GST_plugins_printer_find (address->transport_name); |
411 | if (NULL == api) | 411 | if (NULL == api) |
412 | { | 412 | { |
413 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 413 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
414 | "Failed to find transport plugin `%s'\n", | 414 | "Failed to find transport plugin `%s'\n", |
415 | address->transport_name); | 415 | address->transport_name); |
416 | return "<plugin unknown>"; | 416 | return "<plugin unknown>"; |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 531a81681..7ff26d6eb 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -1887,6 +1887,9 @@ append_port (void *cls, | |||
1887 | struct Plugin *plugin = ppc->plugin; | 1887 | struct Plugin *plugin = ppc->plugin; |
1888 | char *ret; | 1888 | char *ret; |
1889 | 1889 | ||
1890 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
1891 | "append_port called with hostname `%s'\n", | ||
1892 | hostname); | ||
1890 | if (NULL == hostname) | 1893 | if (NULL == hostname) |
1891 | { | 1894 | { |
1892 | /* Final call, done */ | 1895 | /* Final call, done */ |
@@ -1982,6 +1985,9 @@ tcp_plugin_address_pretty_printer (void *cls, | |||
1982 | else | 1985 | else |
1983 | { | 1986 | { |
1984 | /* invalid address */ | 1987 | /* invalid address */ |
1988 | LOG (GNUNET_ERROR_TYPE_WARNING, | ||
1989 | _("Unexpected address length: %u bytes\n"), | ||
1990 | (unsigned int) addrlen); | ||
1985 | asc (asc_cls, NULL, GNUNET_SYSERR); | 1991 | asc (asc_cls, NULL, GNUNET_SYSERR); |
1986 | asc (asc_cls, NULL, GNUNET_OK); | 1992 | asc (asc_cls, NULL, GNUNET_OK); |
1987 | return; | 1993 | return; |
@@ -1996,6 +2002,8 @@ tcp_plugin_address_pretty_printer (void *cls, | |||
1996 | ppc->asc_cls = asc_cls; | 2002 | ppc->asc_cls = asc_cls; |
1997 | ppc->port = port; | 2003 | ppc->port = port; |
1998 | ppc->options = options; | 2004 | ppc->options = options; |
2005 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
2006 | "Starting DNS reverse lookup\n"); | ||
1999 | ppc->resolver_handle = GNUNET_RESOLVER_hostname_get (sb, | 2007 | ppc->resolver_handle = GNUNET_RESOLVER_hostname_get (sb, |
2000 | sbs, | 2008 | sbs, |
2001 | ! numeric, | 2009 | ! numeric, |
diff --git a/src/transport/transport_api_address_to_string.c b/src/transport/transport_api_address_to_string.c index 26073cd2d..801bcac84 100644 --- a/src/transport/transport_api_address_to_string.c +++ b/src/transport/transport_api_address_to_string.c | |||
@@ -73,6 +73,8 @@ address_response_processor (void *cls, | |||
73 | 73 | ||
74 | if (NULL == msg) | 74 | if (NULL == msg) |
75 | { | 75 | { |
76 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
77 | "Disconnected from transport, address resolution failed\n"); | ||
76 | alucb->cb (alucb->cb_cls, | 78 | alucb->cb (alucb->cb_cls, |
77 | NULL, | 79 | NULL, |
78 | GNUNET_SYSERR); | 80 | GNUNET_SYSERR); |
@@ -99,6 +101,8 @@ address_response_processor (void *cls, | |||
99 | { | 101 | { |
100 | /* expect more replies; as this is not the last | 102 | /* expect more replies; as this is not the last |
101 | call, we must pass the empty string for the address */ | 103 | call, we must pass the empty string for the address */ |
104 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
105 | "Address resolution failed\n"); | ||
102 | alucb->cb (alucb->cb_cls, | 106 | alucb->cb (alucb->cb_cls, |
103 | "", | 107 | "", |
104 | GNUNET_NO); | 108 | GNUNET_NO); |
@@ -190,11 +194,15 @@ GNUNET_TRANSPORT_address_to_string (const struct GNUNET_CONFIGURATION_Handle *cf | |||
190 | } | 194 | } |
191 | client = GNUNET_CLIENT_connect ("transport", cfg); | 195 | client = GNUNET_CLIENT_connect ("transport", cfg); |
192 | if (NULL == client) | 196 | if (NULL == client) |
197 | { | ||
198 | GNUNET_break (0); | ||
193 | return NULL; | 199 | return NULL; |
200 | } | ||
194 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 201 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
195 | "Client %p tries to resolve for peer `%s'address len %u \n", | 202 | "Client %p tries to resolve for peer `%s' address plugin %s len %u\n", |
196 | client, | 203 | client, |
197 | GNUNET_i2s (&address->peer), | 204 | GNUNET_i2s (&address->peer), |
205 | address->transport_name, | ||
198 | address->address_length); | 206 | address->address_length); |
199 | 207 | ||
200 | msg = GNUNET_malloc (len); | 208 | msg = GNUNET_malloc (len); |