diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-04 22:50:32 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-09 20:38:10 +0100 |
commit | 065ecd9a0f92ecafd6c552494a6310b92cc08597 (patch) | |
tree | 0b3ca58f4d2a04278033788063d0b432e90c92aa /src/reclaim/gnunet-reclaim.c | |
parent | 73de82ef85076f0421af025887f0053e6c652b09 (diff) | |
download | gnunet-065ecd9a0f92ecafd6c552494a6310b92cc08597.tar.gz gnunet-065ecd9a0f92ecafd6c552494a6310b92cc08597.zip |
bugfixes
Diffstat (limited to 'src/reclaim/gnunet-reclaim.c')
-rw-r--r-- | src/reclaim/gnunet-reclaim.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/src/reclaim/gnunet-reclaim.c b/src/reclaim/gnunet-reclaim.c index 35c1258f5..3e31fef4c 100644 --- a/src/reclaim/gnunet-reclaim.c +++ b/src/reclaim/gnunet-reclaim.c | |||
@@ -208,6 +208,8 @@ do_cleanup (void *cls) | |||
208 | GNUNET_RECLAIM_cancel (reclaim_op); | 208 | GNUNET_RECLAIM_cancel (reclaim_op); |
209 | if (NULL != attr_iterator) | 209 | if (NULL != attr_iterator) |
210 | GNUNET_RECLAIM_get_attributes_stop (attr_iterator); | 210 | GNUNET_RECLAIM_get_attributes_stop (attr_iterator); |
211 | if (NULL != attest_iterator) | ||
212 | GNUNET_RECLAIM_get_attestations_stop (attest_iterator); | ||
211 | if (NULL != ticket_iterator) | 213 | if (NULL != ticket_iterator) |
212 | GNUNET_RECLAIM_ticket_iteration_stop (ticket_iterator); | 214 | GNUNET_RECLAIM_ticket_iteration_stop (ticket_iterator); |
213 | if (NULL != reclaim_handle) | 215 | if (NULL != reclaim_handle) |
@@ -467,7 +469,6 @@ iter_finished (void *cls) | |||
467 | { | 469 | { |
468 | claim->attestation = attestation; | 470 | claim->attestation = attestation; |
469 | } | 471 | } |
470 | else | ||
471 | reclaim_op = GNUNET_RECLAIM_attribute_store (reclaim_handle, | 472 | reclaim_op = GNUNET_RECLAIM_attribute_store (reclaim_handle, |
472 | pkey, | 473 | pkey, |
473 | claim, | 474 | claim, |
@@ -569,13 +570,14 @@ static void | |||
569 | attest_iter_finished (void *cls) | 570 | attest_iter_finished (void *cls) |
570 | { | 571 | { |
571 | attest_iterator = NULL; | 572 | attest_iterator = NULL; |
572 | //Add new attestation | 573 | |
574 | // Add new attestation | ||
573 | if ((NULL != attestation_name) && | 575 | if ((NULL != attestation_name) && |
574 | (NULL != attr_value)) | 576 | (NULL != attr_value)) |
575 | { | 577 | { |
576 | struct GNUNET_RECLAIM_Attestation *attestation = | 578 | struct GNUNET_RECLAIM_Attestation *attestation = |
577 | GNUNET_RECLAIM_attestation_new (attestation_name, | 579 | GNUNET_RECLAIM_attestation_new (attestation_name, |
578 | GNUNET_RECLAIM_ATTESTATION_TYPE_JWT, //FIXME hardcoded | 580 | GNUNET_RECLAIM_ATTESTATION_TYPE_JWT, // FIXME hardcoded |
579 | attr_value, | 581 | attr_value, |
580 | strlen (attr_value)); | 582 | strlen (attr_value)); |
581 | reclaim_op = GNUNET_RECLAIM_attestation_store (reclaim_handle, | 583 | reclaim_op = GNUNET_RECLAIM_attestation_store (reclaim_handle, |
@@ -587,19 +589,20 @@ attest_iter_finished (void *cls) | |||
587 | return; | 589 | return; |
588 | 590 | ||
589 | } | 591 | } |
590 | if (! list_attestations) | 592 | if (list_attestations) |
591 | { | 593 | { |
592 | attr_iterator = GNUNET_RECLAIM_get_attributes_start (reclaim_handle, | 594 | cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); |
593 | pkey, | 595 | return; |
594 | &iter_error, | ||
595 | NULL, | ||
596 | &iter_cb, | ||
597 | NULL, | ||
598 | &iter_finished, | ||
599 | NULL); | ||
600 | |||
601 | } | 596 | } |
602 | cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL); | 597 | attr_iterator = GNUNET_RECLAIM_get_attributes_start (reclaim_handle, |
598 | pkey, | ||
599 | &iter_error, | ||
600 | NULL, | ||
601 | &iter_cb, | ||
602 | NULL, | ||
603 | &iter_finished, | ||
604 | NULL); | ||
605 | |||
603 | } | 606 | } |
604 | 607 | ||
605 | 608 | ||
@@ -620,7 +623,7 @@ attest_iter_cb (void *cls, | |||
620 | attest_str = GNUNET_RECLAIM_attestation_value_to_string (attest->type, | 623 | attest_str = GNUNET_RECLAIM_attestation_value_to_string (attest->type, |
621 | attest->data, | 624 | attest->data, |
622 | attest->data_size); | 625 | attest->data_size); |
623 | attest_type = GNUNET_RECLAIM_attribute_number_to_typename (attest->type); | 626 | attest_type = GNUNET_RECLAIM_attestation_number_to_typename (attest->type); |
624 | id = GNUNET_STRINGS_data_to_string_alloc (&attest->id, sizeof(attest->id)); | 627 | id = GNUNET_STRINGS_data_to_string_alloc (&attest->id, sizeof(attest->id)); |
625 | fprintf (stdout, | 628 | fprintf (stdout, |
626 | "Name: %s; Value: %s (%s); Flag %u; ID: %s\n", | 629 | "Name: %s; Value: %s (%s); Flag %u; ID: %s\n", |
@@ -662,19 +665,6 @@ start_process () | |||
662 | NULL); | 665 | NULL); |
663 | return; | 666 | return; |
664 | } | 667 | } |
665 | if (list_attestations) | ||
666 | { | ||
667 | attest_iterator = GNUNET_RECLAIM_get_attestations_start (reclaim_handle, | ||
668 | pkey, | ||
669 | &iter_error, | ||
670 | NULL, | ||
671 | &attest_iter_cb, | ||
672 | NULL, | ||
673 | & | ||
674 | attest_iter_finished, | ||
675 | NULL); | ||
676 | return; | ||
677 | } | ||
678 | 668 | ||
679 | if ((NULL != rp) && | 669 | if ((NULL != rp) && |
680 | (GNUNET_OK != | 670 | (GNUNET_OK != |
@@ -697,6 +687,16 @@ start_process () | |||
697 | 687 | ||
698 | attr_list = GNUNET_new (struct GNUNET_RECLAIM_AttributeList); | 688 | attr_list = GNUNET_new (struct GNUNET_RECLAIM_AttributeList); |
699 | claim = NULL; | 689 | claim = NULL; |
690 | attest_iterator = GNUNET_RECLAIM_get_attestations_start (reclaim_handle, | ||
691 | pkey, | ||
692 | &iter_error, | ||
693 | NULL, | ||
694 | &attest_iter_cb, | ||
695 | NULL, | ||
696 | & | ||
697 | attest_iter_finished, | ||
698 | NULL); | ||
699 | |||
700 | } | 700 | } |
701 | 701 | ||
702 | 702 | ||
@@ -799,7 +799,8 @@ main (int argc, char *const argv[]) | |||
799 | GNUNET_GETOPT_option_string ('I', | 799 | GNUNET_GETOPT_option_string ('I', |
800 | "Attestation ID", | 800 | "Attestation ID", |
801 | "ATTESTATION_ID", | 801 | "ATTESTATION_ID", |
802 | gettext_noop ("Attestation to use for attribute"), | 802 | gettext_noop ( |
803 | "Attestation to use for attribute"), | ||
803 | &attestation_id), | 804 | &attestation_id), |
804 | GNUNET_GETOPT_option_string ('N', | 805 | GNUNET_GETOPT_option_string ('N', |
805 | "attestation-name", | 806 | "attestation-name", |