aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-dht-get.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-09-14 09:02:31 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-09-14 09:02:31 +0000
commit475b609e3627e489ad234cb9679e7df15e012fcb (patch)
tree87a58d87710b86aeb955c585e497f878e2d08990 /src/dht/gnunet-dht-get.c
parent1b05f977d5fff527287ac0de18405d958b9307bb (diff)
downloadgnunet-475b609e3627e489ad234cb9679e7df15e012fcb.tar.gz
gnunet-475b609e3627e489ad234cb9679e7df15e012fcb.zip
demux everywhere option for CLI
Diffstat (limited to 'src/dht/gnunet-dht-get.c')
-rw-r--r--src/dht/gnunet-dht-get.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c
index 2dff4767f..345a58a13 100644
--- a/src/dht/gnunet-dht-get.c
+++ b/src/dht/gnunet-dht-get.c
@@ -52,6 +52,11 @@ static struct GNUNET_TIME_Relative timeout_request = { 60000 };
52static int verbose; 52static int verbose;
53 53
54/** 54/**
55 * Use DHT demultixplex_everywhere
56 */
57static int demultixplex_everywhere;
58
59/**
55 * Handle to the DHT 60 * Handle to the DHT
56 */ 61 */
57static struct GNUNET_DHT_Handle *dht_handle; 62static struct GNUNET_DHT_Handle *dht_handle;
@@ -161,12 +166,14 @@ run (void *cls, char *const *args, const char *cfgfile,
161 if (query_type == GNUNET_BLOCK_TYPE_ANY) /* Type of data not set */ 166 if (query_type == GNUNET_BLOCK_TYPE_ANY) /* Type of data not set */
162 query_type = GNUNET_BLOCK_TYPE_TEST; 167 query_type = GNUNET_BLOCK_TYPE_TEST;
163 GNUNET_CRYPTO_hash (query_key, strlen (query_key), &key); 168 GNUNET_CRYPTO_hash (query_key, strlen (query_key), &key);
169 if (verbose)
170 FPRINTF (stderr, "%s `%s' \n", _("Issueing DHT GET with key"), GNUNET_h2s_full (&key));
164 GNUNET_SCHEDULER_add_delayed (timeout_request, 171 GNUNET_SCHEDULER_add_delayed (timeout_request,
165 &cleanup_task, NULL); 172 &cleanup_task, NULL);
166 get_handle = 173 get_handle =
167 GNUNET_DHT_get_start (dht_handle, query_type, &key, replication, 174 GNUNET_DHT_get_start (dht_handle, query_type, &key, replication,
168 GNUNET_DHT_RO_NONE, NULL, 0, &get_result_iterator, 175 (demultixplex_everywhere) ? GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE : GNUNET_DHT_RO_NONE,
169 NULL); 176 NULL, 0, &get_result_iterator, NULL);
170 177
171} 178}
172 179
@@ -187,6 +194,9 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
187 {'T', "timeout", "TIMEOUT", 194 {'T', "timeout", "TIMEOUT",
188 gettext_noop ("how long to execute this query before giving up?"), 195 gettext_noop ("how long to execute this query before giving up?"),
189 1, &GNUNET_GETOPT_set_relative_time, &timeout_request}, 196 1, &GNUNET_GETOPT_set_relative_time, &timeout_request},
197 {'x', "demultiplex", NULL,
198 gettext_noop ("use DHT's demultiplex everywhere option"),
199 0, &GNUNET_GETOPT_set_one, &demultixplex_everywhere},
190 {'V', "verbose", NULL, 200 {'V', "verbose", NULL,
191 gettext_noop ("be verbose (print progress information)"), 201 gettext_noop ("be verbose (print progress information)"),
192 0, &GNUNET_GETOPT_set_one, &verbose}, 202 0, &GNUNET_GETOPT_set_one, &verbose},