From 2503d0fdf24b506999ed927240c55d3863e6163c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 31 Jan 2017 14:44:41 +0100 Subject: add method to record and print DHT routes to DHT command-line tools --- src/dht/gnunet-dht-get.c | 31 +++++++++++++++++++++++++++---- src/dht/gnunet-dht-put.c | 18 ++++++++++++++++-- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c index 8a1b836f6..ce479dc3e 100644 --- a/src/dht/gnunet-dht-get.c +++ b/src/dht/gnunet-dht-get.c @@ -148,13 +148,36 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, const struct GNUNET_PeerIdentity *get_path, unsigned int get_path_length, const struct GNUNET_PeerIdentity *put_path, - unsigned int put_path_length, enum GNUNET_BLOCK_Type type, - size_t size, const void *data) + unsigned int put_path_length, + enum GNUNET_BLOCK_Type type, + size_t size, + const void *data) { FPRINTF (stdout, _("Result %d, type %d:\n%.*s\n"), - result_count, type, - (unsigned int) size, (char *) data); + result_count, + type, + (unsigned int) size, + (char *) data); + if (verbose) + { + FPRINTF (stdout, + " GET path: "); + for (unsigned int i=0;i