gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r18319 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r18319 - gnunet/src/transport
Date: Fri, 25 Nov 2011 16:48:13 +0100

Author: grothoff
Date: 2011-11-25 16:48:13 +0100 (Fri, 25 Nov 2011)
New Revision: 18319

Modified:
   gnunet/src/transport/gnunet-service-transport_plugins.c
Log:
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.


Modified: gnunet/src/transport/gnunet-service-transport_plugins.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_plugins.c     2011-11-25 
15:38:24 UTC (rev 18318)
+++ gnunet/src/transport/gnunet-service-transport_plugins.c     2011-11-25 
15:48:13 UTC (rev 18319)
@@ -203,12 +203,19 @@
 GST_plugins_a2s (const struct GNUNET_HELLO_Address *address)
 {
   struct GNUNET_TRANSPORT_PluginFunctions *api;
+  static char unable_to_show[1024];
 
   if (address == NULL)
     return "<inbound>";
   api = GST_plugins_find (address->transport_name);
   if ((api == NULL) || (address->address_length == 0) || (address->address == 
NULL))
-    return NULL;
+  {
+    snprintf (unable_to_show, 1024,
+        "<unable to stringify %u-byte long address 0x%x used by %s transport>",
+        address->address_length, address, address->transport_name);
+    unable_to_show[1023] = '\0';
+    return unable_to_show;
+  }
   return api->address_to_string (NULL, address->address, 
address->address_length);
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]