aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-10-21 13:48:01 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-10-21 13:48:01 +0900
commitbb49aa0110c5648e9eaae0f013fc5a05f7156862 (patch)
tree355fcfded84a5dd404e49b574274bff6fd4f96e5 /src
parentb00f4f30d94015acde0599711bf8056855b2de97 (diff)
downloadgnunet-bb49aa0110c5648e9eaae0f013fc5a05f7156862.tar.gz
gnunet-bb49aa0110c5648e9eaae0f013fc5a05f7156862.zip
-fix warnings
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_mysql_lib.h6
-rw-r--r--src/namestore/gnunet-namestore-zonefile.c19
-rw-r--r--src/zonemaster/gnunet-service-zonemaster.c25
3 files changed, 16 insertions, 34 deletions
diff --git a/src/include/gnunet_mysql_lib.h b/src/include/gnunet_mysql_lib.h
index 843d3ccb3..8da7e5397 100644
--- a/src/include/gnunet_mysql_lib.h
+++ b/src/include/gnunet_mysql_lib.h
@@ -41,11 +41,15 @@ extern "C"
41#endif 41#endif
42#endif 42#endif
43 43
44#ifdef HAVE_MYSQL8 44#ifndef LIBMARIADB
45#ifdef HAVE_MYSQL8 && !LIBMARIADB
45 typedef bool MYSQL_BOOL; 46 typedef bool MYSQL_BOOL;
46#else 47#else
47 typedef my_bool MYSQL_BOOL; //MySQL < 8 wants this 48 typedef my_bool MYSQL_BOOL; //MySQL < 8 wants this
48#endif 49#endif
50#else
51 typedef my_bool MYSQL_BOOL; //MariaDB still uses my_bool
52#endif
49 53
50 54
51/** 55/**
diff --git a/src/namestore/gnunet-namestore-zonefile.c b/src/namestore/gnunet-namestore-zonefile.c
index 26906d140..5cf25abec 100644
--- a/src/namestore/gnunet-namestore-zonefile.c
+++ b/src/namestore/gnunet-namestore-zonefile.c
@@ -271,13 +271,16 @@ parse_origin (char *token, char *origin)
271{ 271{
272 char *next; 272 char *next;
273 next = strchr (token, ';'); 273 next = strchr (token, ';');
274 if (NULL != next) 274 if (NULL == next)
275 next[0] = '\0'; 275 return GNUNET_SYSERR;
276 next[0] = '\0';
276 next = strchr (token, ' '); 277 next = strchr (token, ' ');
277 if (NULL != next) 278 if (NULL == next)
278 next[0] = '\0'; 279 return GNUNET_SYSERR;
280 next[0] = '\0';
279 strcpy (origin, token); 281 strcpy (origin, token);
280 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Origin is: %s\n", origin); 282 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Origin is: %s\n", origin);
283 return GNUNET_OK;
281} 284}
282 285
283static void 286static void
@@ -300,7 +303,6 @@ origin_create_cb (void *cls, const struct GNUNET_IDENTITY_PrivateKey *pk,
300static void 303static void
301origin_lookup_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) 304origin_lookup_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
302{ 305{
303 const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
304 306
305 el = NULL; 307 el = NULL;
306 308
@@ -384,7 +386,7 @@ parse (void *cls)
384 parse_task = NULL; 386 parse_task = NULL;
385 /* use filename provided as 1st argument (stdin by default) */ 387 /* use filename provided as 1st argument (stdin by default) */
386 int ln = 0; 388 int ln = 0;
387 while (res = fgets (buf, sizeof(buf), stdin)) /* read each line of input */ 389 while ((res = fgets (buf, sizeof(buf), stdin))) /* read each line of input */
388 { 390 {
389 ln++; 391 ln++;
390 ttl_line = 0; 392 ttl_line = 0;
@@ -512,7 +514,8 @@ parse (void *cls)
512 if (ZS_READY == state) 514 if (ZS_READY == state)
513 { 515 {
514 fprintf (stderr, 516 fprintf (stderr,
515 _ ("You must provide $ORIGIN in your zonefile or via arguments (--zone)!\n")); 517 _ (
518 "You must provide $ORIGIN in your zonefile or via arguments (--zone)!\n"));
516 ret = 1; 519 ret = 1;
517 GNUNET_SCHEDULER_shutdown (); 520 GNUNET_SCHEDULER_shutdown ();
518 return; 521 return;
@@ -661,10 +664,8 @@ tx_start (void *cls, int32_t success, const char *emsg)
661static void 664static void
662identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) 665identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego)
663{ 666{
664 const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
665 667
666 el = NULL; 668 el = NULL;
667
668 if (NULL == ego) 669 if (NULL == ego)
669 { 670 {
670 if (NULL != ego_name) 671 if (NULL != ego_name)
diff --git a/src/zonemaster/gnunet-service-zonemaster.c b/src/zonemaster/gnunet-service-zonemaster.c
index 4cf5e690a..220cf1f99 100644
--- a/src/zonemaster/gnunet-service-zonemaster.c
+++ b/src/zonemaster/gnunet-service-zonemaster.c
@@ -412,7 +412,7 @@ shutdown_task (void *cls)
412 struct OpenSignJob *job; 412 struct OpenSignJob *job;
413 413
414 (void) cls; 414 (void) cls;
415 in_shutdown == GNUNET_YES; 415 in_shutdown = GNUNET_YES;
416 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 416 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
417 "Shutting down!\n"); 417 "Shutting down!\n");
418 if (NULL != notification_pipe) 418 if (NULL != notification_pipe)
@@ -820,11 +820,9 @@ perform_dht_put (const struct GNUNET_IDENTITY_PrivateKey *key,
820 struct GNUNET_GNSRECORD_Data rd_public[rd_count]; 820 struct GNUNET_GNSRECORD_Data rd_public[rd_count];
821 struct GNUNET_GNSRECORD_Block *block; 821 struct GNUNET_GNSRECORD_Block *block;
822 struct GNUNET_GNSRECORD_Block *block_priv; 822 struct GNUNET_GNSRECORD_Block *block_priv;
823 struct GNUNET_HashCode query;
824 struct GNUNET_TIME_Absolute expire_pub; 823 struct GNUNET_TIME_Absolute expire_pub;
825 size_t block_size; 824 size_t block_size;
826 unsigned int rd_public_count = 0; 825 unsigned int rd_public_count = 0;
827 struct GNUNET_DHT_PutHandle *ret;
828 char *emsg; 826 char *emsg;
829 827
830 if (GNUNET_OK != 828 if (GNUNET_OK !=
@@ -1136,25 +1134,6 @@ publish_zone_dht_start (void *cls)
1136 1134
1137 1135
1138/** 1136/**
1139 * Continuation called from DHT once the PUT operation triggered
1140 * by a monitor is done.
1141 *
1142 * @param cls a `struct DhtPutActivity`
1143 */
1144static void
1145dht_put_monitor_continuation (void *cls)
1146{
1147 struct DhtPutActivity *ma = cls;
1148
1149 ma_queue_length--;
1150 GNUNET_CONTAINER_DLL_remove (ma_head,
1151 ma_tail,
1152 ma);
1153 GNUNET_free (ma);
1154}
1155
1156
1157/**
1158 * Store GNS records in the DHT. 1137 * Store GNS records in the DHT.
1159 * 1138 *
1160 * @param key key of the zone 1139 * @param key key of the zone
@@ -1175,11 +1154,9 @@ perform_dht_put_monitor (const struct GNUNET_IDENTITY_PrivateKey *key,
1175 struct GNUNET_GNSRECORD_Data rd_public[rd_count]; 1154 struct GNUNET_GNSRECORD_Data rd_public[rd_count];
1176 struct GNUNET_GNSRECORD_Block *block; 1155 struct GNUNET_GNSRECORD_Block *block;
1177 struct GNUNET_GNSRECORD_Block *block_priv; 1156 struct GNUNET_GNSRECORD_Block *block_priv;
1178 struct GNUNET_HashCode query;
1179 struct GNUNET_TIME_Absolute expire_pub; 1157 struct GNUNET_TIME_Absolute expire_pub;
1180 size_t block_size; 1158 size_t block_size;
1181 unsigned int rd_public_count = 0; 1159 unsigned int rd_public_count = 0;
1182 struct GNUNET_DHT_PutHandle *ret;
1183 char *emsg; 1160 char *emsg;
1184 1161
1185 if (GNUNET_OK != 1162 if (GNUNET_OK !=