aboutsummaryrefslogtreecommitdiff
path: root/src/zonemaster/gnunet-service-zonemaster.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/zonemaster/gnunet-service-zonemaster.c')
-rw-r--r--src/zonemaster/gnunet-service-zonemaster.c51
1 files changed, 17 insertions, 34 deletions
diff --git a/src/zonemaster/gnunet-service-zonemaster.c b/src/zonemaster/gnunet-service-zonemaster.c
index c6b86bf71..dba1b24ce 100644
--- a/src/zonemaster/gnunet-service-zonemaster.c
+++ b/src/zonemaster/gnunet-service-zonemaster.c
@@ -683,46 +683,28 @@ put_gns_record (void *cls,
683 const struct GNUNET_IDENTITY_PrivateKey *key, 683 const struct GNUNET_IDENTITY_PrivateKey *key,
684 const char *label, 684 const char *label,
685 unsigned int rd_count, 685 unsigned int rd_count,
686 const struct GNUNET_GNSRECORD_Data *rd) 686 const struct GNUNET_GNSRECORD_Data *rd,
687 struct GNUNET_TIME_Absolute expire)
687{ 688{
688 struct GNUNET_GNSRECORD_Data rd_public[rd_count];
689 unsigned int rd_public_count;
690 struct DhtPutActivity *ma; 689 struct DhtPutActivity *ma;
691 struct GNUNET_TIME_Absolute expire;
692 char *emsg;
693 690
694 (void) cls; 691 (void) cls;
695 ns_iteration_left--; 692 ns_iteration_left--;
696 if (GNUNET_OK != GNUNET_GNSRECORD_convert_records_for_export (label, 693 if (0 == rd_count)
697 rd,
698 rd_count,
699 rd_public,
700 &rd_public_count,
701 &expire,
702 &emsg))
703 {
704 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
705 "Record set inconsistent, moving to next record set: %s\n",
706 emsg);
707 GNUNET_free (emsg);
708 check_zone_namestore_next ();
709 return;
710 }
711 if (0 == rd_public_count)
712 { 694 {
713 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 695 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
714 "Record set empty, moving to next record set\n"); 696 "Record set empty, moving to next record set\n");
715 check_zone_namestore_next (); 697 check_zone_namestore_next ();
716 return; 698 return;
717 } 699 }
718 for (unsigned int i = 0; i < rd_public_count; i++) 700 for (unsigned int i = 0; i < rd_count; i++)
719 { 701 {
720 if (0 != (rd_public[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION)) 702 if (0 != (rd[i].flags & GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION))
721 { 703 {
722 /* GNUNET_GNSRECORD_block_create will convert to absolute time; 704 /* GNUNET_GNSRECORD_block_create will convert to absolute time;
723 we just need to adjust our iteration frequency */ 705 we just need to adjust our iteration frequency */
724 min_relative_record_time.rel_value_us = 706 min_relative_record_time.rel_value_us =
725 GNUNET_MIN (rd_public[i].expiration_time, 707 GNUNET_MIN (rd[i].expiration_time,
726 min_relative_record_time.rel_value_us); 708 min_relative_record_time.rel_value_us);
727 } 709 }
728 } 710 }
@@ -736,8 +718,8 @@ put_gns_record (void *cls,
736 ma->start_date = GNUNET_TIME_absolute_get (); 718 ma->start_date = GNUNET_TIME_absolute_get ();
737 ma->ph = perform_dht_put (key, 719 ma->ph = perform_dht_put (key,
738 label, 720 label,
739 rd_public, 721 rd,
740 rd_public_count, 722 rd_count,
741 expire, 723 expire,
742 ma); 724 ma);
743 put_cnt++; 725 put_cnt++;
@@ -793,14 +775,15 @@ publish_zone_dht_start (void *cls)
793 GNUNET_assert (NULL == namestore_iter); 775 GNUNET_assert (NULL == namestore_iter);
794 ns_iteration_left = 1; 776 ns_iteration_left = 1;
795 namestore_iter 777 namestore_iter
796 = GNUNET_NAMESTORE_zone_iteration_start (namestore_handle, 778 = GNUNET_NAMESTORE_zone_iteration_start2 (namestore_handle,
797 NULL, /* All zones */ 779 NULL, /* All zones */
798 &zone_iteration_error, 780 &zone_iteration_error,
799 NULL, 781 NULL,
800 &put_gns_record, 782 &put_gns_record,
801 NULL, 783 NULL,
802 &zone_iteration_finished, 784 &zone_iteration_finished,
803 NULL); 785 NULL,
786 GNUNET_GNSRECORD_FILTER_OMIT_PRIVATE);
804 GNUNET_assert (NULL != namestore_iter); 787 GNUNET_assert (NULL != namestore_iter);
805} 788}
806 789