summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-transport.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2014-05-27 10:56:24 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2014-05-27 10:56:24 +0000
commit10f2f102658f935148475d5aa2b29afd8a4e85c2 (patch)
tree35a63ab1e36557c8758c1020688894ddbc99a722 /src/transport/gnunet-transport.c
parent920e623e06f97e714d70bee1a084b430178c39ce (diff)
fix address resolution process
Diffstat (limited to 'src/transport/gnunet-transport.c')
-rw-r--r--src/transport/gnunet-transport.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c
index 6ff731431..85f97e04c 100644
--- a/src/transport/gnunet-transport.c
+++ b/src/transport/gnunet-transport.c
@@ -1079,21 +1079,25 @@ process_peer_string (void *cls, const char *address, int res)
{
struct PeerResolutionContext *rc = cls;
- if (address != NULL )
+ if (GNUNET_SYSERR == res)
{
- 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);
- }
- else
- print_info (&rc->id, rc->transport, address, rc->state, rc->state_timeout);
+ 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;
}
- else
+
+ 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 */
+ }
+
+ if (NULL == address)
{
/* done */
GNUNET_assert(address_resolutions > 0);