diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-07-18 00:44:39 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-07-18 00:44:39 +0200 |
commit | 7f4ddbcab8598e3d5e29c23ce883cdfa664408f1 (patch) | |
tree | 5f1b18463f641f24fad519e0aefb60b97d707b52 /src/namestore/plugin_rest_namestore.c | |
parent | 28ab2c446fba4980a8295d59fdf203a028a35dd6 (diff) | |
download | gnunet-7f4ddbcab8598e3d5e29c23ce883cdfa664408f1.tar.gz gnunet-7f4ddbcab8598e3d5e29c23ce883cdfa664408f1.zip |
merge flags into enum for GNUNET_DISK_pipe() API, fixing #6188
Diffstat (limited to 'src/namestore/plugin_rest_namestore.c')
-rw-r--r-- | src/namestore/plugin_rest_namestore.c | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c index 4a05b2833..f1cbfb38b 100644 --- a/src/namestore/plugin_rest_namestore.c +++ b/src/namestore/plugin_rest_namestore.c | |||
@@ -536,6 +536,7 @@ namestore_list_iteration (void *cls, | |||
536 | GNUNET_NAMESTORE_zone_iterator_next (handle->list_it, 1); | 536 | GNUNET_NAMESTORE_zone_iterator_next (handle->list_it, 1); |
537 | } | 537 | } |
538 | 538 | ||
539 | |||
539 | /** | 540 | /** |
540 | * Handle lookup error | 541 | * Handle lookup error |
541 | * | 542 | * |
@@ -553,10 +554,10 @@ ns_lookup_error_cb (void *cls) | |||
553 | 554 | ||
554 | static void | 555 | static void |
555 | ns_get_lookup_cb (void *cls, | 556 | ns_get_lookup_cb (void *cls, |
556 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 557 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
557 | const char *label, | 558 | const char *label, |
558 | unsigned int rd_len, | 559 | unsigned int rd_len, |
559 | const struct GNUNET_GNSRECORD_Data *rd) | 560 | const struct GNUNET_GNSRECORD_Data *rd) |
560 | { | 561 | { |
561 | struct RequestHandle *handle = cls; | 562 | struct RequestHandle *handle = cls; |
562 | struct GNUNET_GNSRECORD_Data rd_filtered[rd_len]; | 563 | struct GNUNET_GNSRECORD_Data rd_filtered[rd_len]; |
@@ -588,8 +589,6 @@ ns_get_lookup_cb (void *cls, | |||
588 | } | 589 | } |
589 | 590 | ||
590 | 591 | ||
591 | |||
592 | |||
593 | /** | 592 | /** |
594 | * Handle namestore GET request | 593 | * Handle namestore GET request |
595 | * | 594 | * |
@@ -666,12 +665,12 @@ namestore_get (struct GNUNET_REST_RequestHandle *con_handle, | |||
666 | } | 665 | } |
667 | handle->record_name = GNUNET_strdup (labelname + 1); | 666 | handle->record_name = GNUNET_strdup (labelname + 1); |
668 | handle->ns_qe = GNUNET_NAMESTORE_records_lookup (handle->ns_handle, | 667 | handle->ns_qe = GNUNET_NAMESTORE_records_lookup (handle->ns_handle, |
669 | handle->zone_pkey, | 668 | handle->zone_pkey, |
670 | handle->record_name, | 669 | handle->record_name, |
671 | &ns_lookup_error_cb, | 670 | &ns_lookup_error_cb, |
672 | handle, | 671 | handle, |
673 | &ns_get_lookup_cb, | 672 | &ns_get_lookup_cb, |
674 | handle); | 673 | handle); |
675 | if (NULL == handle->ns_qe) | 674 | if (NULL == handle->ns_qe) |
676 | { | 675 | { |
677 | handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); | 676 | handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); |
@@ -681,7 +680,6 @@ namestore_get (struct GNUNET_REST_RequestHandle *con_handle, | |||
681 | } | 680 | } |
682 | 681 | ||
683 | 682 | ||
684 | |||
685 | static void | 683 | static void |
686 | ns_lookup_cb (void *cls, | 684 | ns_lookup_cb (void *cls, |
687 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, | 685 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, |
@@ -702,12 +700,12 @@ ns_lookup_cb (void *cls, | |||
702 | for (j = 0; j < handle->rd_count; j++) | 700 | for (j = 0; j < handle->rd_count; j++) |
703 | rd_new[i + j] = handle->rd[j]; | 701 | rd_new[i + j] = handle->rd[j]; |
704 | handle->ns_qe = GNUNET_NAMESTORE_records_store (handle->ns_handle, | 702 | handle->ns_qe = GNUNET_NAMESTORE_records_store (handle->ns_handle, |
705 | handle->zone_pkey, | 703 | handle->zone_pkey, |
706 | handle->record_name, | 704 | handle->record_name, |
707 | i + j, | 705 | i + j, |
708 | rd_new, | 706 | rd_new, |
709 | &create_finished, | 707 | &create_finished, |
710 | handle); | 708 | handle); |
711 | if (NULL == handle->ns_qe) | 709 | if (NULL == handle->ns_qe) |
712 | { | 710 | { |
713 | handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); | 711 | handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); |
@@ -794,12 +792,12 @@ namestore_add_or_update (struct GNUNET_REST_RequestHandle *con_handle, | |||
794 | } | 792 | } |
795 | handle->zone_pkey = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego); | 793 | handle->zone_pkey = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego); |
796 | handle->ns_qe = GNUNET_NAMESTORE_records_lookup (handle->ns_handle, | 794 | handle->ns_qe = GNUNET_NAMESTORE_records_lookup (handle->ns_handle, |
797 | handle->zone_pkey, | 795 | handle->zone_pkey, |
798 | handle->record_name, | 796 | handle->record_name, |
799 | &ns_lookup_error_cb, | 797 | &ns_lookup_error_cb, |
800 | handle, | 798 | handle, |
801 | &ns_lookup_cb, | 799 | &ns_lookup_cb, |
802 | handle); | 800 | handle); |
803 | if (NULL == handle->ns_qe) | 801 | if (NULL == handle->ns_qe) |
804 | { | 802 | { |
805 | handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); | 803 | handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); |
@@ -898,9 +896,9 @@ namestore_delete (struct GNUNET_REST_RequestHandle *con_handle, | |||
898 | handle->zone_pkey, | 896 | handle->zone_pkey, |
899 | handle->record_name, | 897 | handle->record_name, |
900 | 0, | 898 | 0, |
901 | NULL, | 899 | NULL, |
902 | &del_finished, | 900 | &del_finished, |
903 | handle); | 901 | handle); |
904 | if (NULL == handle->ns_qe) | 902 | if (NULL == handle->ns_qe) |
905 | { | 903 | { |
906 | handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); | 904 | handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); |