aboutsummaryrefslogtreecommitdiff
path: root/src/zonemaster
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-10-20 12:56:54 +0200
committerChristian Grothoff <christian@grothoff.org>2022-10-20 12:56:54 +0200
commit6f2f55e1d5b72cfc1fbd9715d7846921f6cb1e1b (patch)
treeb0ba8a0b664ce91c506421e34cb67b0ffb5d5dbe /src/zonemaster
parent01b5953cb3d3c7f072115ffa7b72884c3614cbae (diff)
downloadgnunet-6f2f55e1d5b72cfc1fbd9715d7846921f6cb1e1b.tar.gz
gnunet-6f2f55e1d5b72cfc1fbd9715d7846921f6cb1e1b.zip
-fix FTBFS
Diffstat (limited to 'src/zonemaster')
-rw-r--r--src/zonemaster/Makefile.am3
-rw-r--r--src/zonemaster/gnunet-service-zonemaster.c21
2 files changed, 18 insertions, 6 deletions
diff --git a/src/zonemaster/Makefile.am b/src/zonemaster/Makefile.am
index ef82fc19b..635c195ed 100644
--- a/src/zonemaster/Makefile.am
+++ b/src/zonemaster/Makefile.am
@@ -28,4 +28,5 @@ gnunet_service_zonemaster_LDADD = \
28 $(top_builddir)/src/util/libgnunetutil.la \ 28 $(top_builddir)/src/util/libgnunetutil.la \
29 $(top_builddir)/src/namestore/libgnunetnamestore.la \ 29 $(top_builddir)/src/namestore/libgnunetnamestore.la \
30 $(top_builddir)/src/namecache/libgnunetnamecache.la \ 30 $(top_builddir)/src/namecache/libgnunetnamecache.la \
31 $(GN_LIBINTL) 31 $(GN_LIBINTL) \
32 -lpthread
diff --git a/src/zonemaster/gnunet-service-zonemaster.c b/src/zonemaster/gnunet-service-zonemaster.c
index fb55fd718..95863eeac 100644
--- a/src/zonemaster/gnunet-service-zonemaster.c
+++ b/src/zonemaster/gnunet-service-zonemaster.c
@@ -24,6 +24,7 @@
24 * @author Christian Grothoff 24 * @author Christian Grothoff
25 */ 25 */
26#include "platform.h" 26#include "platform.h"
27#include <pthread.h>
27#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
28#include "gnunet_dnsparser_lib.h" 29#include "gnunet_dnsparser_lib.h"
29#include "gnunet_dht_service.h" 30#include "gnunet_dht_service.h"
@@ -99,7 +100,7 @@
99/** 100/**
100 * Our workers 101 * Our workers
101 */ 102 */
102static pthread_t * worker; 103static pthread_t *worker;
103 104
104/** 105/**
105 * Lock for the open jobs queue. 106 * Lock for the open jobs queue.
@@ -469,6 +470,7 @@ shutdown_task (void *cls)
469 } 470 }
470} 471}
471 472
473
472/** 474/**
473 * Cache operation complete, clean up. 475 * Cache operation complete, clean up.
474 * 476 *
@@ -528,7 +530,6 @@ refresh_block (const struct GNUNET_GNSRECORD_Block *block)
528} 530}
529 531
530 532
531
532/** 533/**
533 * Method called periodically that triggers iteration over authoritative records 534 * Method called periodically that triggers iteration over authoritative records
534 * 535 *
@@ -764,6 +765,7 @@ dht_put_continuation (void *cls)
764 GNUNET_free (ma); 765 GNUNET_free (ma);
765} 766}
766 767
768
767static void 769static void
768free_job (struct OpenSignJob *job) 770free_job (struct OpenSignJob *job)
769{ 771{
@@ -859,8 +861,10 @@ perform_dht_put (const struct GNUNET_IDENTITY_PrivateKey *key,
859 label, 861 label,
860 GNUNET_STRINGS_absolute_time_to_string (expire)); 862 GNUNET_STRINGS_absolute_time_to_string (expire));
861 num_public_records++; 863 num_public_records++;
864 return NULL; // FIXME-Martin: WTF?
862} 865}
863 866
867
864static void 868static void
865notification_pipe_cb (void *cls); 869notification_pipe_cb (void *cls);
866 870
@@ -888,7 +892,7 @@ initiate_put_from_pipe_trigger (void *cls)
888 while (GNUNET_SYSERR != 892 while (GNUNET_SYSERR !=
889 (nf_count = GNUNET_DISK_file_read (np_fh, buf, sizeof (buf)))) 893 (nf_count = GNUNET_DISK_file_read (np_fh, buf, sizeof (buf))))
890 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Read %lld notifications from pipe\n", 894 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Read %lld notifications from pipe\n",
891 nf_count); 895 (long long) nf_count);
892 if (NULL == job) 896 if (NULL == job)
893 { 897 {
894 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 898 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1004,6 +1008,7 @@ zone_iteration_finished (void *cls)
1004 } 1008 }
1005} 1009}
1006 1010
1011
1007/** 1012/**
1008 * Function used to put all records successively into the DHT. 1013 * Function used to put all records successively into the DHT.
1009 * 1014 *
@@ -1073,6 +1078,7 @@ put_gns_record (void *cls,
1073 ma); 1078 ma);
1074} 1079}
1075 1080
1081
1076/** 1082/**
1077 * Periodically iterate over all zones and store everything in DHT 1083 * Periodically iterate over all zones and store everything in DHT
1078 * 1084 *
@@ -1204,6 +1210,7 @@ perform_dht_put_monitor (const struct GNUNET_IDENTITY_PrivateKey *key,
1204 GNUNET_assert (0 == pthread_mutex_unlock (&jobs_lock)); 1210 GNUNET_assert (0 == pthread_mutex_unlock (&jobs_lock));
1205} 1211}
1206 1212
1213
1207/** 1214/**
1208 * Process a record that was stored in the namestore 1215 * Process a record that was stored in the namestore
1209 * (invoked by the monitor). 1216 * (invoked by the monitor).
@@ -1279,8 +1286,9 @@ handle_monitor_error (void *cls)
1279 GNUNET_NO); 1286 GNUNET_NO);
1280} 1287}
1281 1288
1289
1282static void* 1290static void*
1283sign_worker (void *) 1291sign_worker (void *cls)
1284{ 1292{
1285 struct OpenSignJob *job; 1293 struct OpenSignJob *job;
1286 const struct GNUNET_DISK_FileHandle *fh; 1294 const struct GNUNET_DISK_FileHandle *fh;
@@ -1310,13 +1318,15 @@ sign_worker (void *)
1310 "Done, notifying main thread through pipe!\n"); 1318 "Done, notifying main thread through pipe!\n");
1311 GNUNET_DISK_file_write (fh, "!", 1); 1319 GNUNET_DISK_file_write (fh, "!", 1);
1312 } 1320 }
1313 else { 1321 else
1322 {
1314 sleep (1); 1323 sleep (1);
1315 } 1324 }
1316 } 1325 }
1317 return NULL; 1326 return NULL;
1318} 1327}
1319 1328
1329
1320static void 1330static void
1321notification_pipe_cb (void *cls) 1331notification_pipe_cb (void *cls)
1322{ 1332{
@@ -1325,6 +1335,7 @@ notification_pipe_cb (void *cls)
1325 GNUNET_SCHEDULER_add_now (&initiate_put_from_pipe_trigger, NULL); 1335 GNUNET_SCHEDULER_add_now (&initiate_put_from_pipe_trigger, NULL);
1326} 1336}
1327 1337
1338
1328/** 1339/**
1329 * Perform zonemaster duties: watch namestore, publish records. 1340 * Perform zonemaster duties: watch namestore, publish records.
1330 * 1341 *