From 10f2f102658f935148475d5aa2b29afd8a4e85c2 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 27 May 2014 10:56:24 +0000 Subject: fix address resolution process --- src/transport/gnunet-transport.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'src') 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); -- cgit v1.2.3