diff options
Diffstat (limited to 'src/dht/gnunet-dht-get.c')
-rw-r--r-- | src/dht/gnunet-dht-get.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c index 842ec6270..3742ed739 100644 --- a/src/dht/gnunet-dht-get.c +++ b/src/dht/gnunet-dht-get.c | |||
@@ -2,20 +2,18 @@ | |||
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2009 GNUnet e.V. | 3 | Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2009 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | it under the terms of the GNU General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation, either version 3 of the License, |
8 | option) any later version. | 8 | or (at your option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 17 | */ |
20 | /** | 18 | /** |
21 | * @file dht/gnunet-dht-get.c | 19 | * @file dht/gnunet-dht-get.c |
@@ -154,7 +152,9 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
154 | const void *data) | 152 | const void *data) |
155 | { | 153 | { |
156 | FPRINTF (stdout, | 154 | FPRINTF (stdout, |
157 | _("Result %d, type %d:\n%.*s\n"), | 155 | (GNUNET_BLOCK_TYPE_TEST == type) |
156 | ? _("Result %d, type %d:\n%.*s\n") | ||
157 | : _("Result %d, type %d:\n"), | ||
158 | result_count, | 158 | result_count, |
159 | type, | 159 | type, |
160 | (unsigned int) size, | 160 | (unsigned int) size, |
@@ -196,8 +196,6 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
196 | { | 196 | { |
197 | struct GNUNET_HashCode key; | 197 | struct GNUNET_HashCode key; |
198 | 198 | ||
199 | |||
200 | |||
201 | cfg = c; | 199 | cfg = c; |
202 | if (NULL == query_key) | 200 | if (NULL == query_key) |
203 | { | 201 | { |
@@ -215,17 +213,22 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
215 | query_type = GNUNET_BLOCK_TYPE_TEST; | 213 | query_type = GNUNET_BLOCK_TYPE_TEST; |
216 | GNUNET_CRYPTO_hash (query_key, strlen (query_key), &key); | 214 | GNUNET_CRYPTO_hash (query_key, strlen (query_key), &key); |
217 | if (verbose) | 215 | if (verbose) |
218 | FPRINTF (stderr, "%s `%s' \n", _("Issueing DHT GET with key"), GNUNET_h2s_full (&key)); | 216 | FPRINTF (stderr, "%s `%s' \n", |
217 | _("Issueing DHT GET with key"), | ||
218 | GNUNET_h2s_full (&key)); | ||
219 | GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL); | 219 | GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL); |
220 | tt = GNUNET_SCHEDULER_add_delayed (timeout_request, | 220 | tt = GNUNET_SCHEDULER_add_delayed (timeout_request, |
221 | &timeout_task, NULL); | 221 | &timeout_task, |
222 | NULL); | ||
222 | get_handle = | 223 | get_handle = |
223 | GNUNET_DHT_get_start (dht_handle, query_type, &key, replication, | 224 | GNUNET_DHT_get_start (dht_handle, query_type, &key, replication, |
224 | (demultixplex_everywhere) ? GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE : GNUNET_DHT_RO_NONE, | 225 | (demultixplex_everywhere) ? GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE : GNUNET_DHT_RO_NONE, |
225 | NULL, 0, &get_result_iterator, NULL); | 226 | NULL, 0, |
226 | 227 | &get_result_iterator, | |
228 | NULL); | ||
227 | } | 229 | } |
228 | 230 | ||
231 | |||
229 | /** | 232 | /** |
230 | * Entry point for gnunet-dht-get | 233 | * Entry point for gnunet-dht-get |
231 | * | 234 | * |
@@ -236,15 +239,12 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
236 | int | 239 | int |
237 | main (int argc, char *const *argv) | 240 | main (int argc, char *const *argv) |
238 | { | 241 | { |
239 | |||
240 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 242 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
241 | |||
242 | GNUNET_GETOPT_option_string ('k', | 243 | GNUNET_GETOPT_option_string ('k', |
243 | "key", | 244 | "key", |
244 | "KEY", | 245 | "KEY", |
245 | gettext_noop ("the query key"), | 246 | gettext_noop ("the query key"), |
246 | &query_key), | 247 | &query_key), |
247 | |||
248 | GNUNET_GETOPT_option_uint ('r', | 248 | GNUNET_GETOPT_option_uint ('r', |
249 | "replication", | 249 | "replication", |
250 | "LEVEL", | 250 | "LEVEL", |