diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2023-11-25 16:02:34 +0100 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2023-11-25 16:02:34 +0100 |
commit | 1c0df659e61217f1adf7be8b105a97b181142b1b (patch) | |
tree | daf435242b0ea8f285e6a555774453c2482c290d | |
parent | dfe9520d60699a7ac19ffbb717c3a6147a1604ec (diff) | |
download | gnunet-1c0df659e61217f1adf7be8b105a97b181142b1b.tar.gz gnunet-1c0df659e61217f1adf7be8b105a97b181142b1b.zip |
PEERSTORE: Actually return error core in API
also fixes meson tests
-rw-r--r-- | meson.build | 44 | ||||
-rw-r--r-- | src/service/peerstore/gnunet-service-peerstore.c | 23 |
2 files changed, 29 insertions, 38 deletions
diff --git a/meson.build b/meson.build index e65e1eebc..9db38740d 100644 --- a/meson.build +++ b/meson.build | |||
@@ -364,8 +364,8 @@ endif | |||
364 | # GNUTLS DANE | 364 | # GNUTLS DANE |
365 | if cc.check_header('gnutls/dane.h') | 365 | if cc.check_header('gnutls/dane.h') |
366 | if cc.has_function('dane_verify_crt_raw', | 366 | if cc.has_function('dane_verify_crt_raw', |
367 | prefix: '#include <gnutls/dane.h>', | 367 | prefix: '#include <gnutls/dane.h>', |
368 | dependencies: gnutls_dep) | 368 | dependencies: gnutls_dep) |
369 | add_project_arguments('-DHAVE_GNUTLS_DANE', language : 'c') | 369 | add_project_arguments('-DHAVE_GNUTLS_DANE', language : 'c') |
370 | endif | 370 | endif |
371 | endif | 371 | endif |
@@ -376,10 +376,10 @@ curl_ssl_check ='''#include <curl/curl.h> | |||
376 | ''' | 376 | ''' |
377 | 377 | ||
378 | result = cc.run(curl_ssl_check, name : 'cURL gnutls check', | 378 | result = cc.run(curl_ssl_check, name : 'cURL gnutls check', |
379 | dependencies: curl_dep) | 379 | dependencies: curl_dep) |
380 | cdata.set('curl_gnutls', 0) | 380 | cdata.set('curl_gnutls', 0) |
381 | if result.returncode() == 0 | 381 | if result.returncode() == 0 |
382 | cdata.set('curl_gnutls', 1) | 382 | cdata.set('curl_gnutls', 1) |
383 | endif | 383 | endif |
384 | 384 | ||
385 | if cc.has_function('getloadavg') == false | 385 | if cc.has_function('getloadavg') == false |
@@ -411,8 +411,8 @@ if cc.check_header('ifaddrs.h') | |||
411 | endif | 411 | endif |
412 | 412 | ||
413 | configure_file(#input: 'gnunet_private_config.h.in', | 413 | configure_file(#input: 'gnunet_private_config.h.in', |
414 | output : 'gnunet_private_config.h', | 414 | output : 'gnunet_private_config.h', |
415 | configuration : cdata) | 415 | configuration : cdata) |
416 | configuration_inc = include_directories('.') | 416 | configuration_inc = include_directories('.') |
417 | 417 | ||
418 | pkg = import('pkgconfig') | 418 | pkg = import('pkgconfig') |
@@ -424,31 +424,31 @@ subdir('data') | |||
424 | 424 | ||
425 | meson.add_dist_script('meson-dist-script') | 425 | meson.add_dist_script('meson-dist-script') |
426 | 426 | ||
427 | add_test_setup('default', exclude_suites: ['perf'], is_default: true) | 427 | add_test_setup('default', env: ['GNUNET_PREFIX='/get_option('libdir')], exclude_suites: ['perf'], is_default: true) |
428 | add_test_setup('full', is_default: false) | 428 | add_test_setup('full', env: ['GNUNET_PREFIX='/get_option('libdir')], is_default: false) |
429 | 429 | ||
430 | summary({'host': host_machine.system(), | 430 | summary({'host': host_machine.system(), |
431 | 'prefix': get_option('prefix'), | 431 | 'prefix': get_option('prefix'), |
432 | 'compiler': cc.get_id(), | 432 | 'compiler': cc.get_id(), |
433 | 'libdir': get_option('libdir'), | 433 | 'libdir': get_option('libdir'), |
434 | 'datadir': get_option('datadir'), | 434 | 'datadir': get_option('datadir'), |
435 | 'default interface': cdata.get('GNUNET_DEFAULT_INTERFACE'), | 435 | 'default interface': cdata.get('GNUNET_DEFAULT_INTERFACE'), |
436 | 'PostgreSQL': pq_dep.found(), | 436 | 'PostgreSQL': pq_dep.found(), |
437 | 'curl w/ gnutls': (cdata.get('curl_gnutls') == 1), | 437 | 'curl w/ gnutls': (cdata.get('curl_gnutls') == 1), |
438 | 'ifconfig': ifconfig_bin.found(), | 438 | 'ifconfig': ifconfig_bin.found(), |
439 | 'iptables': iptables_bin.found() | 439 | 'iptables': iptables_bin.found() |
440 | }, section: 'Detected system') | 440 | }, section: 'Detected system') |
441 | 441 | ||
442 | if not gnunet_user | 442 | if not gnunet_user |
443 | message('Please make sure NOW to create a user and group \'gnunet\' and additionally a group \'gnunetdns\'. Make sure that \'/var/lib/gnunet\' is owned (and writable) by user \'gnunet\'') | 443 | message('Please make sure NOW to create a user and group \'gnunet\' and additionally a group \'gnunetdns\'. Make sure that \'/var/lib/gnunet\' is owned (and writable) by user \'gnunet\'') |
444 | message('Each user of GNUnet should be added to the \'gnunet\' group') | 444 | message('Each user of GNUnet should be added to the \'gnunet\' group') |
445 | if adduser_bin.found() and not gnunet_user | 445 | if adduser_bin.found() and not gnunet_user |
446 | message('''Create the gnunet user and add users to the gnunetdns group, run: | 446 | message('''Create the gnunet user and add users to the gnunetdns group, run: |
447 | # addgroup gnunetdns | 447 | # addgroup gnunetdns |
448 | # adduser --system --disabled-login --home /var/lib/gnunet gnunet''') | 448 | # adduser --system --disabled-login --home /var/lib/gnunet gnunet''') |
449 | message('''To add users to the gnunet group, run: | 449 | message('''To add users to the gnunet group, run: |
450 | # adduser USERNAME gnunet | 450 | # adduser USERNAME gnunet |
451 | for each of your users, replacing \'USERNAME\' with the respective login name. | 451 | for each of your users, replacing \'USERNAME\' with the respective login name. |
452 | Users may have to login again for the changes to take effect.''') | 452 | Users may have to login again for the changes to take effect.''') |
453 | endif | 453 | endif |
454 | endif | 454 | endif |
diff --git a/src/service/peerstore/gnunet-service-peerstore.c b/src/service/peerstore/gnunet-service-peerstore.c index 77523aa2e..90b4e8d88 100644 --- a/src/service/peerstore/gnunet-service-peerstore.c +++ b/src/service/peerstore/gnunet-service-peerstore.c | |||
@@ -494,22 +494,13 @@ store_record_continuation (void *cls, int success) | |||
494 | struct PeerstoreResultMessage *msg; | 494 | struct PeerstoreResultMessage *msg; |
495 | struct GNUNET_MQ_Envelope *env; | 495 | struct GNUNET_MQ_Envelope *env; |
496 | 496 | ||
497 | if (GNUNET_OK == success) | 497 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found a watcher to update.\n"); |
498 | { | 498 | env = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_PEERSTORE_STORE_RESULT); |
499 | 499 | msg->rid = src->rid; | |
500 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found a watcher to update.\n"); | 500 | msg->result = htonl (success); |
501 | env = GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_PEERSTORE_STORE_RESULT); | 501 | GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (src->client), env); |
502 | msg->rid = src->rid; | 502 | watch_notifier (src->record); |
503 | msg->result = htonl (success); | 503 | GNUNET_SERVICE_client_continue (src->client); |
504 | GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (src->client), env); | ||
505 | watch_notifier (src->record); | ||
506 | GNUNET_SERVICE_client_continue (src->client); | ||
507 | } | ||
508 | else | ||
509 | { | ||
510 | GNUNET_break (0); | ||
511 | GNUNET_SERVICE_client_drop (src->record->client); | ||
512 | } | ||
513 | PEERSTORE_destroy_record (src->record); | 504 | PEERSTORE_destroy_record (src->record); |
514 | GNUNET_free (src); | 505 | GNUNET_free (src); |
515 | } | 506 | } |