-allow caller ID to differ from zone used for resolution
[oweals/gnunet.git] / src / transport / gnunet-transport.c
index d4e16face8ef4a845d967af58f60e1ed99b3ea6a..85f97e04c7edc46e719e56c827a78c9d534416d0 100644 (file)
@@ -1079,12 +1079,25 @@ process_peer_string (void *cls, const char *address, int res)
 {
   struct PeerResolutionContext *rc = cls;
 
-  if (address != NULL )
+  if (GNUNET_SYSERR == res)
+  {
+    FPRINTF (stderr, "Failed to convert address for peer `%s' plugin `%s' length %lu to string \n",
+        GNUNET_i2s (&rc->id),
+        rc->addrcp->transport_name,
+        rc->addrcp->address_length);
+    print_info (&rc->id, rc->transport, NULL, rc->state, rc->state_timeout);
+    rc->printed = GNUNET_YES;
+    return;
+  }
+
+  if ((GNUNET_OK == res) && (address != NULL))
   {
     print_info (&rc->id, rc->transport, address, rc->state, rc->state_timeout);
     rc->printed = GNUNET_YES;
+    return; /* Wait for done call */
   }
-  else
+
+  if (NULL == address)
   {
     /* done */
     GNUNET_assert(address_resolutions > 0);
@@ -1099,7 +1112,7 @@ process_peer_string (void *cls, const char *address, int res)
       }
       else
       {
-        print_info (&rc->id, rc->transport, "<unable to resolve address>",
+        print_info (&rc->id, rc->transport, NULL,
             rc->state, rc->state_timeout);
       }
     }