diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2013-11-04 14:25:12 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2013-11-04 14:25:12 +0000 |
commit | 26593ac2b9aaaae80b86fb07a64289fde1de8410 (patch) | |
tree | be31eb14157b3d9d1f674cea30ead744e2ef0cf8 /src/namestore | |
parent | 09c5ef053f8c990d32babf9b30c81c39abd5a45d (diff) | |
download | gnunet-26593ac2b9aaaae80b86fb07a64289fde1de8410.tar.gz gnunet-26593ac2b9aaaae80b86fb07a64289fde1de8410.zip |
- fix: all records were created as shadow record by default
- new:
-- printing record flags
-- improved error message on deletion
Diffstat (limited to 'src/namestore')
-rw-r--r-- | src/namestore/gnunet-namestore.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c index 205e65f82..5becf0e6c 100644 --- a/src/namestore/gnunet-namestore.c +++ b/src/namestore/gnunet-namestore.c | |||
@@ -300,10 +300,20 @@ del_continuation (void *cls, | |||
300 | const char *emsg) | 300 | const char *emsg) |
301 | { | 301 | { |
302 | del_qe = NULL; | 302 | del_qe = NULL; |
303 | if (success != GNUNET_YES) | 303 | if (GNUNET_NO == success) |
304 | { | ||
304 | fprintf (stderr, | 305 | fprintf (stderr, |
305 | _("Deleting record failed: %s\n"), | 306 | _("Deleting record failed, record does not exist%s%s\n"), |
306 | emsg); | 307 | (NULL != emsg) ? ": " : "", |
308 | (NULL != emsg) ? emsg : ""); | ||
309 | } | ||
310 | if (GNUNET_SYSERR == success) | ||
311 | { | ||
312 | fprintf (stderr, | ||
313 | _("Deleting record failed%s%s\n"), | ||
314 | (NULL != emsg) ? ": " : "", | ||
315 | (NULL != emsg) ? emsg : ""); | ||
316 | } | ||
307 | test_finished (); | 317 | test_finished (); |
308 | } | 318 | } |
309 | 319 | ||
@@ -369,10 +379,13 @@ display_record (void *cls, | |||
369 | ets = GNUNET_STRINGS_absolute_time_to_string (at); | 379 | ets = GNUNET_STRINGS_absolute_time_to_string (at); |
370 | } | 380 | } |
371 | FPRINTF (stdout, | 381 | FPRINTF (stdout, |
372 | "\t%s: %s (%s)\n", | 382 | "\t%s: %s (%s)\t%s\t%s\t%s\n", |
373 | typestring, | 383 | typestring, |
374 | s, | 384 | s, |
375 | ets); | 385 | ets, |
386 | (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PRIVATE)) ? "PRIVATE" : "PUBLIC", | ||
387 | (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_SHADOW_RECORD)) ? "SHADOW" : "", | ||
388 | (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_PENDING)) ? "PENDING" : ""); | ||
376 | GNUNET_free (s); | 389 | GNUNET_free (s); |
377 | } | 390 | } |
378 | FPRINTF (stdout, "%s", "\n"); | 391 | FPRINTF (stdout, "%s", "\n"); |
@@ -432,7 +445,7 @@ get_existing_record (void *cls, | |||
432 | rde->data = data; | 445 | rde->data = data; |
433 | rde->data_size = data_size; | 446 | rde->data_size = data_size; |
434 | rde->record_type = type; | 447 | rde->record_type = type; |
435 | if (1 != shadow) | 448 | if (1 == shadow) |
436 | rde->flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; | 449 | rde->flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD; |
437 | if (1 != public) | 450 | if (1 != public) |
438 | rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE; | 451 | rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE; |
@@ -786,6 +799,7 @@ int | |||
786 | main (int argc, char *const *argv) | 799 | main (int argc, char *const *argv) |
787 | { | 800 | { |
788 | public = -1; | 801 | public = -1; |
802 | shadow = -1; | ||
789 | 803 | ||
790 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 804 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { |
791 | {'a', "add", NULL, | 805 | {'a', "add", NULL, |