aboutsummaryrefslogtreecommitdiff
path: root/src/dht/gnunet-dht-get.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/gnunet-dht-get.c')
-rw-r--r--src/dht/gnunet-dht-get.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c
index 842ec6270..afcd5422c 100644
--- a/src/dht/gnunet-dht-get.c
+++ b/src/dht/gnunet-dht-get.c
@@ -154,7 +154,9 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp,
154 const void *data) 154 const void *data)
155{ 155{
156 FPRINTF (stdout, 156 FPRINTF (stdout,
157 _("Result %d, type %d:\n%.*s\n"), 157 (GNUNET_BLOCK_TYPE_TEST == type)
158 ? _("Result %d, type %d:\n%.*s\n")
159 : _("Result %d, type %d:\n"),
158 result_count, 160 result_count,
159 type, 161 type,
160 (unsigned int) size, 162 (unsigned int) size,
@@ -196,8 +198,6 @@ run (void *cls, char *const *args, const char *cfgfile,
196{ 198{
197 struct GNUNET_HashCode key; 199 struct GNUNET_HashCode key;
198 200
199
200
201 cfg = c; 201 cfg = c;
202 if (NULL == query_key) 202 if (NULL == query_key)
203 { 203 {
@@ -215,17 +215,22 @@ run (void *cls, char *const *args, const char *cfgfile,
215 query_type = GNUNET_BLOCK_TYPE_TEST; 215 query_type = GNUNET_BLOCK_TYPE_TEST;
216 GNUNET_CRYPTO_hash (query_key, strlen (query_key), &key); 216 GNUNET_CRYPTO_hash (query_key, strlen (query_key), &key);
217 if (verbose) 217 if (verbose)
218 FPRINTF (stderr, "%s `%s' \n", _("Issueing DHT GET with key"), GNUNET_h2s_full (&key)); 218 FPRINTF (stderr, "%s `%s' \n",
219 _("Issueing DHT GET with key"),
220 GNUNET_h2s_full (&key));
219 GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL); 221 GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL);
220 tt = GNUNET_SCHEDULER_add_delayed (timeout_request, 222 tt = GNUNET_SCHEDULER_add_delayed (timeout_request,
221 &timeout_task, NULL); 223 &timeout_task,
224 NULL);
222 get_handle = 225 get_handle =
223 GNUNET_DHT_get_start (dht_handle, query_type, &key, replication, 226 GNUNET_DHT_get_start (dht_handle, query_type, &key, replication,
224 (demultixplex_everywhere) ? GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE : GNUNET_DHT_RO_NONE, 227 (demultixplex_everywhere) ? GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE : GNUNET_DHT_RO_NONE,
225 NULL, 0, &get_result_iterator, NULL); 228 NULL, 0,
226 229 &get_result_iterator,
230 NULL);
227} 231}
228 232
233
229/** 234/**
230 * Entry point for gnunet-dht-get 235 * Entry point for gnunet-dht-get
231 * 236 *
@@ -236,15 +241,12 @@ run (void *cls, char *const *args, const char *cfgfile,
236int 241int
237main (int argc, char *const *argv) 242main (int argc, char *const *argv)
238{ 243{
239
240 struct GNUNET_GETOPT_CommandLineOption options[] = { 244 struct GNUNET_GETOPT_CommandLineOption options[] = {
241
242 GNUNET_GETOPT_option_string ('k', 245 GNUNET_GETOPT_option_string ('k',
243 "key", 246 "key",
244 "KEY", 247 "KEY",
245 gettext_noop ("the query key"), 248 gettext_noop ("the query key"),
246 &query_key), 249 &query_key),
247
248 GNUNET_GETOPT_option_uint ('r', 250 GNUNET_GETOPT_option_uint ('r',
249 "replication", 251 "replication",
250 "LEVEL", 252 "LEVEL",