From 1f25c506a8543a0f0b98524644ebb177188f4329 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 7 Feb 2012 10:23:53 +0000 Subject: [PATCH] -patch from #1972 to display disconnects instead of exiting --- src/transport/gnunet-transport.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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, -- 2.25.1