aboutsummaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-25 15:48:13 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-25 15:48:13 +0000
commit4eef01098baccf1135faa37a148035a5a42bc774 (patch)
tree413f02ce7794a82a07e61d2843999631d8432579 /src/transport
parent1e10d4997e06555ea34c32be834e4a3fe57f5b0c (diff)
downloadgnunet-4eef01098baccf1135faa37a148035a5a42bc774.tar.gz
gnunet-4eef01098baccf1135faa37a148035a5a42bc774.zip
LRN: I'm tired of seeing something like "ATS tells us to switch to address
'(null)' session 0x497198 for peer `IIH1' in state `S_NOT_CONNECTED'", so i wrote this. - From what i see in the logs, '(null)'s are mostly caused by 0-byte long addresses. I'm not sure whether it is a bug, or a feature (but then, why would ATS tell us to switch to a 0-byte long address?). CG: for inbound connections, ATS tells us to switch to a 0-byte long address (since there is no address) but at the same time gives us a 'struct Session' to use as well. So 0-byte addresses really mean 'inbound' connections.
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/gnunet-service-transport_plugins.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/transport/gnunet-service-transport_plugins.c b/src/transport/gnunet-service-transport_plugins.c
index 9f6961919..e3dd3b26b 100644
--- a/src/transport/gnunet-service-transport_plugins.c
+++ b/src/transport/gnunet-service-transport_plugins.c
@@ -203,12 +203,19 @@ const char *
203GST_plugins_a2s (const struct GNUNET_HELLO_Address *address) 203GST_plugins_a2s (const struct GNUNET_HELLO_Address *address)
204{ 204{
205 struct GNUNET_TRANSPORT_PluginFunctions *api; 205 struct GNUNET_TRANSPORT_PluginFunctions *api;
206 static char unable_to_show[1024];
206 207
207 if (address == NULL) 208 if (address == NULL)
208 return "<inbound>"; 209 return "<inbound>";
209 api = GST_plugins_find (address->transport_name); 210 api = GST_plugins_find (address->transport_name);
210 if ((api == NULL) || (address->address_length == 0) || (address->address == NULL)) 211 if ((api == NULL) || (address->address_length == 0) || (address->address == NULL))
211 return NULL; 212 {
213 snprintf (unable_to_show, 1024,
214 "<unable to stringify %u-byte long address 0x%x used by %s transport>",
215 address->address_length, address, address->transport_name);
216 unable_to_show[1023] = '\0';
217 return unable_to_show;
218 }
212 return api->address_to_string (NULL, address->address, address->address_length); 219 return api->address_to_string (NULL, address->address, address->address_length);
213} 220}
214 221