aboutsummaryrefslogtreecommitdiff
path: root/src/transport/gnunet-transport.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-02-07 10:23:53 +0000
committerChristian Grothoff <christian@grothoff.org>2012-02-07 10:23:53 +0000
commit1f25c506a8543a0f0b98524644ebb177188f4329 (patch)
tree06cabc826a73c7f1927c3ee06ecca820e504bd75 /src/transport/gnunet-transport.c
parentcc28a6e4b02aa052e34a62081a93205e1ef61449 (diff)
downloadgnunet-1f25c506a8543a0f0b98524644ebb177188f4329.tar.gz
gnunet-1f25c506a8543a0f0b98524644ebb177188f4329.zip
-patch from #1972 to display disconnects instead of exiting
Diffstat (limited to 'src/transport/gnunet-transport.c')
-rw-r--r--src/transport/gnunet-transport.c14
1 files 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)
460} 460}
461 461
462/** 462/**
463 * Function to call with a human-readable format of an address 463 * Function to call with a binary address
464 * 464 *
465 * @param cls closure 465 * @param cls closure
466 * @param peer identity of the peer 466 * @param peer identity of the peer
467 * @param transport name of the plugin 467 * @param address binary address (NULL on disconnect)
468 * @param addr binary address
469 * @param addrlen number of bytes in addr
470 */ 468 */
471static void 469static void
472process_address (void *cls, const struct GNUNET_PeerIdentity *peer, 470process_address (void *cls, const struct GNUNET_PeerIdentity *peer,
@@ -474,12 +472,18 @@ process_address (void *cls, const struct GNUNET_PeerIdentity *peer,
474{ 472{
475 const struct GNUNET_CONFIGURATION_Handle *cfg = cls; 473 const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
476 474
477 if ((address == NULL) || (peer == NULL)) 475 if (peer == NULL)
478 { 476 {
479 /* done */ 477 /* done */
480 return; 478 return;
481 } 479 }
482 480
481 if (address == NULL)
482 {
483 FPRINTF (stdout, _("Peer `%s' disconnected\n"), GNUNET_i2s (peer));
484 return;
485 }
486
483 /* Resolve address to string */ 487 /* Resolve address to string */
484 GNUNET_TRANSPORT_address_to_string (cfg, address, numeric, 488 GNUNET_TRANSPORT_address_to_string (cfg, address, numeric,
485 GNUNET_TIME_UNIT_MINUTES, &process_string, 489 GNUNET_TIME_UNIT_MINUTES, &process_string,