aboutsummaryrefslogtreecommitdiff
path: root/src/namestore
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-07-18 00:44:39 +0200
committerChristian Grothoff <christian@grothoff.org>2020-07-18 00:44:39 +0200
commit7f4ddbcab8598e3d5e29c23ce883cdfa664408f1 (patch)
tree5f1b18463f641f24fad519e0aefb60b97d707b52 /src/namestore
parent28ab2c446fba4980a8295d59fdf203a028a35dd6 (diff)
downloadgnunet-7f4ddbcab8598e3d5e29c23ce883cdfa664408f1.tar.gz
gnunet-7f4ddbcab8598e3d5e29c23ce883cdfa664408f1.zip
merge flags into enum for GNUNET_DISK_pipe() API, fixing #6188
Diffstat (limited to 'src/namestore')
-rw-r--r--src/namestore/gnunet-namestore.c3
-rw-r--r--src/namestore/gnunet-service-namestore.c2
-rw-r--r--src/namestore/plugin_rest_namestore.c54
3 files changed, 29 insertions, 30 deletions
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 704a4abf7..07d045b90 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -1048,7 +1048,8 @@ run_with_zone_pkey (const struct GNUNET_CONFIGURATION_Handle *cfg)
1048 return; 1048 return;
1049 } 1049 }
1050 add = 1; 1050 add = 1;
1051 typestring = GNUNET_strdup (GNUNET_GNSRECORD_number_to_typename (GNUNET_GNSRECORD_TYPE_NICK)); 1051 typestring = GNUNET_strdup (GNUNET_GNSRECORD_number_to_typename (
1052 GNUNET_GNSRECORD_TYPE_NICK));
1052 name = GNUNET_strdup (GNUNET_GNS_EMPTY_LABEL_AT); 1053 name = GNUNET_strdup (GNUNET_GNS_EMPTY_LABEL_AT);
1053 value = GNUNET_strdup (nickstring); 1054 value = GNUNET_strdup (nickstring);
1054 is_public = 0; 1055 is_public = 0;
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index ede566d40..bb8138e23 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -915,7 +915,7 @@ refresh_block (struct NamestoreClient *nc,
915 nick = get_nick_record (zone_key); 915 nick = get_nick_record (zone_key);
916 res_count = rd_count; 916 res_count = rd_count;
917 res = (struct GNUNET_GNSRECORD_Data *) rd; /* fixme: a bit unclean... */ 917 res = (struct GNUNET_GNSRECORD_Data *) rd; /* fixme: a bit unclean... */
918 if (NULL != nick && (0 != strcmp (name, GNUNET_GNS_EMPTY_LABEL_AT))) 918 if ((NULL != nick) && (0 != strcmp (name, GNUNET_GNS_EMPTY_LABEL_AT)))
919 { 919 {
920 nick->flags = 920 nick->flags =
921 (nick->flags | GNUNET_GNSRECORD_RF_PRIVATE) ^ GNUNET_GNSRECORD_RF_PRIVATE; 921 (nick->flags | GNUNET_GNSRECORD_RF_PRIVATE) ^ GNUNET_GNSRECORD_RF_PRIVATE;
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
554static void 555static void
555ns_get_lookup_cb (void *cls, 556ns_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
685static void 683static void
686ns_lookup_cb (void *cls, 684ns_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);