From: Christian Grothoff Date: Tue, 7 Feb 2012 10:23:53 +0000 (+0000) Subject: -patch from #1972 to display disconnects instead of exiting X-Git-Tag: initial-import-from-subversion-38251~14924 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1f25c506a8543a0f0b98524644ebb177188f4329;p=oweals%2Fgnunet.git -patch from #1972 to display disconnects instead of exiting --- diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index 4b0c08f54..5142ee642 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c @@ -460,13 +460,11 @@ process_string (void *cls, const char *address) } /** - * Function to call with a human-readable format of an address + * Function to call with a binary address * * @param cls closure * @param peer identity of the peer - * @param transport name of the plugin - * @param addr binary address - * @param addrlen number of bytes in addr + * @param address binary address (NULL on disconnect) */ static void process_address (void *cls, const struct GNUNET_PeerIdentity *peer, @@ -474,12 +472,18 @@ process_address (void *cls, const struct GNUNET_PeerIdentity *peer, { const struct GNUNET_CONFIGURATION_Handle *cfg = cls; - if ((address == NULL) || (peer == NULL)) + if (peer == NULL) { /* done */ return; } + if (address == NULL) + { + FPRINTF (stdout, _("Peer `%s' disconnected\n"), GNUNET_i2s (peer)); + return; + } + /* Resolve address to string */ GNUNET_TRANSPORT_address_to_string (cfg, address, numeric, GNUNET_TIME_UNIT_MINUTES, &process_string,