From 8c2243f05b4aa671cdcd4cfd614055ef6f80e20c Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Sun, 28 Jun 2020 22:38:45 +0200 Subject: Prevent user from storing records which belong in a BOX --- src/namestore/gnunet-namestore.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c index 94fcb8952..1e0c6fdbc 100644 --- a/src/namestore/gnunet-namestore.c +++ b/src/namestore/gnunet-namestore.c @@ -1087,6 +1087,16 @@ run_with_zone_pkey (const struct GNUNET_CONFIGURATION_Handle *cfg) ret = 1; return; } + if ((GNUNET_DNSPARSER_TYPE_SRV == type) || + (GNUNET_DNSPARSER_TYPE_TLSA == type) || + (GNUNET_DNSPARSER_TYPE_OPENPGPKEY == type)) + { + fprintf (stderr, + _ ("For DNS record types `SRV', `TLSA' and `OPENPGPKEY'")); + fprintf (stderr, ", please use a `BOX' record instead\n"); + ret = 1; + return; + } if (NULL == value) { fprintf (stderr, -- cgit v1.2.3 From 385052cb493e2b0f56c3c4a874e46d2028ce18ec Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Sun, 28 Jun 2020 22:39:49 +0200 Subject: -actually shutdown --- src/namestore/gnunet-namestore.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c index 1e0c6fdbc..f438de136 100644 --- a/src/namestore/gnunet-namestore.c +++ b/src/namestore/gnunet-namestore.c @@ -1094,6 +1094,7 @@ run_with_zone_pkey (const struct GNUNET_CONFIGURATION_Handle *cfg) fprintf (stderr, _ ("For DNS record types `SRV', `TLSA' and `OPENPGPKEY'")); fprintf (stderr, ", please use a `BOX' record instead\n"); + GNUNET_SCHEDULER_shutdown (); ret = 1; return; } -- cgit v1.2.3 From 406e2ee8835abcad5356cb4921d76a6ffe28b7c6 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 1 Jul 2020 13:36:00 +0200 Subject: -style fix --- src/util/crypto_rsa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c index cb4640d48..b12ec7434 100644 --- a/src/util/crypto_rsa.c +++ b/src/util/crypto_rsa.c @@ -1301,7 +1301,8 @@ GNUNET_CRYPTO_rsa_verify (const struct GNUNET_HashCode *hash, * so the exchange is being malicious in an unfamilair way, maybe * just trying to crash us. Arguably, we've only an internal error * though because we should've detected this in our previous call - * to GNUNET_CRYPTO_rsa_unblind. */return GNUNET_NO; + * to GNUNET_CRYPTO_rsa_unblind. */// + return GNUNET_NO; } data = mpi_to_sexp (r); -- cgit v1.2.3 From fd9b241cafa715b0da84cdd03f53387082b373f7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 2 Jul 2020 20:13:57 +0200 Subject: try to fix #6419: --- src/block/Makefile.am | 30 +++++++++++++++++++----------- src/include/gnunet_common.h | 16 ++++++++++------ 2 files changed, 29 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/block/Makefile.am b/src/block/Makefile.am index dd596f6b4..ceeff4c66 100644 --- a/src/block/Makefile.am +++ b/src/block/Makefile.am @@ -23,41 +23,49 @@ libgnunet_plugin_block_template_la_SOURCES = \ plugin_block_template.c libgnunet_plugin_block_template_la_LIBADD = \ libgnunetblockgroup.la \ + libgnunetblock.la \ $(top_builddir)/src/util/libgnunetutil.la \ $(LTLIBINTL) +libgnunet_plugin_block_template_la_DEPENDENCIES = \ + libgnunetblockgroup.la \ + libgnunetblock.la \ + $(top_builddir)/src/util/libgnunetutil.la libgnunet_plugin_block_template_la_LDFLAGS = \ - $(GN_PLUGIN_LDFLAGS) + $(GN_PLUGIN_LDFLAGS) libgnunet_plugin_block_test_la_SOURCES = \ plugin_block_test.c libgnunet_plugin_block_test_la_LIBADD = \ libgnunetblockgroup.la \ -$(top_builddir)/src/util/libgnunetutil.la \ + libgnunetblock.la \ + $(top_builddir)/src/util/libgnunetutil.la \ $(LTLIBINTL) +libgnunet_plugin_block_test_la_DEPENDENCIES = \ + libgnunetblockgroup.la \ + libgnunetblock.la \ + $(top_builddir)/src/util/libgnunetutil.la libgnunet_plugin_block_test_la_LDFLAGS = \ - $(GN_PLUGIN_LDFLAGS) - + $(GN_PLUGIN_LDFLAGS) libgnunetblock_la_SOURCES = \ block.c libgnunetblock_la_LIBADD = \ - $(top_builddir)/src/util/libgnunetutil.la + $(top_builddir)/src/util/libgnunetutil.la libgnunetblock_la_DEPENDENCIES = \ - $(top_builddir)/src/util/libgnunetutil.la + $(top_builddir)/src/util/libgnunetutil.la libgnunetblock_la_LDFLAGS = \ $(GN_LIB_LDFLAGS) \ $(GN_LIBINTL) \ -version-info 0:0:0 - libgnunetblockgroup_la_SOURCES = \ bg_bf.c libgnunetblockgroup_la_LIBADD = \ - libgnunetblock.la \ - $(top_builddir)/src/util/libgnunetutil.la + libgnunetblock.la \ + $(top_builddir)/src/util/libgnunetutil.la libgnunetblockgroup_la_DEPENDENCIES = \ - libgnunetblock.la \ - $(top_builddir)/src/util/libgnunetutil.la + libgnunetblock.la \ + $(top_builddir)/src/util/libgnunetutil.la libgnunetblockgroup_la_LDFLAGS = \ $(GN_LIB_LDFLAGS) \ $(GN_LIBINTL) \ diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index 34f419a49..68993b51d 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -345,7 +345,9 @@ struct GNUNET_AsyncScopeSave * #GNUNET_NO to stop iteration with no error, * #GNUNET_SYSERR to abort iteration with error! */ -typedef int (*GNUNET_FileNameCallback) (void *cls, const char *filename); +typedef int +(*GNUNET_FileNameCallback) (void *cls, + const char *filename); /** @@ -353,7 +355,8 @@ typedef int (*GNUNET_FileNameCallback) (void *cls, const char *filename); * * @param cls Closure. */ -typedef void (*GNUNET_ContinuationCallback) (void *cls); +typedef void +(*GNUNET_ContinuationCallback) (void *cls); /** @@ -368,10 +371,11 @@ typedef void (*GNUNET_ContinuationCallback) (void *cls); * @param data_size * Size of @a data. */ -typedef void (*GNUNET_ResultCallback) (void *cls, - int64_t result_code, - const void *data, - uint16_t data_size); +typedef void +(*GNUNET_ResultCallback) (void *cls, + int64_t result_code, + const void *data, + uint16_t data_size); /* ****************************** logging ***************************** */ -- cgit v1.2.3 From e31c1d4a9f78c4e31fda1f98fe349b33abdd01a2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 5 Jul 2020 16:32:34 +0200 Subject: GNUNET_free_non_null -> GNUNET_free --- src/abd/gnunet-abd.c | 2 +- src/abd/gnunet-service-abd.c | 18 ++--- src/arm/arm_api.c | 2 +- src/arm/gnunet-service-arm.c | 18 ++--- src/ats-tests/ats-testing-experiment.c | 10 +-- src/ats-tests/ats-testing.c | 2 +- src/ats-tests/gnunet-ats-sim.c | 2 +- src/ats-tests/gnunet-solver-eval.c | 10 +-- src/ats-tool/gnunet-ats.c | 4 +- src/ats/gnunet-ats-solver-eval.c | 20 +++--- src/ats/perf_ats_solver.c | 12 ++-- src/ats/plugin_ats_proportional.c | 2 +- src/ats/test_ats_lib.c | 4 +- src/cadet/cadet_api.c | 2 +- src/cadet/gnunet-service-cadet.c | 2 +- src/cadet/gnunet-service-cadet_hello.c | 2 +- src/cadet/gnunet-service-cadet_peer.c | 6 +- src/consensus/gnunet-service-consensus.c | 2 +- src/conversation/gnunet-conversation.c | 4 +- src/core/core_api.c | 2 +- src/core/test_core_api_reliability.c | 6 +- src/curl/curl.c | 4 +- src/datacache/plugin_datacache_heap.c | 4 +- src/datacache/plugin_datacache_sqlite.c | 2 +- src/datastore/gnunet-service-datastore.c | 6 +- src/datastore/plugin_datastore_sqlite.c | 8 +-- src/datastore/test_datastore_api.c | 2 +- src/datastore/test_datastore_api_management.c | 2 +- src/dht/dht_api.c | 2 +- src/dht/gnunet-service-dht.c | 4 +- src/dht/gnunet-service-dht_clients.c | 10 +-- src/dht/gnunet-service-dht_hello.c | 2 +- src/dht/gnunet-service-dht_neighbours.c | 4 +- src/dht/gnunet_dht_profiler.c | 2 +- src/dns/gnunet-dns-monitor.c | 2 +- src/dns/gnunet-dns-redirector.c | 2 +- src/dns/gnunet-service-dns.c | 12 ++-- src/exit/gnunet-daemon-exit.c | 18 ++--- src/fs/fs_api.c | 82 +++++++++++----------- src/fs/fs_directory.c | 16 ++--- src/fs/fs_dirmetascan.c | 2 +- src/fs/fs_download.c | 18 ++--- src/fs/fs_file_information.c | 10 +-- src/fs/fs_namespace.c | 6 +- src/fs/fs_publish.c | 14 ++-- src/fs/fs_search.c | 22 +++--- src/fs/fs_sharetree.c | 4 +- src/fs/fs_test_lib.c | 4 +- src/fs/fs_tree.c | 2 +- src/fs/fs_unindex.c | 8 +-- src/fs/fs_uri.c | 6 +- src/fs/gnunet-auto-share.c | 6 +- src/fs/gnunet-directory.c | 4 +- src/fs/gnunet-publish.c | 6 +- src/fs/gnunet-search.c | 4 +- src/fs/gnunet-service-fs_pr.c | 4 +- src/fs/test_fs_file_information.c | 4 +- src/fs/test_fs_namespace.c | 2 +- src/gns/gns_tld_api.c | 2 +- src/gns/gnunet-gns-import.c | 4 +- src/gns/gnunet-gns-proxy.c | 30 ++++---- src/gns/gnunet-service-gns_resolver.c | 12 ++-- src/gns/plugin_gnsrecord_gns.c | 6 +- src/gns/plugin_rest_gns.c | 2 +- src/gns/test_gns_proxy.c | 8 +-- src/gnsrecord/gnsrecord.c | 2 +- src/gnsrecord/plugin_gnsrecord_dns.c | 6 +- src/hello/hello-ng.c | 2 +- src/hello/hello.c | 2 +- src/hostlist/gnunet-daemon-hostlist_client.c | 16 ++--- src/hostlist/gnunet-daemon-hostlist_server.c | 6 +- .../test_gnunet_daemon_hostlist_learning.c | 2 +- src/identity/plugin_rest_identity.c | 2 +- src/include/gnunet_common.h | 31 ++++---- src/mysql/mysql.c | 6 +- src/namecache/plugin_namecache_sqlite.c | 2 +- src/namestore/gnunet-namestore.c | 4 +- src/namestore/gnunet-service-namestore.c | 4 +- src/namestore/plugin_namestore_sqlite.c | 2 +- src/namestore/plugin_rest_namestore.c | 4 +- src/namestore/test_namestore_api_lookup_nick.c | 2 +- src/namestore/test_namestore_api_monitoring.c | 6 +- src/namestore/test_namestore_api_zone_iteration.c | 6 +- .../test_namestore_api_zone_iteration_nick.c | 6 +- ...st_namestore_api_zone_iteration_specific_zone.c | 6 +- .../test_namestore_api_zone_iteration_stop.c | 6 +- src/nat-auto/gnunet-service-nat-auto_legacy.c | 4 +- src/nat/gnunet-nat.c | 8 +-- src/nat/gnunet-service-nat.c | 6 +- src/nat/test_nat.c | 2 +- src/peerinfo-tool/gnunet-peerinfo.c | 6 +- src/peerinfo-tool/plugin_rest_peerinfo.c | 6 +- src/peerinfo/gnunet-service-peerinfo.c | 12 ++-- src/peerstore/peerstore_api.c | 2 +- src/peerstore/plugin_peerstore_flat.c | 2 +- src/peerstore/plugin_peerstore_sqlite.c | 2 +- src/pq/pq_connect.c | 16 ++--- src/pq/pq_prepare.c | 2 +- src/pt/test_gns_vpn.c | 2 +- src/pt/test_gnunet_vpn.c | 2 +- src/reclaim/gnunet-reclaim.c | 2 +- src/reclaim/gnunet-service-reclaim_tickets.c | 2 +- src/reclaim/oidc_helper.c | 6 +- src/reclaim/plugin_rest_openid_connect.c | 48 ++++++------- src/reclaim/plugin_rest_reclaim.c | 2 +- src/reclaim/reclaim_api.c | 2 +- src/regex/gnunet-regex-profiler.c | 4 +- src/regex/gnunet-regex-simulation-profiler.c | 2 +- src/regex/regex_internal.c | 26 +++---- src/regex/regex_test_lib.c | 8 +-- src/regex/test_regex_eval_api.c | 8 +-- src/rest/gnunet-rest-server.c | 8 +-- src/rps/rps_api.c | 2 +- src/set/gnunet-service-set.c | 4 +- .../gnunet-service-set_union_strata_estimator.c | 4 +- src/statistics/gnunet-service-statistics.c | 2 +- src/statistics/gnunet-statistics.c | 2 +- src/statistics/statistics_api.c | 4 +- src/testbed-logger/test_testbed_logger_api.c | 2 +- src/testbed/gnunet-helper-testbed.c | 2 +- src/testbed/gnunet-service-testbed.c | 12 ++-- src/testbed/gnunet-service-testbed_cache.c | 4 +- .../gnunet-service-testbed_connectionpool.c | 2 +- src/testbed/gnunet-service-testbed_cpustatus.c | 2 +- src/testbed/gnunet-service-testbed_links.c | 6 +- src/testbed/gnunet-service-testbed_oc.c | 24 +++---- src/testbed/gnunet-service-testbed_peers.c | 6 +- src/testbed/gnunet_testbed_mpi_spawn.c | 2 +- src/testbed/test_gnunet_helper_testbed.c | 2 +- src/testbed/test_testbed_api_statistics.c | 2 +- src/testbed/testbed_api.c | 6 +- src/testbed/testbed_api_hosts.c | 17 ++--- src/testbed/testbed_api_operations.c | 10 +-- src/testbed/testbed_api_peers.c | 2 +- src/testbed/testbed_api_statistics.c | 4 +- src/testbed/testbed_api_testbed.c | 8 +-- src/testbed/testbed_api_topology.c | 8 +-- src/testing/gnunet-testing.c | 2 +- src/testing/test_testing_peerstartup.c | 2 +- src/testing/test_testing_peerstartup2.c | 2 +- src/testing/test_testing_sharedservices.c | 2 +- src/testing/testing.c | 24 +++---- src/topology/gnunet-daemon-topology.c | 4 +- src/transport/gnunet-communicator-udp.c | 2 +- src/transport/gnunet-service-transport.c | 4 +- src/transport/gnunet-service-transport_hello.c | 2 +- src/transport/gnunet-transport.c | 6 +- src/transport/plugin_transport_http_client.c | 12 ++-- src/transport/plugin_transport_http_common.c | 18 ++--- src/transport/plugin_transport_http_server.c | 36 +++++----- src/transport/plugin_transport_tcp.c | 28 ++++---- src/transport/plugin_transport_udp.c | 4 +- src/transport/plugin_transport_wlan.c | 2 +- src/transport/tcp_connection_legacy.c | 4 +- src/transport/tcp_service_legacy.c | 52 +++++++------- src/transport/test_http_common.c | 6 +- src/transport/transport-testing-main.c | 2 +- src/transport/transport-testing.c | 6 +- src/transport/transport_api2_core.c | 4 +- src/transport/transport_api_core.c | 4 +- src/util/bio.c | 16 ++--- src/util/buffer.c | 2 +- src/util/client.c | 10 +-- src/util/common_allocation.c | 5 +- src/util/common_logging.c | 6 +- src/util/configuration.c | 12 ++-- src/util/container_bloomfilter.c | 2 +- src/util/container_meta_data.c | 14 ++-- src/util/disk.c | 4 +- src/util/dnsparser.c | 26 +++---- src/util/getopt_helpers.c | 4 +- src/util/gnunet-config.c | 2 +- src/util/gnunet-scrypt.c | 2 +- src/util/gnunet-service-resolver.c | 12 ++-- src/util/mq.c | 2 +- src/util/network.c | 2 +- src/util/os_installation.c | 8 +-- src/util/program.c | 8 +-- src/util/regex.c | 14 ++-- src/util/service.c | 40 +++++------ src/util/socks.c | 6 +- src/util/strings.c | 2 +- src/util/test_common_allocation.c | 6 +- src/util/test_configuration.c | 2 +- src/util/test_container_meta_data.c | 2 +- src/util/test_crypto_symmetric.c | 2 +- src/util/test_resolver_api.c | 2 +- src/vpn/gnunet-service-vpn.c | 10 +-- src/vpn/gnunet-vpn.c | 6 +- 189 files changed, 705 insertions(+), 710 deletions(-) (limited to 'src') diff --git a/src/abd/gnunet-abd.c b/src/abd/gnunet-abd.c index f7e03fb4a..963d9207a 100644 --- a/src/abd/gnunet-abd.c +++ b/src/abd/gnunet-abd.c @@ -723,7 +723,7 @@ sign_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) GNUNET_free (dele); printf ("%s\n", res); - GNUNET_free_non_null (ego_name); + GNUNET_free (ego_name); ego_name = NULL; GNUNET_SCHEDULER_shutdown (); diff --git a/src/abd/gnunet-service-abd.c b/src/abd/gnunet-service-abd.c index 36b0009ef..569d42295 100644 --- a/src/abd/gnunet-service-abd.c +++ b/src/abd/gnunet-service-abd.c @@ -364,14 +364,14 @@ print_deleset (struct DelegationSetQueueEntry *dsentry, char *text) static void cleanup_dsq_entry (struct DelegationSetQueueEntry *ds_entry) { - GNUNET_free_non_null (ds_entry->issuer_key); - GNUNET_free_non_null (ds_entry->issuer_attribute); - GNUNET_free_non_null (ds_entry->attr_trailer); + GNUNET_free (ds_entry->issuer_key); + GNUNET_free (ds_entry->issuer_attribute); + GNUNET_free (ds_entry->attr_trailer); // those fields are only set/used in bw search if (ds_entry->from_bw) { - GNUNET_free_non_null (ds_entry->lookup_attribute); - GNUNET_free_non_null (ds_entry->unresolved_attribute_delegation); + GNUNET_free (ds_entry->lookup_attribute); + GNUNET_free (ds_entry->unresolved_attribute_delegation); } if (NULL != ds_entry->lookup_request) { @@ -380,9 +380,9 @@ cleanup_dsq_entry (struct DelegationSetQueueEntry *ds_entry) } if (NULL != ds_entry->delegation_chain_entry) { - GNUNET_free_non_null ( + GNUNET_free ( ds_entry->delegation_chain_entry->subject_attribute); - GNUNET_free_non_null (ds_entry->delegation_chain_entry->issuer_attribute); + GNUNET_free (ds_entry->delegation_chain_entry->issuer_attribute); GNUNET_free (ds_entry->delegation_chain_entry); } // Free DQ entries @@ -423,11 +423,11 @@ cleanup_handle (struct VerifyRequestHandle *vrh) GNUNET_CONTAINER_DLL_remove (vrh->del_chain_head, vrh->del_chain_tail, del_entry); - GNUNET_free_non_null (del_entry->delegate); + GNUNET_free (del_entry->delegate); GNUNET_free (del_entry); } } - GNUNET_free_non_null (vrh->issuer_attribute); + GNUNET_free (vrh->issuer_attribute); GNUNET_free (vrh); } diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c index 1c402a8e0..cd5f44565 100644 --- a/src/arm/arm_api.c +++ b/src/arm/arm_api.c @@ -774,7 +774,7 @@ start_arm_service (struct GNUNET_ARM_Handle *h, } GNUNET_free (binary); GNUNET_free (quotedbinary); - GNUNET_free_non_null (config); + GNUNET_free (config); GNUNET_free (loprefix); GNUNET_free (lopostfix); if (NULL == proc) diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 09d85ca89..5efd8b72b 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c @@ -475,7 +475,7 @@ get_server_addresses (const char *service_name, (EACCES == errno)) { LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "socket"); - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); GNUNET_free (unixpath); return GNUNET_SYSERR; } @@ -504,7 +504,7 @@ get_server_addresses (const char *service_name, _ ( "Have neither PORT nor UNIXPATH for service `%s', but one is required\n"), service_name); - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); return GNUNET_SYSERR; } if (0 == port) @@ -512,8 +512,8 @@ get_server_addresses (const char *service_name, saddrs = GNUNET_new_array (2, struct sockaddr *); saddrlens = GNUNET_new_array (2, socklen_t); add_unixpath (saddrs, saddrlens, unixpath, abstract); - GNUNET_free_non_null (unixpath); - GNUNET_free_non_null (hostname); + GNUNET_free (unixpath); + GNUNET_free (hostname); *addrs = saddrs; *addr_lens = saddrlens; return 1; @@ -537,7 +537,7 @@ get_server_addresses (const char *service_name, hostname, gai_strerror (ret)); GNUNET_free (hostname); - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); return GNUNET_SYSERR; } next = res; @@ -557,7 +557,7 @@ get_server_addresses (const char *service_name, hostname); freeaddrinfo (res); GNUNET_free (hostname); - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); return GNUNET_SYSERR; } resi = i; @@ -664,7 +664,7 @@ get_server_addresses (const char *service_name, ((struct sockaddr_in *) saddrs[i])->sin_port = htons (port); } } - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); *addrs = saddrs; *addr_lens = saddrlens; return resi; @@ -1132,8 +1132,8 @@ free_service (struct ServiceList *sl) GNUNET_assert (GNUNET_YES == in_shutdown); GNUNET_CONTAINER_DLL_remove (running_head, running_tail, sl); GNUNET_assert (NULL == sl->listen_head); - GNUNET_free_non_null (sl->config); - GNUNET_free_non_null (sl->binary); + GNUNET_free (sl->config); + GNUNET_free (sl->binary); GNUNET_free (sl->name); GNUNET_free (sl); } diff --git a/src/ats-tests/ats-testing-experiment.c b/src/ats-tests/ats-testing-experiment.c index fa379200f..9f8db1be4 100644 --- a/src/ats-tests/ats-testing-experiment.c +++ b/src/ats-tests/ats-testing-experiment.c @@ -88,8 +88,8 @@ free_experiment (struct Experiment *e) GNUNET_free (cur); } - GNUNET_free_non_null (e->name); - GNUNET_free_non_null (e->cfg_file); + GNUNET_free (e->name); + GNUNET_free (e->cfg_file); GNUNET_free (e); } @@ -332,7 +332,7 @@ load_episode (struct Experiment *e, GNUNET_free (type); GNUNET_free (op_name); GNUNET_free (op); - GNUNET_free_non_null (pref); + GNUNET_free (pref); GNUNET_free (o); GNUNET_free (sec_name); return GNUNET_SYSERR; @@ -350,7 +350,7 @@ load_episode (struct Experiment *e, GNUNET_free (type); GNUNET_free (op_name); GNUNET_free (op); - GNUNET_free_non_null (pref); + GNUNET_free (pref); GNUNET_free (o); GNUNET_free (sec_name); return GNUNET_SYSERR; @@ -384,7 +384,7 @@ load_episode (struct Experiment *e, fprintf (stderr, "Found operation %u in episode %u: %s [%llu]->[%llu]\n", op_counter, cur->id, print_op (o->type), o->src_id, o->dest_id); - GNUNET_free_non_null (type); + GNUNET_free (type); GNUNET_free (op); GNUNET_CONTAINER_DLL_insert (cur->head, cur->tail, o); diff --git a/src/ats-tests/ats-testing.c b/src/ats-tests/ats-testing.c index c7969cdfe..c6ba8533d 100644 --- a/src/ats-tests/ats-testing.c +++ b/src/ats-tests/ats-testing.c @@ -110,7 +110,7 @@ do_shutdown (void *cls) GNUNET_TESTBED_operation_done (p->comm_op); p->comm_op = NULL; } - GNUNET_free_non_null (p->core_connect_ops); + GNUNET_free (p->core_connect_ops); GNUNET_free (p->partners); p->partners = NULL; } diff --git a/src/ats-tests/gnunet-ats-sim.c b/src/ats-tests/gnunet-ats-sim.c index fb3014798..15cd52e2f 100644 --- a/src/ats-tests/gnunet-ats-sim.c +++ b/src/ats-tests/gnunet-ats-sim.c @@ -339,7 +339,7 @@ parse_args (int argc, char *argv[]) { if ((c < (argc - 1)) && (0 == strcmp (argv[c], "-e"))) { - GNUNET_free_non_null (opt_exp_file); + GNUNET_free (opt_exp_file); opt_exp_file = GNUNET_strdup (argv[c + 1]); } if (0 == strcmp (argv[c], "-l")) diff --git a/src/ats-tests/gnunet-solver-eval.c b/src/ats-tests/gnunet-solver-eval.c index 09ddd7b2d..7a3461bf7 100644 --- a/src/ats-tests/gnunet-solver-eval.c +++ b/src/ats-tests/gnunet-solver-eval.c @@ -94,8 +94,8 @@ free_experiment (struct Experiment *e) GNUNET_free (cur); } - GNUNET_free_non_null (e->name); - GNUNET_free_non_null (e->cfg_file); + GNUNET_free (e->name); + GNUNET_free (e->cfg_file); GNUNET_free (e); } @@ -344,7 +344,7 @@ load_episode (struct Experiment *e, GNUNET_free (op_name); GNUNET_free (op); GNUNET_free (sec_name); - GNUNET_free_non_null (pref); + GNUNET_free (pref); GNUNET_free (o); return GNUNET_SYSERR; } @@ -364,7 +364,7 @@ load_episode (struct Experiment *e, GNUNET_free (op_name); GNUNET_free (op); GNUNET_free (sec_name); - GNUNET_free_non_null (pref); + GNUNET_free (pref); GNUNET_free (o); return GNUNET_SYSERR; } @@ -397,7 +397,7 @@ load_episode (struct Experiment *e, fprintf (stderr, "Found operation %u in episode %u: %s [%llu]->[%llu]\n", op_counter, cur->id, print_op (o->type), o->src_id, o->dest_id); - GNUNET_free_non_null (type); + GNUNET_free (type); GNUNET_free (op); GNUNET_CONTAINER_DLL_insert (cur->head, cur->tail, o); diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c index 947ed7798..169daa6f1 100644 --- a/src/ats-tool/gnunet-ats.c +++ b/src/ats-tool/gnunet-ats.c @@ -978,8 +978,8 @@ main (int argc, char *const *argv) options, &run, NULL); - GNUNET_free_non_null (opt_pid_str); - GNUNET_free_non_null (opt_type_str); + GNUNET_free (opt_pid_str); + GNUNET_free (opt_type_str); GNUNET_free_nz ((void *) argv); if (GNUNET_OK == res) diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c index 6a014357e..25b963532 100644 --- a/src/ats/gnunet-ats-solver-eval.c +++ b/src/ats/gnunet-ats-solver-eval.c @@ -1307,17 +1307,17 @@ free_experiment (struct Experiment *e) for (cur_o = next_o; NULL != cur_o; cur_o = next_o) { next_o = cur_o->next; - GNUNET_free_non_null (cur_o->address); - GNUNET_free_non_null (cur_o->plugin); + GNUNET_free (cur_o->address); + GNUNET_free (cur_o->plugin); GNUNET_free (cur_o); } GNUNET_free (cur); } - GNUNET_free_non_null (e->name); - GNUNET_free_non_null (e->log_prefix); - GNUNET_free_non_null (e->log_output_dir); - GNUNET_free_non_null (e->cfg_file); + GNUNET_free (e->name); + GNUNET_free (e->log_prefix); + GNUNET_free (e->log_output_dir); + GNUNET_free (e->cfg_file); GNUNET_free (e); } @@ -1967,7 +1967,7 @@ load_op_start_set_property (struct GNUNET_ATS_TEST_Operation *o, fprintf (stderr, "Missing property in operation %u `%s' in episode %u\n", op_counter, op_name, e->id); GNUNET_free (op_name); - GNUNET_free_non_null (prop); + GNUNET_free (prop); return GNUNET_SYSERR; } @@ -2038,7 +2038,7 @@ load_op_stop_set_property (struct GNUNET_ATS_TEST_Operation *o, fprintf (stderr, "Missing property in operation %u `%s' in episode `%s'\n", op_counter, "STOP_SET_PROPERTY", op_name); GNUNET_free (op_name); - GNUNET_free_non_null (pref); + GNUNET_free (pref); return GNUNET_SYSERR; } @@ -2047,7 +2047,7 @@ load_op_stop_set_property (struct GNUNET_ATS_TEST_Operation *o, fprintf (stderr, "Invalid property in operation %u `%s' in episode %u\n", op_counter, op_name, e->id); GNUNET_free (op_name); - GNUNET_free_non_null (pref); + GNUNET_free (pref); return GNUNET_SYSERR; } @@ -2419,7 +2419,7 @@ enforce_del_address (struct GNUNET_ATS_TEST_Operation *op) } GNUNET_CONTAINER_DLL_remove (p->addr_head, p->addr_tail, a); - GNUNET_free_non_null (a->ats_addr->atsi); + GNUNET_free (a->ats_addr->atsi); GNUNET_free (a->ats_addr); GNUNET_free (a); } diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c index 8e20f4454..2fbadef4d 100644 --- a/src/ats/perf_ats_solver.c +++ b/src/ats/perf_ats_solver.c @@ -325,8 +325,8 @@ end_now (int res) ph.stat = NULL; } - GNUNET_free_non_null (ph.peers); - GNUNET_free_non_null (ph.iterations_results); + GNUNET_free (ph.peers); + GNUNET_free (ph.iterations_results); GAS_normalization_stop (); GAS_preference_done (); @@ -1090,13 +1090,13 @@ write_all_iterations (void) if ((NULL != f_full) && (GNUNET_SYSERR == GNUNET_DISK_file_close (f_full))) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot close log file `%s'\n", data_fn_full); - GNUNET_free_non_null (data_fn_full); + GNUNET_free (data_fn_full); if ((NULL != f_update) && (GNUNET_SYSERR == GNUNET_DISK_file_close ( f_update))) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot close log file `%s'\n", data_fn_update); - GNUNET_free_non_null (data_fn_update); + GNUNET_free (data_fn_update); } @@ -1115,7 +1115,7 @@ do_delete_address (void *cls, pid, cur)); ph.sf->s_del (ph.sf->cls, cur); - GNUNET_free_non_null (cur->atsi); + GNUNET_free (cur->atsi); GNUNET_free (cur); return GNUNET_OK; } @@ -1427,7 +1427,7 @@ run (void *cls, char *const *args, const char *cfgfile, if (0 == c2) continue; if (ph.measure_updates) - GNUNET_free_non_null ( + GNUNET_free ( ph.iterations_results[c].update_results_array[c2]); GNUNET_free (ph.iterations_results[c].results_array[c2]); } diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c index f4324d238..f554291b6 100644 --- a/src/ats/plugin_ats_proportional.c +++ b/src/ats/plugin_ats_proportional.c @@ -1225,7 +1225,7 @@ libgnunet_plugin_ats_proportional_done (void *cls) GNUNET_CONTAINER_DLL_remove (s->network_entries[c].head, s->network_entries[c].tail, cur); - GNUNET_free_non_null (cur->addr->solver_information); + GNUNET_free (cur->addr->solver_information); GNUNET_free (cur); } GNUNET_free (s->network_entries[c].stat_total); diff --git a/src/ats/test_ats_lib.c b/src/ats/test_ats_lib.c index 2c4d3f5ad..d19da0106 100644 --- a/src/ats/test_ats_lib.c +++ b/src/ats/test_ats_lib.c @@ -165,7 +165,7 @@ free_asd (void *cls, GNUNET_CONTAINER_multipeermap_remove (p2asd, key, asd)); - GNUNET_free_non_null (asd->address); + GNUNET_free (asd->address); GNUNET_free (asd); return GNUNET_OK; } @@ -951,7 +951,7 @@ address_suggest_cb (void *cls, asd->bandwidth_out = bandwidth_out; asd->bandwidth_in = bandwidth_in; asd->session = session; - GNUNET_free_non_null (asd->address); + GNUNET_free (asd->address); asd->address = NULL; if (NULL != address) asd->address = GNUNET_HELLO_address_copy (address); diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c index 45cb66c1d..67f6571c5 100644 --- a/src/cadet/cadet_api.c +++ b/src/cadet/cadet_api.c @@ -819,7 +819,7 @@ GNUNET_CADET_close_port (struct GNUNET_CADET_Port *p) msg->port = p->id; GNUNET_MQ_send (p->cadet->mq, env); } - GNUNET_free_non_null (p->handlers); + GNUNET_free (p->handlers); GNUNET_free (p); } diff --git a/src/cadet/gnunet-service-cadet.c b/src/cadet/gnunet-service-cadet.c index 03af3d5c0..f3767fb01 100644 --- a/src/cadet/gnunet-service-cadet.c +++ b/src/cadet/gnunet-service-cadet.c @@ -415,7 +415,7 @@ shutdown_rest () } GCD_shutdown (); GCH_shutdown (); - GNUNET_free_non_null (my_private_key); + GNUNET_free (my_private_key); my_private_key = NULL; } diff --git a/src/cadet/gnunet-service-cadet_hello.c b/src/cadet/gnunet-service-cadet_hello.c index 21870a454..c7857032b 100644 --- a/src/cadet/gnunet-service-cadet_hello.c +++ b/src/cadet/gnunet-service-cadet_hello.c @@ -75,7 +75,7 @@ got_hello (void *cls, if (0 == GNUNET_memcmp (id, &my_full_id)) { - GNUNET_free_non_null (mine); + GNUNET_free (mine); mine = (struct GNUNET_HELLO_Message *) GNUNET_copy_message (&hello->header); GCD_hello_update (); return; diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index 55800b88c..e5885278b 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c @@ -345,8 +345,8 @@ destroy_peer (void *cls) GNUNET_CONTAINER_multipeermap_remove (peers, &cp->pid, cp)); - GNUNET_free_non_null (cp->path_heads); - GNUNET_free_non_null (cp->path_tails); + GNUNET_free (cp->path_heads); + GNUNET_free (cp->path_tails); cp->path_dll_length = 0; if (NULL != cp->search_h) { @@ -376,7 +376,7 @@ destroy_peer (void *cls) GNUNET_SCHEDULER_cancel (cp->heap_cleanup_task); cp->heap_cleanup_task = NULL; } - GNUNET_free_non_null (cp->hello); + GNUNET_free (cp->hello); /* Peer should not be freed if paths exist; if there are no paths, there ought to be no connections, and without connections, no notifications. Thus we can assert that mqm_head is empty at this diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c index 160d352d7..13fa0d0e7 100644 --- a/src/consensus/gnunet-service-consensus.c +++ b/src/consensus/gnunet-service-consensus.c @@ -1347,7 +1347,7 @@ not_evil: evil->type = EVILNESS_NONE; cleanup: GNUNET_free (evil_spec); - /* no GNUNET_free_non_null since it wasn't + /* no GNUNET_free since it wasn't * allocated with GNUNET_malloc */ if (NULL != evil_type_str) free (evil_type_str); diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c index b908cd82c..7a2a727a5 100644 --- a/src/conversation/gnunet-conversation.c +++ b/src/conversation/gnunet-conversation.c @@ -359,7 +359,7 @@ start_phone () else { GNUNET_CONVERSATION_phone_get_record (phone, &rd); - GNUNET_free_non_null (address); + GNUNET_free (address); address = GNUNET_GNSRECORD_value_to_string (rd.record_type, rd.data, rd.data_size); fprintf ( @@ -1035,7 +1035,7 @@ do_stop_task (void *cls) mic = NULL; GNUNET_free (ego_name); ego_name = NULL; - GNUNET_free_non_null (peer_name); + GNUNET_free (peer_name); peer_name = NULL; phone_state = PS_ERROR; } diff --git a/src/core/core_api.c b/src/core/core_api.c index d24378654..81118693d 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -745,7 +745,7 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle) GNUNET_MQ_destroy (handle->mq); handle->mq = NULL; } - GNUNET_free_non_null (handle->handlers); + GNUNET_free (handle->handlers); GNUNET_free (handle); } diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index b510e8993..136539ed3 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c @@ -384,7 +384,7 @@ process_hello (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received (my) `%s' from transport service\n", "HELLO"); GNUNET_assert (message != NULL); - GNUNET_free_non_null (p->hello); + GNUNET_free (p->hello); p->hello = GNUNET_copy_message (message); if ((p == &p1) && (NULL == p2.oh)) p2.oh = GNUNET_TRANSPORT_offer_hello (p2.cfg, @@ -523,8 +523,8 @@ main (int argc, &ok); stop_arm (&p1); stop_arm (&p2); - GNUNET_free_non_null (p1.hello); - GNUNET_free_non_null (p2.hello); + GNUNET_free (p1.hello); + GNUNET_free (p2.hello); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1"); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-2"); diff --git a/src/curl/curl.c b/src/curl/curl.c index b7452330f..a63a10f3b 100644 --- a/src/curl/curl.c +++ b/src/curl/curl.c @@ -529,7 +529,7 @@ GNUNET_CURL_job_cancel (struct GNUNET_CURL_Job *job) GNUNET_break (CURLM_OK == curl_multi_remove_handle (ctx->multi, job->easy_handle)); curl_easy_cleanup (job->easy_handle); - GNUNET_free_non_null (job->db.buf); + GNUNET_free (job->db.buf); curl_slist_free_all (job->job_headers); ctx->cb (ctx->cb_cls); GNUNET_free (job); @@ -642,7 +642,7 @@ GNUNET_CURL_download_get_result_ (struct GNUNET_CURL_DownloadBuffer *db, *response_code = 0; } } - GNUNET_free_non_null (db->buf); + GNUNET_free (db->buf); db->buf = NULL; db->buf_size = 0; if (NULL != json) diff --git a/src/datacache/plugin_datacache_heap.c b/src/datacache/plugin_datacache_heap.c index dbc9cac9c..074437e7d 100644 --- a/src/datacache/plugin_datacache_heap.c +++ b/src/datacache/plugin_datacache_heap.c @@ -395,7 +395,7 @@ heap_plugin_del (void *cls) plugin->env->delete_notify (plugin->env->cls, &val->key, val->size + OVERHEAD); - GNUNET_free_non_null (val->path_info); + GNUNET_free (val->path_info); GNUNET_free (val); return GNUNET_OK; } @@ -577,7 +577,7 @@ libgnunet_plugin_datacache_heap_done (void *cls) GNUNET_CONTAINER_multihashmap_remove (plugin->map, &val->key, val)); - GNUNET_free_non_null (val->path_info); + GNUNET_free (val->path_info); GNUNET_free (val); } GNUNET_CONTAINER_heap_destroy (plugin->heaps[i]); diff --git a/src/datacache/plugin_datacache_sqlite.c b/src/datacache/plugin_datacache_sqlite.c index 55a8a7fae..a7da6b068 100644 --- a/src/datacache/plugin_datacache_sqlite.c +++ b/src/datacache/plugin_datacache_sqlite.c @@ -764,7 +764,7 @@ libgnunet_plugin_datacache_sqlite_done (void *cls) #if ! WINDOWS || defined(__CYGWIN__) if ((NULL != plugin->fn) && (0 != unlink (plugin->fn))) LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_WARNING, "unlink", plugin->fn); - GNUNET_free_non_null (plugin->fn); + GNUNET_free (plugin->fn); #endif sqlite3_finalize (plugin->insert_stmt); sqlite3_finalize (plugin->get_count_stmt); diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index 3fc46e19c..1c9e5e463 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c @@ -1355,7 +1355,7 @@ cleaning_task (void *cls) GNUNET_SCHEDULER_cancel (stat_timeout_task); stat_timeout_task = NULL; } - GNUNET_free_non_null (plugin_name); + GNUNET_free (plugin_name); plugin_name = NULL; if (last_sync > 0) sync_stats (); @@ -1490,7 +1490,7 @@ run (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _ ("Could not use specified filename `%s' for bloomfilter.\n"), NULL != fn ? fn : ""); - GNUNET_free_non_null (fn); + GNUNET_free (fn); fn = NULL; } if (NULL != fn) @@ -1566,7 +1566,7 @@ run (void *cls, 5); /* approx. 3% false positives at max use */ refresh_bf = GNUNET_YES; } - GNUNET_free_non_null (fn); + GNUNET_free (fn); if (NULL == filter) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c index b3b30f256..cecc37978 100644 --- a/src/datastore/plugin_datastore_sqlite.c +++ b/src/datastore/plugin_datastore_sqlite.c @@ -550,7 +550,7 @@ database_shutdown (struct Plugin *plugin) #endif if (SQLITE_OK != result) LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR, "sqlite3_close"); - GNUNET_free_non_null (plugin->fn); + GNUNET_free (plugin->fn); } @@ -640,7 +640,7 @@ sqlite_plugin_put (void *cls, GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, "sqlite3_step"); cont (cont_cls, key, size, GNUNET_SYSERR, msg); - GNUNET_free_non_null (msg); + GNUNET_free (msg); return; } int changes = sqlite3_changes (plugin->dbh); @@ -724,12 +724,12 @@ sqlite_plugin_put (void *cls, database_shutdown (plugin); database_setup (plugin->env->cfg, plugin); cont (cont_cls, key, size, GNUNET_SYSERR, msg); - GNUNET_free_non_null (msg); + GNUNET_free (msg); return; } GNUNET_SQ_reset (plugin->dbh, stmt); cont (cont_cls, key, size, ret, msg); - GNUNET_free_non_null (msg); + GNUNET_free (msg); } diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c index dbe590bab..e72a6acd3 100644 --- a/src/datastore/test_datastore_api.c +++ b/src/datastore/test_datastore_api.c @@ -198,7 +198,7 @@ check_success (void *cls, msg); crc->phase = RP_ERROR; } - GNUNET_free_non_null (crc->data); + GNUNET_free (crc->data); crc->data = NULL; GNUNET_SCHEDULER_add_now (&run_continuation, crc); } diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c index 7bec0d064..175765267 100644 --- a/src/datastore/test_datastore_api_management.c +++ b/src/datastore/test_datastore_api_management.c @@ -131,7 +131,7 @@ check_success (void *cls, int success, struct GNUNET_TIME_Absolute if (GNUNET_OK != success) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s\n", msg); GNUNET_assert (GNUNET_OK == success); - GNUNET_free_non_null (crc->data); + GNUNET_free (crc->data); crc->data = NULL; GNUNET_SCHEDULER_add_now (&run_continuation, crc); } diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index c6443f102..1eaed8a5c 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c @@ -1258,7 +1258,7 @@ GNUNET_DHT_monitor_stop (struct GNUNET_DHT_MonitorHandle *mh) } GNUNET_MQ_send (handle->mq, env); - GNUNET_free_non_null (mh->key); + GNUNET_free (mh->key); GNUNET_free (mh); } diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index 2dd49a1b6..da46dcfee 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c @@ -69,7 +69,7 @@ static void process_hello (void *cls, const struct GNUNET_MessageHeader *message) { - GNUNET_free_non_null (GDS_my_hello); + GNUNET_free (GDS_my_hello); GDS_my_hello = GNUNET_malloc (ntohs (message->size)); GNUNET_memcpy (GDS_my_hello, message, @@ -106,7 +106,7 @@ shutdown_task (void *cls) GNUNET_YES); GDS_stats = NULL; } - GNUNET_free_non_null (GDS_my_hello); + GNUNET_free (GDS_my_hello); GDS_my_hello = NULL; GDS_CLIENTS_stop (); } diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c index be6e22d01..1e44c1fad 100644 --- a/src/dht/gnunet-service-dht_clients.c +++ b/src/dht/gnunet-service-dht_clients.c @@ -333,7 +333,7 @@ client_disconnect_cb (void *cls, struct ClientMonitorRecord *next; next = monitor->next; - GNUNET_free_non_null (monitor->key); + GNUNET_free (monitor->key); GNUNET_CONTAINER_DLL_remove (monitor_head, monitor_tail, monitor); @@ -938,7 +938,7 @@ handle_dht_local_monitor_stop (void *cls, GNUNET_CONTAINER_DLL_remove (monitor_head, monitor_tail, r); - GNUNET_free_non_null (r->key); + GNUNET_free (r->key); GNUNET_free (r); return; /* Delete only ONE entry */ } @@ -1281,7 +1281,7 @@ GDS_CLIENTS_process_get (uint32_t options, env); } } - GNUNET_free_non_null (cl); + GNUNET_free (cl); } @@ -1363,7 +1363,7 @@ GDS_CLIENTS_process_get_resp (enum GNUNET_BLOCK_Type type, env); } } - GNUNET_free_non_null (cl); + GNUNET_free (cl); } @@ -1445,7 +1445,7 @@ GDS_CLIENTS_process_put (uint32_t options, env); } } - GNUNET_free_non_null (cl); + GNUNET_free (cl); } diff --git a/src/dht/gnunet-service-dht_hello.c b/src/dht/gnunet-service-dht_hello.c index a0141d1fb..906391334 100644 --- a/src/dht/gnunet-service-dht_hello.c +++ b/src/dht/gnunet-service-dht_hello.c @@ -86,7 +86,7 @@ process_hello (void *cls, gettext_noop ("# HELLOs obtained from peerinfo"), 1, GNUNET_NO); hm = GNUNET_CONTAINER_multipeermap_get (peer_to_hello, peer); - GNUNET_free_non_null (hm); + GNUNET_free (hm); hm = GNUNET_malloc (GNUNET_HELLO_size (hello)); GNUNET_memcpy (hm, hello, GNUNET_HELLO_size (hello)); GNUNET_assert (GNUNET_SYSERR != diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index fce69d3f6..b211fca6b 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c @@ -1436,7 +1436,7 @@ GDS_NEIGHBOURS_handle_get (enum GNUNET_BLOCK_Type type, if (msize + sizeof(struct PeerGetMessage) >= GNUNET_MAX_MESSAGE_SIZE) { GNUNET_break (0); - GNUNET_free_non_null (reply_bf); + GNUNET_free (reply_bf); GNUNET_free (targets); return GNUNET_NO; } @@ -1493,7 +1493,7 @@ GDS_NEIGHBOURS_handle_get (enum GNUNET_BLOCK_Type type, env); } GNUNET_free (targets); - GNUNET_free_non_null (reply_bf); + GNUNET_free (reply_bf); return (skip_count < target_count) ? GNUNET_OK : GNUNET_NO; } diff --git a/src/dht/gnunet_dht_profiler.c b/src/dht/gnunet_dht_profiler.c index 5a73880be..ba50c3d1a 100644 --- a/src/dht/gnunet_dht_profiler.c +++ b/src/dht/gnunet_dht_profiler.c @@ -323,7 +323,7 @@ do_shutdown (void *cls) GNUNET_TESTBED_operation_done (bandwidth_stats_op); bandwidth_stats_op = NULL; } - GNUNET_free_non_null (a_ac); + GNUNET_free (a_ac); } diff --git a/src/dns/gnunet-dns-monitor.c b/src/dns/gnunet-dns-monitor.c index f6c0d0660..d9830baa4 100644 --- a/src/dns/gnunet-dns-monitor.c +++ b/src/dns/gnunet-dns-monitor.c @@ -233,7 +233,7 @@ display_record (const struct GNUNET_DNSPARSER_Record *record) (unsigned int) (GNUNET_TIME_absolute_get_remaining ( record->expiration_time).rel_value_us / 1000LL / 1000LL)); - GNUNET_free_non_null (tmp); + GNUNET_free (tmp); } diff --git a/src/dns/gnunet-dns-redirector.c b/src/dns/gnunet-dns-redirector.c index 606864c8a..835497dba 100644 --- a/src/dns/gnunet-dns-redirector.c +++ b/src/dns/gnunet-dns-redirector.c @@ -172,7 +172,7 @@ modify_request (void *cls, "Injecting modified DNS response\n"); GNUNET_DNS_request_answer (rh, len, buf); } - GNUNET_free_non_null (buf); + GNUNET_free (buf); } diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c index 25fbcf430..1cb238add 100644 --- a/src/dns/gnunet-service-dns.c +++ b/src/dns/gnunet-service-dns.c @@ -257,7 +257,7 @@ static struct GNUNET_DNSSTUB_Context *dnsstub; static void cleanup_rr (struct RequestRecord *rr) { - GNUNET_free_non_null (rr->payload); + GNUNET_free (rr->payload); rr->payload = NULL; rr->payload_length = 0; GNUNET_array_grow (rr->client_wait_list, @@ -280,7 +280,7 @@ cleanup_task (void *cls GNUNET_UNUSED) hijacker = NULL; } for (unsigned int i = 0; i < 8; i++) - GNUNET_free_non_null (helper_argv[i]); + GNUNET_free (helper_argv[i]); for (unsigned int i = 0; i <= UINT16_MAX; i++) cleanup_rr (&requests[i]); if (NULL != stats) @@ -762,7 +762,7 @@ process_dns_result (void *cls, LOG (GNUNET_ERROR_TYPE_DEBUG, "Got a response from the stub resolver for DNS request %llu intercepted locally!\n", (unsigned long long) rr->request_id); - GNUNET_free_non_null (rr->payload); + GNUNET_free (rr->payload); rr->payload = GNUNET_malloc (r); GNUNET_memcpy (rr->payload, dns, @@ -862,7 +862,7 @@ handle_client_response (void *cls, next_phase (rr); return; } - GNUNET_free_non_null (rr->payload); + GNUNET_free (rr->payload); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Changing DNS reply according to client specifications\n"); rr->payload = GNUNET_malloc (msize); @@ -1005,7 +1005,7 @@ process_helper_messages (void *cls, rr = &requests[dns->id]; /* clean up from previous request */ - GNUNET_free_non_null (rr->payload); + GNUNET_free (rr->payload); rr->payload = NULL; GNUNET_array_grow (rr->client_wait_list, rr->client_wait_list_length, @@ -1115,7 +1115,7 @@ run (void *cls, "dns", "DNS_EXIT", _ ("need a valid IPv4 or IPv6 address\n")); - GNUNET_free_non_null (dns_exit); + GNUNET_free (dns_exit); } binary = GNUNET_OS_get_suid_binary_path (cfg, "gnunet-helper-dns"); diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c index b193176c4..27eba018f 100644 --- a/src/exit/gnunet-daemon-exit.c +++ b/src/exit/gnunet-daemon-exit.c @@ -2471,7 +2471,7 @@ free_service_record (void *cls, key, service)); GNUNET_CADET_close_port (service->port); - GNUNET_free_non_null (service->name); + GNUNET_free (service->name); GNUNET_free (service); return GNUNET_OK; } @@ -2613,7 +2613,7 @@ store_service (int proto, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)) { GNUNET_CADET_close_port (service->port); - GNUNET_free_non_null (service->name); + GNUNET_free (service->name); GNUNET_free (service); GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _ ("Got duplicate service records for `%s:%u'\n"), @@ -3340,7 +3340,7 @@ cleanup (void *cls) stats = NULL; } for (i = 0; i < 8; i++) - GNUNET_free_non_null (exit_argv[i]); + GNUNET_free (exit_argv[i]); } @@ -3706,7 +3706,7 @@ advertise_dns_exit () "dns", "DNS_RESOLVER", _ ("need a valid IPv4 or IPv6 address\n")); - GNUNET_free_non_null (dns_exit); + GNUNET_free (dns_exit); return; } /* open port */ @@ -3807,7 +3807,7 @@ setup_exit_helper_args () GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "EXIT", "IPV6ADDR"); - GNUNET_free_non_null (ipv6addr); + GNUNET_free (ipv6addr); return GNUNET_SYSERR; } exit_argv[3] = ipv6addr; @@ -3858,7 +3858,7 @@ setup_exit_helper_args () GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "EXIT", "IPV4ADDR"); - GNUNET_free_non_null (ipv4addr); + GNUNET_free (ipv4addr); return GNUNET_SYSERR; } exit_argv[5] = ipv4addr; @@ -3875,7 +3875,7 @@ setup_exit_helper_args () GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "EXIT", "IPV4MASK"); - GNUNET_free_non_null (ipv4mask); + GNUNET_free (ipv4mask); return GNUNET_SYSERR; } exit_argv[6] = ipv4mask; @@ -4023,7 +4023,7 @@ run (void *cls, regex = NULL; else regex = GNUNET_TUN_ipv4policy2regex (policy); - GNUNET_free_non_null (policy); + GNUNET_free (policy); if (NULL != regex) { (void) GNUNET_asprintf (&prefixed_regex, @@ -4063,7 +4063,7 @@ run (void *cls, regex = NULL; else regex = GNUNET_TUN_ipv6policy2regex (policy); - GNUNET_free_non_null (policy); + GNUNET_free (policy); if (NULL != regex) { (void) GNUNET_asprintf (&prefixed_regex, diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c index 3d2ba3e99..920786146 100644 --- a/src/fs/fs_api.c +++ b/src/fs/fs_api.c @@ -570,7 +570,7 @@ GNUNET_FS_data_reader_copy_ (void *cls, return 0; if (0 == max) { - GNUNET_free_non_null (data); + GNUNET_free (data); return 0; } GNUNET_memcpy (buf, &data[offset], max); @@ -1132,15 +1132,15 @@ deserialize_fi_node (struct GNUNET_FS_Handle *h, GNUNET_free (filename); filename = NULL; } - GNUNET_free_non_null (ksks); - GNUNET_free_non_null (skss); - GNUNET_free_non_null (chks); + GNUNET_free (ksks); + GNUNET_free (skss); + GNUNET_free (chks); return ret; cleanup: - GNUNET_free_non_null (ksks); - GNUNET_free_non_null (chks); - GNUNET_free_non_null (skss); - GNUNET_free_non_null (filename); + GNUNET_free (ksks); + GNUNET_free (chks); + GNUNET_free (skss); + GNUNET_free (filename); GNUNET_FS_file_information_destroy (ret, NULL, NULL); return NULL; } @@ -1417,11 +1417,11 @@ GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *fi) GNUNET_break (0); goto cleanup; } - GNUNET_free_non_null (chks); + GNUNET_free (chks); chks = NULL; - GNUNET_free_non_null (ksks); + GNUNET_free (ksks); ksks = NULL; - GNUNET_free_non_null (skss); + GNUNET_free (skss); skss = NULL; switch (b) @@ -1527,9 +1527,9 @@ GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *fi) cleanup: if (NULL != wh) (void) GNUNET_BIO_write_close (wh, NULL); - GNUNET_free_non_null (chks); - GNUNET_free_non_null (ksks); - GNUNET_free_non_null (skss); + GNUNET_free (chks); + GNUNET_free (ksks); + GNUNET_free (skss); fn = get_serialization_file_name (fi->h, GNUNET_FS_SYNC_PATH_FILE_INFO, fi->serialization); @@ -1729,10 +1729,10 @@ deserialize_publish_file (void *cls, const char *filename) pc->top = GNUNET_FS_make_top (h, &GNUNET_FS_publish_signal_suspend_, pc); return GNUNET_OK; cleanup: - GNUNET_free_non_null (pc->nid); - GNUNET_free_non_null (pc->nuid); - GNUNET_free_non_null (fi_root); - GNUNET_free_non_null (fi_pos); + GNUNET_free (pc->nid); + GNUNET_free (pc->nuid); + GNUNET_free (fi_root); + GNUNET_free (fi_pos); if ((NULL != rh) && (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg))) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, @@ -2131,7 +2131,7 @@ GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc) goto cleanup; } } - GNUNET_free_non_null (uris); + GNUNET_free (uris); uris = NULL; if (GNUNET_OK != GNUNET_BIO_write_close (wh, NULL)) { @@ -2144,7 +2144,7 @@ GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc) cleanup: if (NULL != wh) (void) GNUNET_BIO_write_close (wh, NULL); - GNUNET_free_non_null (uris); + GNUNET_free (uris); if (0 != unlink (fn)) GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", fn); GNUNET_free (fn); @@ -2235,10 +2235,10 @@ GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr) GNUNET_break (0); goto cleanup; } - GNUNET_free_non_null (uris); + GNUNET_free (uris); return; cleanup: - GNUNET_free_non_null (uris); + GNUNET_free (uris); if (NULL != wh) (void) GNUNET_BIO_write_close (wh, NULL); remove_sync_file_in_dir (sr->h, @@ -2309,7 +2309,7 @@ GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc) cleanup: if (NULL != wh) (void) GNUNET_BIO_write_close (wh, NULL); - GNUNET_free_non_null (uris); + GNUNET_free (uris); GNUNET_FS_remove_sync_file_ (sc->h, category, sc->serialization); GNUNET_free (sc->serialization); sc->serialization = NULL; @@ -2359,7 +2359,7 @@ deserialize_unindex_file (void *cls, const char *filename) (GNUNET_OK != GNUNET_BIO_read_int32 (rh, "ksk offset", (int32_t *) &uc->ksk_offset))) { - GNUNET_free_non_null (uris); + GNUNET_free (uris); GNUNET_break (0); goto cleanup; } @@ -2370,7 +2370,7 @@ deserialize_unindex_file (void *cls, const char *filename) if (NULL == uc->ksk_uri) { GNUNET_break (0); - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); goto cleanup; } } @@ -2472,7 +2472,7 @@ deserialize_unindex_file (void *cls, const char *filename) } return GNUNET_OK; cleanup: - GNUNET_free_non_null (uc->filename); + GNUNET_free (uc->filename); if ((NULL != rh) && (GNUNET_OK != GNUNET_BIO_read_close (rh, &emsg))) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, @@ -2485,7 +2485,7 @@ cleanup: GNUNET_FS_remove_sync_file_ (h, GNUNET_FS_SYNC_PATH_MASTER_UNINDEX, uc->serialization); - GNUNET_free_non_null (uc->serialization); + GNUNET_free (uc->serialization); GNUNET_free (uc); return GNUNET_OK; } @@ -2665,10 +2665,10 @@ deserialize_search_result (void *cls, const char *filename) } return GNUNET_OK; cleanup: - GNUNET_free_non_null (download); - GNUNET_free_non_null (emsg); - GNUNET_free_non_null (uris); - GNUNET_free_non_null (update_srch); + GNUNET_free (download); + GNUNET_free (emsg); + GNUNET_free (uris); + GNUNET_free (update_srch); if (NULL != sr->uri) GNUNET_FS_uri_destroy (sr->uri); if (NULL != sr->meta) @@ -2823,8 +2823,8 @@ free_search_context (struct GNUNET_FS_SearchContext *sc) : GNUNET_FS_SYNC_PATH_CHILD_SEARCH, sc->serialization); } - GNUNET_free_non_null (sc->serialization); - GNUNET_free_non_null (sc->emsg); + GNUNET_free (sc->serialization); + GNUNET_free (sc->emsg); if (NULL != sc->uri) GNUNET_FS_uri_destroy (sc->uri); if (NULL != sc->master_result_map) @@ -2896,10 +2896,10 @@ free_download_context (struct GNUNET_FS_DownloadContext *dc) GNUNET_CONTAINER_meta_data_destroy (dc->meta); if (NULL != dc->uri) GNUNET_FS_uri_destroy (dc->uri); - GNUNET_free_non_null (dc->temp_filename); - GNUNET_free_non_null (dc->emsg); - GNUNET_free_non_null (dc->filename); - GNUNET_free_non_null (dc->serialization); + GNUNET_free (dc->temp_filename); + GNUNET_free (dc->emsg); + GNUNET_free (dc->filename); + GNUNET_free (dc->serialization); while (NULL != (dcc = dc->child_head)) { GNUNET_CONTAINER_DLL_remove (dc->child_head, dc->child_tail, dcc); @@ -3020,8 +3020,8 @@ deserialize_download (struct GNUNET_FS_Handle *h, dc->task = GNUNET_SCHEDULER_add_now (&GNUNET_FS_download_start_task_, dc); return; cleanup: - GNUNET_free_non_null (uris); - GNUNET_free_non_null (emsg); + GNUNET_free (uris); + GNUNET_free (emsg); free_download_context (dc); } @@ -3127,9 +3127,9 @@ deserialize_search (struct GNUNET_FS_Handle *h, GNUNET_free (uris); return sc; cleanup: - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); free_search_context (sc); - GNUNET_free_non_null (uris); + GNUNET_free (uris); return NULL; } diff --git a/src/fs/fs_directory.c b/src/fs/fs_directory.c index 1ef5fa3bb..9a198d8d7 100644 --- a/src/fs/fs_directory.c +++ b/src/fs/fs_directory.c @@ -309,8 +309,8 @@ GNUNET_FS_directory_list_contents (size_t size, full_data.size, full_data.data); } - GNUNET_free_non_null (full_data.data); - GNUNET_free_non_null (filename); + GNUNET_free (full_data.data); + GNUNET_free (filename); GNUNET_CONTAINER_meta_data_destroy (md); GNUNET_FS_uri_destroy (uri); } @@ -630,9 +630,9 @@ GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, "malloc"); *rsize = 0; *rdata = NULL; - GNUNET_free_non_null (sizes); - GNUNET_free_non_null (perm); - GNUNET_free_non_null (bes); + GNUNET_free (sizes); + GNUNET_free (perm); + GNUNET_free (bes); return GNUNET_SYSERR; } *rdata = data; @@ -662,9 +662,9 @@ GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, GNUNET_memcpy (&data[off - sizes[i]], &(bes[i])[1], sizes[i]); GNUNET_free (bes[i]); } - GNUNET_free_non_null (sizes); - GNUNET_free_non_null (perm); - GNUNET_free_non_null (bes); + GNUNET_free (sizes); + GNUNET_free (perm); + GNUNET_free (bes); GNUNET_assert (off == size); GNUNET_CONTAINER_meta_data_destroy (bld->meta); GNUNET_free (bld); diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c index 11efa053b..cb50182f9 100644 --- a/src/fs/fs_dirmetascan.c +++ b/src/fs/fs_dirmetascan.c @@ -106,7 +106,7 @@ GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds) GNUNET_FS_share_tree_free (ds->toplevel); if (NULL != ds->stop_task) GNUNET_SCHEDULER_cancel (ds->stop_task); - GNUNET_free_non_null (ds->ex_arg); + GNUNET_free (ds->ex_arg); GNUNET_free (ds->filename_expanded); GNUNET_free (ds); } diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index 4d03b6546..6154e8be0 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c @@ -960,7 +960,7 @@ trigger_recursive_download (void *cls, "Failed to create directory for recursive download of `%s'\n"), full_name); GNUNET_free (full_name); - GNUNET_free_non_null (fn); + GNUNET_free (fn); return; } @@ -981,9 +981,9 @@ trigger_recursive_download (void *cls, dc->options, NULL, dc); - GNUNET_free_non_null (full_name); - GNUNET_free_non_null (temp_name); - GNUNET_free_non_null (fn); + GNUNET_free (full_name); + GNUNET_free (temp_name); + GNUNET_free (fn); } @@ -999,7 +999,7 @@ GNUNET_FS_free_download_request_ (struct DownloadRequest *dr) return; for (unsigned int i = 0; i < dr->num_children; i++) GNUNET_FS_free_download_request_ (dr->children[i]); - GNUNET_free_non_null (dr->children); + GNUNET_free (dr->children); GNUNET_free (dr); } @@ -2011,11 +2011,11 @@ GNUNET_FS_download_signal_suspend_ (void *cls) GNUNET_CONTAINER_multihashmap_destroy (dc->active); dc->active = NULL; } - GNUNET_free_non_null (dc->filename); + GNUNET_free (dc->filename); GNUNET_CONTAINER_meta_data_destroy (dc->meta); GNUNET_FS_uri_destroy (dc->uri); - GNUNET_free_non_null (dc->temp_filename); - GNUNET_free_non_null (dc->serialization); + GNUNET_free (dc->temp_filename); + GNUNET_free (dc->serialization); GNUNET_assert (NULL == dc->job_queue); GNUNET_free (dc); } @@ -2409,7 +2409,7 @@ GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete) dc->temp_filename); GNUNET_free (dc->temp_filename); } - GNUNET_free_non_null (dc->serialization); + GNUNET_free (dc->serialization); GNUNET_assert (NULL == dc->job_queue); GNUNET_free (dc); } diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index 28bbf12dd..3324abd58 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c @@ -75,7 +75,7 @@ void GNUNET_FS_file_information_set_filename (struct GNUNET_FS_FileInformation *s, const char *filename) { - GNUNET_free_non_null (s->filename); + GNUNET_free (s->filename); if (filename) s->filename = GNUNET_strdup (filename); else @@ -426,7 +426,7 @@ GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, &fi->bo, &no, &fi->client_info); - GNUNET_free_non_null (fi->data.dir.dir_data); + GNUNET_free (fi->data.dir.dir_data); } else { @@ -447,8 +447,8 @@ GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, &fi->data.file.do_index, &fi->client_info); } - GNUNET_free_non_null (fi->filename); - GNUNET_free_non_null (fi->emsg); + GNUNET_free (fi->filename); + GNUNET_free (fi->emsg); if (NULL != fi->sks_uri) GNUNET_FS_uri_destroy (fi->sks_uri); if (NULL != fi->chk_uri) @@ -462,7 +462,7 @@ GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, GNUNET_FS_uri_destroy (fi->keywords); if (NULL != fi->meta) GNUNET_CONTAINER_meta_data_destroy (fi->meta); - GNUNET_free_non_null (fi->serialization); + GNUNET_free (fi->serialization); if (NULL != fi->te) { GNUNET_FS_tree_encoder_finish (fi->te, NULL); diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c index f098032d7..508f9cadc 100644 --- a/src/fs/fs_namespace.c +++ b/src/fs/fs_namespace.c @@ -301,8 +301,8 @@ read_update_information_graph (struct GNUNET_FS_Handle *h, if (GNUNET_OK != GNUNET_BIO_read_spec_commit (rh, rs)) { GNUNET_break (0); - GNUNET_free_non_null (n->id); - GNUNET_free_non_null (n->update); + GNUNET_free (n->id); + GNUNET_free (n->update); if (n->md != NULL) GNUNET_CONTAINER_meta_data_destroy (n->md); GNUNET_free (n); @@ -315,7 +315,7 @@ read_update_information_graph (struct GNUNET_FS_Handle *h, GNUNET_break (0); GNUNET_free (emsg); GNUNET_free (n->id); - GNUNET_free_non_null (n->update); + GNUNET_free (n->update); GNUNET_CONTAINER_meta_data_destroy (n->md); GNUNET_free (n); break; diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 8bb57b1e2..fddc65d67 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c @@ -85,9 +85,9 @@ publish_cleanup (struct GNUNET_FS_PublishContext *pc) pc->fhc = NULL; } GNUNET_FS_file_information_destroy (pc->fi, NULL, NULL); - GNUNET_free_non_null (pc->nid); - GNUNET_free_non_null (pc->nuid); - GNUNET_free_non_null (pc->serialization); + GNUNET_free (pc->nid); + GNUNET_free (pc->nuid); + GNUNET_free (pc->serialization); if (NULL != pc->dsh) { GNUNET_DATASTORE_disconnect (pc->dsh, GNUNET_NO); @@ -650,7 +650,7 @@ publish_content (struct GNUNET_FS_PublishContext *pc) dirpos->data.file.file_size, raw_data, &emsg)) { - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); GNUNET_free (raw_data); raw_data = NULL; } @@ -660,10 +660,10 @@ publish_content (struct GNUNET_FS_PublishContext *pc) } GNUNET_FS_directory_builder_add (db, dirpos->chk_uri, dirpos->meta, raw_data); - GNUNET_free_non_null (raw_data); + GNUNET_free (raw_data); dirpos = dirpos->next; } - GNUNET_free_non_null (p->data.dir.dir_data); + GNUNET_free (p->data.dir.dir_data); p->data.dir.dir_data = NULL; p->data.dir.dir_size = 0; GNUNET_FS_directory_builder_finish (db, &p->data.dir.dir_size, @@ -1281,7 +1281,7 @@ suspend_operation (struct GNUNET_FS_FileInformation *fi, } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Suspending publish operation\n"); - GNUNET_free_non_null (fi->serialization); + GNUNET_free (fi->serialization); fi->serialization = NULL; off = (NULL == fi->chk_uri) ? 0 : (GNUNET_YES == fi->is_directory) ? fi->data.dir.dir_size : fi->data.file.file_size; diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 8e2d7deba..3dbee43ef 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c @@ -830,7 +830,7 @@ process_kblock (struct GNUNET_FS_SearchContext *sc, &pt[1], emsg); } - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); return; } j = eos - pt + 1; @@ -900,7 +900,7 @@ process_sblock (struct GNUNET_FS_SearchContext *sc, _ ("Failed to parse URI `%s': %s\n"), uris, emsg); GNUNET_break_op (0); /* ublock malformed */ - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); GNUNET_CONTAINER_meta_data_destroy (meta); return; } @@ -1548,10 +1548,10 @@ search_result_suspend (void *cls, sr->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc); } GNUNET_break (NULL == sr->client_info); - GNUNET_free_non_null (sr->serialization); + GNUNET_free (sr->serialization); GNUNET_FS_uri_destroy (sr->uri); GNUNET_CONTAINER_meta_data_destroy (sr->meta); - GNUNET_free_non_null (sr->keyword_bitmap); + GNUNET_free (sr->keyword_bitmap); GNUNET_free (sr); return GNUNET_OK; } @@ -1596,10 +1596,10 @@ GNUNET_FS_search_signal_suspend_ (void *cls) GNUNET_free (sc->requests[i].keyword); } } - GNUNET_free_non_null (sc->requests); - GNUNET_free_non_null (sc->emsg); + GNUNET_free (sc->requests); + GNUNET_free (sc->emsg); GNUNET_FS_uri_destroy (sc->uri); - GNUNET_free_non_null (sc->serialization); + GNUNET_free (sc->serialization); GNUNET_free (sc); } @@ -1760,10 +1760,10 @@ search_result_free (void *cls, GNUNET_break (NULL == sr->probe_ctx); GNUNET_break (NULL == sr->probe_cancel_task); GNUNET_break (NULL == sr->client_info); - GNUNET_free_non_null (sr->serialization); + GNUNET_free (sr->serialization); GNUNET_FS_uri_destroy (sr->uri); GNUNET_CONTAINER_meta_data_destroy (sr->meta); - GNUNET_free_non_null (sr->keyword_bitmap); + GNUNET_free (sr->keyword_bitmap); GNUNET_free (sr); return GNUNET_OK; } @@ -1825,8 +1825,8 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc) for (i = 0; i < sc->uri->data.ksk.keywordCount; i++) GNUNET_CONTAINER_multihashmap_destroy (sc->requests[i].results); } - GNUNET_free_non_null (sc->requests); - GNUNET_free_non_null (sc->emsg); + GNUNET_free (sc->requests); + GNUNET_free (sc->emsg); GNUNET_FS_uri_destroy (sc->uri); GNUNET_free (sc); } diff --git a/src/fs/fs_sharetree.c b/src/fs/fs_sharetree.c index e291938b5..ac850076d 100644 --- a/src/fs/fs_sharetree.c +++ b/src/fs/fs_sharetree.c @@ -447,8 +447,8 @@ GNUNET_FS_share_tree_free (struct GNUNET_FS_ShareTreeItem *toplevel) GNUNET_CONTAINER_meta_data_destroy (toplevel->meta); if (NULL != toplevel->ksk_uri) GNUNET_FS_uri_destroy (toplevel->ksk_uri); - GNUNET_free_non_null (toplevel->filename); - GNUNET_free_non_null (toplevel->short_filename); + GNUNET_free (toplevel->filename); + GNUNET_free (toplevel->short_filename); GNUNET_free (toplevel); } diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c index a0fe336df..dc4b214d9 100644 --- a/src/fs/fs_test_lib.c +++ b/src/fs/fs_test_lib.c @@ -195,7 +195,7 @@ report_uri (void *cls) if ((GNUNET_YES != po->do_index) && (NULL != po->publish_tmp_file)) (void) GNUNET_DISK_directory_remove (po->publish_tmp_file); - GNUNET_free_non_null (po->publish_tmp_file); + GNUNET_free (po->publish_tmp_file); GNUNET_free (po); } @@ -217,7 +217,7 @@ publish_timeout (void *cls) GNUNET_FS_publish_stop (po->publish_context); po->publish_cont (po->publish_cont_cls, NULL, NULL); (void) GNUNET_DISK_directory_remove (po->publish_tmp_file); - GNUNET_free_non_null (po->publish_tmp_file); + GNUNET_free (po->publish_tmp_file); GNUNET_free (po); } diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c index e7f922823..6203690d2 100644 --- a/src/fs/fs_tree.c +++ b/src/fs/fs_tree.c @@ -454,7 +454,7 @@ GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, if (emsg != NULL) *emsg = te->emsg; else - GNUNET_free_non_null (te->emsg); + GNUNET_free (te->emsg); GNUNET_free (te->chk_tree); GNUNET_free (te); } diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c index f2315d7d0..8c27af9de 100644 --- a/src/fs/fs_unindex.c +++ b/src/fs/fs_unindex.c @@ -415,7 +415,7 @@ GNUNET_FS_unindex_do_extract_keywords_ (struct GNUNET_FS_UnindexContext *uc) GNUNET_NO, ex, &unindex_directory_scan_cb, uc); - GNUNET_free_non_null (ex); + GNUNET_free (ex); } @@ -777,8 +777,8 @@ GNUNET_FS_unindex_signal_suspend_ (void *cls) UNINDEX_STATE_COMPLETE) ? uc->file_size : 0); GNUNET_break (NULL == uc->client_info); GNUNET_free (uc->filename); - GNUNET_free_non_null (uc->serialization); - GNUNET_free_non_null (uc->emsg); + GNUNET_free (uc->serialization); + GNUNET_free (uc->emsg); GNUNET_free (uc); } @@ -892,7 +892,7 @@ GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc) (uc->state == UNINDEX_STATE_COMPLETE) ? uc->file_size : 0); GNUNET_break (NULL == uc->client_info); - GNUNET_free_non_null (uc->emsg); + GNUNET_free (uc->emsg); GNUNET_free (uc->filename); GNUNET_free (uc); } diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 410f3c815..9c430ad9d 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c @@ -353,7 +353,7 @@ uri_ksk_parse (const char *s, char **emsg) return ret; CLEANUP: for (i = 0; i < max; i++) - GNUNET_free_non_null (keywords[i]); + GNUNET_free (keywords[i]); GNUNET_free (keywords); GNUNET_free (dup); return NULL; @@ -1172,7 +1172,7 @@ GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, const char **argv) strlen (GNUNET_FS_URI_PREFIX))) && (NULL != (uri = GNUNET_FS_uri_parse (argv[0], &emsg)))) return uri; - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); uri = GNUNET_new (struct GNUNET_FS_Uri); uri->type = GNUNET_FS_URI_KSK; uri->data.ksk.keywordCount = argc; @@ -1825,7 +1825,7 @@ GNUNET_FS_uri_ksk_create_from_meta_data ( ret->data.ksk.keywords, ret->data.ksk.keywordCount); if (ent > 0) - GNUNET_free_non_null (full_name); + GNUNET_free (full_name); return ret; } diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c index 3aed0268b..ee4a719e0 100644 --- a/src/fs/gnunet-auto-share.c +++ b/src/fs/gnunet-auto-share.c @@ -227,13 +227,13 @@ load_state () return; rh = NULL; error: - GNUNET_free_non_null (fn); + GNUNET_free (fn); if (NULL != rh) (void) GNUNET_BIO_read_close (rh, &emsg); GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _ ("Failed to load state: %s\n"), emsg); - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); } @@ -781,7 +781,7 @@ main (int argc, char *const *argv) shc_chld = NULL; GNUNET_DISK_pipe_close (sigpipe); sigpipe = NULL; - GNUNET_free_non_null (cfg_filename); + GNUNET_free (cfg_filename); cfg_filename = NULL; GNUNET_free_nz ((void *) argv); return ok; diff --git a/src/fs/gnunet-directory.c b/src/fs/gnunet-directory.c index 10a09f73b..ef5c40ae2 100644 --- a/src/fs/gnunet-directory.c +++ b/src/fs/gnunet-directory.c @@ -106,7 +106,7 @@ print_entry (void *cls, GNUNET_CONTAINER_meta_data_iterate (meta, &item_printer, NULL); printf ("\n"); printf (_ ("Directory `%s' contents:\n"), name ? name : ""); - GNUNET_free_non_null (name); + GNUNET_free (name); return; } string = GNUNET_FS_uri_to_string (uri); @@ -114,7 +114,7 @@ print_entry (void *cls, GNUNET_free (string); GNUNET_CONTAINER_meta_data_iterate (meta, &item_printer, NULL); printf ("\n"); - GNUNET_free_non_null (name); + GNUNET_free (name); } diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c index b10e6163c..91fcd8f8a 100644 --- a/src/fs/gnunet-publish.c +++ b/src/fs/gnunet-publish.c @@ -729,7 +729,7 @@ identity_continuation (const char *args0) _ ("Failed to access `%s': %s\n"), args0, strerror (errno)); - GNUNET_free_non_null (ex); + GNUNET_free (ex); return; } ds = GNUNET_FS_directory_scan_start (args0, @@ -744,10 +744,10 @@ identity_continuation (const char *args0) "%s", _ ( "Failed to start meta directory scanner. Is gnunet-helper-publish-fs installed?\n")); - GNUNET_free_non_null (ex); + GNUNET_free (ex); return; } - GNUNET_free_non_null (ex); + GNUNET_free (ex); } diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index 098633379..d25ae55e6 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c @@ -127,7 +127,7 @@ clean_task (void *cls) _ ("Failed to write directory with search results to `%s'\n"), output_filename); } - GNUNET_free_non_null (ddata); + GNUNET_free (ddata); GNUNET_free (output_filename); } @@ -197,7 +197,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) NULL); printf ("\n"); fflush (stdout); - GNUNET_free_non_null (filename); + GNUNET_free (filename); GNUNET_free (uri); results++; if ((results_limit > 0) && (results >= results_limit)) diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 71de5668b..150dd72e2 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c @@ -588,7 +588,7 @@ GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr) if (NULL != pr->public_data.target) ext[k++] = *pr->public_data.target; GNUNET_memcpy (&ext[k], bf_data, bf_size); - GNUNET_free_non_null (bf_data); + GNUNET_free (bf_data); return env; } @@ -622,7 +622,7 @@ clean_request (void *cls, const struct GNUNET_HashCode *key, void *value) cont (pr->llc_cont_cls, pr, pr->local_result); } GSF_plan_notify_request_done_ (pr); - GNUNET_free_non_null (pr->replies_seen); + GNUNET_free (pr->replies_seen); GNUNET_BLOCK_group_destroy (pr->bg); pr->bg = NULL; GNUNET_PEER_change_rc (pr->sender_pid, -1); diff --git a/src/fs/test_fs_file_information.c b/src/fs/test_fs_file_information.c index 391b667cb..9305471d6 100644 --- a/src/fs/test_fs_file_information.c +++ b/src/fs/test_fs_file_information.c @@ -129,8 +129,8 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_FS_file_information_destroy (fidir, &mycleaner, NULL); GNUNET_DISK_directory_remove (fn1); GNUNET_DISK_directory_remove (fn2); - GNUNET_free_non_null (fn1); - GNUNET_free_non_null (fn2); + GNUNET_free (fn1); + GNUNET_free (fn2); GNUNET_FS_stop (fs); } diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c index 484884243..c1e10d575 100644 --- a/src/fs/test_fs_namespace.c +++ b/src/fs/test_fs_namespace.c @@ -190,7 +190,7 @@ publish_cont (void *cls, const struct GNUNET_FS_Uri *ksk_uri, const char *emsg) fprintf (stderr, "failed to parse URI `%s': %s\n", sbuf, msg); err = 1; GNUNET_FS_stop (fs); - GNUNET_free_non_null (msg); + GNUNET_free (msg); return; } ksk_search = diff --git a/src/gns/gns_tld_api.c b/src/gns/gns_tld_api.c index 1db5baacb..3ebf07db6 100644 --- a/src/gns/gns_tld_api.c +++ b/src/gns/gns_tld_api.c @@ -340,7 +340,7 @@ GNUNET_GNS_lookup_with_tld_cancel (struct GNUNET_GNS_LookupWithTldRequest *ltr) GNUNET_GNS_lookup_cancel (ltr->lr); ltr->lr = NULL; } - GNUNET_free_non_null (ltr->longest_match); + GNUNET_free (ltr->longest_match); GNUNET_free (ltr->name); GNUNET_free (ltr); return ret; diff --git a/src/gns/gnunet-gns-import.c b/src/gns/gnunet-gns-import.c index 2c7c56411..3c95e782d 100644 --- a/src/gns/gnunet-gns-import.c +++ b/src/gns/gnunet-gns-import.c @@ -346,9 +346,9 @@ get_ego (void *cls, static void shutdown_task (void *cls) { - GNUNET_free_non_null (master_zone_pkey); + GNUNET_free (master_zone_pkey); master_zone_pkey = NULL; - GNUNET_free_non_null (private_zone_pkey); + GNUNET_free (private_zone_pkey); private_zone_pkey = NULL; if (NULL != list_it) { diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c index eb6c6852e..d38204ef1 100644 --- a/src/gns/gnunet-gns-proxy.c +++ b/src/gns/gnunet-gns-proxy.c @@ -831,9 +831,9 @@ cleanup_s5r (struct Socks5Request *s5r) GNUNET_CONTAINER_DLL_remove (s5r_head, s5r_tail, s5r); - GNUNET_free_non_null (s5r->domain); - GNUNET_free_non_null (s5r->leho); - GNUNET_free_non_null (s5r->url); + GNUNET_free (s5r->domain); + GNUNET_free (s5r->leho); + GNUNET_free (s5r->url); for (unsigned int i = 0; i < s5r->num_danes; i++) GNUNET_free (s5r->dane_data[i]); GNUNET_free (s5r); @@ -1311,8 +1311,8 @@ curl_check_hdr (void *buffer, } cleanup: GNUNET_free (ndup); - GNUNET_free_non_null (new_cookie_hdr); - GNUNET_free_non_null (new_location); + GNUNET_free (new_cookie_hdr); + GNUNET_free (new_location); return bytes; } @@ -2446,14 +2446,14 @@ kill_httpd (struct MhdHttpList *hd) GNUNET_CONTAINER_DLL_remove (mhd_httpd_head, mhd_httpd_tail, hd); - GNUNET_free_non_null (hd->domain); + GNUNET_free (hd->domain); MHD_stop_daemon (hd->daemon); if (NULL != hd->httpd_task) { GNUNET_SCHEDULER_cancel (hd->httpd_task); hd->httpd_task = NULL; } - GNUNET_free_non_null (hd->proxy_cert); + GNUNET_free (hd->proxy_cert); if (hd == httpd) httpd = NULL; GNUNET_free (hd); @@ -2657,7 +2657,7 @@ load_key_from_file (gnutls_x509_privkey_t key, _ ("Unable to import private key from file `%s'\n"), keyfile); } - GNUNET_free_non_null (key_data.data); + GNUNET_free (key_data.data); return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK; } @@ -2689,7 +2689,7 @@ load_cert_from_file (gnutls_x509_crt_t crt, _ ("Unable to import certificate from `%s'\n"), certfile); } - GNUNET_free_non_null (cert_data.data); + GNUNET_free (cert_data.data); return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK; } @@ -2921,7 +2921,7 @@ setup_data_transfer (struct Socks5Request *s5r) GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _ ("Failed to pass client to MHD\n")); cleanup_s5r (s5r); - GNUNET_free_non_null (domain); + GNUNET_free (domain); return; } s5r->hd = hd; @@ -2929,7 +2929,7 @@ setup_data_transfer (struct Socks5Request *s5r) s5r->timeout_task = GNUNET_SCHEDULER_add_delayed (HTTP_HANDSHAKE_TIMEOUT, &timeout_s5r_handshake, s5r); - GNUNET_free_non_null (domain); + GNUNET_free (domain); } @@ -3145,7 +3145,7 @@ handle_gns_result (void *cls, break; case GNUNET_GNSRECORD_TYPE_LEHO: - GNUNET_free_non_null (s5r->leho); + GNUNET_free (s5r->leho); s5r->leho = GNUNET_strndup (r->data, r->data_size); break; @@ -3732,10 +3732,10 @@ run (void *cls, gnutls_x509_crt_deinit (proxy_ca.cert); gnutls_x509_privkey_deinit (proxy_ca.key); gnutls_global_deinit (); - GNUNET_free_non_null (cafile_cfg); + GNUNET_free (cafile_cfg); return; } - GNUNET_free_non_null (cafile_cfg); + GNUNET_free (cafile_cfg); if (NULL == (gns_handle = GNUNET_GNS_connect (cfg))) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -3900,7 +3900,7 @@ main (int argc, options, &run, NULL)) ? 0 : 1; MHD_destroy_response (curl_failure_response); - GNUNET_free_non_null ((char *) argv); + GNUNET_free_nz ((char *) argv); return ret; } diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index 7d398c168..cb75b23c7 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c @@ -1675,7 +1675,7 @@ recursive_cname_resolution (struct GNS_ResolverHandle *rh, (off != rd->data_size)) { GNUNET_break_op (0); /* record not well-formed */ - GNUNET_free_non_null (cname); + GNUNET_free (cname); fail_resolution (rh); return; } @@ -1777,8 +1777,8 @@ recursive_gns2dns_resolution (struct GNS_ResolverHandle *rh, (off != rd[i].data_size)) { GNUNET_break_op (0); - GNUNET_free_non_null (n); - GNUNET_free_non_null (ip); + GNUNET_free (n); + GNUNET_free (ip); continue; } /* resolve 'ip' to determine the IP(s) of the DNS @@ -1983,7 +1983,7 @@ handle_gns_resolution_result (void *cls, (off != rd[0].data_size)) { GNUNET_break_op (0); - GNUNET_free_non_null (cname); + GNUNET_free (cname); fail_resolution (rh); return; } @@ -2137,7 +2137,7 @@ handle_gns_resolution_result (void *cls, rd_off++; } } - GNUNET_free_non_null (cname); + GNUNET_free (cname); } break; @@ -2993,7 +2993,7 @@ GNS_resolver_lookup_cancel (struct GNS_ResolverHandle *rh) dr); GNUNET_free (dr); } - GNUNET_free_non_null (rh->leho); + GNUNET_free (rh->leho); GNUNET_free (rh->name); GNUNET_free (rh); } diff --git a/src/gns/plugin_gnsrecord_gns.c b/src/gns/plugin_gnsrecord_gns.c index 370bf1da4..81f2b9eff 100644 --- a/src/gns/plugin_gnsrecord_gns.c +++ b/src/gns/plugin_gnsrecord_gns.c @@ -75,14 +75,14 @@ gns_value_to_string (void *cls, if (NULL == ns) { GNUNET_break_op (0); - GNUNET_free_non_null (ns); + GNUNET_free (ns); return NULL; } /* DNS server IP/name must be UTF-8 */ ip = GNUNET_strdup (&((const char*) data)[off]); GNUNET_asprintf (&nstr, "%s@%s", ns, ip); - GNUNET_free_non_null (ns); - GNUNET_free_non_null (ip); + GNUNET_free (ns); + GNUNET_free (ip); return nstr; } diff --git a/src/gns/plugin_rest_gns.c b/src/gns/plugin_rest_gns.c index feb333350..37313c529 100644 --- a/src/gns/plugin_rest_gns.c +++ b/src/gns/plugin_rest_gns.c @@ -461,7 +461,7 @@ libgnunet_plugin_rest_gns_done (void *cls) plugin->cfg = NULL; - GNUNET_free_non_null (allow_methods); + GNUNET_free (allow_methods); GNUNET_free (api); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Gns REST plugin is finished\n"); return NULL; diff --git a/src/gns/test_gns_proxy.c b/src/gns/test_gns_proxy.c index 12f3f8625..c0002673b 100644 --- a/src/gns/test_gns_proxy.c +++ b/src/gns/test_gns_proxy.c @@ -139,7 +139,7 @@ load_key_from_file (gnutls_x509_privkey_t key, _ ("Unable to import private key from file `%s'\n"), keyfile); } - GNUNET_free_non_null (key_data.data); + GNUNET_free (key_data.data); return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK; } @@ -171,7 +171,7 @@ load_cert_from_file (gnutls_x509_crt_t crt, _ ("Unable to import certificate from `%s'\n"), certfile); } - GNUNET_free_non_null (cert_data.data); + GNUNET_free (cert_data.data); return (GNUTLS_E_SUCCESS != ret) ? GNUNET_SYSERR : GNUNET_OK; } @@ -245,7 +245,7 @@ do_shutdown () MHD_stop_daemon (mhd); mhd = NULL; } - GNUNET_free_non_null (url); + GNUNET_free (url); if (NULL != proxy_proc) { @@ -568,7 +568,7 @@ main (int argc, char *const *argv) options, &run, NULL)) return 1; - GNUNET_free_non_null ((char *) argv); + GNUNET_free ((char *) argv); return global_ret; } diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c index 82fb71c06..c6ebd7c29 100644 --- a/src/gnsrecord/gnsrecord.c +++ b/src/gnsrecord/gnsrecord.c @@ -124,7 +124,7 @@ GNSRECORD_fini () GNUNET_free (plugin->library_name); GNUNET_free (plugin); } - GNUNET_free_non_null (gns_plugins); + GNUNET_free (gns_plugins); gns_plugins = NULL; once = 0; num_plugins = 0; diff --git a/src/gnsrecord/plugin_gnsrecord_dns.c b/src/gnsrecord/plugin_gnsrecord_dns.c index 5410d9546..9ac6fb9e6 100644 --- a/src/gnsrecord/plugin_gnsrecord_dns.c +++ b/src/gnsrecord/plugin_gnsrecord_dns.c @@ -65,7 +65,7 @@ dns_value_to_string (void *cls, if ((NULL == ns) || (off != data_size)) { GNUNET_break_op (0); - GNUNET_free_non_null (ns); + GNUNET_free (ns); return NULL; } return ns; @@ -80,7 +80,7 @@ dns_value_to_string (void *cls, if ((NULL == cname) || (off != data_size)) { GNUNET_break_op (0); - GNUNET_free_non_null (cname); + GNUNET_free (cname); return NULL; } return cname; @@ -121,7 +121,7 @@ dns_value_to_string (void *cls, if ((NULL == ptr) || (off != data_size)) { GNUNET_break_op (0); - GNUNET_free_non_null (ptr); + GNUNET_free (ptr); return NULL; } return ptr; diff --git a/src/hello/hello-ng.c b/src/hello/hello-ng.c index d06feadd5..dd3480a48 100644 --- a/src/hello/hello-ng.c +++ b/src/hello/hello-ng.c @@ -153,7 +153,7 @@ GNUNET_HELLO_extract_address (const void *raw, GNUNET_STRINGS_base64_decode (raws, sc - raws, (void **) &sig)) { GNUNET_break_op (0); - GNUNET_free_non_null (sig); + GNUNET_free (sig); return NULL; } raw_addr = sc3 + 1; diff --git a/src/hello/hello.c b/src/hello/hello.c index 11eec9898..fa859a772 100644 --- a/src/hello/hello.c +++ b/src/hello/hello.c @@ -300,7 +300,7 @@ GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, if (0 == esize) { GNUNET_break (0); - GNUNET_free_non_null (ret); + GNUNET_free (ret); return NULL; } /* need GNUNET_memcpy() due to possibility of misalignment */ diff --git a/src/hostlist/gnunet-daemon-hostlist_client.c b/src/hostlist/gnunet-daemon-hostlist_client.c index c2e8f5d88..5dc2e7f2a 100644 --- a/src/hostlist/gnunet-daemon-hostlist_client.c +++ b/src/hostlist/gnunet-daemon-hostlist_client.c @@ -790,7 +790,7 @@ clean_up () curl_easy_cleanup (curl); curl = NULL; } - GNUNET_free_non_null (current_url); + GNUNET_free (current_url); current_url = NULL; stat_bytes_downloaded = 0; stat_download_in_progress = GNUNET_NO; @@ -1460,7 +1460,7 @@ load_hostlist_file () linked_list_size, GNUNET_NO); - GNUNET_free_non_null (uri); + GNUNET_free (uri); emsg = NULL; (void) GNUNET_BIO_read_close (rh, &emsg); if (emsg != NULL) @@ -1657,15 +1657,15 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c, GNUNET_free (proxytype_str); GNUNET_free (proxy); proxy = NULL; - GNUNET_free_non_null (proxy_username); + GNUNET_free (proxy_username); proxy_username = NULL; - GNUNET_free_non_null (proxy_password); + GNUNET_free (proxy_password); proxy_password = NULL; return GNUNET_SYSERR; } } - GNUNET_free_non_null (proxytype_str); + GNUNET_free (proxytype_str); } stat_learning = learn; @@ -1786,11 +1786,11 @@ GNUNET_HOSTLIST_client_stop () ti_check_download = NULL; curl_global_cleanup (); } - GNUNET_free_non_null (proxy); + GNUNET_free (proxy); proxy = NULL; - GNUNET_free_non_null (proxy_username); + GNUNET_free (proxy_username); proxy_username = NULL; - GNUNET_free_non_null (proxy_password); + GNUNET_free (proxy_password); proxy_password = NULL; if (NULL != pi) { diff --git a/src/hostlist/gnunet-daemon-hostlist_server.c b/src/hostlist/gnunet-daemon-hostlist_server.c index 999730e3e..b6c0495c0 100644 --- a/src/hostlist/gnunet-daemon-hostlist_server.c +++ b/src/hostlist/gnunet-daemon-hostlist_server.c @@ -229,7 +229,7 @@ host_processor (void *cls, { GNUNET_assert (NULL == peer); builder->pitr = NULL; - GNUNET_free_non_null (builder->data); + GNUNET_free (builder->data); GNUNET_free (builder); builder = NULL; GNUNET_log (GNUNET_ERROR_TYPE_INFO, @@ -534,7 +534,7 @@ process_notify (void *cls, GNUNET_PEERINFO_iterate_cancel (builder->pitr); builder->pitr = NULL; } - GNUNET_free_non_null (builder->data); + GNUNET_free (builder->data); builder->size = 0; builder->data = NULL; } @@ -886,7 +886,7 @@ GNUNET_HOSTLIST_server_stop () GNUNET_PEERINFO_iterate_cancel (builder->pitr); builder->pitr = NULL; } - GNUNET_free_non_null (builder->data); + GNUNET_free (builder->data); GNUNET_free (builder); builder = NULL; } diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c index a45721521..a50e7acc2 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c @@ -390,7 +390,7 @@ handle_ad_arrive (void *cls, expected_uri, current_adv_uri); GNUNET_free (expected_uri); - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); } diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c index 009a01f16..5aca07ddf 100644 --- a/src/identity/plugin_rest_identity.c +++ b/src/identity/plugin_rest_identity.c @@ -1422,7 +1422,7 @@ libgnunet_plugin_rest_identity_done (void *cls) plugin->cfg = NULL; - GNUNET_free_non_null (allow_methods); + GNUNET_free (allow_methods); GNUNET_free (api); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Identity REST plugin is finished\n"); return NULL; diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index 68993b51d..b2f99cd55 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -769,6 +769,12 @@ const char * GNUNET_e2s2 (const struct GNUNET_CRYPTO_EcdhePublicKey *p); +/** + * Forward declaration to make compiler happy depending on include order. + */ +struct GNUNET_PeerIdentity; + + /** * @ingroup logging * Convert a peer identity to a string (for printing debug messages). @@ -1275,6 +1281,7 @@ GNUNET_is_zero_ (const void *a, #define GNUNET_malloc_large(size) \ GNUNET_xmalloc_unchecked_ (size, __FILE__, __LINE__) + /** * @ingroup memory * Wrapper around realloc. Reallocates size bytes of memory. @@ -1287,6 +1294,7 @@ GNUNET_is_zero_ (const void *a, #define GNUNET_realloc(ptr, size) \ GNUNET_xrealloc_ (ptr, size, __FILE__, __LINE__) + /** * @ingroup memory * Wrapper around free. Frees the memory referred to by ptr. @@ -1294,40 +1302,27 @@ GNUNET_is_zero_ (const void *a, * allocated with #GNUNET_array_grow using #GNUNET_array_grow(mem, size, 0) instead of #GNUNET_free_nz. * * @param ptr location where to free the memory. ptr must have - * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier. + * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier. NULL is allowed. */ #define GNUNET_free_nz(ptr) GNUNET_xfree_ (ptr, __FILE__, __LINE__) + /** * @ingroup memory * Wrapper around free. Frees the memory referred to by ptr and sets ptr to NULL. * Note that it is generally better to free memory that was * allocated with #GNUNET_array_grow using #GNUNET_array_grow(mem, size, 0) instead of #GNUNET_free. * + * @a ptr will be set to NULL. Use #GNUNET_free_nz() if @a ptr is not an L-value. + * * @param ptr location where to free the memory. ptr must have - * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier. + * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier. NULL is allowed. */ #define GNUNET_free(ptr) do { \ GNUNET_xfree_ (ptr, __FILE__, __LINE__); \ ptr = NULL; \ } while (0) -/** - * @ingroup memory - * Free the memory pointed to by ptr if ptr is not NULL. - * Equivalent to `if (NULL != ptr) GNUNET_free(ptr)`. - * - * @param ptr the location in memory to free - */ -#define GNUNET_free_non_null(ptr) \ - do \ - { \ - void *__x__ = ptr; \ - if (NULL != __x__) \ - { \ - GNUNET_free (__x__); \ - } \ - } while (0) /** * @ingroup memory diff --git a/src/mysql/mysql.c b/src/mysql/mysql.c index 76effd95a..713227068 100644 --- a/src/mysql/mysql.c +++ b/src/mysql/mysql.c @@ -296,9 +296,9 @@ iopen (struct GNUNET_MYSQL_Context *mc) (unsigned int) mysql_port, NULL, CLIENT_IGNORE_SIGPIPE); - GNUNET_free_non_null (mysql_server); - GNUNET_free_non_null (mysql_user); - GNUNET_free_non_null (mysql_password); + GNUNET_free (mysql_server); + GNUNET_free (mysql_user); + GNUNET_free (mysql_password); GNUNET_free (mysql_dbname); if (mysql_error (mc->dbf)[0]) { diff --git a/src/namecache/plugin_namecache_sqlite.c b/src/namecache/plugin_namecache_sqlite.c index 8f762cb40..c9d79ba2d 100644 --- a/src/namecache/plugin_namecache_sqlite.c +++ b/src/namecache/plugin_namecache_sqlite.c @@ -260,7 +260,7 @@ database_shutdown (struct Plugin *plugin) GNUNET_ERROR_TYPE_ERROR, "sqlite3_close"); - GNUNET_free_non_null (plugin->fn); + GNUNET_free (plugin->fn); } diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c index f438de136..704a4abf7 100644 --- a/src/namestore/gnunet-namestore.c +++ b/src/namestore/gnunet-namestore.c @@ -878,7 +878,7 @@ del_monitor (void *cls, rd[i].data_size)))) || (0 == strcmp (vs, value))))) rdx[rd_left++] = rd[i]; - GNUNET_free_non_null (vs); + GNUNET_free (vs); } if (rd_count == rd_left) { @@ -1307,7 +1307,7 @@ identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) return; } zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego); - GNUNET_free_non_null (ego_name); + GNUNET_free (ego_name); ego_name = NULL; run_with_zone_pkey (cfg); } diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c index c57f15f65..ede566d40 100644 --- a/src/namestore/gnunet-service-namestore.c +++ b/src/namestore/gnunet-service-namestore.c @@ -540,7 +540,7 @@ cache_nick (const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, break; } } - GNUNET_free_non_null (oldest->rd); + GNUNET_free (oldest->rd); oldest->zone = *zone; if (NULL != nick) { @@ -1392,7 +1392,7 @@ handle_record_lookup (void *cls, const struct LabelLookupMessage *ll_msg) GNUNET_memcpy (&llr_msg[1], name_tmp, name_len); GNUNET_memcpy (&res_name[name_len], rlc.res_rd, rlc.rd_ser_len); GNUNET_MQ_send (nc->mq, env); - GNUNET_free_non_null (rlc.res_rd); + GNUNET_free (rlc.res_rd); } diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c index a909221e2..45fb782f7 100644 --- a/src/namestore/plugin_namestore_sqlite.c +++ b/src/namestore/plugin_namestore_sqlite.c @@ -296,7 +296,7 @@ database_shutdown (struct Plugin *plugin) GNUNET_ERROR_TYPE_ERROR, "sqlite3_close"); - GNUNET_free_non_null (plugin->fn); + GNUNET_free (plugin->fn); } diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c index 95b9b428f..4a05b2833 100644 --- a/src/namestore/plugin_rest_namestore.c +++ b/src/namestore/plugin_rest_namestore.c @@ -491,7 +491,7 @@ namestore_list_finished (void *cls) resp = GNUNET_REST_create_response (result_str); MHD_add_response_header (resp, "Content-Type", "application/json"); handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); - GNUNET_free_non_null (result_str); + GNUNET_free (result_str); GNUNET_SCHEDULER_add_now (&cleanup_handle, handle); } @@ -1109,7 +1109,7 @@ libgnunet_plugin_rest_namestore_done (void *cls) plugin->cfg = NULL; - GNUNET_free_non_null (allow_methods); + GNUNET_free (allow_methods); GNUNET_free (api); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Namestore REST plugin is finished\n"); return NULL; diff --git a/src/namestore/test_namestore_api_lookup_nick.c b/src/namestore/test_namestore_api_lookup_nick.c index 628e76254..2fbd9d7cb 100644 --- a/src/namestore/test_namestore_api_lookup_nick.c +++ b/src/namestore/test_namestore_api_lookup_nick.c @@ -58,7 +58,7 @@ static const char *name = "d"; static void cleanup () { - GNUNET_free_non_null ((void *) rd_orig.data); + GNUNET_free ((void *) rd_orig.data); if (NULL != nsh) { GNUNET_NAMESTORE_disconnect (nsh); diff --git a/src/namestore/test_namestore_api_monitoring.c b/src/namestore/test_namestore_api_monitoring.c index cc00adf44..3f1be1403 100644 --- a/src/namestore/test_namestore_api_monitoring.c +++ b/src/namestore/test_namestore_api_monitoring.c @@ -88,9 +88,9 @@ do_shutdown () GNUNET_NAMESTORE_disconnect (nsh); nsh = NULL; } - GNUNET_free_non_null (s_name_1); - GNUNET_free_non_null (s_name_2); - GNUNET_free_non_null (s_name_3); + GNUNET_free (s_name_1); + GNUNET_free (s_name_2); + GNUNET_free (s_name_3); if (s_rd_1 != NULL) { diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c index a363ee28d..5d02b9e49 100644 --- a/src/namestore/test_namestore_api_zone_iteration.c +++ b/src/namestore/test_namestore_api_zone_iteration.c @@ -88,9 +88,9 @@ end (void *cls) GNUNET_SCHEDULER_cancel (endbadly_task); endbadly_task = NULL; } - GNUNET_free_non_null (s_name_1); - GNUNET_free_non_null (s_name_2); - GNUNET_free_non_null (s_name_3); + GNUNET_free (s_name_1); + GNUNET_free (s_name_2); + GNUNET_free (s_name_3); if (NULL != s_rd_1) { GNUNET_free_nz ((void *) s_rd_1->data); diff --git a/src/namestore/test_namestore_api_zone_iteration_nick.c b/src/namestore/test_namestore_api_zone_iteration_nick.c index 1ebdfd073..4e54a05d2 100644 --- a/src/namestore/test_namestore_api_zone_iteration_nick.c +++ b/src/namestore/test_namestore_api_zone_iteration_nick.c @@ -82,9 +82,9 @@ end (void *cls) GNUNET_NAMESTORE_disconnect (nsh); nsh = NULL; } - GNUNET_free_non_null (s_name_1); - GNUNET_free_non_null (s_name_2); - GNUNET_free_non_null (s_name_3); + GNUNET_free (s_name_1); + GNUNET_free (s_name_2); + GNUNET_free (s_name_3); if (s_rd_1 != NULL) { diff --git a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c index 0534da001..30920713f 100644 --- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c +++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c @@ -88,9 +88,9 @@ end (void *cls) GNUNET_SCHEDULER_cancel (endbadly_task); endbadly_task = NULL; } - GNUNET_free_non_null (s_name_1); - GNUNET_free_non_null (s_name_2); - GNUNET_free_non_null (s_name_3); + GNUNET_free (s_name_1); + GNUNET_free (s_name_2); + GNUNET_free (s_name_3); if (s_rd_1 != NULL) { GNUNET_free_nz ((void *) s_rd_1->data); diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c index b71a8789c..bdcdd1706 100644 --- a/src/namestore/test_namestore_api_zone_iteration_stop.c +++ b/src/namestore/test_namestore_api_zone_iteration_stop.c @@ -75,9 +75,9 @@ end (void *cls) GNUNET_NAMESTORE_disconnect (nsh); nsh = NULL; } - GNUNET_free_non_null (s_name_1); - GNUNET_free_non_null (s_name_2); - GNUNET_free_non_null (s_name_3); + GNUNET_free (s_name_1); + GNUNET_free (s_name_2); + GNUNET_free (s_name_3); if (s_rd_1 != NULL) { GNUNET_free_nz ((void *) s_rd_1->data); diff --git a/src/nat-auto/gnunet-service-nat-auto_legacy.c b/src/nat-auto/gnunet-service-nat-auto_legacy.c index 1817c2270..de7910588 100644 --- a/src/nat-auto/gnunet-service-nat-auto_legacy.c +++ b/src/nat-auto/gnunet-service-nat-auto_legacy.c @@ -791,7 +791,7 @@ test_icmp_server (struct GNUNET_NAT_AutoHandle *ah) _ ("No working gnunet-helper-nat-server found\n")); } err: - GNUNET_free_non_null (tmp); + GNUNET_free (tmp); GNUNET_free (helper); if ((GNUNET_OK == ext_ip) && @@ -853,7 +853,7 @@ test_icmp_client (struct GNUNET_NAT_AutoHandle *ah) _ ("No working gnunet-helper-nat-server found\n")); } err: - GNUNET_free_non_null (tmp); + GNUNET_free (tmp); GNUNET_free (helper); next_phase (ah); diff --git a/src/nat/gnunet-nat.c b/src/nat/gnunet-nat.c index 5012d6455..0743a478d 100644 --- a/src/nat/gnunet-nat.c +++ b/src/nat/gnunet-nat.c @@ -392,15 +392,15 @@ run (void *cls, &stun_read_task, NULL); } - GNUNET_free_non_null (remote_sa); - GNUNET_free_non_null (local_sa); + GNUNET_free (remote_sa); + GNUNET_free (local_sa); test_finished (); return; fail_and_shutdown: global_ret = 1; GNUNET_SCHEDULER_shutdown (); - GNUNET_free_non_null (remote_sa); - GNUNET_free_non_null (local_sa); + GNUNET_free (remote_sa); + GNUNET_free (local_sa); } diff --git a/src/nat/gnunet-service-nat.c b/src/nat/gnunet-service-nat.c index 3b7d48c82..4dcc0312f 100644 --- a/src/nat/gnunet-service-nat.c +++ b/src/nat/gnunet-service-nat.c @@ -2009,7 +2009,7 @@ client_disconnect_cb (void *cls, ch->caddrs[i].mh = NULL; } } - GNUNET_free_non_null (ch->caddrs); + GNUNET_free (ch->caddrs); while (NULL != (lal = ch->ext_addr_head)) { GNUNET_CONTAINER_DLL_remove (ch->ext_addr_head, @@ -2032,8 +2032,8 @@ client_disconnect_cb (void *cls, GNUNET_RESOLVER_request_cancel (ch->ext_dns); ch->ext_dns = NULL; } - GNUNET_free_non_null (ch->hole_external); - GNUNET_free_non_null (ch->section_name); + GNUNET_free (ch->hole_external); + GNUNET_free (ch->section_name); GNUNET_free (ch); } diff --git a/src/nat/test_nat.c b/src/nat/test_nat.c index 69a2f4218..a3072f712 100644 --- a/src/nat/test_nat.c +++ b/src/nat/test_nat.c @@ -108,7 +108,7 @@ process_if (void *cls, if (addr == NULL) return GNUNET_OK; - GNUNET_free_non_null (data->addr); + GNUNET_free (data->addr); data->addr = GNUNET_malloc (addrlen); GNUNET_memcpy (data->addr, addr, addrlen); data->addrlen = addrlen; diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index df6c169b5..739249a93 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c @@ -249,7 +249,7 @@ dump_pc (struct PrintContext *pc) } } printf ("\n"); - GNUNET_free_non_null (pc->address_list); + GNUNET_free (pc->address_list); GNUNET_CONTAINER_DLL_remove (pc_head, pc_tail, pc); GNUNET_free (pc); if ((NULL == pc_head) && (NULL == pic)) @@ -619,14 +619,14 @@ shutdown_task (void *cls) for (i = 0; i < pc->address_list_size; i++) { ar = &pc->address_list[i]; - GNUNET_free_non_null (ar->result); + GNUNET_free (ar->result); if (NULL != ar->atsc) { GNUNET_TRANSPORT_address_to_string_cancel (ar->atsc); ar->atsc = NULL; } } - GNUNET_free_non_null (pc->address_list); + GNUNET_free (pc->address_list); GNUNET_free (pc); } GPI_plugins_unload (); diff --git a/src/peerinfo-tool/plugin_rest_peerinfo.c b/src/peerinfo-tool/plugin_rest_peerinfo.c index 514b14313..1ab6d6f75 100644 --- a/src/peerinfo-tool/plugin_rest_peerinfo.c +++ b/src/peerinfo-tool/plugin_rest_peerinfo.c @@ -359,7 +359,7 @@ peerinfo_list_finished (void *cls) resp = GNUNET_REST_create_response (result_str); MHD_add_response_header (resp, "Content-Type", "application/json"); handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); - GNUNET_free_non_null (result_str); + GNUNET_free (result_str); GNUNET_SCHEDULER_add_now (&cleanup_handle, handle); } @@ -452,7 +452,7 @@ dump_pc (struct PrintContext *pc) json_decref (temp_array); json_decref (response_entry); - GNUNET_free_non_null (pc->address_list); + GNUNET_free (pc->address_list); GNUNET_CONTAINER_DLL_remove (pc_head, pc_tail, pc); @@ -813,7 +813,7 @@ libgnunet_plugin_rest_peerinfo_done (void *cls) plugin->cfg = NULL; - GNUNET_free_non_null (allow_methods); + GNUNET_free (allow_methods); GNUNET_free (api); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peerinfo REST plugin is finished\n"); diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index 27e0337ee..79af90dd4 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c @@ -443,8 +443,8 @@ add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity) update_hello (identity, r.hello); if (NULL != r.friend_only_hello) update_hello (identity, r.friend_only_hello); - GNUNET_free_non_null (r.hello); - GNUNET_free_non_null (r.friend_only_hello); + GNUNET_free (r.hello); + GNUNET_free (r.friend_only_hello); GNUNET_free (fn); } } @@ -825,7 +825,7 @@ update_hello (const struct GNUNET_PeerIdentity *peer, GNUNET_free (buffer); } } - GNUNET_free_non_null (fn); + GNUNET_free (fn); notify_all (host); } @@ -982,7 +982,7 @@ discard_hosts_helper (void *cls, const char *fn) write_pos += new_hello_size; } read_pos += cur_hello_size; - GNUNET_free_non_null (new_hello); + GNUNET_free (new_hello); } if (0 < write_pos) @@ -1209,8 +1209,8 @@ free_host_entry (void *cls, const struct GNUNET_PeerIdentity *key, void *value) (void) cls; (void) key; - GNUNET_free_non_null (he->hello); - GNUNET_free_non_null (he->friend_only_hello); + GNUNET_free (he->hello); + GNUNET_free (he->friend_only_hello); GNUNET_free (he); return GNUNET_YES; } diff --git a/src/peerstore/peerstore_api.c b/src/peerstore/peerstore_api.c index 17f73d70a..db5aee0d5 100644 --- a/src/peerstore/peerstore_api.c +++ b/src/peerstore/peerstore_api.c @@ -676,7 +676,7 @@ GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic) { GNUNET_CONTAINER_DLL_remove (ic->h->iterate_head, ic->h->iterate_tail, ic); GNUNET_free (ic->sub_system); - GNUNET_free_non_null (ic->key); + GNUNET_free (ic->key); GNUNET_free (ic); } else diff --git a/src/peerstore/plugin_peerstore_flat.c b/src/peerstore/plugin_peerstore_flat.c index 5efe9dddc..cc5b8b76b 100644 --- a/src/peerstore/plugin_peerstore_flat.c +++ b/src/peerstore/plugin_peerstore_flat.c @@ -450,7 +450,7 @@ database_setup (struct Plugin *plugin) s); else GNUNET_break (0); - GNUNET_free_non_null (o); + GNUNET_free (o); } entry->value_size = GNUNET_STRINGS_base64_decode (value, strlen (value), diff --git a/src/peerstore/plugin_peerstore_sqlite.c b/src/peerstore/plugin_peerstore_sqlite.c index cf499a5df..ad69efdf4 100644 --- a/src/peerstore/plugin_peerstore_sqlite.c +++ b/src/peerstore/plugin_peerstore_sqlite.c @@ -639,7 +639,7 @@ database_shutdown (struct Plugin *plugin) LOG_SQLITE (plugin, GNUNET_ERROR_TYPE_ERROR, "sqlite3_close"); - GNUNET_free_non_null (plugin->fn); + GNUNET_free (plugin->fn); } diff --git a/src/pq/pq_connect.c b/src/pq/pq_connect.c index 8da273b2b..405dca174 100644 --- a/src/pq/pq_connect.c +++ b/src/pq/pq_connect.c @@ -125,7 +125,7 @@ GNUNET_PQ_connect (const char *config_str, GNUNET_PQ_reconnect (db); if (NULL == db->conn) { - GNUNET_free_non_null (db->load_path); + GNUNET_free (db->load_path); GNUNET_free (db->config_str); GNUNET_free (db); return NULL; @@ -495,9 +495,9 @@ GNUNET_PQ_connect_with_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg, load_path, es, ps); - GNUNET_free_non_null (load_path); - GNUNET_free_non_null (sp); - GNUNET_free_non_null (conninfo); + GNUNET_free (load_path); + GNUNET_free (sp); + GNUNET_free (conninfo); return db; } @@ -511,10 +511,10 @@ GNUNET_PQ_connect_with_cfg (const struct GNUNET_CONFIGURATION_Handle *cfg, void GNUNET_PQ_disconnect (struct GNUNET_PQ_Context *db) { - GNUNET_free_non_null (db->es); - GNUNET_free_non_null (db->ps); - GNUNET_free_non_null (db->load_path); - GNUNET_free_non_null (db->config_str); + GNUNET_free (db->es); + GNUNET_free (db->ps); + GNUNET_free (db->load_path); + GNUNET_free (db->config_str); PQfinish (db->conn); GNUNET_free (db); } diff --git a/src/pq/pq_prepare.c b/src/pq/pq_prepare.c index b7003fb69..63087456f 100644 --- a/src/pq/pq_prepare.c +++ b/src/pq/pq_prepare.c @@ -83,7 +83,7 @@ GNUNET_PQ_prepare_statements (struct GNUNET_PQ_Context *db, memcpy (&rps[olen], ps, nlen * sizeof (struct GNUNET_PQ_PreparedStatement)); - GNUNET_free_non_null (db->ps); + GNUNET_free (db->ps); db->ps = rps; } diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c index 69afca789..cf0455477 100644 --- a/src/pt/test_gns_vpn.c +++ b/src/pt/test_gns_vpn.c @@ -194,7 +194,7 @@ do_shutdown (void *cls) GNUNET_NAMESTORE_disconnect (namestore); namestore = NULL; } - GNUNET_free_non_null (url); + GNUNET_free (url); url = NULL; } diff --git a/src/pt/test_gnunet_vpn.c b/src/pt/test_gnunet_vpn.c index cb9bb61fe..8ffadeca4 100644 --- a/src/pt/test_gnunet_vpn.c +++ b/src/pt/test_gnunet_vpn.c @@ -165,7 +165,7 @@ do_shutdown (void *cls) GNUNET_VPN_disconnect (vpn); vpn = NULL; } - GNUNET_free_non_null (url); + GNUNET_free (url); url = NULL; } diff --git a/src/reclaim/gnunet-reclaim.c b/src/reclaim/gnunet-reclaim.c index e7ee814b6..6bef5b6fe 100644 --- a/src/reclaim/gnunet-reclaim.c +++ b/src/reclaim/gnunet-reclaim.c @@ -313,7 +313,7 @@ process_attrs (void *cls, attr->flag, id, (NULL == attest) ? "" : "(ATTESTED)"); - GNUNET_free_non_null (value_str); + GNUNET_free (value_str); GNUNET_free (id); } diff --git a/src/reclaim/gnunet-service-reclaim_tickets.c b/src/reclaim/gnunet-service-reclaim_tickets.c index 205886c78..f170b6d84 100644 --- a/src/reclaim/gnunet-service-reclaim_tickets.c +++ b/src/reclaim/gnunet-service-reclaim_tickets.c @@ -971,7 +971,7 @@ cleanup_cth (struct RECLAIM_TICKETS_ConsumeHandle *cth) { if (NULL != lu->lookup_request) GNUNET_GNS_lookup_cancel (lu->lookup_request); - GNUNET_free_non_null (lu->label); + GNUNET_free (lu->label); GNUNET_CONTAINER_DLL_remove (cth->parallel_lookups_head, cth->parallel_lookups_tail, lu); diff --git a/src/reclaim/oidc_helper.c b/src/reclaim/oidc_helper.c index e309ed01d..ad2839200 100644 --- a/src/reclaim/oidc_helper.c +++ b/src/reclaim/oidc_helper.c @@ -616,7 +616,7 @@ OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *ecdsa_priv, + sizeof(struct GNUNET_CRYPTO_EcdsaSignature)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Authorization code malformed\n"); - GNUNET_free_non_null (code_payload); + GNUNET_free (code_payload); return GNUNET_SYSERR; } @@ -646,7 +646,7 @@ OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *ecdsa_priv, { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Expected code verifier!\n"); - GNUNET_free_non_null (code_payload); + GNUNET_free (code_payload); return GNUNET_SYSERR; } code_verifier_hash = GNUNET_malloc (256 / 8); @@ -669,7 +669,7 @@ OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *ecdsa_priv, expected_code_challenge, code_challenge_len, code_challenge); - GNUNET_free_non_null (code_payload); + GNUNET_free (code_payload); GNUNET_free (expected_code_challenge); return GNUNET_SYSERR; } diff --git a/src/reclaim/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c index 563bdd749..36ae937c1 100644 --- a/src/reclaim/plugin_rest_openid_connect.c +++ b/src/reclaim/plugin_rest_openid_connect.c @@ -557,12 +557,12 @@ cleanup_handle (struct RequestHandle *handle) GNUNET_RECLAIM_cancel (handle->idp_op); if (NULL != handle->idp) GNUNET_RECLAIM_disconnect (handle->idp); - GNUNET_free_non_null (handle->url); - GNUNET_free_non_null (handle->tld); - GNUNET_free_non_null (handle->redirect_prefix); - GNUNET_free_non_null (handle->redirect_suffix); - GNUNET_free_non_null (handle->emsg); - GNUNET_free_non_null (handle->edesc); + GNUNET_free (handle->url); + GNUNET_free (handle->tld); + GNUNET_free (handle->redirect_prefix); + GNUNET_free (handle->redirect_suffix); + GNUNET_free (handle->emsg); + GNUNET_free (handle->edesc); if (NULL != handle->gns_op) GNUNET_GNS_lookup_cancel (handle->gns_op); if (NULL != handle->gns_handle) @@ -572,13 +572,13 @@ cleanup_handle (struct RequestHandle *handle) GNUNET_NAMESTORE_disconnect (handle->namestore_handle); if (NULL != handle->oidc) { - GNUNET_free_non_null (handle->oidc->client_id); - GNUNET_free_non_null (handle->oidc->login_identity); - GNUNET_free_non_null (handle->oidc->nonce); - GNUNET_free_non_null (handle->oidc->redirect_uri); - GNUNET_free_non_null (handle->oidc->response_type); - GNUNET_free_non_null (handle->oidc->scope); - GNUNET_free_non_null (handle->oidc->state); + GNUNET_free (handle->oidc->client_id); + GNUNET_free (handle->oidc->login_identity); + GNUNET_free (handle->oidc->nonce); + GNUNET_free (handle->oidc->redirect_uri); + GNUNET_free (handle->oidc->response_type); + GNUNET_free (handle->oidc->scope); + GNUNET_free (handle->oidc->state); json_decref (handle->oidc->response); GNUNET_free (handle->oidc); } @@ -594,8 +594,8 @@ cleanup_handle (struct RequestHandle *handle) GNUNET_CONTAINER_DLL_remove (handle->ego_head, handle->ego_tail, ego_entry); - GNUNET_free_non_null (ego_entry->identifier); - GNUNET_free_non_null (ego_entry->keystring); + GNUNET_free (ego_entry->identifier); + GNUNET_free (ego_entry->keystring); GNUNET_free (ego_entry); } GNUNET_free (handle); @@ -1734,7 +1734,7 @@ login_cont (struct GNUNET_REST_RequestHandle *con_handle, OIDC_COOKIE_EXPIRATION)); last_time = GNUNET_CONTAINER_multihashmap_get (OIDC_cookie_jar_map, &cache_key); - GNUNET_free_non_null (last_time); + GNUNET_free (last_time); GNUNET_CONTAINER_multihashmap_put (OIDC_cookie_jar_map, &cache_key, current_time, @@ -1804,7 +1804,7 @@ check_authorization (struct RequestHandle *handle, client_id = strtok (basic_authorization, ":"); if (NULL == client_id) { - GNUNET_free_non_null (basic_authorization); + GNUNET_free (basic_authorization); handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_INVALID_CLIENT); handle->response_code = MHD_HTTP_UNAUTHORIZED; return GNUNET_SYSERR; @@ -1812,7 +1812,7 @@ check_authorization (struct RequestHandle *handle, pass = strtok (NULL, ":"); if (NULL == pass) { - GNUNET_free_non_null (basic_authorization); + GNUNET_free (basic_authorization); handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_INVALID_CLIENT); handle->response_code = MHD_HTTP_UNAUTHORIZED; return GNUNET_SYSERR; @@ -1826,7 +1826,7 @@ check_authorization (struct RequestHandle *handle, { if (0 != strcmp (expected_pass, pass)) { - GNUNET_free_non_null (basic_authorization); + GNUNET_free (basic_authorization); GNUNET_free (expected_pass); handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_INVALID_CLIENT); handle->response_code = MHD_HTTP_UNAUTHORIZED; @@ -1836,7 +1836,7 @@ check_authorization (struct RequestHandle *handle, } else { - GNUNET_free_non_null (basic_authorization); + GNUNET_free (basic_authorization); handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_SERVER_ERROR); handle->edesc = GNUNET_strdup ("gnunet configuration failed"); handle->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR; @@ -1852,7 +1852,7 @@ check_authorization (struct RequestHandle *handle, } if (NULL == handle->ego_entry) { - GNUNET_free_non_null (basic_authorization); + GNUNET_free (basic_authorization); handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_INVALID_CLIENT); handle->response_code = MHD_HTTP_UNAUTHORIZED; return GNUNET_SYSERR; @@ -2504,7 +2504,7 @@ libgnunet_plugin_rest_openid_connect_done (void *cls) while (GNUNET_YES == GNUNET_CONTAINER_multihashmap_iterator_next (hashmap_it, NULL, value)) - GNUNET_free_non_null (value); + GNUNET_free (value); GNUNET_CONTAINER_multihashmap_iterator_destroy (hashmap_it); GNUNET_CONTAINER_multihashmap_destroy (OIDC_cookie_jar_map); @@ -2513,10 +2513,10 @@ libgnunet_plugin_rest_openid_connect_done (void *cls) while (GNUNET_YES == GNUNET_CONTAINER_multihashmap_iterator_next (hashmap_it, NULL, value)) - GNUNET_free_non_null (value); + GNUNET_free (value); GNUNET_CONTAINER_multihashmap_destroy (OIDC_access_token_map); GNUNET_CONTAINER_multihashmap_iterator_destroy (hashmap_it); - GNUNET_free_non_null (allow_methods); + GNUNET_free (allow_methods); GNUNET_free (api); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "OpenID Connect REST plugin is finished\n"); diff --git a/src/reclaim/plugin_rest_reclaim.c b/src/reclaim/plugin_rest_reclaim.c index 863dd0450..654df175e 100644 --- a/src/reclaim/plugin_rest_reclaim.c +++ b/src/reclaim/plugin_rest_reclaim.c @@ -1492,7 +1492,7 @@ libgnunet_plugin_rest_reclaim_done (void *cls) plugin->cfg = NULL; - GNUNET_free_non_null (allow_methods); + GNUNET_free (allow_methods); GNUNET_free (api); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Identity Provider REST plugin is finished\n"); diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c index cfe137949..ff549fa71 100644 --- a/src/reclaim/reclaim_api.c +++ b/src/reclaim/reclaim_api.c @@ -658,7 +658,7 @@ handle_consume_ticket_result (void *cls, } GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op); free_op (op); - GNUNET_free_non_null (attrs); + GNUNET_free (attrs); return; } GNUNET_assert (0); diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c index 3f8133d61..e82e10e3b 100644 --- a/src/regex/gnunet-regex-profiler.c +++ b/src/regex/gnunet-regex-profiler.c @@ -448,9 +448,9 @@ do_shutdown (void *cls) search_str_cnt < num_peers && NULL != search_strings; search_str_cnt++) { - GNUNET_free_non_null (search_strings[search_str_cnt]); + GNUNET_free (search_strings[search_str_cnt]); } - GNUNET_free_non_null (search_strings); + GNUNET_free (search_strings); search_strings = NULL; if (NULL != reg_handle) diff --git a/src/regex/gnunet-regex-simulation-profiler.c b/src/regex/gnunet-regex-simulation-profiler.c index 9adde99bd..3d449a04e 100644 --- a/src/regex/gnunet-regex-simulation-profiler.c +++ b/src/regex/gnunet-regex-simulation-profiler.c @@ -255,7 +255,7 @@ reset_meter (struct ProgressMeter *meter) static void free_meter (struct ProgressMeter *meter) { - GNUNET_free_non_null (meter->startup_string); + GNUNET_free (meter->startup_string); GNUNET_free (meter); } diff --git a/src/regex/regex_internal.c b/src/regex/regex_internal.c index 1dd4f6a97..cd33281e2 100644 --- a/src/regex/regex_internal.c +++ b/src/regex/regex_internal.c @@ -168,7 +168,7 @@ state_remove_transition (struct REGEX_INTERNAL_State *state, if (transition->from_state != state) return; - GNUNET_free_non_null (transition->label); + GNUNET_free (transition->label); state->transition_count--; GNUNET_CONTAINER_DLL_remove (state->transitions_head, @@ -310,8 +310,8 @@ automaton_destroy_state (struct REGEX_INTERNAL_State *s) if (NULL == s) return; - GNUNET_free_non_null (s->name); - GNUNET_free_non_null (s->proof); + GNUNET_free (s->name); + GNUNET_free (s->proof); state_set_clear (&s->nfa_set); for (t = s->transitions_head; NULL != t; t = next_t) { @@ -658,7 +658,7 @@ sb_realloc (struct StringBuffer *ret, size_t nlen) ret->blen = nlen; GNUNET_memcpy (ret->abuf, ret->sbuf, ret->slen); ret->sbuf = ret->abuf; - GNUNET_free_non_null (old); + GNUNET_free (old); } @@ -726,7 +726,7 @@ sb_wrap (struct StringBuffer *ret, const char *format, size_t extra_chars) format, (int) ret->slen, ret->sbuf); - GNUNET_free_non_null (ret->abuf); + GNUNET_free (ret->abuf); ret->abuf = temp; ret->sbuf = temp; ret->blen = ret->slen + extra_chars + 1; @@ -1592,8 +1592,8 @@ automaton_create_proofs (struct REGEX_INTERNAL_Automaton *a) if ((NULL == R_last) || (NULL == R_cur)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "malloc"); - GNUNET_free_non_null (R_cur); - GNUNET_free_non_null (R_last); + GNUNET_free (R_cur); + GNUNET_free (R_last); return GNUNET_SYSERR; } @@ -2159,7 +2159,7 @@ dfa_add_multi_strides_helper (void *cls, t->to_state); } } - GNUNET_free_non_null (label); + GNUNET_free (label); } @@ -2213,7 +2213,7 @@ REGEX_INTERNAL_dfa_add_multi_strides (struct REGEX_INTERNAL_Context *regex_ctx, t_next = t->next; state_add_transition (regex_ctx, t->from_state, t->label, t->to_state); GNUNET_CONTAINER_DLL_remove (ctx.transitions_head, ctx.transitions_tail, t); - GNUNET_free_non_null (t->label); + GNUNET_free (t->label); GNUNET_free (t); } @@ -2361,7 +2361,7 @@ dfa_compress_paths (struct REGEX_INTERNAL_Context *regex_ctx, t_next = t->next; state_add_transition (regex_ctx, t->from_state, t->label, t->to_state); GNUNET_CONTAINER_DLL_remove (transitions_head, transitions_tail, t); - GNUNET_free_non_null (t->label); + GNUNET_free (t->label); GNUNET_free (t); } @@ -2972,7 +2972,7 @@ error: if (NULL != error_msg) GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s\n", error_msg); - GNUNET_free_non_null (p); + GNUNET_free (p); while (NULL != (nfa = ctx.stack_head)) { @@ -3133,8 +3133,8 @@ REGEX_INTERNAL_automaton_destroy (struct REGEX_INTERNAL_Automaton *a) if (NULL == a) return; - GNUNET_free_non_null (a->regex); - GNUNET_free_non_null (a->canonical_regex); + GNUNET_free (a->regex); + GNUNET_free (a->canonical_regex); for (s = a->states_head; NULL != s; s = next_state) { diff --git a/src/regex/regex_test_lib.c b/src/regex/regex_test_lib.c index 05001b5d2..58cd8dc10 100644 --- a/src/regex/regex_test_lib.c +++ b/src/regex/regex_test_lib.c @@ -222,10 +222,10 @@ regex_combine (struct RegexCombineCtx *ctx) else { GNUNET_asprintf (&tmp, "%s%s|", regex, s); - GNUNET_free_non_null (regex); + GNUNET_free (regex); regex = tmp; } - GNUNET_free_non_null (s); + GNUNET_free (s); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " so far '%s' for inner %s\n", regex, ctx->s); } @@ -517,7 +517,7 @@ regex_ctx_destroy (struct RegexCombineCtx *ctx) { regex_ctx_destroy (ctx->children[i]); } - GNUNET_free_non_null (ctx->s); /* 's' on root node is null */ + GNUNET_free (ctx->s); /* 's' on root node is null */ GNUNET_free (ctx->children); GNUNET_free (ctx); } @@ -632,7 +632,7 @@ REGEX_TEST_read_from_file (const char *filename) regex = NULL; } while (offset < size); - GNUNET_free_non_null (regex); + GNUNET_free (regex); GNUNET_free (buffer); return regexes; diff --git a/src/regex/test_regex_eval_api.c b/src/regex/test_regex_eval_api.c index 767571156..7cd081269 100644 --- a/src/regex/test_regex_eval_api.c +++ b/src/regex/test_regex_eval_api.c @@ -178,9 +178,9 @@ test_random (unsigned int rx_length, unsigned int max_str_len, return result; error: - GNUNET_free_non_null (matching_str); - GNUNET_free_non_null (rand_rx); - GNUNET_free_non_null (canonical_regex); + GNUNET_free (matching_str); + GNUNET_free (rand_rx); + GNUNET_free (canonical_regex); return -1; } @@ -371,7 +371,7 @@ main (int argc, char *argv[]) REGEX_INTERNAL_automaton_destroy (a); if (0 != check_dfa) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "check_proof: %s\n", check_proof); - GNUNET_free_non_null (check_proof); + GNUNET_free (check_proof); regfree (&rx); } diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c index 30eade623..875509536 100644 --- a/src/rest/gnunet-rest-server.c +++ b/src/rest/gnunet-rest-server.c @@ -209,7 +209,7 @@ plugin_callback (void *cls, struct MHD_Response *resp, int status) static int cleanup_url_map (void *cls, const struct GNUNET_HashCode *key, void *value) { - GNUNET_free_non_null (value); + GNUNET_free (value); return GNUNET_YES; } @@ -728,8 +728,8 @@ do_shutdown (void *cls) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Shutting down...\n"); kill_httpd (); - GNUNET_free_non_null (allow_credentials); - GNUNET_free_non_null (allow_headers); + GNUNET_free (allow_credentials); + GNUNET_free (allow_headers); } @@ -1055,7 +1055,7 @@ main (int argc, char *const *argv) ? 0 : 1; MHD_destroy_response (failure_response); - GNUNET_free_non_null ((char *) argv); + GNUNET_free_nz ((char *) argv); return ret; } diff --git a/src/rps/rps_api.c b/src/rps/rps_api.c index da24ca4c9..8b69dae96 100644 --- a/src/rps/rps_api.c +++ b/src/rps/rps_api.c @@ -674,7 +674,7 @@ handle_stream_input (void *cls, // peers = (struct GNUNET_PeerIdentity *) &msg[1]; num_peers = ntohl (msg->num_peers); srh_callback_num_peers = num_peers; - GNUNET_free_non_null (srh_callback_peers); + GNUNET_free (srh_callback_peers); srh_callback_peers = GNUNET_new_array (num_peers, struct GNUNET_PeerIdentity); GNUNET_memcpy (srh_callback_peers, diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c index 8b46f68de..2b859d81a 100644 --- a/src/set/gnunet-service-set.c +++ b/src/set/gnunet-service-set.c @@ -492,7 +492,7 @@ destroy_elements_iterator (void *cls, { struct ElementEntry *ee = value; - GNUNET_free_non_null (ee->mutations); + GNUNET_free (ee->mutations); GNUNET_free (ee); return GNUNET_YES; } @@ -570,7 +570,7 @@ client_disconnect_cb (void *cls, content->elements = NULL; GNUNET_free (content); } - GNUNET_free_non_null (set->excluded_generations); + GNUNET_free (set->excluded_generations); set->excluded_generations = NULL; /* remove set from pending copy requests */ diff --git a/src/set/gnunet-service-set_union_strata_estimator.c b/src/set/gnunet-service-set_union_strata_estimator.c index a59dbbd57..1101a56a6 100644 --- a/src/set/gnunet-service-set_union_strata_estimator.c +++ b/src/set/gnunet-service-set_union_strata_estimator.c @@ -120,7 +120,7 @@ strata_estimator_read (const void *buf, if (buf_len != se->strata_count * se->ibf_size * IBF_BUCKET_SIZE) { GNUNET_break (0); /* very odd error */ - GNUNET_free_non_null (dbuf); + GNUNET_free (dbuf); return GNUNET_SYSERR; } @@ -129,7 +129,7 @@ strata_estimator_read (const void *buf, ibf_read_slice (buf, 0, se->ibf_size, se->strata[i]); buf += se->ibf_size * IBF_BUCKET_SIZE; } - GNUNET_free_non_null (dbuf); + GNUNET_free (dbuf); return GNUNET_OK; } diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c index d40f74aaf..be2a49201 100644 --- a/src/statistics/gnunet-service-statistics.c +++ b/src/statistics/gnunet-service-statistics.c @@ -319,7 +319,7 @@ save () total, fn); } - GNUNET_free_non_null (fn); + GNUNET_free (fn); } diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c index 63afde877..b9aedb4e7 100644 --- a/src/statistics/gnunet-statistics.c +++ b/src/statistics/gnunet-statistics.c @@ -880,7 +880,7 @@ main (int argc, char *const *argv) GNUNET_array_grow (nodes, num_nodes, 0); - GNUNET_free_non_null (remote_host); + GNUNET_free (remote_host); GNUNET_free_nz ((void *) argv); return ret; } diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index 869d51544..12c09b7d2 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c @@ -374,8 +374,8 @@ schedule_watch_request (struct GNUNET_STATISTICS_Handle *h, static void free_action_item (struct GNUNET_STATISTICS_GetHandle *gh) { - GNUNET_free_non_null (gh->subsystem); - GNUNET_free_non_null (gh->name); + GNUNET_free (gh->subsystem); + GNUNET_free (gh->name); GNUNET_free (gh); } diff --git a/src/testbed-logger/test_testbed_logger_api.c b/src/testbed-logger/test_testbed_logger_api.c index 7496184c0..085f83d0e 100644 --- a/src/testbed-logger/test_testbed_logger_api.c +++ b/src/testbed-logger/test_testbed_logger_api.c @@ -88,7 +88,7 @@ shutdown_now () { CANCEL_TASK (abort_task); CANCEL_TASK (write_task); - GNUNET_free_non_null (search_dir); + GNUNET_free (search_dir); if (NULL != h) GNUNET_TESTBED_LOGGER_disconnect (h); GNUNET_SCHEDULER_shutdown (); diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c index 4c1637db6..24c212d6b 100644 --- a/src/testbed/gnunet-helper-testbed.c +++ b/src/testbed/gnunet-helper-testbed.c @@ -405,7 +405,7 @@ tokenizer_cb (void *cls, const struct GNUNET_MessageHeader *message) GNUNET_free (evstr); evstr = NULL; } - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); hostname = NULL; GNUNET_assert (NULL != test_system); GNUNET_assert (GNUNET_OK == diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index 21a9d0a51..3ef99ae25 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c @@ -550,8 +550,8 @@ handle_add_host (void *cls, GNUNET_strlcpy (hostname, ptr, hostname_length + 1); if (NULL == (host_cfg = GNUNET_TESTBED_extract_config_ (&msg->header))) { - GNUNET_free_non_null (username); - GNUNET_free_non_null (hostname); + GNUNET_free (username); + GNUNET_free (hostname); GNUNET_break_op (0); GNUNET_SERVICE_client_drop (client); return; @@ -570,7 +570,7 @@ handle_add_host (void *cls, username, host_cfg, ntohs (msg->ssh_port)); - GNUNET_free_non_null (username); + GNUNET_free (username); GNUNET_free (hostname); GNUNET_CONFIGURATION_destroy (host_cfg); if (NULL == host) @@ -757,17 +757,17 @@ shutdown_task (void *cls) for (id = 0; id < GST_host_list_size; id++) if (NULL != GST_host_list[id]) GNUNET_TESTBED_host_destroy (GST_host_list[id]); - GNUNET_free_non_null (GST_host_list); + GNUNET_free (GST_host_list); if (NULL != GST_context) { - GNUNET_free_non_null (GST_context->master_ip); + GNUNET_free (GST_context->master_ip); if (NULL != GST_context->system) GNUNET_TESTING_system_destroy (GST_context->system, GNUNET_YES); GNUNET_free (GST_context); GST_context = NULL; } - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); /* Free hello cache */ GST_cache_clear (); GST_connection_pool_destroy (); diff --git a/src/testbed/gnunet-service-testbed_cache.c b/src/testbed/gnunet-service-testbed_cache.c index f87f39067..5e74b865a 100644 --- a/src/testbed/gnunet-service-testbed_cache.c +++ b/src/testbed/gnunet-service-testbed_cache.c @@ -120,7 +120,7 @@ static void free_entry (struct CacheEntry *entry) { GNUNET_CONTAINER_DLL_remove (cache_head, cache_tail, entry); - GNUNET_free_non_null (entry->hello); + GNUNET_free (entry->hello); GNUNET_free (entry); } @@ -261,7 +261,7 @@ GST_cache_add_hello (const unsigned int peer_id, entry = cache_lookup (peer_id); if (NULL == entry) entry = add_entry (peer_id); - GNUNET_free_non_null (entry->hello); + GNUNET_free (entry->hello); entry->hello = GNUNET_copy_message (hello); } diff --git a/src/testbed/gnunet-service-testbed_connectionpool.c b/src/testbed/gnunet-service-testbed_connectionpool.c index 7f9c9fd57..7318971b3 100644 --- a/src/testbed/gnunet-service-testbed_connectionpool.c +++ b/src/testbed/gnunet-service-testbed_connectionpool.c @@ -687,7 +687,7 @@ oprelease_get_handle_core (void *cls) return; GNUNET_CORE_disconnect (entry->handle_core); entry->handle_core = NULL; - GNUNET_free_non_null (entry->peer_identity); + GNUNET_free (entry->peer_identity); entry->peer_identity = NULL; } diff --git a/src/testbed/gnunet-service-testbed_cpustatus.c b/src/testbed/gnunet-service-testbed_cpustatus.c index 2d490ba8c..70b865c73 100644 --- a/src/testbed/gnunet-service-testbed_cpustatus.c +++ b/src/testbed/gnunet-service-testbed_cpustatus.c @@ -649,7 +649,7 @@ GST_stats_destroy () proc_stat = NULL; } #elif OSX - GNUNET_free_non_null (prev_cpu_load); + GNUNET_free (prev_cpu_load); #endif if (NULL != sample_load_task_id) { diff --git a/src/testbed/gnunet-service-testbed_links.c b/src/testbed/gnunet-service-testbed_links.c index ee00e4be0..fb25d7bcb 100644 --- a/src/testbed/gnunet-service-testbed_links.c +++ b/src/testbed/gnunet-service-testbed_links.c @@ -401,7 +401,7 @@ GST_route_list_clear () for (id = 0; id < route_list_size; id++) if (NULL != route_list[id]) GNUNET_free (route_list[id]); - GNUNET_free_non_null (route_list); + GNUNET_free (route_list); route_list = NULL; } @@ -508,7 +508,7 @@ GST_slave_list_clear () continue; destroy_slave (slave); } - GNUNET_free_non_null (GST_slave_list); + GNUNET_free (GST_slave_list); GST_slave_list = NULL; } @@ -1104,7 +1104,7 @@ GST_neighbour_list_clean () GNUNET_free (n); neighbour_list[id] = NULL; } - GNUNET_free_non_null (neighbour_list); + GNUNET_free (neighbour_list); } diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c index 262fcfc00..3d13ac8cc 100644 --- a/src/testbed/gnunet-service-testbed_oc.c +++ b/src/testbed/gnunet-service-testbed_oc.c @@ -360,7 +360,7 @@ GST_cleanup_focc (struct ForwardedOverlayConnectContext *focc) GNUNET_CONTAINER_DLL_remove (rhc->focc_dll_head, rhc->focc_dll_tail, focc); - GNUNET_free_non_null (focc->orig_msg); + GNUNET_free (focc->orig_msg); GNUNET_free (focc); } @@ -536,8 +536,8 @@ cleanup_occ (struct OverlayConnectContext *occ) LOG_DEBUG ("0x%llx: Cleaning up occ\n", occ->op_id); - GNUNET_free_non_null (occ->emsg); - GNUNET_free_non_null (occ->hello); + GNUNET_free (occ->emsg); + GNUNET_free (occ->hello); if (NULL != occ->send_hello_task) GNUNET_SCHEDULER_cancel (occ->send_hello_task); if (NULL != occ->cleanup_task) @@ -727,7 +727,7 @@ overlay_connect_notify (void *cls, cleanup_occ_rp2c (&occ->p2ctx.remote); break; } - GNUNET_free_non_null (occ->emsg); + GNUNET_free (occ->emsg); occ->emsg = NULL; send_overlay_connect_success_msg (occ); occ->cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup_occ, @@ -758,7 +758,7 @@ occ_cache_get_handle_ats_occ_cb (void *cls, GNUNET_assert (OCC_TYPE_LOCAL == occ->type); GNUNET_assert (NULL != occ->timeout_task); - GNUNET_free_non_null (occ->emsg); + GNUNET_free (occ->emsg); if (NULL == ac) { GNUNET_asprintf (&occ->emsg, @@ -842,7 +842,7 @@ occ_hello_sent_cb (void *cls) lp2c->ohh = NULL; GNUNET_assert (NULL == occ->send_hello_task); - GNUNET_free_non_null (occ->emsg); + GNUNET_free (occ->emsg); GNUNET_asprintf (&occ->emsg, "0x%llx: Timeout while acquiring ATS of %s from cache", @@ -1092,7 +1092,7 @@ hello_update_cb (void *cls, GST_connection_pool_get_handle_done (occ->cgh_p1th); occ->cgh_p1th = NULL; occ->p1th_ = NULL; - GNUNET_free_non_null (occ->emsg); + GNUNET_free (occ->emsg); occ->emsg = NULL; p2_transport_connect (occ); } @@ -1118,7 +1118,7 @@ p1_transport_connect_cache_callback (void *cls, { struct OverlayConnectContext *occ = cls; - GNUNET_free_non_null (occ->emsg); + GNUNET_free (occ->emsg); occ->emsg = NULL; if (NULL == th) { @@ -1166,7 +1166,7 @@ occ_cache_get_handle_core_cb (void *cls, const struct GNUNET_MessageHeader *hello; GNUNET_assert (NULL != occ->timeout_task); - GNUNET_free_non_null (occ->emsg); + GNUNET_free (occ->emsg); if ((NULL == ch) || (NULL == my_identity)) { GNUNET_asprintf (&occ->emsg, @@ -1249,7 +1249,7 @@ overlay_connect_get_config (void *cls, cmsg = (const struct GNUNET_TESTBED_PeerConfigurationInformationMessage *) msg; occ->other_peer_identity = cmsg->peer_identity; - GNUNET_free_non_null (occ->emsg); + GNUNET_free (occ->emsg); GNUNET_asprintf (&occ->emsg, "0x%llx: Timeout while connecting to CORE of peer with " "id: %u", @@ -1508,7 +1508,7 @@ p2_controller_connect_cb (void *cls, &cmsg.header, &overlay_connect_get_config, occ); - GNUNET_free_non_null (occ->emsg); + GNUNET_free (occ->emsg); GNUNET_asprintf (&occ->emsg, "0x%llx: Timeout while getting peer identity of peer " "with id: %u", @@ -1674,7 +1674,7 @@ cleanup_rocc (struct RemoteOverlayConnectCtx *rocc) if ((GNUNET_YES == rocc->peer->destroy_flag) && (0 == rocc->peer->reference_cnt)) GST_destroy_peer (rocc->peer); - GNUNET_free_non_null (rocc->hello); + GNUNET_free (rocc->hello); GNUNET_CONTAINER_DLL_remove (roccq_head, roccq_tail, rocc); diff --git a/src/testbed/gnunet-service-testbed_peers.c b/src/testbed/gnunet-service-testbed_peers.c index d3d597d4f..0184635fa 100644 --- a/src/testbed/gnunet-service-testbed_peers.c +++ b/src/testbed/gnunet-service-testbed_peers.c @@ -1084,7 +1084,7 @@ handle_peer_reconfigure (void *cls, GST_send_operation_success_msg (client, op_id); GNUNET_SERVICE_client_continue (client); - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); return; } prc = GNUNET_new (struct PeerReconfigureContext); @@ -1264,7 +1264,7 @@ ret: else GST_send_operation_success_msg (mctx->client, mctx->op_id); - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); cleanup_mctx (mctx); } @@ -1459,7 +1459,7 @@ GST_destroy_peers () } GNUNET_free (peer); } - GNUNET_free_non_null (GST_peer_list); + GNUNET_free (GST_peer_list); GST_peer_list = NULL; GST_peer_list_size = 0; } diff --git a/src/testbed/gnunet_testbed_mpi_spawn.c b/src/testbed/gnunet_testbed_mpi_spawn.c index 8b67523a1..353cc2881 100644 --- a/src/testbed/gnunet_testbed_mpi_spawn.c +++ b/src/testbed/gnunet_testbed_mpi_spawn.c @@ -321,7 +321,7 @@ main (int argc, char *argv[]) GNUNET_SIGNAL_handler_uninstall (shc_chld); shc_chld = NULL; GNUNET_DISK_pipe_close (sigpipe); - GNUNET_free_non_null (fn); + GNUNET_free (fn); if (GNUNET_OK != ret) return ret; return 0; diff --git a/src/testbed/test_gnunet_helper_testbed.c b/src/testbed/test_gnunet_helper_testbed.c index 7c4d4bad5..d4eec0269 100644 --- a/src/testbed/test_gnunet_helper_testbed.c +++ b/src/testbed/test_gnunet_helper_testbed.c @@ -88,7 +88,7 @@ do_shutdown (void *cls) GNUNET_SCHEDULER_cancel (abort_task); if (NULL != helper) GNUNET_HELPER_stop (helper, GNUNET_NO); - GNUNET_free_non_null (msg); + GNUNET_free (msg); if (NULL != cfg) GNUNET_CONFIGURATION_destroy (cfg); } diff --git a/src/testbed/test_testbed_api_statistics.c b/src/testbed/test_testbed_api_statistics.c index 2d0e2d6b8..dc305d008 100644 --- a/src/testbed/test_testbed_api_statistics.c +++ b/src/testbed/test_testbed_api_statistics.c @@ -198,7 +198,7 @@ main (int argc, char **argv) NUM_PEERS, 1LL, NULL, NULL, &test_master, NULL); - GNUNET_free_non_null (seen_peers); + GNUNET_free (seen_peers); if (GNUNET_OK != result) return 1; return 0; diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 9fe5bccdc..697783d96 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c @@ -1178,7 +1178,7 @@ handle_link_controllers_result ( LOG_DEBUG ("Not calling callback\n"); if (NULL != cfg) GNUNET_CONFIGURATION_destroy (cfg); - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); } @@ -1314,7 +1314,7 @@ handle_barrier_status (void *cls, return; /* just initialised; skip cleanup */ cleanup: - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); /** * Do not remove the barrier if we did not echo the status back; this is * required at the chained testbed controller setup to ensure the only the @@ -1459,7 +1459,7 @@ oprelease_link_controllers (void *cls) case OPC_STATE_FINISHED: break; } - GNUNET_free_non_null (data); + GNUNET_free (data); GNUNET_free (opc); } diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index 95463e44d..f7352250d 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c @@ -506,7 +506,7 @@ GNUNET_TESTBED_hosts_load_from_file ( else (void) GNUNET_TESTBED_host_create (hostname, username, cfg, port); count++; - GNUNET_free_non_null (username); + GNUNET_free (username); GNUNET_free (hostname); buf = &data[offset + 1]; } @@ -611,26 +611,27 @@ GNUNET_TESTBED_hosts_load_from_loadleveler ( void GNUNET_TESTBED_host_destroy (struct GNUNET_TESTBED_Host *host) { - struct RegisteredController *rc; - uint32_t id; - GNUNET_assert (host->id < host_list_size); GNUNET_assert (host_list[host->id] == host); host_list[host->id] = NULL; /* clear registered controllers list */ - for (rc = host->rc_head; NULL != rc; rc = host->rc_head) + for (struct RegisteredController *rc = host->rc_head; + NULL != rc; + rc = host->rc_head) { GNUNET_CONTAINER_DLL_remove (host->rc_head, host->rc_tail, rc); GNUNET_free (rc); } - GNUNET_free_non_null ((char *) host->username); - GNUNET_free_non_null ((char *) host->hostname); + GNUNET_free_nz ((char *) host->username); + GNUNET_free_nz ((char *) host->hostname); GNUNET_TESTBED_operation_queue_destroy_ ( host->opq_parallel_overlay_connect_operations); GNUNET_CONFIGURATION_destroy (host->cfg); GNUNET_free (host); while (host_list_size >= HOST_LIST_GROW_STEP) { + uint32_t id; + for (id = host_list_size - 1; id > host_list_size - HOST_LIST_GROW_STEP; id--) if (NULL != host_list[id]) @@ -1223,7 +1224,7 @@ GNUNET_TESTBED_controller_destroy_ (struct GNUNET_TESTBED_ControllerProc *cproc) free_argv (cproc->helper_argv); cproc->host->controller_started = GNUNET_NO; cproc->host->locked = GNUNET_NO; - GNUNET_free_non_null (cproc->msg); + GNUNET_free (cproc->msg); GNUNET_free (cproc); } diff --git a/src/testbed/testbed_api_operations.c b/src/testbed/testbed_api_operations.c index a406c0e0b..ae85e0842 100644 --- a/src/testbed/testbed_api_operations.c +++ b/src/testbed/testbed_api_operations.c @@ -696,7 +696,7 @@ decide_capacity (struct OperationQueue *opq, } ret: - GNUNET_free_non_null (evict_entries); + GNUNET_free (evict_entries); if (NULL != ops_) *ops_ = ops; else @@ -771,7 +771,7 @@ check_readiness (struct GNUNET_TESTBED_Operation *op) if (GNUNET_NO == decide_capacity (op->queues[i], op->qentries[i], &ops, &n_ops)) { - GNUNET_free_non_null (evict_ops); + GNUNET_free (evict_ops); return GNUNET_NO; } if (NULL == ops) @@ -842,7 +842,7 @@ cleanup_tslots (struct OperationQueue *queue) continue; GNUNET_CONTAINER_DLL_remove (op->tslots_head, op->tslots_tail, tslot); } - GNUNET_free_non_null (fctx->tslots_freeptr); + GNUNET_free (fctx->tslots_freeptr); fctx->tslots_freeptr = NULL; fctx->alloc_head = NULL; fctx->alloc_tail = NULL; @@ -1337,7 +1337,7 @@ GNUNET_TESTBED_operation_release_ (struct GNUNET_TESTBED_Operation *op) } GNUNET_free (entry); } - GNUNET_free_non_null (op->qentries); + GNUNET_free (op->qentries); GNUNET_free (op->queues); GNUNET_free (op->nres); if (NULL != op->release) @@ -1376,7 +1376,7 @@ GNUNET_TESTBED_operations_fini () warn = 1; queue_destroy (queue); } - GNUNET_free_non_null (expired_opqs); + GNUNET_free (expired_opqs); n_expired_opqs = 0; if (warn) GNUNET_log (GNUNET_ERROR_TYPE_WARNING, diff --git a/src/testbed/testbed_api_peers.c b/src/testbed/testbed_api_peers.c index 7bd895871..99d30e85b 100644 --- a/src/testbed/testbed_api_peers.c +++ b/src/testbed/testbed_api_peers.c @@ -952,7 +952,7 @@ oprelease_manage_service (void *cls) case OPC_STATE_FINISHED: break; } - GNUNET_free_non_null (data); + GNUNET_free (data); GNUNET_free (opc); } diff --git a/src/testbed/testbed_api_statistics.c b/src/testbed/testbed_api_statistics.c index 4858208cc..7fe47d2a0 100644 --- a/src/testbed/testbed_api_statistics.c +++ b/src/testbed/testbed_api_statistics.c @@ -378,8 +378,8 @@ oprelease_get_stats (void *cls) } GNUNET_free (sc->ops); } - GNUNET_free_non_null (sc->subsystem); - GNUNET_free_non_null (sc->name); + GNUNET_free (sc->subsystem); + GNUNET_free (sc->name); GNUNET_free (sc); if (GNUNET_YES == GNUNET_TESTBED_operation_queue_destroy_empty_ (no_wait_queue)) diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 7be8054ca..7ae30e0c6 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c @@ -472,11 +472,11 @@ cleanup (struct GNUNET_TESTBED_RunHandle *rc) GNUNET_TESTBED_host_destroy (rc->h); for (hid = 0; hid < rc->num_hosts; hid++) GNUNET_TESTBED_host_destroy (rc->hosts[hid]); - GNUNET_free_non_null (rc->hosts); + GNUNET_free (rc->hosts); if (NULL != rc->cfg) GNUNET_CONFIGURATION_destroy (rc->cfg); - GNUNET_free_non_null (rc->topo_file); - GNUNET_free_non_null (rc->trusted_ip); + GNUNET_free (rc->topo_file); + GNUNET_free (rc->trusted_ip); GNUNET_free (rc); } @@ -863,7 +863,7 @@ event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) case RC_PEERS_CREATED: case RC_READY: rc->state = RC_PEERS_SHUTDOWN; - GNUNET_free_non_null (rc->peers); + GNUNET_free (rc->peers); rc->peers = NULL; DEBUG ("Peers shut down in %s\n", prof_time (rc)); GNUNET_SCHEDULER_shutdown (); diff --git a/src/testbed/testbed_api_topology.c b/src/testbed/testbed_api_topology.c index 9ffe7f47d..1d765af92 100644 --- a/src/testbed/testbed_api_topology.c +++ b/src/testbed/testbed_api_topology.c @@ -1183,7 +1183,7 @@ _exit: struct TopologyContextOverlay *overlay; overlay = &tc->u.overlay; - GNUNET_free_non_null (overlay->link_array); + GNUNET_free (overlay->link_array); overlay->link_array = NULL; } break; @@ -1193,7 +1193,7 @@ _exit: struct TopologyContextUnderlay *underlay; underlay = &tc->u.underlay; - GNUNET_free_non_null (underlay->link_array); + GNUNET_free (underlay->link_array); underlay->link_array = NULL; } break; @@ -1428,7 +1428,7 @@ GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls, default: GNUNET_break (0); /* Should not use any other option apart from * the ones handled here */ - GNUNET_free_non_null (overlay->link_array); + GNUNET_free (overlay->link_array); GNUNET_free (tc); return NULL; } @@ -1653,7 +1653,7 @@ GNUNET_TESTBED_underlay_construct_ (int num_peers, break; } } - GNUNET_free_non_null (underlay->link_array); + GNUNET_free (underlay->link_array); return ret; } diff --git a/src/testing/gnunet-testing.c b/src/testing/gnunet-testing.c index a9e5042b2..88906e5fa 100644 --- a/src/testing/gnunet-testing.c +++ b/src/testing/gnunet-testing.c @@ -365,7 +365,7 @@ run_no_scheduler (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Extracting hostkey %u\n", create_no); ret = create_hostkeys (create_no); } - GNUNET_free_non_null (create_cfg_template); + GNUNET_free (create_cfg_template); } diff --git a/src/testing/test_testing_peerstartup.c b/src/testing/test_testing_peerstartup.c index 4e21fedc9..25cbb2a9f 100644 --- a/src/testing/test_testing_peerstartup.c +++ b/src/testing/test_testing_peerstartup.c @@ -118,7 +118,7 @@ run (void *cls, char *const *args, const char *cfgfile, end: GNUNET_SCHEDULER_add_now (&do_shutdown, test_ctx); - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); } diff --git a/src/testing/test_testing_peerstartup2.c b/src/testing/test_testing_peerstartup2.c index 26948b7c5..8d357cb08 100644 --- a/src/testing/test_testing_peerstartup2.c +++ b/src/testing/test_testing_peerstartup2.c @@ -197,7 +197,7 @@ run (void *cls, char *const *args, const char *cfgfile, end: FAIL_TEST (0); GNUNET_SCHEDULER_add_now (&do_shutdown, test_ctx); - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); } diff --git a/src/testing/test_testing_sharedservices.c b/src/testing/test_testing_sharedservices.c index 77def3453..d2f760d7a 100644 --- a/src/testing/test_testing_sharedservices.c +++ b/src/testing/test_testing_sharedservices.c @@ -139,7 +139,7 @@ run (void *cls, char *const *args, const char *cfgfile, end: GNUNET_SCHEDULER_add_now (&do_shutdown, test_ctx); - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); } diff --git a/src/testing/testing.c b/src/testing/testing.c index 23bc40d7e..0ca4c3063 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -473,8 +473,8 @@ cleanup_shared_service_instance (struct SharedServiceInstance *i) (void) unlink (i->cfg_fn); GNUNET_free (i->cfg_fn); } - GNUNET_free_non_null (i->unix_sock); - GNUNET_free_non_null (i->port_str); + GNUNET_free (i->unix_sock); + GNUNET_free (i->port_str); GNUNET_break (NULL == i->proc); GNUNET_break (0 == i->n_refs); GNUNET_free (i); @@ -551,17 +551,17 @@ GNUNET_TESTING_system_destroy (struct GNUNET_TESTING_System *system, stop_shared_service_instance (i); cleanup_shared_service_instance (i); } - GNUNET_free_non_null (ss->instances); + GNUNET_free (ss->instances); GNUNET_CONFIGURATION_destroy (ss->cfg); GNUNET_free (ss->sname); GNUNET_free (ss); } - GNUNET_free_non_null (system->shared_services); + GNUNET_free (system->shared_services); if (GNUNET_YES == remove_paths) GNUNET_DISK_directory_remove (system->tmppath); GNUNET_free (system->tmppath); - GNUNET_free_non_null (system->trusted_ip); - GNUNET_free_non_null (system->hostname); + GNUNET_free (system->trusted_ip); + GNUNET_free (system->hostname); GNUNET_free (system); } @@ -957,7 +957,7 @@ update_config_sections (void *cls, const char *section) } GNUNET_free (ikeys); } - GNUNET_free_non_null (val); + GNUNET_free (val); ACCEPT_FROM_key = "ACCEPT_FROM"; if ((NULL != uc->system->trusted_ip) && (NULL != strstr (uc->system->trusted_ip, ":"))) /* IPv6 in use */ @@ -1120,7 +1120,7 @@ GNUNET_TESTING_configuration_create_ (struct GNUNET_TESTING_System *system, *nports = uc.nports; } else - GNUNET_free_non_null (uc.ports); + GNUNET_free (uc.ports); return uc.status; } @@ -1316,8 +1316,8 @@ GNUNET_TESTING_peer_configure (struct GNUNET_TESTING_System *system, return peer; err_ret: - GNUNET_free_non_null (ss_instances); - GNUNET_free_non_null (ports); + GNUNET_free (ss_instances); + GNUNET_free (ports); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s", emsg_); if (NULL != emsg) *emsg = emsg_; @@ -1566,8 +1566,8 @@ GNUNET_TESTING_peer_destroy (struct GNUNET_TESTING_Peer *peer) GNUNET_CONFIGURATION_destroy (peer->cfg); GNUNET_free (peer->main_binary); GNUNET_free (peer->args); - GNUNET_free_non_null (peer->id); - GNUNET_free_non_null (peer->ss_instances); + GNUNET_free (peer->id); + GNUNET_free (peer->ss_instances); if (NULL != peer->ports) { for (cnt = 0; cnt < peer->nports; cnt++) diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index c6f600df1..b380c0bd4 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c @@ -275,7 +275,7 @@ free_peer (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) } if (NULL != pos->hello) { - GNUNET_free_non_null (pos->hello); + GNUNET_free (pos->hello); pos->hello = NULL; } if (NULL != pos->filter) @@ -812,7 +812,7 @@ process_peer (void *cls, pos = GNUNET_CONTAINER_multipeermap_get (peers, peer); if (NULL != pos) { - GNUNET_free_non_null (pos->hello); + GNUNET_free (pos->hello); pos->hello = NULL; if (NULL != pos->filter) { diff --git a/src/transport/gnunet-communicator-udp.c b/src/transport/gnunet-communicator-udp.c index 585b29c2d..efbbd08a7 100644 --- a/src/transport/gnunet-communicator-udp.c +++ b/src/transport/gnunet-communicator-udp.c @@ -783,7 +783,7 @@ bi_destroy (struct BroadcastInterface *bi) GNUNET_CONTAINER_DLL_remove (bi_head, bi_tail, bi); GNUNET_SCHEDULER_cancel (bi->broadcast_task); GNUNET_free (bi->sa); - GNUNET_free_non_null (bi->ba); + GNUNET_free (bi->ba); GNUNET_free (bi); } diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 93fa031f4..9bdcd64be 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -2108,7 +2108,7 @@ free_blacklist_entry (void *cls, { char *be = value; - GNUNET_free_non_null (be); + GNUNET_free (be); return GNUNET_OK; } @@ -2511,7 +2511,7 @@ GST_blacklist_test_cancel (struct GST_BlacklistCheck *bc) GNUNET_SCHEDULER_cancel (bc->task); bc->task = NULL; } - GNUNET_free_non_null (bc->address); + GNUNET_free (bc->address); GNUNET_free (bc); } diff --git a/src/transport/gnunet-service-transport_hello.c b/src/transport/gnunet-service-transport_hello.c index ed6565d23..472c77c27 100644 --- a/src/transport/gnunet-service-transport_hello.c +++ b/src/transport/gnunet-service-transport_hello.c @@ -182,7 +182,7 @@ refresh_hello_task (void *cls) gc.addr_pos = oal_head; gc.expiration = GNUNET_TIME_relative_to_absolute (hello_expiration); - GNUNET_free_non_null (our_hello); + GNUNET_free (our_hello); our_hello = GNUNET_HELLO_create (&GST_my_identity.public_key, &address_generator, &gc, diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index 35da5ec10..0d71e1ff9 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c @@ -339,7 +339,7 @@ destroy_it (void *cls, const struct GNUNET_PeerIdentity *key, void *value) GNUNET_assert ( GNUNET_OK == GNUNET_CONTAINER_multipeermap_remove (monitored_peers, key, value)); - GNUNET_free_non_null (m->address); + GNUNET_free (m->address); GNUNET_free (value); return GNUNET_OK; } @@ -1037,7 +1037,7 @@ plugin_monitoring_cb (void *cls, GNUNET_TRANSPORT_address_to_string_cancel (addr->asc); addr->asc = NULL; } - GNUNET_free_non_null (addr->str); + GNUNET_free (addr->str); GNUNET_free (addr); *session_ctx = NULL; } @@ -1069,7 +1069,7 @@ plugin_monitoring_cb (void *cls, GNUNET_TRANSPORT_address_to_string_cancel (addr->asc); addr->asc = NULL; } - GNUNET_free_non_null (addr->str); + GNUNET_free (addr->str); GNUNET_free (addr); *session_ctx = NULL; } diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index 87cd7ead2..92ed2fe52 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c @@ -2207,9 +2207,9 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) _ ("Shutdown for plugin `%s' complete\n"), plugin->name); GNUNET_CONTAINER_multipeermap_destroy (plugin->sessions); - GNUNET_free_non_null (plugin->proxy_hostname); - GNUNET_free_non_null (plugin->proxy_username); - GNUNET_free_non_null (plugin->proxy_password); + GNUNET_free (plugin->proxy_hostname); + GNUNET_free (plugin->proxy_username); + GNUNET_free (plugin->proxy_password); GNUNET_free (plugin); GNUNET_free (api); return NULL; @@ -2304,9 +2304,9 @@ client_configure_plugin (struct HTTP_Client_Plugin *plugin) GNUNET_free (proxy_type); GNUNET_free (plugin->proxy_hostname); plugin->proxy_hostname = NULL; - GNUNET_free_non_null (plugin->proxy_username); + GNUNET_free (plugin->proxy_username); plugin->proxy_username = NULL; - GNUNET_free_non_null (plugin->proxy_password); + GNUNET_free (plugin->proxy_password); plugin->proxy_password = NULL; return GNUNET_SYSERR; @@ -2325,7 +2325,7 @@ client_configure_plugin (struct HTTP_Client_Plugin *plugin) if (GNUNET_SYSERR == plugin->proxy_use_httpproxytunnel) plugin->proxy_use_httpproxytunnel = GNUNET_NO; - GNUNET_free_non_null (proxy_type); + GNUNET_free (proxy_type); } /* Should we emulate an XHR client for testing? */ diff --git a/src/transport/plugin_transport_http_common.c b/src/transport/plugin_transport_http_common.c index 2bcab42b4..d81d6db9c 100644 --- a/src/transport/plugin_transport_http_common.c +++ b/src/transport/plugin_transport_http_common.c @@ -34,10 +34,10 @@ http_clean_splitted (struct SplittedHTTPAddress *spa) { if (NULL != spa) { - GNUNET_free_non_null (spa->protocol); - GNUNET_free_non_null (spa->host); - GNUNET_free_non_null (spa->path); - GNUNET_free_non_null (spa); + GNUNET_free (spa->protocol); + GNUNET_free (spa->host); + GNUNET_free (spa->path); + GNUNET_free (spa); } } @@ -494,7 +494,7 @@ http_common_plugin_address_pretty_printer (void *cls, const char *type, asc (asc_cls, ret, (NULL == ret) ? GNUNET_SYSERR : GNUNET_OK); asc (asc_cls, NULL, GNUNET_OK); http_clean_splitted (saddr); - GNUNET_free_non_null (sock_addr); + GNUNET_free (sock_addr); return; } if ((GNUNET_YES == numeric) && @@ -510,7 +510,7 @@ http_common_plugin_address_pretty_printer (void *cls, const char *type, goto handle_error; } /* Wait for resolver callback */ - GNUNET_free_non_null (sock_addr); + GNUNET_free (sock_addr); return; } if ((GNUNET_NO == numeric) && @@ -531,7 +531,7 @@ http_common_plugin_address_pretty_printer (void *cls, const char *type, goto handle_error; } /* Wait for resolver callback */ - GNUNET_free_non_null (sock_addr); + GNUNET_free (sock_addr); return; } if ((GNUNET_NO == numeric) && @@ -541,7 +541,7 @@ http_common_plugin_address_pretty_printer (void *cls, const char *type, ret = http_common_plugin_address_to_string (type, address, addrlen); asc (asc_cls, ret, (NULL == ret) ? GNUNET_SYSERR : GNUNET_OK); asc (asc_cls, NULL, GNUNET_OK); - GNUNET_free_non_null (sock_addr); + GNUNET_free (sock_addr); http_clean_splitted (saddr); return; } @@ -553,7 +553,7 @@ handle_error: /* Report error */ asc (asc_cls, NULL, GNUNET_SYSERR); asc (asc_cls, NULL, GNUNET_OK); - GNUNET_free_non_null (sock_addr); + GNUNET_free (sock_addr); if (NULL != saddr) http_clean_splitted (saddr); } diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index eef83b29d..514f7fd1f 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c @@ -1495,7 +1495,7 @@ server_lookup_connection (struct HTTP_Server_Plugin *plugin, http_common_plugin_address_to_string (plugin->protocol, addr, addr_len)); - GNUNET_free_non_null (addr); + GNUNET_free (addr); } if ((_RECEIVE == direction) && @@ -2179,9 +2179,9 @@ server_load_certificate (struct HTTP_Server_Plugin *plugin) { struct GNUNET_OS_Process *cert_creation; - GNUNET_free_non_null (plugin->key); + GNUNET_free (plugin->key); plugin->key = NULL; - GNUNET_free_non_null (plugin->cert); + GNUNET_free (plugin->cert); plugin->cert = NULL; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -2203,11 +2203,11 @@ server_load_certificate (struct HTTP_Server_Plugin *plugin) GNUNET_free (key_file); GNUNET_free (cert_file); - GNUNET_free_non_null (plugin->key); + GNUNET_free (plugin->key); plugin->key = NULL; - GNUNET_free_non_null (plugin->cert); + GNUNET_free (plugin->cert); plugin->cert = NULL; - GNUNET_free_non_null (plugin->crypto_init); + GNUNET_free (plugin->crypto_init); plugin->crypto_init = NULL; return GNUNET_SYSERR; @@ -2228,11 +2228,11 @@ server_load_certificate (struct HTTP_Server_Plugin *plugin) GNUNET_free (key_file); GNUNET_free (cert_file); - GNUNET_free_non_null (plugin->key); + GNUNET_free (plugin->key); plugin->key = NULL; - GNUNET_free_non_null (plugin->cert); + GNUNET_free (plugin->cert); plugin->cert = NULL; - GNUNET_free_non_null (plugin->crypto_init); + GNUNET_free (plugin->crypto_init); plugin->crypto_init = NULL; return GNUNET_SYSERR; @@ -2871,8 +2871,8 @@ server_start_report_addresses (struct HTTP_Server_Plugin *plugin) GNUNET_assert (NULL != addrs[res]); GNUNET_free (addrs[res]); } - GNUNET_free_non_null (addrs); - GNUNET_free_non_null (addrlens); + GNUNET_free (addrs); + GNUNET_free (addrlens); } @@ -3316,9 +3316,9 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) plugin->server_v6_task = NULL; } #if BUILD_HTTPS - GNUNET_free_non_null (plugin->crypto_init); - GNUNET_free_non_null (plugin->cert); - GNUNET_free_non_null (plugin->key); + GNUNET_free (plugin->crypto_init); + GNUNET_free (plugin->cert); + GNUNET_free (plugin->key); #endif GNUNET_CONTAINER_multipeermap_iterate (plugin->sessions, &destroy_session_shutdown_cb, @@ -3336,10 +3336,10 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) plugin->server_v6 = NULL; } /* Clean up */ - GNUNET_free_non_null (plugin->external_hostname); - GNUNET_free_non_null (plugin->ext_addr); - GNUNET_free_non_null (plugin->server_addr_v4); - GNUNET_free_non_null (plugin->server_addr_v6); + GNUNET_free (plugin->external_hostname); + GNUNET_free (plugin->ext_addr); + GNUNET_free (plugin->server_addr_v4); + GNUNET_free (plugin->server_addr_v6); regfree (&plugin->url_regex); LOG (GNUNET_ERROR_TYPE_DEBUG, diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 4cec181b0..e3bc21543 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c @@ -1186,7 +1186,7 @@ get_server_addresses (const char *service_name, (EACCES == errno)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "socket"); - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); GNUNET_free (unixpath); return GNUNET_SYSERR; } @@ -1212,7 +1212,7 @@ get_server_addresses (const char *service_name, _ ( "Have neither PORT nor UNIXPATH for service `%s', but one is required\n"), service_name); - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); return GNUNET_SYSERR; } if (0 == port) @@ -1220,8 +1220,8 @@ get_server_addresses (const char *service_name, saddrs = GNUNET_malloc (2 * sizeof(struct sockaddr *)); saddrlens = GNUNET_malloc (2 * sizeof(socklen_t)); add_unixpath (saddrs, saddrlens, unixpath, abstract); - GNUNET_free_non_null (unixpath); - GNUNET_free_non_null (hostname); + GNUNET_free (unixpath); + GNUNET_free (hostname); *addrs = saddrs; *addr_lens = saddrlens; return 1; @@ -1245,7 +1245,7 @@ get_server_addresses (const char *service_name, hostname, gai_strerror (ret)); GNUNET_free (hostname); - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); return GNUNET_SYSERR; } next = res; @@ -1265,7 +1265,7 @@ get_server_addresses (const char *service_name, hostname); freeaddrinfo (res); GNUNET_free (hostname); - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); return GNUNET_SYSERR; } resi = i; @@ -1372,7 +1372,7 @@ get_server_addresses (const char *service_name, ((struct sockaddr_in *) saddrs[i])->sin_port = htons (port); } } - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); *addrs = saddrs; *addr_lens = saddrlens; return resi; @@ -3163,7 +3163,7 @@ handle_tcp_welcome (void *cls, else { GNUNET_break (0); - GNUNET_free_non_null (vaddr); + GNUNET_free (vaddr); GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); return; } @@ -3267,7 +3267,7 @@ handle_tcp_data (void *cls, GNUNET_a2s (vaddr, alen)); GNUNET_break_op (0); GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); - GNUNET_free_non_null (vaddr); + GNUNET_free (vaddr); return; } if (GNUNET_YES == session->expecting_welcome) @@ -3284,7 +3284,7 @@ handle_tcp_data (void *cls, GNUNET_a2s (vaddr, alen)); GNUNET_break_op (0); GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); - GNUNET_free_non_null (vaddr); + GNUNET_free (vaddr); return; } @@ -3300,7 +3300,7 @@ handle_tcp_data (void *cls, (unsigned int) ntohs (message->type), GNUNET_i2s (&session->target), GNUNET_a2s (vaddr, alen)); - GNUNET_free_non_null (vaddr); + GNUNET_free (vaddr); } GNUNET_STATISTICS_update (plugin->env->stats, @@ -3802,8 +3802,8 @@ libgnunet_plugin_transport_tcp_init (void *cls) plugin); for (ret = ret_s - 1; ret >= 0; ret--) GNUNET_free (addrs[ret]); - GNUNET_free_non_null (addrs); - GNUNET_free_non_null (addrlens); + GNUNET_free (addrs); + GNUNET_free (addrlens); } else { @@ -3893,7 +3893,7 @@ die: if (NULL != service) LEGACY_SERVICE_stop (service); GNUNET_free (plugin); - GNUNET_free_non_null (api); + GNUNET_free (api); return NULL; } diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index ef4fddb24..ec3a0edd8 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c @@ -3669,7 +3669,7 @@ libgnunet_plugin_transport_udp_init (void *cls) } have_bind4 = GNUNET_YES; } - GNUNET_free_non_null (bind4_address); + GNUNET_free (bind4_address); have_bind6 = GNUNET_NO; memset (&server_addrv6, 0, sizeof(server_addrv6)); if (GNUNET_YES == GNUNET_CONFIGURATION_get_value_string (env->cfg, @@ -3691,7 +3691,7 @@ libgnunet_plugin_transport_udp_init (void *cls) } have_bind6 = GNUNET_YES; } - GNUNET_free_non_null (bind6_address); + GNUNET_free (bind6_address); enable_broadcasting = GNUNET_CONFIGURATION_get_value_yesno (env->cfg, "transport-udp", diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index 17d72135b..74b8d5a8a 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c @@ -2093,7 +2093,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls) GNUNET_SERVER_mst_destroy (plugin->helper_payload_tokenizer); plugin->helper_payload_tokenizer = NULL; } - GNUNET_free_non_null (plugin->wlan_interface); + GNUNET_free (plugin->wlan_interface); GNUNET_free (plugin); GNUNET_free (api); return NULL; diff --git a/src/transport/tcp_connection_legacy.c b/src/transport/tcp_connection_legacy.c index 4e8c8140d..3e173b8a4 100644 --- a/src/transport/tcp_connection_legacy.c +++ b/src/transport/tcp_connection_legacy.c @@ -1088,8 +1088,8 @@ GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *connection) * leak the socket in this special case) ... */ } } - GNUNET_free_non_null (connection->addr); - GNUNET_free_non_null (connection->hostname); + GNUNET_free (connection->addr); + GNUNET_free (connection->hostname); GNUNET_free (connection->write_buffer); GNUNET_free (connection); } diff --git a/src/transport/tcp_service_legacy.c b/src/transport/tcp_service_legacy.c index fb4e9c3c9..12dce3993 100644 --- a/src/transport/tcp_service_legacy.c +++ b/src/transport/tcp_service_legacy.c @@ -657,7 +657,7 @@ LEGACY_SERVICE_get_server_addresses ( (EACCES == errno)) { LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "socket"); - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); GNUNET_free (unixpath); return GNUNET_SYSERR; } @@ -683,7 +683,7 @@ LEGACY_SERVICE_get_server_addresses ( _ ( "Have neither PORT nor UNIXPATH for service `%s', but one is required\n"), service_name); - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); return GNUNET_SYSERR; } if (0 == port) @@ -691,8 +691,8 @@ LEGACY_SERVICE_get_server_addresses ( saddrs = GNUNET_malloc (2 * sizeof(struct sockaddr *)); saddrlens = GNUNET_malloc (2 * sizeof(socklen_t)); add_unixpath (saddrs, saddrlens, unixpath, abstract); - GNUNET_free_non_null (unixpath); - GNUNET_free_non_null (hostname); + GNUNET_free (unixpath); + GNUNET_free (hostname); *addrs = saddrs; *addr_lens = saddrlens; return 1; @@ -716,7 +716,7 @@ LEGACY_SERVICE_get_server_addresses ( hostname, gai_strerror (ret)); GNUNET_free (hostname); - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); return GNUNET_SYSERR; } next = res; @@ -736,7 +736,7 @@ LEGACY_SERVICE_get_server_addresses ( hostname); freeaddrinfo (res); GNUNET_free (hostname); - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); return GNUNET_SYSERR; } resi = i; @@ -843,7 +843,7 @@ LEGACY_SERVICE_get_server_addresses ( ((struct sockaddr_in *) saddrs[i])->sin_port = htons (port); } } - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); *addrs = saddrs; *addr_lens = saddrlens; return resi; @@ -1024,7 +1024,7 @@ write_pid_file (struct LEGACY_SERVICE_Context *sctx, pid_t pid) { LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "access", rdir); GNUNET_free (rdir); - GNUNET_free_non_null (user); + GNUNET_free (user); GNUNET_free (pif); return GNUNET_SYSERR; } @@ -1034,7 +1034,7 @@ write_pid_file (struct LEGACY_SERVICE_Context *sctx, pid_t pid) { LOG_STRERROR_FILE (GNUNET_ERROR_TYPE_ERROR, "fopen", pif); GNUNET_free (pif); - GNUNET_free_non_null (user); + GNUNET_free (user); return GNUNET_SYSERR; } if (0 > fprintf (pidfd, "%u", pid)) @@ -1042,7 +1042,7 @@ write_pid_file (struct LEGACY_SERVICE_Context *sctx, pid_t pid) GNUNET_break (0 == fclose (pidfd)); if ((NULL != user) && (0 < strlen (user))) GNUNET_DISK_file_change_owner (pif, user); - GNUNET_free_non_null (user); + GNUNET_free (user); GNUNET_free (pif); return GNUNET_OK; } @@ -1441,7 +1441,7 @@ LEGACY_SERVICE_run (int argc, /* shutdown */ if ((1 == do_daemonize) && (NULL != sctx.server)) pid_file_delete (&sctx); - GNUNET_free_non_null (sctx.my_handlers); + GNUNET_free (sctx.my_handlers); shutdown: if (-1 != sctx.ready_confirm_fd) @@ -1475,16 +1475,16 @@ shutdown: if (NULL != sctx.addrs) while (NULL != sctx.addrs[i]) GNUNET_free_nz (sctx.addrs[i++]); - GNUNET_free_non_null (sctx.addrs); - GNUNET_free_non_null (sctx.addrlens); - GNUNET_free_non_null (logfile); - GNUNET_free_non_null (loglev); + GNUNET_free (sctx.addrs); + GNUNET_free (sctx.addrlens); + GNUNET_free (logfile); + GNUNET_free (loglev); GNUNET_free (cfg_fn); - GNUNET_free_non_null (opt_cfg_fn); - GNUNET_free_non_null (sctx.v4_denied); - GNUNET_free_non_null (sctx.v6_denied); - GNUNET_free_non_null (sctx.v4_allowed); - GNUNET_free_non_null (sctx.v6_allowed); + GNUNET_free (opt_cfg_fn); + GNUNET_free (sctx.v4_denied); + GNUNET_free (sctx.v6_denied); + GNUNET_free (sctx.v4_allowed); + GNUNET_free (sctx.v6_allowed); return err ? GNUNET_SYSERR : sctx.ret; } @@ -1626,7 +1626,7 @@ LEGACY_SERVICE_stop (struct LEGACY_SERVICE_Context *sctx) } if (NULL != sctx->server) GNUNET_SERVER_destroy (sctx->server); - GNUNET_free_non_null (sctx->my_handlers); + GNUNET_free (sctx->my_handlers); if (NULL != sctx->addrs) { i = 0; @@ -1634,11 +1634,11 @@ LEGACY_SERVICE_stop (struct LEGACY_SERVICE_Context *sctx) GNUNET_free_nz (sctx->addrs[i++]); GNUNET_free (sctx->addrs); } - GNUNET_free_non_null (sctx->addrlens); - GNUNET_free_non_null (sctx->v4_denied); - GNUNET_free_non_null (sctx->v6_denied); - GNUNET_free_non_null (sctx->v4_allowed); - GNUNET_free_non_null (sctx->v6_allowed); + GNUNET_free (sctx->addrlens); + GNUNET_free (sctx->v4_denied); + GNUNET_free (sctx->v6_denied); + GNUNET_free (sctx->v4_allowed); + GNUNET_free (sctx->v6_allowed); GNUNET_free (sctx); } diff --git a/src/transport/test_http_common.c b/src/transport/test_http_common.c index 6e31ec85e..fe6e4faa3 100644 --- a/src/transport/test_http_common.c +++ b/src/transport/test_http_common.c @@ -32,9 +32,9 @@ clean (struct SplittedHTTPAddress *addr) { if (NULL == addr) return; - GNUNET_free_non_null (addr->host); - GNUNET_free_non_null (addr->path); - GNUNET_free_non_null (addr->protocol); + GNUNET_free (addr->host); + GNUNET_free (addr->path); + GNUNET_free (addr->protocol); GNUNET_free (addr); } diff --git a/src/transport/transport-testing-main.c b/src/transport/transport-testing-main.c index 8c35ff252..20c58eeee 100644 --- a/src/transport/transport-testing-main.c +++ b/src/transport/transport-testing-main.c @@ -604,7 +604,7 @@ GNUNET_TRANSPORT_TESTING_main_ (const char *argv0, for (unsigned int i = 0; i < num_peers; i++) GNUNET_free (cfg_names[i]); GNUNET_free (test_source); - GNUNET_free_non_null (test_plugin); + GNUNET_free (test_plugin); GNUNET_free (test_name); return ret; } diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c index 06dbe891a..2da193b31 100644 --- a/src/transport/transport-testing.c +++ b/src/transport/transport-testing.c @@ -349,7 +349,7 @@ get_hello (void *cb_cls, GNUNET_assert (0 == memcmp (&hello_id, &p->id, sizeof(hello_id))); - GNUNET_free_non_null (p->hello); + GNUNET_free (p->hello); p->hello = (struct GNUNET_HELLO_Message *) GNUNET_copy_message (message); if (NULL != p->start_cb) @@ -460,10 +460,10 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct cfgname, emsg); GNUNET_TRANSPORT_TESTING_stop_peer (p); - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); return NULL; } - GNUNET_free_non_null (emsg); + GNUNET_free (emsg); if (GNUNET_OK != GNUNET_TESTING_peer_start (p->peer)) { LOG (GNUNET_ERROR_TYPE_ERROR, diff --git a/src/transport/transport_api2_core.c b/src/transport/transport_api2_core.c index cd8bacf3d..002af81fc 100644 --- a/src/transport/transport_api2_core.c +++ b/src/transport/transport_api2_core.c @@ -762,7 +762,7 @@ GNUNET_TRANSPORT_core_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, reconnect (h); if (NULL == h->mq) { - GNUNET_free_non_null (h->handlers); + GNUNET_free (h->handlers); GNUNET_free (h); return NULL; } @@ -792,7 +792,7 @@ GNUNET_TRANSPORT_core_disconnect (struct GNUNET_TRANSPORT_CoreHandle *handle) } GNUNET_CONTAINER_multipeermap_destroy (handle->neighbours); handle->neighbours = NULL; - GNUNET_free_non_null (handle->handlers); + GNUNET_free (handle->handlers); handle->handlers = NULL; GNUNET_free (handle); } diff --git a/src/transport/transport_api_core.c b/src/transport/transport_api_core.c index 5d841fa10..55647508d 100644 --- a/src/transport/transport_api_core.c +++ b/src/transport/transport_api_core.c @@ -891,7 +891,7 @@ GNUNET_TRANSPORT_core_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, reconnect (h); if (NULL == h->mq) { - GNUNET_free_non_null (h->handlers); + GNUNET_free (h->handlers); GNUNET_free (h); return NULL; } @@ -922,7 +922,7 @@ GNUNET_TRANSPORT_core_disconnect (struct GNUNET_TRANSPORT_CoreHandle *handle) } GNUNET_CONTAINER_multipeermap_destroy (handle->neighbours); handle->neighbours = NULL; - GNUNET_free_non_null (handle->handlers); + GNUNET_free (handle->handlers); handle->handlers = NULL; GNUNET_free (handle); } diff --git a/src/util/bio.c b/src/util/bio.c index ce15f073b..b27230240 100644 --- a/src/util/bio.c +++ b/src/util/bio.c @@ -171,7 +171,7 @@ GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg) if (NULL != emsg) *emsg = h->emsg; else - GNUNET_free_non_null (h->emsg); + GNUNET_free (h->emsg); switch (h->type) { case IO_FILE: @@ -345,7 +345,7 @@ GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, GNUNET_asprintf (&h->emsg, _ ("Error reading length of string `%s'"), what); - GNUNET_free_non_null (tmp); + GNUNET_free (tmp); return GNUNET_SYSERR; } if (0 == big) @@ -612,7 +612,7 @@ GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h, char **emsg) if (NULL != emsg) *emsg = h->emsg; else - GNUNET_free_non_null (h->emsg); + GNUNET_free (h->emsg); switch (h->type) { case IO_FILE: @@ -623,7 +623,7 @@ GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h, char **emsg) if (NULL != emsg) *emsg = h->emsg; else - GNUNET_free_non_null (h->emsg); + GNUNET_free (h->emsg); err = GNUNET_SYSERR; } else @@ -663,7 +663,7 @@ GNUNET_BIO_flush (struct GNUNET_BIO_WriteHandle *h) { GNUNET_DISK_file_close (h->fd); h->fd = NULL; - GNUNET_free_non_null (h->emsg); + GNUNET_free (h->emsg); GNUNET_asprintf (&h->emsg, _ ("Unable to flush buffer to file")); return GNUNET_SYSERR; } @@ -698,7 +698,7 @@ GNUNET_BIO_get_buffer_contents (struct GNUNET_BIO_WriteHandle *h, if (NULL != emsg) *emsg = h->emsg; else - GNUNET_free_non_null (h->emsg); + GNUNET_free (h->emsg); *contents = GNUNET_buffer_reap ((struct GNUNET_Buffer *) h->buffer, size); return ret; } @@ -750,7 +750,7 @@ write_to_file (struct GNUNET_BIO_WriteHandle *h, _ ("Error while writing `%s' to file: %s"), what, tmp); - GNUNET_free_non_null (tmp); + GNUNET_free (tmp); return GNUNET_SYSERR; } } @@ -870,7 +870,7 @@ GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, if (-1 == size) { GNUNET_free (buf); - GNUNET_free_non_null (h->emsg); + GNUNET_free (h->emsg); GNUNET_asprintf (&h->emsg, _ ("Failed to serialize metadata `%s'"), what); diff --git a/src/util/buffer.c b/src/util/buffer.c index c865f6307..d0261889e 100644 --- a/src/util/buffer.c +++ b/src/util/buffer.c @@ -162,7 +162,7 @@ GNUNET_buffer_reap (struct GNUNET_Buffer *buf, size_t *size) void GNUNET_buffer_clear (struct GNUNET_Buffer *buf) { - GNUNET_free_non_null (buf->mem); + GNUNET_free (buf->mem); memset (buf, 0, sizeof (struct GNUNET_Buffer)); } diff --git a/src/util/client.c b/src/util/client.c index a7b1a2a0f..86dabe664 100644 --- a/src/util/client.c +++ b/src/util/client.c @@ -422,7 +422,7 @@ connection_client_destroy_impl (struct GNUNET_MQ_Handle *mq, } cancel_aps (cstate); GNUNET_free (cstate->service_name); - GNUNET_free_non_null (cstate->hostname); + GNUNET_free (cstate->hostname); GNUNET_MST_destroy (cstate->mst); GNUNET_free (cstate); } @@ -563,7 +563,7 @@ try_unixpath (const char *service_name, if (NULL != sock) GNUNET_NETWORK_socket_close (sock); } - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); #endif return NULL; } @@ -747,7 +747,7 @@ test_service_configuration (const char *service_name, _ ("not a valid filename")); return GNUNET_SYSERR; /* UNIXPATH specified but invalid! */ } - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); #endif if ((GNUNET_YES == @@ -768,7 +768,7 @@ test_service_configuration (const char *service_name, &hostname)) && (0 != strlen (hostname))) ret = GNUNET_OK; - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); return ret; } @@ -1043,7 +1043,7 @@ GNUNET_CLIENT_test (const struct GNUNET_CONFIGURATION_Handle *cfg, /* service running remotely */ ret = GNUNET_OK; } - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); return ret; } diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c index fd91e23b2..4aad49777 100644 --- a/src/util/common_allocation.c +++ b/src/util/common_allocation.c @@ -323,13 +323,12 @@ GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, int linenumber) * want to keep track of allocations. * * @param ptr the pointer to free - * @param filename where in the code was the call to GNUNET_free - * @param linenumber where in the code was the call to GNUNET_free + * @param filename where in the code was the call to GNUNET_free() + * @param linenumber where in the code was the call to GNUNET_free() */ void GNUNET_xfree_ (void *ptr, const char *filename, int linenumber) { - GNUNET_assert_at (NULL != ptr, filename, linenumber); #ifdef W32_MEM_LIMIT ptr = &((size_t *) ptr)[-1]; mem_used -= *((size_t *) ptr); diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 3894cdda1..b30175543 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c @@ -715,9 +715,9 @@ GNUNET_log_setup (const char *comp, #if ! defined(GNUNET_CULL_LOGGING) parse_all_definitions (); #endif - GNUNET_free_non_null (component); + GNUNET_free (component); GNUNET_asprintf (&component, "%s-%d", comp, getpid ()); - GNUNET_free_non_null (component_nopid); + GNUNET_free (component_nopid); component_nopid = GNUNET_strdup (comp); env_logfile = getenv ("GNUNET_FORCE_LOGFILE"); @@ -725,7 +725,7 @@ GNUNET_log_setup (const char *comp, logfile = env_logfile; if (NULL == logfile) return GNUNET_OK; - GNUNET_free_non_null (log_file_name); + GNUNET_free (log_file_name); log_file_name = GNUNET_STRINGS_filename_expand (logfile); if (NULL == log_file_name) return GNUNET_SYSERR; diff --git a/src/util/configuration.c b/src/util/configuration.c index 7ed87cc1e..34ecc9e73 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c @@ -286,7 +286,7 @@ GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg, line_orig = NULL; while (r_bytes < size) { - GNUNET_free_non_null (line_orig); + GNUNET_free (line_orig); /* fgets-like behaviour on buffer */ to_read = size - r_bytes; pos = memchr (&mem[r_bytes], '\n', to_read); @@ -404,7 +404,7 @@ GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg, ret = GNUNET_SYSERR; break; } - GNUNET_free_non_null (line_orig); + GNUNET_free (line_orig); GNUNET_free (section); GNUNET_assert ((GNUNET_OK != ret) || (r_bytes == size)); return ret; @@ -734,7 +734,7 @@ GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg, { spos->entries = ent->next; GNUNET_free (ent->key); - GNUNET_free_non_null (ent->val); + GNUNET_free (ent->val); GNUNET_free (ent); cfg->dirty = GNUNET_YES; } @@ -926,13 +926,13 @@ GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg, { if (NULL == value) { - GNUNET_free_non_null (e->val); + GNUNET_free (e->val); e->val = NULL; } else { nv = GNUNET_strdup (value); - GNUNET_free_non_null (e->val); + GNUNET_free (e->val); e->val = nv; } return; @@ -1383,7 +1383,7 @@ expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg, result = GNUNET_malloc (strlen (prefix) + strlen (post) + 1); strcpy (result, prefix); strcat (result, post); - GNUNET_free_non_null (def); + GNUNET_free (def); GNUNET_free (prefix); GNUNET_free (orig); return result; diff --git a/src/util/container_bloomfilter.c b/src/util/container_bloomfilter.c index eca651862..d7460043d 100644 --- a/src/util/container_bloomfilter.c +++ b/src/util/container_bloomfilter.c @@ -707,7 +707,7 @@ GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter *bf) return; if (bf->fh != NULL) GNUNET_DISK_file_close (bf->fh); - GNUNET_free_non_null (bf->filename); + GNUNET_free (bf->filename); GNUNET_free (bf->bitArray); GNUNET_free (bf); } diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c index ad362408e..b66a7b258 100644 --- a/src/util/container_meta_data.c +++ b/src/util/container_meta_data.c @@ -217,9 +217,9 @@ GNUNET_CONTAINER_meta_data_create () static void meta_item_free (struct MetaItem *mi) { - GNUNET_free_non_null (mi->plugin_name); - GNUNET_free_non_null (mi->mime_type); - GNUNET_free_non_null (mi->data); + GNUNET_free (mi->plugin_name); + GNUNET_free (mi->mime_type); + GNUNET_free (mi->data); GNUNET_free (mi); } @@ -258,7 +258,7 @@ GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md) GNUNET_CONTAINER_DLL_remove (md->items_head, md->items_tail, pos); meta_item_free (pos); } - GNUNET_free_non_null (md->sbuf); + GNUNET_free (md->sbuf); GNUNET_free (md); } @@ -280,7 +280,7 @@ GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md) GNUNET_CONTAINER_DLL_remove (md->items_head, md->items_tail, mi); meta_item_free (mi); } - GNUNET_free_non_null (md->sbuf); + GNUNET_free (md->sbuf); memset (md, 0, sizeof(struct GNUNET_CONTAINER_MetaData)); } @@ -976,7 +976,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData if (NULL != pos->mime_type) left -= strlen (pos->mime_type) + 1; - GNUNET_free_non_null (cdata); + GNUNET_free (cdata); cdata = NULL; i++; @@ -1180,7 +1180,7 @@ GNUNET_CONTAINER_meta_data_deserialize (const char *input, size_t size) ntohl (ent.type), format, mime_type, meta_data, dlen); } - GNUNET_free_non_null (data); + GNUNET_free (data); return md; } diff --git a/src/util/disk.c b/src/util/disk.c index 9018aa955..cdead59d2 100644 --- a/src/util/disk.c +++ b/src/util/disk.c @@ -1556,8 +1556,8 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2]) GNUNET_break (0 == close (p->fd[0]->fd)); if (p->fd[1]->fd >= 0) GNUNET_break (0 == close (p->fd[1]->fd)); - GNUNET_free_non_null (p->fd[0]); - GNUNET_free_non_null (p->fd[1]); + GNUNET_free (p->fd[0]); + GNUNET_free (p->fd[1]); GNUNET_free (p); errno = eno; return NULL; diff --git a/src/util/dnsparser.c b/src/util/dnsparser.c index ab687414e..401723106 100644 --- a/src/util/dnsparser.c +++ b/src/util/dnsparser.c @@ -109,8 +109,8 @@ GNUNET_DNSPARSER_free_soa (struct GNUNET_DNSPARSER_SoaRecord *soa) { if (NULL == soa) return; - GNUNET_free_non_null (soa->mname); - GNUNET_free_non_null (soa->rname); + GNUNET_free (soa->mname); + GNUNET_free (soa->rname); GNUNET_free (soa); } @@ -125,7 +125,7 @@ GNUNET_DNSPARSER_free_cert (struct GNUNET_DNSPARSER_CertRecord *cert) { if (NULL == cert) return; - GNUNET_free_non_null (cert->certificate_data); + GNUNET_free (cert->certificate_data); GNUNET_free (cert); } @@ -140,7 +140,7 @@ GNUNET_DNSPARSER_free_srv (struct GNUNET_DNSPARSER_SrvRecord *srv) { if (NULL == srv) return; - GNUNET_free_non_null (srv->target); + GNUNET_free (srv->target); GNUNET_free (srv); } @@ -155,7 +155,7 @@ GNUNET_DNSPARSER_free_mx (struct GNUNET_DNSPARSER_MxRecord *mx) { if (NULL == mx) return; - GNUNET_free_non_null (mx->mxhost); + GNUNET_free (mx->mxhost); GNUNET_free (mx); } @@ -168,7 +168,7 @@ GNUNET_DNSPARSER_free_mx (struct GNUNET_DNSPARSER_MxRecord *mx) void GNUNET_DNSPARSER_free_record (struct GNUNET_DNSPARSER_Record *r) { - GNUNET_free_non_null (r->name); + GNUNET_free (r->name); switch (r->type) { case GNUNET_DNSPARSER_TYPE_MX: @@ -190,11 +190,11 @@ GNUNET_DNSPARSER_free_record (struct GNUNET_DNSPARSER_Record *r) case GNUNET_DNSPARSER_TYPE_NS: case GNUNET_DNSPARSER_TYPE_CNAME: case GNUNET_DNSPARSER_TYPE_PTR: - GNUNET_free_non_null (r->data.hostname); + GNUNET_free (r->data.hostname); break; default: - GNUNET_free_non_null (r->data.raw.data); + GNUNET_free (r->data.raw.data); break; } } @@ -854,17 +854,17 @@ void GNUNET_DNSPARSER_free_packet (struct GNUNET_DNSPARSER_Packet *p) { for (unsigned int i = 0; i < p->num_queries; i++) - GNUNET_free_non_null (p->queries[i].name); - GNUNET_free_non_null (p->queries); + GNUNET_free (p->queries[i].name); + GNUNET_free (p->queries); for (unsigned int i = 0; i < p->num_answers; i++) GNUNET_DNSPARSER_free_record (&p->answers[i]); - GNUNET_free_non_null (p->answers); + GNUNET_free (p->answers); for (unsigned int i = 0; i < p->num_authority_records; i++) GNUNET_DNSPARSER_free_record (&p->authority_records[i]); - GNUNET_free_non_null (p->authority_records); + GNUNET_free (p->authority_records); for (unsigned int i = 0; i < p->num_additional_records; i++) GNUNET_DNSPARSER_free_record (&p->additional_records[i]); - GNUNET_free_non_null (p->additional_records); + GNUNET_free (p->additional_records); GNUNET_free (p); } diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c index a56ef2d96..592875531 100644 --- a/src/util/getopt_helpers.c +++ b/src/util/getopt_helpers.c @@ -377,7 +377,7 @@ set_string (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, (void) ctx; (void) option; GNUNET_assert (NULL != value); - GNUNET_free_non_null (*val); + GNUNET_free (*val); *val = GNUNET_strdup (value); return GNUNET_OK; } @@ -458,7 +458,7 @@ set_filename (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, (void) ctx; (void) option; GNUNET_assert (NULL != value); - GNUNET_free_non_null (*val); + GNUNET_free (*val); *val = GNUNET_STRINGS_filename_expand (value); return GNUNET_OK; } diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c index 5883c1497..2b279dda2 100644 --- a/src/util/gnunet-config.c +++ b/src/util/gnunet-config.c @@ -258,7 +258,7 @@ run (void *cls, GNUNET_CONFIGURATION_write ((NULL == out) ? diff : out, cfgfile)) global_ret = 2; } - GNUNET_free_non_null (cfg_fn); + GNUNET_free (cfg_fn); if (NULL != out) GNUNET_CONFIGURATION_destroy (out); cleanup: diff --git a/src/util/gnunet-scrypt.c b/src/util/gnunet-scrypt.c index 7d13ce469..aa64144a8 100644 --- a/src/util/gnunet-scrypt.c +++ b/src/util/gnunet-scrypt.c @@ -323,7 +323,7 @@ main (int argc, char *const *argv) ? 0 : 1; GNUNET_free_nz ((void *) argv); - GNUNET_free_non_null (pwfn); + GNUNET_free (pwfn); return ret; } diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c index 357453da7..5ed70807e 100644 --- a/src/util/gnunet-service-resolver.c +++ b/src/util/gnunet-service-resolver.c @@ -217,7 +217,7 @@ free_cache_entry (struct ResolveCache *rc) GNUNET_free (pos->record); GNUNET_free (pos); } - GNUNET_free_non_null (rc->hostname); + GNUNET_free (rc->hostname); GNUNET_CONTAINER_DLL_remove (cache_head, cache_tail, rc); cache_size--; GNUNET_free (rc); @@ -241,7 +241,7 @@ free_hosts_entry (struct ResolveCache *rc) GNUNET_free (pos->record); GNUNET_free (pos); } - GNUNET_free_non_null (rc->hostname); + GNUNET_free (rc->hostname); GNUNET_CONTAINER_DLL_remove (hosts_head, hosts_tail, rc); cache_size--; GNUNET_free (rc); @@ -267,7 +267,7 @@ free_active_lookup (struct ActiveLookup *al) GNUNET_SCHEDULER_cancel (al->timeout_task); al->timeout_task = NULL; } - GNUNET_free_non_null (al->hostname); + GNUNET_free (al->hostname); GNUNET_free (al); } @@ -1094,7 +1094,7 @@ handle_get (void *cls, const struct GNUNET_RESOLVER_GetMessage *msg) client_request_id, client); } - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); } @@ -1115,7 +1115,7 @@ shutdown_task (void *cls) while (NULL != hosts_head) free_hosts_entry (hosts_head); GNUNET_DNSSTUB_stop (dnsstub_ctx); - GNUNET_free_non_null (my_domain); + GNUNET_free (my_domain); } @@ -1296,7 +1296,7 @@ init_cb (void *cls, GNUNET_OK == result ? "success" : "failure"); GNUNET_free (dns_servers[i]); } - GNUNET_free_non_null (dns_servers); + GNUNET_free (dns_servers); } diff --git a/src/util/mq.c b/src/util/mq.c index 78dc7dba2..302b310de 100644 --- a/src/util/mq.c +++ b/src/util/mq.c @@ -881,7 +881,7 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq) GNUNET_CONTAINER_multihashmap32_destroy (mq->assoc_map); mq->assoc_map = NULL; } - GNUNET_free_non_null (mq->handlers); + GNUNET_free (mq->handlers); GNUNET_free (mq); } diff --git a/src/util/network.c b/src/util/network.c index 223ce2080..b18030fcd 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -621,7 +621,7 @@ GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc) void GNUNET_NETWORK_socket_free_memory_only_ (struct GNUNET_NETWORK_Handle *desc) { - GNUNET_free_non_null (desc->addr); + GNUNET_free (desc->addr); GNUNET_free (desc); } diff --git a/src/util/os_installation.c b/src/util/os_installation.c index 714df6957..34b88d761 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c @@ -563,11 +563,11 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind) (GNUNET_YES == GNUNET_DISK_directory_test (tmp, GNUNET_YES))) { GNUNET_free (execpath); - GNUNET_free_non_null (dirname); + GNUNET_free (dirname); return tmp; } GNUNET_free (tmp); - GNUNET_free_non_null (dirname); + GNUNET_free (dirname); } GNUNET_asprintf (&dirname, DIR_SEPARATOR_STR "%s" DIR_SEPARATOR_STR, @@ -643,11 +643,11 @@ GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind) (GNUNET_YES == GNUNET_DISK_directory_test (tmp, GNUNET_YES))) { GNUNET_free (execpath); - GNUNET_free_non_null (dirname); + GNUNET_free (dirname); return tmp; } GNUNET_free (tmp); - GNUNET_free_non_null (dirname); + GNUNET_free (dirname); } GNUNET_asprintf (&dirname, DIR_SEPARATOR_STR "%s" DIR_SEPARATOR_STR diff --git a/src/util/program.c b/src/util/program.c index 5ad069edd..8bda34b4f 100644 --- a/src/util/program.c +++ b/src/util/program.c @@ -342,10 +342,10 @@ GNUNET_PROGRAM_run2 (int argc, ret = GNUNET_OK; cleanup: GNUNET_CONFIGURATION_destroy (cfg); - GNUNET_free_non_null (cc.cfgfile); - GNUNET_free_non_null (cfg_fn); - GNUNET_free_non_null (loglev); - GNUNET_free_non_null (logfile); + GNUNET_free (cc.cfgfile); + GNUNET_free (cfg_fn); + GNUNET_free (loglev); + GNUNET_free (logfile); return ret; } diff --git a/src/util/regex.c b/src/util/regex.c index d3ab35652..fed325cd6 100644 --- a/src/util/regex.c +++ b/src/util/regex.c @@ -174,10 +174,10 @@ num_to_regex (uint16_t value, GNUNET_asprintf (&ret, "%s%s%s%s", a, b, c, d); - GNUNET_free_non_null (a); - GNUNET_free_non_null (b); - GNUNET_free_non_null (c); - GNUNET_free_non_null (d); + GNUNET_free (a); + GNUNET_free (b); + GNUNET_free (c); + GNUNET_free (d); return ret; } @@ -607,7 +607,7 @@ address_to_regex (const void *addr, reg = num_to_regex (a[i], m[i]); if (NULL == reg) { - GNUNET_free_non_null (ret); + GNUNET_free (ret); return NULL; } if (NULL == ret) @@ -721,7 +721,7 @@ GNUNET_TUN_ipv4policy2regex (const char *policy) line = ipv4_to_regex (&np[i]); if (NULL == line) { - GNUNET_free_non_null (reg); + GNUNET_free (reg); GNUNET_free (np); return NULL; } @@ -777,7 +777,7 @@ GNUNET_TUN_ipv6policy2regex (const char *policy) line = ipv6_to_regex (&np[i]); if (NULL == line) { - GNUNET_free_non_null (reg); + GNUNET_free (reg); GNUNET_free (np); return NULL; } diff --git a/src/util/service.c b/src/util/service.c index ea078b19b..1b80c8d13 100644 --- a/src/util/service.c +++ b/src/util/service.c @@ -1144,7 +1144,7 @@ get_server_addresses (const char *service_name, (EACCES == errno)) { LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "socket"); - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); GNUNET_free (unixpath); return GNUNET_SYSERR; } @@ -1170,7 +1170,7 @@ get_server_addresses (const char *service_name, _ ( "Have neither PORT nor UNIXPATH for service `%s', but one is required\n"), service_name); - GNUNET_free_non_null (hostname); + GNUNET_free (hostname); return GNUNET_SYSERR; } if (0 == port) @@ -1178,8 +1178,8 @@ get_server_addresses (const char *service_name, saddrs = GNUNET_new_array (2, struct sockaddr *); saddrlens = GNUNET_new_array (2, socklen_t); add_unixpath (saddrs, saddrlens, unixpath); - GNUNET_free_non_null (unixpath); - GNUNET_free_non_null (hostname); + GNUNET_free (unixpath); + GNUNET_free (hostname); *addrs = saddrs; *addr_lens = saddrlens; return 1; @@ -1203,7 +1203,7 @@ get_server_addresses (const char *service_name, hostname, gai_strerror (ret)); GNUNET_free (hostname); - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); return GNUNET_SYSERR; } next = res; @@ -1223,7 +1223,7 @@ get_server_addresses (const char *service_name, hostname); freeaddrinfo (res); GNUNET_free (hostname); - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); return GNUNET_SYSERR; } resi = i; @@ -1330,7 +1330,7 @@ get_server_addresses (const char *service_name, ((struct sockaddr_in *) saddrs[i])->sin_port = htons (port); } } - GNUNET_free_non_null (unixpath); + GNUNET_free (unixpath); *addrs = saddrs; *addr_lens = saddrlens; return resi; @@ -1557,8 +1557,8 @@ setup_service (struct GNUNET_SERVICE_Handle *sh) } GNUNET_CONTAINER_DLL_insert (sh->slc_head, sh->slc_tail, slc); } - GNUNET_free_non_null (addrlens); - GNUNET_free_non_null (addrs); + GNUNET_free (addrlens); + GNUNET_free (addrs); if ((0 != num) && (NULL == sh->slc_head)) { /* All attempts to bind failed, hard failure */ @@ -1566,7 +1566,7 @@ setup_service (struct GNUNET_SERVICE_Handle *sh) GNUNET_ERROR_TYPE_ERROR, _ ( "Could not bind to any of the ports I was supposed to, refusing to run!\n")); - GNUNET_free_non_null (csocks); + GNUNET_free (csocks); return GNUNET_SYSERR; } } @@ -1793,10 +1793,10 @@ teardown_service (struct GNUNET_SERVICE_Handle *sh) { struct ServiceListenContext *slc; - GNUNET_free_non_null (sh->v4_denied); - GNUNET_free_non_null (sh->v6_denied); - GNUNET_free_non_null (sh->v4_allowed); - GNUNET_free_non_null (sh->v6_allowed); + GNUNET_free (sh->v4_denied); + GNUNET_free (sh->v6_denied); + GNUNET_free (sh->v4_allowed); + GNUNET_free (sh->v6_allowed); while (NULL != (slc = sh->slc_head)) { GNUNET_CONTAINER_DLL_remove (sh->slc_head, sh->slc_tail, slc); @@ -1890,7 +1890,7 @@ GNUNET_SERVICE_start (const char *service_name, sh->handlers = GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL); if (GNUNET_OK != setup_service (sh)) { - GNUNET_free_non_null (sh->handlers); + GNUNET_free (sh->handlers); GNUNET_free (sh); return NULL; } @@ -1913,7 +1913,7 @@ GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Handle *srv) while (NULL != (client = srv->clients_head)) GNUNET_SERVICE_client_drop (client); teardown_service (srv); - GNUNET_free_non_null (srv->handlers); + GNUNET_free (srv->handlers); GNUNET_free (srv); } @@ -2159,13 +2159,13 @@ shutdown: } #endif teardown_service (&sh); - GNUNET_free_non_null (sh.handlers); + GNUNET_free (sh.handlers); GNUNET_SPEEDUP_stop_ (); GNUNET_CONFIGURATION_destroy (cfg); - GNUNET_free_non_null (logfile); - GNUNET_free_non_null (loglev); + GNUNET_free (logfile); + GNUNET_free (loglev); GNUNET_free (cfg_filename); - GNUNET_free_non_null (opt_cfg_filename); + GNUNET_free (opt_cfg_filename); return err ? GNUNET_SYSERR : sh.ret; } diff --git a/src/util/socks.c b/src/util/socks.c index 756be753a..7ab297272 100644 --- a/src/util/socks.c +++ b/src/util/socks.c @@ -665,7 +665,7 @@ GNUNET_SOCKS_do_connect (const char *service_name, (host0 != NULL) ? host0 : "127.0.0.1", port0); - GNUNET_free_non_null (host0); + GNUNET_free (host0); /* Sets to NULL if they do not exist */ (void) GNUNET_CONFIGURATION_get_value_string (cfg, @@ -677,8 +677,8 @@ GNUNET_SOCKS_do_connect (const char *service_name, "SOCKSPASS", &pass); ih = GNUNET_SOCKS_init_handshake (user, pass); - GNUNET_free_non_null (user); - GNUNET_free_non_null (pass); + GNUNET_free (user); + GNUNET_free (pass); GNUNET_SOCKS_set_handshake_destination (ih, host1, port1); GNUNET_free (host1); diff --git a/src/util/strings.c b/src/util/strings.c index 9510b3b3b..5148d0368 100644 --- a/src/util/strings.c +++ b/src/util/strings.c @@ -1148,7 +1148,7 @@ GNUNET_STRINGS_path_is_absolute (const char *filename, if (r_uri_scheme) *r_uri_scheme = uri; else - GNUNET_free_non_null (uri); + GNUNET_free (uri); return GNUNET_STRINGS_path_is_absolute (post_scheme_path, GNUNET_NO, diff --git a/src/util/test_common_allocation.c b/src/util/test_common_allocation.c index a24af7124..da3d2f470 100644 --- a/src/util/test_common_allocation.c +++ b/src/util/test_common_allocation.c @@ -55,9 +55,9 @@ check (void) GNUNET_free (ptrs[i]); } - /* GNUNET_free_non_null test */ - GNUNET_free_non_null (NULL); - GNUNET_free_non_null (GNUNET_malloc (4)); + /* GNUNET_free test */ + GNUNET_free (NULL); + GNUNET_free (GNUNET_malloc (4)); /* GNUNET_strdup tests */ ptrs[0] = GNUNET_strdup ("bar"); diff --git a/src/util/test_configuration.c b/src/util/test_configuration.c index 6227a28db..59b1b2291 100644 --- a/src/util/test_configuration.c +++ b/src/util/test_configuration.c @@ -128,7 +128,7 @@ diffsCallBack (void *cls, const char *section, const char *option, } else cbData->status = 1; - GNUNET_free_non_null (diffValue); + GNUNET_free (diffValue); break; } diff --git a/src/util/test_container_meta_data.c b/src/util/test_container_meta_data.c index d768f3699..db413f313 100644 --- a/src/util/test_container_meta_data.c +++ b/src/util/test_container_meta_data.c @@ -113,7 +113,7 @@ testMeta (int i) GNUNET_CONTAINER_meta_data_serialize (m, &sval, size, GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL)) { - GNUNET_free_non_null (sval); + GNUNET_free (sval); ABORT (m); } GNUNET_CONTAINER_meta_data_destroy (m); diff --git a/src/util/test_crypto_symmetric.c b/src/util/test_crypto_symmetric.c index 9f6cd5ed0..5012c7f5b 100644 --- a/src/util/test_crypto_symmetric.c +++ b/src/util/test_crypto_symmetric.c @@ -147,7 +147,7 @@ verifyCrypto () ret = 1; } error: - GNUNET_free_non_null (res); + GNUNET_free (res); return ret; } diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c index 13fda53bf..05716741e 100644 --- a/src/util/test_resolver_api.c +++ b/src/util/test_resolver_api.c @@ -215,7 +215,7 @@ run (void *cls, char *const *args, const char *cfgfile, own_fqdn = GNUNET_RESOLVER_local_fqdn_get (); /* can't really check, only thing we can safely compare against is our own identical logic... */ - GNUNET_free_non_null (own_fqdn); + GNUNET_free (own_fqdn); /* * Testing non-local DNS resolution diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c index 62bc45e41..4c57438c3 100644 --- a/src/vpn/gnunet-service-vpn.c +++ b/src/vpn/gnunet-service-vpn.c @@ -2882,7 +2882,7 @@ cleanup (void *cls) stats = NULL; } for (i = 0; i < 5; i++) - GNUNET_free_non_null (vpn_argv[i]); + GNUNET_free (vpn_argv[i]); } @@ -3008,7 +3008,7 @@ run (void *cls, _ ("Must specify valid IPv6 address")); GNUNET_free (binary); GNUNET_SCHEDULER_shutdown (); - GNUNET_free_non_null (ipv6addr); + GNUNET_free (ipv6addr); return; } vpn_argv[2] = ipv6addr; @@ -3020,7 +3020,7 @@ run (void *cls, { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "VPN", "IPV6PREFIX"); GNUNET_SCHEDULER_shutdown (); - GNUNET_free_non_null (ipv6prefix_s); + GNUNET_free (ipv6prefix_s); return; } vpn_argv[3] = ipv6prefix_s; @@ -3062,7 +3062,7 @@ run (void *cls, _ ("Must specify valid IPv4 address")); GNUNET_free (binary); GNUNET_SCHEDULER_shutdown (); - GNUNET_free_non_null (ipv4addr); + GNUNET_free (ipv4addr); return; } vpn_argv[4] = ipv4addr; @@ -3079,7 +3079,7 @@ run (void *cls, _ ("Must specify valid IPv4 mask")); GNUNET_free (binary); GNUNET_SCHEDULER_shutdown (); - GNUNET_free_non_null (ipv4mask); + GNUNET_free (ipv4mask); return; } vpn_argv[5] = ipv4mask; diff --git a/src/vpn/gnunet-vpn.c b/src/vpn/gnunet-vpn.c index a7f7fc30c..60d631d5e 100644 --- a/src/vpn/gnunet-vpn.c +++ b/src/vpn/gnunet-vpn.c @@ -107,9 +107,9 @@ do_disconnect (void *cls) GNUNET_VPN_disconnect (handle); handle = NULL; } - GNUNET_free_non_null (peer_id); - GNUNET_free_non_null (service_name); - GNUNET_free_non_null (target_ip); + GNUNET_free (peer_id); + GNUNET_free (service_name); + GNUNET_free (target_ip); } -- cgit v1.2.3 From 1d417dcd0f4743976ddeecb397cb1cd8fde2f053 Mon Sep 17 00:00:00 2001 From: Bertrand Marc Date: Sat, 4 Jul 2020 19:06:49 +0200 Subject: Fix_build_dependencies Signed-off-by: Martin Schanzenbach --- src/ats-tests/Makefile.am | 2 ++ src/dns/Makefile.am | 5 +++++ src/fs/Makefile.am | 5 +++++ src/json/Makefile.am | 4 ++++ src/peerinfo-tool/Makefile.am | 9 +++++++++ src/reclaim/Makefile.am | 9 +++++++++ src/revocation/Makefile.am | 6 ++++++ src/testbed/Makefile.am | 6 ++++++ src/testing/Makefile.am | 3 +++ src/transport/Makefile.am | 12 ++++++++++++ 10 files changed, 61 insertions(+) (limited to 'src') diff --git a/src/ats-tests/Makefile.am b/src/ats-tests/Makefile.am index 1375d1505..cc30f660a 100644 --- a/src/ats-tests/Makefile.am +++ b/src/ats-tests/Makefile.am @@ -41,8 +41,10 @@ libgnunetatstesting_la_SOURCES = \ ats-testing-experiment.c ats-testing-preferences.c libgnunetatstesting_la_LIBADD = \ $(top_builddir)/src/testbed/libgnunettestbed.la \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ $(top_builddir)/src/core/libgnunetcore.la \ $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/hello/libgnunethello.la \ $(top_builddir)/src/ats/libgnunetats.la \ $(top_builddir)/src/util/libgnunetutil.la \ $(GN_LIBINTL) diff --git a/src/dns/Makefile.am b/src/dns/Makefile.am index 17be841f5..45107304b 100644 --- a/src/dns/Makefile.am +++ b/src/dns/Makefile.am @@ -81,6 +81,11 @@ libgnunet_plugin_block_dns_la_SOURCES = \ plugin_block_dns.c libgnunet_plugin_block_dns_la_LIBADD = \ $(top_builddir)/src/block/libgnunetblockgroup.la \ + $(top_builddir)/src/block/libgnunetblock.la \ + $(top_builddir)/src/util/libgnunetutil.la +libgnunet_plugin_block_dns_la_DEPENDENCIES = \ + $(top_builddir)/src/block/libgnunetblockgroup.la \ + $(top_builddir)/src/block/libgnunetblock.la \ $(top_builddir)/src/util/libgnunetutil.la libgnunet_plugin_block_dns_la_LDFLAGS = \ $(GN_LIBINTL) \ diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am index b1555be60..25590c6f7 100644 --- a/src/fs/Makefile.am +++ b/src/fs/Makefile.am @@ -46,8 +46,13 @@ libgnunetfs_la_SOURCES = \ libgnunetfs_la_LIBADD = \ $(top_builddir)/src/datastore/libgnunetdatastore.la \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ $(top_builddir)/src/util/libgnunetutil.la \ $(GN_LIBINTL) $(XLIB) $(LIBGCRYPT_LIBS) -lunistring +libgnunetfs_la_DEPENDENCIES = \ + $(top_builddir)/src/datastore/libgnunetdatastore.la \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/util/libgnunetutil.la if HAVE_LIBEXTRACTOR libgnunetfs_la_LIBADD += \ diff --git a/src/json/Makefile.am b/src/json/Makefile.am index 9cd80851c..2ed05c35a 100644 --- a/src/json/Makefile.am +++ b/src/json/Makefile.am @@ -27,6 +27,10 @@ libgnunetjson_la_LIBADD = \ $(MHD_LIBS) \ $(XLIB) \ $(Z_LIBS) +libgnunetjson_la_DEPENDENCIES = \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la + check_PROGRAMS = \ test_json \ diff --git a/src/peerinfo-tool/Makefile.am b/src/peerinfo-tool/Makefile.am index dfcdcd3da..74af5890b 100644 --- a/src/peerinfo-tool/Makefile.am +++ b/src/peerinfo-tool/Makefile.am @@ -21,10 +21,19 @@ libgnunet_plugin_rest_peerinfo_la_LIBADD = \ $(top_builddir)/src/hello/libgnunethello.la \ $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \ $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/ats/libgnunetats.la \ $(top_builddir)/src/rest/libgnunetrest.la \ $(top_builddir)/src/json/libgnunetjson.la \ $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \ $(LTLIBINTL) -ljansson $(MHD_LIBS) +libgnunet_plugin_rest_peerinfo_la_DEPENDENCIES = \ + $(top_builddir)/src/hello/libgnunethello.la \ + $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/ats/libgnunetats.la \ + $(top_builddir)/src/rest/libgnunetrest.la \ + $(top_builddir)/src/json/libgnunetjson.la \ + $(top_builddir)/src/util/libgnunetutil.la libgnunet_plugin_rest_peerinfo_la_LDFLAGS = \ $(GN_PLUGIN_LDFLAGS) libgnunet_plugin_rest_peerinfo_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS) diff --git a/src/reclaim/Makefile.am b/src/reclaim/Makefile.am index b6d73bdf7..a9829c47e 100644 --- a/src/reclaim/Makefile.am +++ b/src/reclaim/Makefile.am @@ -51,10 +51,19 @@ libgnunet_plugin_rest_reclaim_la_LIBADD = \ $(top_builddir)/src/identity/libgnunetidentity.la \ libgnunetreclaim.la \ $(top_builddir)/src/json/libgnunetjson.la \ + $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ $(top_builddir)/src/rest/libgnunetrest.la \ $(top_builddir)/src/namestore/libgnunetnamestore.la \ $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \ $(LTLIBINTL) -ljansson $(MHD_LIBS) +libgnunet_plugin_rest_reclaim_la_DEPENDENCIES = \ + $(top_builddir)/src/identity/libgnunetidentity.la \ + libgnunetreclaim.la \ + $(top_builddir)/src/json/libgnunetjson.la \ + $(top_builddir)/src/gnsrecord/libgnunetgnsrecord.la \ + $(top_builddir)/src/rest/libgnunetrest.la \ + $(top_builddir)/src/namestore/libgnunetnamestore.la \ + $(top_builddir)/src/util/libgnunetutil.la libgnunet_plugin_rest_reclaim_la_LDFLAGS = \ $(GN_PLUGIN_LDFLAGS) libgnunet_plugin_rest_reclaim_la_CFLAGS = $(MHD_CFLAGS) $(AM_CFLAGS) diff --git a/src/revocation/Makefile.am b/src/revocation/Makefile.am index 6efd461c1..a90f8cd79 100644 --- a/src/revocation/Makefile.am +++ b/src/revocation/Makefile.am @@ -28,8 +28,14 @@ libgnunet_plugin_block_revocation_la_SOURCES = \ libgnunet_plugin_block_revocation_la_LIBADD = \ libgnunetrevocation.la \ $(top_builddir)/src/block/libgnunetblockgroup.la \ + $(top_builddir)/src/block/libgnunetblock.la \ $(top_builddir)/src/util/libgnunetutil.la \ $(LTLIBINTL) +libgnunet_plugin_block_revocation_la_DEPENDENCIES = \ + libgnunetrevocation.la \ + $(top_builddir)/src/block/libgnunetblockgroup.la \ + $(top_builddir)/src/block/libgnunetblock.la \ + $(top_builddir)/src/util/libgnunetutil.la libgnunet_plugin_block_revocation_la_LDFLAGS = \ $(GN_PLUGIN_LDFLAGS) diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am index 62b49af78..7c1e217bb 100644 --- a/src/testbed/Makefile.am +++ b/src/testbed/Makefile.am @@ -111,6 +111,12 @@ libgnunettestbed_la_LIBADD = $(XLIB) \ $(top_builddir)/src/util/libgnunetutil.la \ $(top_builddir)/src/testing/libgnunettesting.la \ $(LTLIBINTL) +libgnunettestbed_la_DEPENDENCIES = \ + $(top_builddir)/src/statistics/libgnunetstatistics.la \ + $(top_builddir)/src/transport/libgnunettransport.la \ + $(top_builddir)/src/hello/libgnunethello.la \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/testing/libgnunettesting.la libgnunettestbed_la_LDFLAGS = \ $(GN_LIB_LDFLAGS) \ -version-info 0:0:0 diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am index 9c6357455..2b599f55b 100644 --- a/src/testing/Makefile.am +++ b/src/testing/Makefile.am @@ -20,6 +20,9 @@ libgnunettesting_la_LIBADD = \ $(top_builddir)/src/arm/libgnunetarm.la \ $(top_builddir)/src/util/libgnunetutil.la \ $(LTLIBINTL) +libgnunettesting_la_DEPENDENCIES = \ + $(top_builddir)/src/arm/libgnunetarm.la \ + $(top_builddir)/src/util/libgnunetutil.la libgnunettesting_la_LDFLAGS = \ $(GN_LIB_LDFLAGS) \ -version-info 2:0:1 diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index eadb601ef..354bb1cf4 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am @@ -155,7 +155,15 @@ libgnunettransporttesting_la_LIBADD = \ $(top_builddir)/src/ats/libgnunetats.la \ $(top_builddir)/src/util/libgnunetutil.la \ $(top_builddir)/src/testing/libgnunettesting.la \ + $(top_builddir)/src/arm/libgnunetarm.la \ $(GN_LIBINTL) +libgnunettransporttesting_la_DEPENDENCIES = \ + libgnunettransport.la \ + $(top_builddir)/src/hello/libgnunethello.la \ + $(top_builddir)/src/ats/libgnunetats.la \ + $(top_builddir)/src/util/libgnunetutil.la \ + $(top_builddir)/src/testing/libgnunettesting.la \ + $(top_builddir)/src/arm/libgnunetarm.la libgnunettransporttesting_la_LDFLAGS = \ $(GN_LIB_LDFLAGS) @@ -185,6 +193,10 @@ libgnunettransport_la_LIBADD = \ $(top_builddir)/src/ats/libgnunetats.la \ $(top_builddir)/src/util/libgnunetutil.la \ $(GN_LIBINTL) +libgnunettransport_la_DEPENDENCIES = \ + $(top_builddir)/src/hello/libgnunethello.la \ + $(top_builddir)/src/ats/libgnunetats.la \ + $(top_builddir)/src/util/libgnunetutil.la libgnunettransport_la_LDFLAGS = \ $(GN_LIB_LDFLAGS) \ -version-info 4:0:2 -- cgit v1.2.3 From 06df47b5e2960d0fa8a94032f024d0dc96509f65 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Sun, 5 Jul 2020 17:50:51 +0200 Subject: -fix test for changed free logic --- src/util/test_common_allocation.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/util/test_common_allocation.c b/src/util/test_common_allocation.c index da3d2f470..50f259257 100644 --- a/src/util/test_common_allocation.c +++ b/src/util/test_common_allocation.c @@ -33,6 +33,7 @@ check (void) char *ptrs[MAX_TESTVAL]; unsigned int **a2; char ***a3; + char *tmp; int i; int j; int k; @@ -56,8 +57,8 @@ check (void) } /* GNUNET_free test */ - GNUNET_free (NULL); - GNUNET_free (GNUNET_malloc (4)); + tmp = GNUNET_malloc (4); + GNUNET_free (tmp); /* GNUNET_strdup tests */ ptrs[0] = GNUNET_strdup ("bar"); -- cgit v1.2.3 From 03ca3c27142db7182a14a4e7096394f5b7225340 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Sun, 5 Jul 2020 18:04:58 +0200 Subject: -fix key file format mismatch --- src/transport/test_plugin_hostkey.ecc | Bin 827 -> 32 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'src') diff --git a/src/transport/test_plugin_hostkey.ecc b/src/transport/test_plugin_hostkey.ecc index 96c3e7e4e..18641b798 100644 Binary files a/src/transport/test_plugin_hostkey.ecc and b/src/transport/test_plugin_hostkey.ecc differ -- cgit v1.2.3 From ccf0f7739c6253ea6dae79c8618e369a8e14e472 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Sun, 5 Jul 2020 21:47:02 +0200 Subject: -fix revocation config for test --- src/gns/test_gns_lookup.conf | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/gns/test_gns_lookup.conf b/src/gns/test_gns_lookup.conf index 130d190e7..12b0dc2d0 100644 --- a/src/gns/test_gns_lookup.conf +++ b/src/gns/test_gns_lookup.conf @@ -24,6 +24,7 @@ DNS_ROOT=PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0 [revocation] WORKBITS = 1 +EPOCH_DURATION = 365 d [dhtcache] QUOTA = 1 MB -- cgit v1.2.3 From 0b08174e0192dfa5b514263d2dd6bcb79391d07c Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Sun, 5 Jul 2020 21:56:31 +0200 Subject: -fix: make it 2 bits for test pow --- src/gns/test_gns_lookup.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gns/test_gns_lookup.conf b/src/gns/test_gns_lookup.conf index 12b0dc2d0..db0b4bfbe 100644 --- a/src/gns/test_gns_lookup.conf +++ b/src/gns/test_gns_lookup.conf @@ -23,7 +23,7 @@ DNS_ROOT=PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0 #PREFIX = valgrind --leak-check=full --track-origins=yes --log-file=/tmp/ns_log [revocation] -WORKBITS = 1 +WORKBITS = 2 EPOCH_DURATION = 365 d [dhtcache] -- cgit v1.2.3 From 7247d3f1ff651bd71a4e8bc287422be4845bb730 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 5 Jul 2020 21:59:40 +0200 Subject: style fix: use correct type --- src/json/json_helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/json/json_helper.c b/src/json/json_helper.c index 02bd6bfab..621487f0a 100644 --- a/src/json/json_helper.c +++ b/src/json/json_helper.c @@ -721,7 +721,7 @@ GNUNET_JSON_spec_absolute_time (const char *name, .cls = NULL, .field = name, .ptr = at, - .ptr_size = sizeof(uint64_t), + .ptr_size = sizeof(struct GNUNET_TIME_Absolute), .size_ptr = NULL }; @@ -775,7 +775,7 @@ GNUNET_JSON_spec_absolute_time_nbo (const char *name, .cls = NULL, .field = name, .ptr = at, - .ptr_size = sizeof(uint64_t), + .ptr_size = sizeof(struct GNUNET_TIME_AbsoluteNBO), .size_ptr = NULL }; @@ -852,7 +852,7 @@ GNUNET_JSON_spec_relative_time (const char *name, .cls = NULL, .field = name, .ptr = rt, - .ptr_size = sizeof(uint64_t), + .ptr_size = sizeof(struct GNUNET_TIME_Relative), .size_ptr = NULL }; -- cgit v1.2.3 From 4ae4bcb747b95d1ad296a55a3802a8a35437d845 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Sun, 5 Jul 2020 23:28:07 +0200 Subject: -fix: failing tests --- src/gns/test_gns_proxy.c | 6 ++++-- src/revocation/test_revocation.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gns/test_gns_proxy.c b/src/gns/test_gns_proxy.c index c0002673b..13764d520 100644 --- a/src/gns/test_gns_proxy.c +++ b/src/gns/test_gns_proxy.c @@ -528,6 +528,8 @@ run (void *cls, int main (int argc, char *const *argv) { + char *tmp_argv; + struct GNUNET_GETOPT_CommandLineOption options[] = { GNUNET_GETOPT_option_uint16 ('p', "port", @@ -557,7 +559,7 @@ main (int argc, char *const *argv) } if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, - &argc, &argv)) + &argc, &tmp_argv)) return 2; GNUNET_log_setup ("gnunet-gns-proxy-test", "WARNING", @@ -568,7 +570,7 @@ main (int argc, char *const *argv) options, &run, NULL)) return 1; - GNUNET_free ((char *) argv); + GNUNET_free (tmp_argv); return global_ret; } diff --git a/src/revocation/test_revocation.c b/src/revocation/test_revocation.c index 1c2efa60f..b65567d79 100644 --- a/src/revocation/test_revocation.c +++ b/src/revocation/test_revocation.c @@ -141,11 +141,11 @@ revocation_cb (void *cls, enum GNUNET_GenericReturnValue is_valid) } } -struct GNUNET_REVOCATION_Pow proof_of_work; +static struct GNUNET_REVOCATION_PowP proof_of_work; static void -ego_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) +ego_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) { static int completed = 0; const struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; -- cgit v1.2.3 From ab9b5dd1113e889a63b03d764d298da7d6d962f1 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 6 Jul 2020 10:30:27 +0200 Subject: -fix: codepath fixes --- src/transport/test_transport_api_reliability.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c index 058d7d8bf..deb943956 100644 --- a/src/transport/test_transport_api_reliability.c +++ b/src/transport/test_transport_api_reliability.c @@ -93,10 +93,9 @@ get_size (unsigned int iter) /* FreeBSD/OSX etc. Unix DGRAMs do not work * with large messages */ if (0 == strcmp ("unix", ccc->test_plugin)) - ret = sizeof(struct GNUNET_TRANSPORT_TESTING_TestMessage) + (ret % 1024); + return sizeof(struct GNUNET_TRANSPORT_TESTING_TestMessage) + (ret % 1024); #endif - ret = sizeof(struct GNUNET_TRANSPORT_TESTING_TestMessage) + (ret % 60000); - return ret; + return sizeof(struct GNUNET_TRANSPORT_TESTING_TestMessage) + (ret % 60000); } -- cgit v1.2.3 From 50f16c6a4fe992ab25637fb80a67b9d4e59b789a Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 6 Jul 2020 14:36:28 +0200 Subject: -fix: variable size in test --- src/transport/gnunet-service-transport.c | 4 ++-- src/transport/transport_api_core.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 9bdcd64be..207c17f2f 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -727,9 +727,9 @@ handle_send_transmit_continuation (void *cls, stcc->uuid); send_ok_msg.header.size = htons (sizeof(send_ok_msg)); send_ok_msg.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_OK); - send_ok_msg.bytes_msg = htonl (bytes_payload); + send_ok_msg.bytes_msg = htons (bytes_payload); send_ok_msg.bytes_physical = htonl (bytes_on_wire); - send_ok_msg.success = htonl (success); + send_ok_msg.success = htons (success); send_ok_msg.peer = stcc->target; unicast (stcc->tc, &send_ok_msg.header, GNUNET_NO); } diff --git a/src/transport/transport_api_core.c b/src/transport/transport_api_core.c index 55647508d..7d4b415bd 100644 --- a/src/transport/transport_api_core.c +++ b/src/transport/transport_api_core.c @@ -622,13 +622,14 @@ handle_send_ok (void *cls, const struct SendOkMessage *okm) struct Neighbour *n; uint32_t bytes_msg; uint32_t bytes_physical; + uint16_t success = ntohs (okm->success); - bytes_msg = ntohl (okm->bytes_msg); + bytes_msg = ntohs (okm->bytes_msg); bytes_physical = ntohl (okm->bytes_physical); LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving SEND_OK message, transmission to %s %s.\n", GNUNET_i2s (&okm->peer), - ntohl (okm->success) == GNUNET_OK ? "succeeded" : "failed"); + success == GNUNET_OK ? "succeeded" : "failed"); n = neighbour_find (h, &okm->peer); if (NULL == n) { -- cgit v1.2.3 From b73aab5f1aa2e4e28f15cf569f3ac4e11faf2ebe Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 6 Jul 2020 15:52:10 +0200 Subject: -fix: use non-experimental unix plugin as second entry --- .../test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf | 2 +- .../test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/transport/test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf b/src/transport/test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf index 30b82aebf..64fe7320c 100644 --- a/src/transport/test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf +++ b/src/transport/test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf @@ -3,7 +3,7 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/api-tcp-p1/ [transport] -PLUGINS = tcp udp +PLUGINS = tcp unix #Peer 1: 6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG #Peer 2: DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50 diff --git a/src/transport/test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf b/src/transport/test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf index 690eb3b76..ee67372e1 100644 --- a/src/transport/test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf +++ b/src/transport/test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf @@ -3,7 +3,7 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/api-tcp-p2/ [transport] -PLUGINS = tcp udp +PLUGINS = tcp unix #Peer 1: 6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG #Peer 2: DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50 -- cgit v1.2.3 From a09e28c54044d7f112f4b5173debdbfb68c34042 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 6 Jul 2020 16:48:42 +0200 Subject: -fix: temporarily bumb minimum quots --- src/include/gnunet_constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h index e1572635f..c83bec683 100644 --- a/src/include/gnunet_constants.h +++ b/src/include/gnunet_constants.h @@ -47,7 +47,7 @@ extern "C" * so that at least one maximum-size message can be send roughly once * per minute. */ -#define GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT GNUNET_BANDWIDTH_value_init (1024) +#define GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT GNUNET_BANDWIDTH_value_init (1024*1024) /** * After how long do we consider a connection to a peer dead -- cgit v1.2.3 From 36331bf786303653c1a56c7718ee64dd0b37a70f Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 6 Jul 2020 19:51:54 +0200 Subject: -fix: namestore test keys --- src/namestore/Makefile.am | 8 ++++---- src/namestore/test_namestore_api_lookup_nick.c | 6 ++++-- ...35GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey | Bin 826 -> 0 bytes ...0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey | Bin 827 -> 0 bytes ...JMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey | Bin 826 -> 0 bytes ...9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey | Bin 827 -> 0 bytes 6 files changed, 8 insertions(+), 6 deletions(-) delete mode 100644 src/namestore/zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey delete mode 100644 src/namestore/zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey delete mode 100644 src/namestore/zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey delete mode 100644 src/namestore/zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey (limited to 'src') diff --git a/src/namestore/Makefile.am b/src/namestore/Makefile.am index f4b846065..40ac64197 100644 --- a/src/namestore/Makefile.am +++ b/src/namestore/Makefile.am @@ -691,8 +691,8 @@ EXTRA_DIST = \ test_plugin_namestore_postgres.conf \ test_plugin_namestore_flat.conf \ test_hostkey \ - zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey \ - zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey \ - zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey \ - zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey \ + zonefiles/BW7PTMDSN5KS42GMK2VKVE96BAYDS3QVMAS7SC5208FD6HFTAXE0.zkey \ + zonefiles/KHW2Y5A7X59Z8BC2GHSEQ9WGZ5HWVEF25TBFR3Q5QHCERMVM76DG.zkey \ + zonefiles/CNFGWF0JH0C65M6PQW6VSRR6D3NEZVHAQF6NC037J01TETS6CJ30.zkey \ + zonefiles/TWY43VS959JJ41KN2FG8782EJ2N0XDF4J6BWASR1BK5BPPRWQJAG.zkey \ $(check_SCRIPTS) diff --git a/src/namestore/test_namestore_api_lookup_nick.c b/src/namestore/test_namestore_api_lookup_nick.c index 2fbd9d7cb..14fe7fc70 100644 --- a/src/namestore/test_namestore_api_lookup_nick.c +++ b/src/namestore/test_namestore_api_lookup_nick.c @@ -54,11 +54,12 @@ static struct GNUNET_NAMESTORE_QueueEntry *nsqe; // static const char * name = "dummy.dummy.gnunet"; static const char *name = "d"; +static char *record_data; static void cleanup () { - GNUNET_free ((void *) rd_orig.data); + GNUNET_free (record_data); if (NULL != nsh) { GNUNET_NAMESTORE_disconnect (nsh); @@ -264,7 +265,8 @@ nick_cont (void *cls, int32_t success, const char *emsg) rd_orig.expiration_time = GNUNET_TIME_absolute_get ().abs_value_us; rd_orig.record_type = TEST_RECORD_TYPE; rd_orig.data_size = TEST_RECORD_DATALEN; - rd_orig.data = GNUNET_malloc (TEST_RECORD_DATALEN); + record_data = GNUNET_malloc (TEST_RECORD_DATALEN); + rd_orig.data = record_data; rd_orig.flags = 0; memset ((char *) rd_orig.data, 'a', TEST_RECORD_DATALEN); diff --git a/src/namestore/zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey b/src/namestore/zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey deleted file mode 100644 index 7dfee2d0b..000000000 Binary files a/src/namestore/zonefiles/AQ835GVL939H4O8QJQ7GBLPTQC0QAAO91BN7QK01BA63MDSK6I4G.zkey and /dev/null differ diff --git a/src/namestore/zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey b/src/namestore/zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey deleted file mode 100644 index acc877d4f..000000000 Binary files a/src/namestore/zonefiles/HGU0A0VCU334DN7F2I9UIUMVQMM7JMSD142LIMNUGTTV9R0CF4EG.zkey and /dev/null differ diff --git a/src/namestore/zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey b/src/namestore/zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey deleted file mode 100644 index 7dfee2d0b..000000000 Binary files a/src/namestore/zonefiles/N0UJMP015AFUNR2BTNM3FKPBLG38913BL8IDMCO2H0A1LIB81960.zkey and /dev/null differ diff --git a/src/namestore/zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey b/src/namestore/zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey deleted file mode 100644 index acc877d4f..000000000 Binary files a/src/namestore/zonefiles/S5I9DSGQVAB5FVV16T3B3CC5H1B2JGL3Q412JBKURME8EKU0600G.zkey and /dev/null differ -- cgit v1.2.3 From a72edb069fe5fbff2e33878d5f2eac4dd8dad237 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 6 Jul 2020 19:52:28 +0200 Subject: -fix: actually add namestore keys --- src/cadet/test_cadet.conf | 2 +- ...7PTMDSN5KS42GMK2VKVE96BAYDS3QVMAS7SC5208FD6HFTAXE0.zkey | 1 + ...FGWF0JH0C65M6PQW6VSRR6D3NEZVHAQF6NC037J01TETS6CJ30.zkey | Bin 0 -> 32 bytes ...W2Y5A7X59Z8BC2GHSEQ9WGZ5HWVEF25TBFR3Q5QHCERMVM76DG.zkey | 1 + ...Y43VS959JJ41KN2FG8782EJ2N0XDF4J6BWASR1BK5BPPRWQJAG.zkey | 2 ++ 5 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 src/namestore/zonefiles/BW7PTMDSN5KS42GMK2VKVE96BAYDS3QVMAS7SC5208FD6HFTAXE0.zkey create mode 100644 src/namestore/zonefiles/CNFGWF0JH0C65M6PQW6VSRR6D3NEZVHAQF6NC037J01TETS6CJ30.zkey create mode 100644 src/namestore/zonefiles/KHW2Y5A7X59Z8BC2GHSEQ9WGZ5HWVEF25TBFR3Q5QHCERMVM76DG.zkey create mode 100644 src/namestore/zonefiles/TWY43VS959JJ41KN2FG8782EJ2N0XDF4J6BWASR1BK5BPPRWQJAG.zkey (limited to 'src') diff --git a/src/cadet/test_cadet.conf b/src/cadet/test_cadet.conf index 067dd5fb4..79c86bb59 100644 --- a/src/cadet/test_cadet.conf +++ b/src/cadet/test_cadet.conf @@ -66,7 +66,7 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-cadet/ NO_IO = YES [nse] -WORKBITS = 0 +WORKBITS = 2 [hostlist] IMMEDIATE_START = NO diff --git a/src/namestore/zonefiles/BW7PTMDSN5KS42GMK2VKVE96BAYDS3QVMAS7SC5208FD6HFTAXE0.zkey b/src/namestore/zonefiles/BW7PTMDSN5KS42GMK2VKVE96BAYDS3QVMAS7SC5208FD6HFTAXE0.zkey new file mode 100644 index 000000000..0d37aefef --- /dev/null +++ b/src/namestore/zonefiles/BW7PTMDSN5KS42GMK2VKVE96BAYDS3QVMAS7SC5208FD6HFTAXE0.zkey @@ -0,0 +1 @@ +ˆ‘’“ÂÚ Qž”0ÿ·Ò†d Õ/Ô#‰`«ÇËÂ$Éf \ No newline at end of file diff --git a/src/namestore/zonefiles/CNFGWF0JH0C65M6PQW6VSRR6D3NEZVHAQF6NC037J01TETS6CJ30.zkey b/src/namestore/zonefiles/CNFGWF0JH0C65M6PQW6VSRR6D3NEZVHAQF6NC037J01TETS6CJ30.zkey new file mode 100644 index 000000000..b5b465ea1 Binary files /dev/null and b/src/namestore/zonefiles/CNFGWF0JH0C65M6PQW6VSRR6D3NEZVHAQF6NC037J01TETS6CJ30.zkey differ diff --git a/src/namestore/zonefiles/KHW2Y5A7X59Z8BC2GHSEQ9WGZ5HWVEF25TBFR3Q5QHCERMVM76DG.zkey b/src/namestore/zonefiles/KHW2Y5A7X59Z8BC2GHSEQ9WGZ5HWVEF25TBFR3Q5QHCERMVM76DG.zkey new file mode 100644 index 000000000..7535efb5e --- /dev/null +++ b/src/namestore/zonefiles/KHW2Y5A7X59Z8BC2GHSEQ9WGZ5HWVEF25TBFR3Q5QHCERMVM76DG.zkey @@ -0,0 +1 @@ +p‘Ñç¨Â¡8&û„D6£ Vív+XÃì{ A \ No newline at end of file diff --git a/src/namestore/zonefiles/TWY43VS959JJ41KN2FG8782EJ2N0XDF4J6BWASR1BK5BPPRWQJAG.zkey b/src/namestore/zonefiles/TWY43VS959JJ41KN2FG8782EJ2N0XDF4J6BWASR1BK5BPPRWQJAG.zkey new file mode 100644 index 000000000..ac3ed96a3 --- /dev/null +++ b/src/namestore/zonefiles/TWY43VS959JJ41KN2FG8782EJ2N0XDF4J6BWASR1BK5BPPRWQJAG.zkey @@ -0,0 +1,2 @@ +XJèµMíŠÀ …¬½ +dú胦ÓŒòB×=ÏB \ No newline at end of file -- cgit v1.2.3 From f0ecab4996507613fa224fdfb5b136399ef5d6ab Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 6 Jul 2020 20:19:00 +0200 Subject: fix: namestore rest test --- src/namestore/test_plugin_rest_namestore.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/namestore/test_plugin_rest_namestore.sh b/src/namestore/test_plugin_rest_namestore.sh index 014057e56..12a7fa50c 100755 --- a/src/namestore/test_plugin_rest_namestore.sh +++ b/src/namestore/test_plugin_rest_namestore.sh @@ -85,17 +85,17 @@ test="$(gnunet-namestore -D -z $TEST_ID -c test_namestore_api.conf)" name=$TEST_ID public="$(gnunet-identity -d -c test_namestore_api.conf | grep $TEST_ID | awk 'NR==1{print $3}')" gnunet-namestore -z $name -p -a -n "test_entry" -e "1d" -V "HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG" -t "PKEY" -c test_namestore_api.conf -curl_get "${namestore_link}" "HTTP/1.1 200 OK" +#curl_get "${namestore_link}" "HTTP/1.1 200 OK" curl_get "${namestore_link}/$name" "HTTP/1.1 200 OK" curl_get "${namestore_link}/$public" "error" gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf #Test POST with NAME -curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"1d","flag":0}],"record_name":"test_entry"}' "HTTP/1.1 204 No Content" +curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "HTTP/1.1 204 No Content" gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 # invalid values -curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRGxxx", "record_type":"PKEY", "expiration_time":"1d","flag":0}],"record_name":"test_entry"}' "error" +curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRGxxx", "record_type":"PKEY", "expiration_time":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "error" gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 @@ -106,30 +106,30 @@ curl_post "${namestore_link}/$name" '{"data": [{"record_type":"PKEY", "expiratio gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 #expirations -curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"0d","flag":0}],"record_name":"test_entry"}' "HTTP/1.1 204" +curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"0d","private": false, "relative_expiration": true, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "HTTP/1.1 204" gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 -curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"10000d","flag":0}],"record_name":"test_entry"}' "HTTP/1.1 204" +curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"10000d","private": false, "relative_expiration": true, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "HTTP/1.1 204" gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 -curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"now","flag":0}],"record_name":"test_entry"}' "error" +curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"now","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "error" gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 -curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time_missing":"1d","flag":0}],"record_name":"test_entry"}' "error" +curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time_missing":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":"test_entry"}' "error" gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 #record_name -curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"1d","flag":0}],"record_name":""}' "error" +curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name":""}' "error" gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 -curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"1d","flag":0}],"record_name_missing":"test_entry"}' "error" +curl_post "${namestore_link}/$name" '{"data": [{"value":"HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG", "record_type":"PKEY", "expiration_time":"1d","private": false, "relative_expiration": false, "supplemental": false, "shadow": false}],"record_name_missing":"test_entry"}' "error" gnunet-namestore -z $name -d -n "test_entry" -c test_namestore_api.conf > /dev/null 2>&1 #Test DELETE gnunet-namestore -z $name -p -a -n "test_entry" -e "1d" -V "HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG" -t "PKEY" -c test_namestore_api.conf -curl_delete "${namestore_link}/$name?record_name=test_entry" "HTTP/1.1 204" -curl_delete "${namestore_link}/$name?record_name=test_entry" "error" +curl_delete "${namestore_link}/$name/test_entry" "HTTP/1.1 204" +curl_delete "${namestore_link}/$name/test_entry" "error" gnunet-namestore -z $name -p -a -n "test_entry" -e "1d" -V "HVX38H2CB7WJM0WCPWT9CFX6GASMYJVR65RN75SJSSKAYVYXHMRG" -t "PKEY" -c test_namestore_api.conf -curl_delete "${namestore_link}/$public?record_name=test_entry" "error" +curl_delete "${namestore_link}/$public/test_entry" "error" gnunet-arm -e -c test_namestore_api.conf exit 0; -- cgit v1.2.3 From 13b2791f49d8aeacb96fa005942ad98ec2c88d50 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 6 Jul 2020 22:29:59 +0200 Subject: fix: do not use udp plugin for tests --- src/testbed/test_testbed_api_template.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/testbed/test_testbed_api_template.conf b/src/testbed/test_testbed_api_template.conf index 43ae06f81..255c1b766 100644 --- a/src/testbed/test_testbed_api_template.conf +++ b/src/testbed/test_testbed_api_template.conf @@ -14,7 +14,7 @@ QUOTA = 1 MB DATABASE = heap [transport] -PLUGINS = udp +PLUGINS = tcp ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; NEIGHBOUR_LIMIT = 50 -- cgit v1.2.3 From 309ad1364e8ea04a0a2dff35919b3c8a0fadf0b1 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Mon, 6 Jul 2020 23:34:48 +0200 Subject: fix: cadet fix to use correct tunnel end --- src/cadet/gnunet-service-cadet_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/cadet/gnunet-service-cadet_core.c b/src/cadet/gnunet-service-cadet_core.c index 04847f906..db47c8a90 100644 --- a/src/cadet/gnunet-service-cadet_core.c +++ b/src/cadet/gnunet-service-cadet_core.c @@ -822,7 +822,7 @@ handle_connection_create ( GCP_2s (origin), GNUNET_sh2s (&msg->cid.connection_of_tunnel)); path = GCPP_get_path_from_route (path_length - 1, pids); - t = GCP_get_tunnel (sender, GNUNET_YES); + t = GCP_get_tunnel (origin, GNUNET_YES); // Check for CADET state in case the other side has lost the tunnel (xrs,t3ss) if ((GNUNET_YES == msg->has_monotime) && -- cgit v1.2.3 From e4a1ec5a6a192f81b8d8ca51822b35f06a87bf6d Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Tue, 7 Jul 2020 00:19:53 +0200 Subject: -fix: use new peer keys for blacklist --- src/transport/test_transport_blacklisting_cfg_blp_peer1_full.conf | 8 ++++---- ...est_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf | 8 ++++---- .../test_transport_blacklisting_cfg_blp_peer1_plugin.conf | 8 ++++---- ...est_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf | 8 ++++---- .../test_transport_blacklisting_cfg_blp_peer2_plugin.conf | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/transport/test_transport_blacklisting_cfg_blp_peer1_full.conf b/src/transport/test_transport_blacklisting_cfg_blp_peer1_full.conf index c8a5bf0d4..19bff8fcc 100644 --- a/src/transport/test_transport_blacklisting_cfg_blp_peer1_full.conf +++ b/src/transport/test_transport_blacklisting_cfg_blp_peer1_full.conf @@ -9,8 +9,8 @@ TIMEOUT = 5 s [transport] PLUGINS = tcp -#Peer 1: 6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG -#Peer 2: DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50 +#Peer 1: 4TTC9WBSVP9RJT6DVEZ7E0TDW7TQXC11NR1EMR2F8ARS87WZ2730 +#Peer 2: F7B5NX6KCPG8SAKYSGV0E94Y5NXR9JE3HCGQ5YGH1H04WFQWMWT0 -[transport-blacklist-6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG] -DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50 = +[transport-blacklist-4TTC9WBSVP9RJT6DVEZ7E0TDW7TQXC11NR1EMR2F8ARS87WZ2730] +F7B5NX6KCPG8SAKYSGV0E94Y5NXR9JE3HCGQ5YGH1H04WFQWMWT0 = diff --git a/src/transport/test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf b/src/transport/test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf index 64fe7320c..79bc90469 100644 --- a/src/transport/test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf +++ b/src/transport/test_transport_blacklisting_cfg_blp_peer1_multiple_plugins.conf @@ -5,9 +5,9 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/api-tcp-p1/ [transport] PLUGINS = tcp unix -#Peer 1: 6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG -#Peer 2: DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50 +#Peer 1: 4TTC9WBSVP9RJT6DVEZ7E0TDW7TQXC11NR1EMR2F8ARS87WZ2730 +#Peer 2: F7B5NX6KCPG8SAKYSGV0E94Y5NXR9JE3HCGQ5YGH1H04WFQWMWT0 -[transport-blacklist-6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG] -DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50 = tcp +[transport-blacklist-4TTC9WBSVP9RJT6DVEZ7E0TDW7TQXC11NR1EMR2F8ARS87WZ2730] +F7B5NX6KCPG8SAKYSGV0E94Y5NXR9JE3HCGQ5YGH1H04WFQWMWT0 = tcp diff --git a/src/transport/test_transport_blacklisting_cfg_blp_peer1_plugin.conf b/src/transport/test_transport_blacklisting_cfg_blp_peer1_plugin.conf index 12c11252e..b328dd5cf 100644 --- a/src/transport/test_transport_blacklisting_cfg_blp_peer1_plugin.conf +++ b/src/transport/test_transport_blacklisting_cfg_blp_peer1_plugin.conf @@ -5,9 +5,9 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/api-tcp-p1/ [transport] PLUGINS = tcp -#Peer 1: 6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG -#Peer 2: DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50 +#Peer 1: 4TTC9WBSVP9RJT6DVEZ7E0TDW7TQXC11NR1EMR2F8ARS87WZ2730 +#Peer 2: F7B5NX6KCPG8SAKYSGV0E94Y5NXR9JE3HCGQ5YGH1H04WFQWMWT0 -[transport-blacklist-6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG] -DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50 = tcp +[transport-blacklist-4TTC9WBSVP9RJT6DVEZ7E0TDW7TQXC11NR1EMR2F8ARS87WZ2730] +F7B5NX6KCPG8SAKYSGV0E94Y5NXR9JE3HCGQ5YGH1H04WFQWMWT0 = tcp diff --git a/src/transport/test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf b/src/transport/test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf index ee67372e1..3134f9d81 100644 --- a/src/transport/test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf +++ b/src/transport/test_transport_blacklisting_cfg_blp_peer2_multiple_plugins.conf @@ -5,8 +5,8 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/api-tcp-p2/ [transport] PLUGINS = tcp unix -#Peer 1: 6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG -#Peer 2: DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50 +#Peer 1: 4TTC9WBSVP9RJT6DVEZ7E0TDW7TQXC11NR1EMR2F8ARS87WZ2730 +#Peer 2: F7B5NX6KCPG8SAKYSGV0E94Y5NXR9JE3HCGQ5YGH1H04WFQWMWT0 -[transport-blacklist-DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50] -6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG = tcp +[transport-blacklist-F7B5NX6KCPG8SAKYSGV0E94Y5NXR9JE3HCGQ5YGH1H04WFQWMWT0] +4TTC9WBSVP9RJT6DVEZ7E0TDW7TQXC11NR1EMR2F8ARS87WZ2730 = tcp diff --git a/src/transport/test_transport_blacklisting_cfg_blp_peer2_plugin.conf b/src/transport/test_transport_blacklisting_cfg_blp_peer2_plugin.conf index 00d3343e8..dd582125d 100644 --- a/src/transport/test_transport_blacklisting_cfg_blp_peer2_plugin.conf +++ b/src/transport/test_transport_blacklisting_cfg_blp_peer2_plugin.conf @@ -5,8 +5,8 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/api-tcp-p2/ [transport] PLUGINS = tcp -#Peer 1: 6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG -#Peer 2: DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50 +#Peer 1: 4TTC9WBSVP9RJT6DVEZ7E0TDW7TQXC11NR1EMR2F8ARS87WZ2730 +#Peer 2: F7B5NX6KCPG8SAKYSGV0E94Y5NXR9JE3HCGQ5YGH1H04WFQWMWT0 -[transport-blacklist-DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50] -6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG = tcp +[transport-blacklist-F7B5NX6KCPG8SAKYSGV0E94Y5NXR9JE3HCGQ5YGH1H04WFQWMWT0] +4TTC9WBSVP9RJT6DVEZ7E0TDW7TQXC11NR1EMR2F8ARS87WZ2730 = tcp -- cgit v1.2.3 From 8d0c55ce57abc11431ba8285d731f1f11c3f8592 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Tue, 7 Jul 2020 11:36:46 +0200 Subject: -fix: increase quotas due to increased min value fix --- src/ats/plugin_ats_proportional.c | 2 ++ src/core/test_core_quota_peer1.conf | 69 ++++++++++++++++++------------------- src/core/test_core_quota_peer2.conf | 60 ++++++++++++++++---------------- 3 files changed, 65 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c index f554291b6..52476c825 100644 --- a/src/ats/plugin_ats_proportional.c +++ b/src/ats/plugin_ats_proportional.c @@ -218,6 +218,8 @@ is_bandwidth_available_in_network (struct Network *net, if (((net->total_quota_in / na) > min_bw) && ((net->total_quota_out / na) > min_bw)) return GNUNET_YES; + LOG (GNUNET_ERROR_TYPE_DEBUG, + "No bandwidth available in network\n"); return GNUNET_NO; } diff --git a/src/core/test_core_quota_peer1.conf b/src/core/test_core_quota_peer1.conf index ea4fa273c..ec592f778 100644 --- a/src/core/test_core_quota_peer1.conf +++ b/src/core/test_core_quota_peer1.conf @@ -1,61 +1,58 @@ @INLINE@ test_core_defaults.conf [PATHS] -GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-core-quota-sym-peer-1/ - -[transport-tcp] -PORT = 12468 +GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-core-peer-1/ [arm] -PORT = 12476 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p1-service-arm.sock +PORT = 12460 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-arm.sock [statistics] -PORT = 12477 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p1-service-statistics.sock +PORT = 12461 [resolver] -PORT = 12474 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p1-service-resolver.sock +PORT = 12462 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-resolver.sock [peerinfo] -PORT = 12479 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p1-service-peerinfo.sock +PORT = 12463 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-peerinfo.sock [transport] -PORT = 12475 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p1-service-transport.sock +PORT = 12464 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-transport.sock -[nat] -port = 12481 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p1-service-nat.sock +[core] +PORT = 12475 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-core.sock [ats] -PORT = 12471 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p1-service-ats.sock +PORT = 12476 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p1-service-ats.sock # UNSPECIFIED -UNSPECIFIED_QUOTA_IN = 10240 -UNSPECIFIED_QUOTA_OUT = 10240 +UNSPECIFIED_QUOTA_IN = 10 MiB +UNSPECIFIED_QUOTA_OUT = 10 MiB # LOOPBACK -LOOPBACK_QUOTA_IN = 10240 -LOOPBACK_QUOTA_OUT = 10240 +LOOPBACK_QUOTA_IN = 10 MiB +LOOPBACK_QUOTA_OUT = 10 MiB # LAN -LAN_QUOTA_IN = 10240 -LAN_QUOTA_OUT = 10240 +LAN_QUOTA_IN = 10 MiB +LAN_QUOTA_OUT = 10 MiB # WAN -WAN_QUOTA_IN = 10240 -WAN_QUOTA_OUT = 10240 +WAN_QUOTA_IN = 10 MiB +WAN_QUOTA_OUT = 10 MiB # WLAN -WLAN_QUOTA_IN = 10240 -WLAN_QUOTA_OUT = 10240 +WLAN_QUOTA_IN = 10 MiB +WLAN_QUOTA_OUT = 10 MiB -[core] -PORT = 12480 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p1-service-core.sock -[ats] -PORT = 12481 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p1-service-ats.sock +[transport-tcp] +PORT = 12467 [transport-udp] -PORT = 12482 +PORT = 12468 + +[transport-unix] +PORT = 12469 +[transport-http] +PORT = 12470 diff --git a/src/core/test_core_quota_peer2.conf b/src/core/test_core_quota_peer2.conf index 03c684cff..65d0710bb 100644 --- a/src/core/test_core_quota_peer2.conf +++ b/src/core/test_core_quota_peer2.conf @@ -1,53 +1,50 @@ @INLINE@ test_core_defaults.conf [PATHS] -GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-core-quota-sym-peer-2/ +GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-core-peer-2/ [arm] -PORT = 22476 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p2-service-arm.sock +PORT = 22460 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-arm.sock [statistics] -PORT = 22477 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p2-service-statistics.sock +PORT = 22461 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-statistics.sock [resolver] -PORT = 22474 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p2-service-resolver.sock +PORT = 22462 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-resolver.sock [peerinfo] -PORT = 22479 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p2-service-peerinfo.sock +PORT = 22463 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-peerinfo.sock [transport] -PORT = 22475 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p2-service-transport.sock +PORT = 22464 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-transport.sock [core] -PORT = 22480 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p2-service-core.sock - -[nat] -PORT = 22481 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p2.service-nat.sock +PORT = 22475 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-core.sock [ats] -PORT = 22482 -UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p2-service-ats.sock +PORT = 22476 +UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-p2-service-ats.sock # UNSPECIFIED -UNSPECIFIED_QUOTA_IN = 10240 -UNSPECIFIED_QUOTA_OUT = 10240 +UNSPECIFIED_QUOTA_IN = 10 MiB +UNSPECIFIED_QUOTA_OUT = 10 MiB # LOOPBACK -LOOPBACK_QUOTA_IN = 10240 -LOOPBACK_QUOTA_OUT = 10240 +LOOPBACK_QUOTA_IN = 10 MiB +LOOPBACK_QUOTA_OUT = 10 MiB # LAN -LAN_QUOTA_IN = 10240 -LAN_QUOTA_OUT = 10240 +LAN_QUOTA_IN = 10 MiB +LAN_QUOTA_OUT = 10 MiB # WAN -WAN_QUOTA_IN = 10240 -WAN_QUOTA_OUT = 10240 +WAN_QUOTA_IN = 10 MiB +WAN_QUOTA_OUT = 10 MiB # WLAN -WLAN_QUOTA_IN = 10240 -WLAN_QUOTA_OUT = 10240 +WLAN_QUOTA_IN = 10 MiB +WLAN_QUOTA_OUT = 10 MiB + [transport-tcp] PORT = 22467 @@ -55,5 +52,8 @@ PORT = 22467 [transport-udp] PORT = 22468 -[transport-http] +[transport-unix] PORT = 22469 + +[transport-http] +PORT = 22470 -- cgit v1.2.3 From b953d97e83f71782f1e45ea793e137847372c6de Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Tue, 7 Jul 2020 12:55:33 +0200 Subject: -fix: increase quotas due to increased min value fix --- src/ats/test_ats_api_proportional.conf | 4 ++-- src/ats/test_ats_reservation_api.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ats/test_ats_api_proportional.conf b/src/ats/test_ats_api_proportional.conf index 21f8218ee..ee8f8f8e7 100644 --- a/src/ats/test_ats_api_proportional.conf +++ b/src/ats/test_ats_api_proportional.conf @@ -17,8 +17,8 @@ LOOPBACK_QUOTA_OUT = unlimited LAN_QUOTA_IN = unlimited LAN_QUOTA_OUT = unlimited # WAN -WAN_QUOTA_IN = 64 KiB -WAN_QUOTA_OUT = 64 KiB +WAN_QUOTA_IN = 5 MiB +WAN_QUOTA_OUT = 5 MiB # WLAN WLAN_QUOTA_IN = 4096 WLAN_QUOTA_OUT = 4096 diff --git a/src/ats/test_ats_reservation_api.c b/src/ats/test_ats_reservation_api.c index 46658007b..f6a964df4 100644 --- a/src/ats/test_ats_reservation_api.c +++ b/src/ats/test_ats_reservation_api.c @@ -102,14 +102,14 @@ static struct Command test_commands[] = { }, - /* 6: reserve another 32k -- should now fail (if MAX_BANDWIDTH_CARRY_S + /* 6: reserve another 32M -- should now fail (if MAX_BANDWIDTH_CARRY_S is precisely observed) */ { .code = CMD_RESERVE_BANDWIDTH, .label = "failing reservation", .details.reserve_bandwidth = { .pid = 0, - .amount = 32 * 1024, + .amount = 32 * 1024 * 1024, .expected_result = GNUNET_SYSERR } -- cgit v1.2.3 From cb745ab729e55c9f9141ff839db47c91b007663d Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Tue, 7 Jul 2020 14:43:42 +0200 Subject: -fix --- .../test_transport_blacklisting_cfg_blp_peer2_full.conf | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/transport/test_transport_blacklisting_cfg_blp_peer2_full.conf b/src/transport/test_transport_blacklisting_cfg_blp_peer2_full.conf index 4b449bed8..862209d2c 100644 --- a/src/transport/test_transport_blacklisting_cfg_blp_peer2_full.conf +++ b/src/transport/test_transport_blacklisting_cfg_blp_peer2_full.conf @@ -5,9 +5,8 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-transport/api-tcp-p2/ [transport] PLUGINS = tcp -#Peer 1: 6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG -#Peer 2: DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50 - -[transport-blacklist-DK5WZKKDHH06BH1H0DE0Z8CPBTG9AD8P85SF02WW3285AT3V0V50] -6YNBKM6TTK64FAG9DF0292AW5JA9CCAC04JTY0HF8XHP635HPBBG = +#Peer 1: 4TTC9WBSVP9RJT6DVEZ7E0TDW7TQXC11NR1EMR2F8ARS87WZ2730 +#Peer 2: F7B5NX6KCPG8SAKYSGV0E94Y5NXR9JE3HCGQ5YGH1H04WFQWMWT0 +[transport-blacklist-F7B5NX6KCPG8SAKYSGV0E94Y5NXR9JE3HCGQ5YGH1H04WFQWMWT0] +4TTC9WBSVP9RJT6DVEZ7E0TDW7TQXC11NR1EMR2F8ARS87WZ2730 = -- cgit v1.2.3 From 9011fd0dded9a55c6b531818fabf4c729cc4e911 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Tue, 7 Jul 2020 16:32:23 +0200 Subject: -fix more configs --- ...t_core_quota_asymmetric_recv_limited_peer1.conf | 20 +++++++++--------- ...t_core_quota_asymmetric_recv_limited_peer2.conf | 20 +++++++++--------- ...est_core_quota_asymmetric_send_limit_peer1.conf | 20 +++++++++--------- ...est_core_quota_asymmetric_send_limit_peer2.conf | 24 +++++++++++----------- 4 files changed, 42 insertions(+), 42 deletions(-) (limited to 'src') diff --git a/src/core/test_core_quota_asymmetric_recv_limited_peer1.conf b/src/core/test_core_quota_asymmetric_recv_limited_peer1.conf index fa2d64474..766a2e73b 100644 --- a/src/core/test_core_quota_asymmetric_recv_limited_peer1.conf +++ b/src/core/test_core_quota_asymmetric_recv_limited_peer1.conf @@ -32,20 +32,20 @@ PORT = 12489 PORT = 12491 UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-asym-recv-p1-service-ats.sock # UNSPECIFIED -UNSPECIFIED_QUOTA_IN = 1 MB -UNSPECIFIED_QUOTA_OUT = 1 MB +UNSPECIFIED_QUOTA_IN = 100 MiB +UNSPECIFIED_QUOTA_OUT = 100 MiB # LOOPBACK -LOOPBACK_QUOTA_IN = 1 MB -LOOPBACK_QUOTA_OUT = 1 MB +LOOPBACK_QUOTA_IN = 100 MiB +LOOPBACK_QUOTA_OUT = 100 MiB # LAN -LAN_QUOTA_IN = 1 MB -LAN_QUOTA_OUT = 1 MB +LAN_QUOTA_IN = 100 MiB +LAN_QUOTA_OUT = 100 MiB # WAN -WAN_QUOTA_IN = 1 MB -WAN_QUOTA_OUT = 1 MB +WAN_QUOTA_IN = 100 MiB +WAN_QUOTA_OUT = 100 MiB # WLAN -WLAN_QUOTA_IN = 1 MB -WLAN_QUOTA_OUT = 1 MB +WLAN_QUOTA_IN = 100 MiB +WLAN_QUOTA_OUT = 100 MiB [core] diff --git a/src/core/test_core_quota_asymmetric_recv_limited_peer2.conf b/src/core/test_core_quota_asymmetric_recv_limited_peer2.conf index b2a84f706..30c0bb81f 100644 --- a/src/core/test_core_quota_asymmetric_recv_limited_peer2.conf +++ b/src/core/test_core_quota_asymmetric_recv_limited_peer2.conf @@ -31,20 +31,20 @@ UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-asym-recv-p2-service-core.sock PORT = 22491 UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-asym-recv-p2-service-ats.sock # UNSPECIFIED -UNSPECIFIED_QUOTA_IN = 10240 -UNSPECIFIED_QUOTA_OUT = 10240 +UNSPECIFIED_QUOTA_IN = 10 MiB +UNSPECIFIED_QUOTA_OUT = 10 MiB # LOOPBACK -LOOPBACK_QUOTA_IN = 10240 -LOOPBACK_QUOTA_OUT = 10240 +LOOPBACK_QUOTA_IN = 10 MiB +LOOPBACK_QUOTA_OUT = 10 MiB # LAN -LAN_QUOTA_IN = 10240 -LAN_QUOTA_OUT = 10240 +LAN_QUOTA_IN = 10 MiB +LAN_QUOTA_OUT = 10 MiB # WAN -WAN_QUOTA_IN = 10240 -WAN_QUOTA_OUT = 10240 +WAN_QUOTA_IN = 10 MiB +WAN_QUOTA_OUT = 10 MiB # WLAN -WLAN_QUOTA_IN = 10240 -WLAN_QUOTA_OUT = 10240 +WLAN_QUOTA_IN = 10 MiB +WLAN_QUOTA_OUT = 10 MiB [transport-tcp] PORT = 22467 diff --git a/src/core/test_core_quota_asymmetric_send_limit_peer1.conf b/src/core/test_core_quota_asymmetric_send_limit_peer1.conf index 6b416f580..4a9f483d6 100644 --- a/src/core/test_core_quota_asymmetric_send_limit_peer1.conf +++ b/src/core/test_core_quota_asymmetric_send_limit_peer1.conf @@ -32,20 +32,20 @@ UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-asym-send-p1-service-transport.sock PORT = 12491 UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-asym-send-p1-service-ats.sock # UNSPECIFIED -UNSPECIFIED_QUOTA_IN = 10240 -UNSPECIFIED_QUOTA_OUT = 10240 +UNSPECIFIED_QUOTA_IN = 10 MiB +UNSPECIFIED_QUOTA_OUT = 10 MiB # LOOPBACK -LOOPBACK_QUOTA_IN = 10240 -LOOPBACK_QUOTA_OUT = 10240 +LOOPBACK_QUOTA_IN = 10 MiB +LOOPBACK_QUOTA_OUT = 10 MiB # LAN -LAN_QUOTA_IN = 10240 -LAN_QUOTA_OUT = 10240 +LAN_QUOTA_IN = 10 MiB +LAN_QUOTA_OUT = 10 MiB # WAN -WAN_QUOTA_IN = 10240 -WAN_QUOTA_OUT = 10240 +WAN_QUOTA_IN = 10 MiB +WAN_QUOTA_OUT = 10 MiB # WLAN -WLAN_QUOTA_IN = 10240 -WLAN_QUOTA_OUT = 10240 +WLAN_QUOTA_IN = 10 MiB +WLAN_QUOTA_OUT = 10 MiB [core] PORT = 12490 diff --git a/src/core/test_core_quota_asymmetric_send_limit_peer2.conf b/src/core/test_core_quota_asymmetric_send_limit_peer2.conf index 05ea062e6..36434461c 100644 --- a/src/core/test_core_quota_asymmetric_send_limit_peer2.conf +++ b/src/core/test_core_quota_asymmetric_send_limit_peer2.conf @@ -29,27 +29,27 @@ UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-asym-send-p2-service-core.sock [ats] PORT = 22491 UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-asym-send-p2-service-ats.sock -WAN_QUOTA_IN = 1 MB -WAN_QUOTA_OUT = 1 MB +WAN_QUOTA_IN = 100 MiB +WAN_QUOTA_OUT = 100 MiB [ats] PORT = 12471 UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-core-sym-p1-service-ats.sock # UNSPECIFIED -UNSPECIFIED_QUOTA_IN = 1 MB -UNSPECIFIED_QUOTA_OUT = 1 MB +UNSPECIFIED_QUOTA_IN = 100 MiB +UNSPECIFIED_QUOTA_OUT = 100 MiB # LOOPBACK -LOOPBACK_QUOTA_IN = 1 MB -LOOPBACK_QUOTA_OUT = 1 MB +LOOPBACK_QUOTA_IN = 100 MiB +LOOPBACK_QUOTA_OUT = 100 MiB # LAN -LAN_QUOTA_IN = 1 MB -LAN_QUOTA_OUT = 1 MB +LAN_QUOTA_IN = 100 MiB +LAN_QUOTA_OUT = 100 MiB # WAN -WAN_QUOTA_IN = 1 MB -WAN_QUOTA_OUT = 1 MB +WAN_QUOTA_IN = 100 MiB +WAN_QUOTA_OUT = 100 MiB # WLAN -WLAN_QUOTA_IN = 1 MB -WLAN_QUOTA_OUT = 1 MB +WLAN_QUOTA_IN = 100 MiB +WLAN_QUOTA_OUT = 100 MiB [transport-tcp] PORT = 22467 -- cgit v1.2.3 From 5a0df5e18a6c9b058f10b0b8eaf459959e15ce54 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Thu, 9 Jul 2020 09:09:50 +0200 Subject: fix: raise ATS quotas to 10 MiB #6426 --- src/ats/ats.conf.in | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/ats/ats.conf.in b/src/ats/ats.conf.in index 53c0de0c5..7691f98c0 100644 --- a/src/ats/ats.conf.in +++ b/src/ats/ats.conf.in @@ -12,9 +12,11 @@ UNIX_MATCH_GID = YES # Designated assignment mode: PROPORTIONAL / MLP / RIL MODE = proportional +# IMPORTANT: Do not lower those quotas below 10 MiB +# Or your peer may not bootstrap correctly. # Network specific inbound/outbound quotas -UNSPECIFIED_QUOTA_IN = 64 KiB -UNSPECIFIED_QUOTA_OUT = 64 KiB +UNSPECIFIED_QUOTA_IN = 10 MiB +UNSPECIFIED_QUOTA_OUT = 10 MiB # LOOPBACK LOOPBACK_QUOTA_IN = unlimited LOOPBACK_QUOTA_OUT = unlimited @@ -22,14 +24,14 @@ LOOPBACK_QUOTA_OUT = unlimited LAN_QUOTA_IN = unlimited LAN_QUOTA_OUT = unlimited # WAN -WAN_QUOTA_IN = 64 KiB -WAN_QUOTA_OUT = 64 KiB +WAN_QUOTA_IN = 10 MiB +WAN_QUOTA_OUT = 10 MiB # WLAN -WLAN_QUOTA_IN = 1 MiB -WLAN_QUOTA_OUT = 1 MiB +WLAN_QUOTA_IN = 10 MiB +WLAN_QUOTA_OUT = 10 MiB # BLUETOOTH -BLUETOOTH_QUOTA_IN = 128 KiB -BLUETOOTH_QUOTA_OUT = 128 KiB +BLUETOOTH_QUOTA_IN = 10 MiB +BLUETOOTH_QUOTA_OUT = 10 MiB # ATS options # Proportional specific settings -- cgit v1.2.3 From 0f2ac01f3d935435f9fa0e3d1fb7e038fb0c19fa Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Fri, 3 Jul 2020 22:37:42 +0200 Subject: Add function to return GNUnet's default configuration It's for convenience when applications call `GNUNET_OS_init', after which it's impossible to obtain GNUnet's configuration without manually checking the filesystem. With this function it's possible to get the configuration regardless of the state of the application. --- src/include/gnunet_configuration_lib.h | 12 ++++++++++ src/util/configuration.c | 40 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) (limited to 'src') diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index 302429430..b5ceb5b94 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h @@ -100,6 +100,18 @@ GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, const char *defaults_d); +/** + * Return GNUnet's default configuration. A new configuration is allocated + * each time and it's up to the caller to destroy it when done. This function + * returns GNUnet's configuration even when #GNUNET_OS_init has been called + * with a value different from #GNUNET_OS_project_data_default. + * + * @return a freshly allocated configuration + */ +struct GNUNET_CONFIGURATION_Handle * +GNUNET_CONFIGURATION_default(void); + + /** * Parse a configuration file, add all of the options in the * file to the configuration environment. diff --git a/src/util/configuration.c b/src/util/configuration.c index 34ecc9e73..faee9e3bf 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c @@ -1810,4 +1810,44 @@ GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, } +/** + * Return GNUnet's default configuration. A new configuration is allocated + * each time and it's up to the caller to destroy it when done. This function + * returns GNUnet's configuration even when #GNUNET_OS_init has been called + * with a value different from #GNUNET_OS_project_data_default. + * + * @return a freshly allocated configuration + */ +struct GNUNET_CONFIGURATION_Handle * +GNUNET_CONFIGURATION_default(void) +{ + const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get (); + const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); + + GNUNET_OS_init(dpd); + + struct GNUNET_CONFIGURATION_Handle *cfg = GNUNET_CONFIGURATION_create (); + const char *xdg = getenv ("XDG_CONFIG_HOME"); + char *cfgname = NULL; + + if (NULL != xdg) + GNUNET_asprintf (&cfgname, "%s/%s", xdg, pd->config_file); + else + cfgname = GNUNET_strdup (pd->user_config_file); + + if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cfgname)) { + GNUNET_OS_init (pd); + GNUNET_CONFIGURATION_destroy (cfg); + GNUNET_free (cfgname); + return NULL; + } + + GNUNET_free (cfgname); + + GNUNET_OS_init (pd); + + return cfg; +} + + /* end of configuration.c */ -- cgit v1.2.3 From 9bb2c1e3183bbdd6554fe51c0b0a3e90022b77e1 Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Wed, 15 Jul 2020 17:21:39 +0200 Subject: Load GNSRECORD plugins within GNUnet's context When applications set a new project data structure using `GNUNET_OS_init', the plugin loader will look into a different path for plugins, instead of using GNUnet's installation path. Since applications don't normally come with the default DNS/GNS plugins for GNSRECORD, the consequence is that GNSRECORD will always fail when operating on a record from GNS. Signed-off-by: Christian Grothoff --- src/gnsrecord/gnsrecord.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c index c6ebd7c29..3ce10473b 100644 --- a/src/gnsrecord/gnsrecord.c +++ b/src/gnsrecord/gnsrecord.c @@ -102,8 +102,15 @@ init () if (1 == once) return; once = 1; + struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get (); + struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); + + if (pd != dpd) + GNUNET_OS_init(dpd); GNUNET_PLUGIN_load_all ("libgnunet_plugin_gnsrecord_", NULL, &add_plugin, NULL); + if (pd != dpd) + GNUNET_OS_init(pd); } @@ -114,6 +121,11 @@ void __attribute__ ((destructor)) GNSRECORD_fini () { struct Plugin *plugin; + struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get (); + struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); + + if (pd != dpd) + GNUNET_OS_init(dpd); for (unsigned int i = 0; i < num_plugins; i++) { @@ -125,6 +137,10 @@ GNSRECORD_fini () GNUNET_free (plugin); } GNUNET_free (gns_plugins); + + if (pd != dpd) + GNUNET_OS_init(dpd); + gns_plugins = NULL; once = 0; num_plugins = 0; -- cgit v1.2.3 From 5b4a00d35bd229180c6769ec582fee97c16ebf3d Mon Sep 17 00:00:00 2001 From: Alessio Vanni Date: Wed, 15 Jul 2020 20:58:51 +0200 Subject: - Use correct argument in GNUNET_OS_init call Signed-off-by: Christian Grothoff --- src/gnsrecord/gnsrecord.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c index 3ce10473b..a59997934 100644 --- a/src/gnsrecord/gnsrecord.c +++ b/src/gnsrecord/gnsrecord.c @@ -139,7 +139,7 @@ GNSRECORD_fini () GNUNET_free (gns_plugins); if (pd != dpd) - GNUNET_OS_init(dpd); + GNUNET_OS_init(pd); gns_plugins = NULL; once = 0; -- cgit v1.2.3 From ee1fbffa1c42f7ac3fc897e73e90c525037dd915 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 16 Jul 2020 17:40:14 +0200 Subject: support context-wide client authentication --- contrib/build-common | 2 +- src/curl/curl.c | 114 ++++++++++++++++++++++++++++++++++++++++++ src/gnsrecord/gnsrecord.c | 8 +-- src/include/gnunet_curl_lib.h | 36 +++++++++++++ src/util/crypto_kdf.c | 4 +- 5 files changed, 157 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/contrib/build-common b/contrib/build-common index 1915a74bb..d81bbfabc 160000 --- a/contrib/build-common +++ b/contrib/build-common @@ -1 +1 @@ -Subproject commit 1915a74bbb4cd2ae9bc541a382dfebc37064a2fd +Subproject commit d81bbfabc2538932f631d3946bd6a9b95182b4f2 diff --git a/src/curl/curl.c b/src/curl/curl.c index a63a10f3b..f43670944 100644 --- a/src/curl/curl.c +++ b/src/curl/curl.c @@ -170,9 +170,92 @@ struct GNUNET_CURL_Context * Closure for @e cb. */ void *cb_cls; + + /** + * USERNAME:PASSWORD to use for client-authentication + * with all requests of this context, or NULL. + */ + char *userpass; + + /** + * Type of the TLS client certificate used, or NULL. + */ + char *certtype; + + /** + * File with the TLS client certificate, or NULL. + */ + char *certfile; + + /** + * File with the private key to authenticate the + * TLS client, or NULL. + */ + char *keyfile; + + /** + * Passphrase to decrypt @e keyfile, or NULL. + */ + char *keypass; + }; +/** + * Force use of the provided username and password + * for client authentication for all operations performed + * with @a ctx. + * + * @param ctx context to set authentication data for + * @param userpass string with "$USERNAME:$PASSWORD" + */ +void +GNUNET_CURL_set_userpass (struct GNUNET_CURL_Context *ctx, + const char *userpass) +{ + GNUNET_free (ctx->userpass); + if (NULL != userpass) + ctx->userpass = GNUNET_strdup (userpass); +} + + +/** + * Force use of the provided TLS client certificate + * for client authentication for all operations performed + * with @a ctx. + * + * Note that if the provided information is incorrect, + * the earliest operation that could fail is + * #GNUNET_CURL_job_add() or #GNUNET_CURL_job_add2()! + * + * @param ctx context to set authentication data for + * @param certtype type of the certificate + * @param certfile file with the certificate + * @param keyfile file with the private key + * @param keypass passphrase to decrypt @a keyfile (or NULL) + */ +void +GNUNET_CURL_set_tlscert (struct GNUNET_CURL_Context *ctx, + const char *certtype, + const char *certfile, + const char *keyfile, + const char *keypass) +{ + GNUNET_free (ctx->certtype); + GNUNET_free (ctx->certfile); + GNUNET_free (ctx->keyfile); + GNUNET_free (ctx->keypass); + if (NULL != certtype) + ctx->certtype = GNUNET_strdup (certtype); + if (NULL != certfile) + ctx->certfile = GNUNET_strdup (certfile); + if (NULL != keyfile) + ctx->certtype = GNUNET_strdup (keyfile); + if (NULL != keypass) + ctx->certtype = GNUNET_strdup (keypass); +} + + /** * Initialise this library. This function should be called before using any of * the following functions. @@ -457,6 +540,32 @@ GNUNET_CURL_job_add2 (struct GNUNET_CURL_Context *ctx, struct curl_slist *all_headers; GNUNET_assert (NULL != jcc); + if ( (NULL != ctx->userpass) && + (0 != curl_easy_setopt (eh, + CURLOPT_USERPWD, + ctx->userpass)) ) + return NULL; + if ( (NULL != ctx->certfile) && + (0 != curl_easy_setopt (eh, + CURLOPT_SSLCERT, + ctx->certfile)) ) + return NULL; + if ( (NULL != ctx->certtype) && + (0 != curl_easy_setopt (eh, + CURLOPT_SSLCERTTYPE, + ctx->certtype)) ) + return NULL; + if ( (NULL != ctx->keyfile) && + (0 != curl_easy_setopt (eh, + CURLOPT_SSLKEY, + ctx->keyfile)) ) + return NULL; + if ( (NULL != ctx->keypass) && + (0 != curl_easy_setopt (eh, + CURLOPT_KEYPASSWD, + ctx->keypass)) ) + return NULL; + all_headers = setup_job_headers (ctx, job_headers); if (NULL == (job = setup_job (eh, @@ -899,6 +1008,11 @@ GNUNET_CURL_fini (struct GNUNET_CURL_Context *ctx) curl_share_cleanup (ctx->share); curl_multi_cleanup (ctx->multi); curl_slist_free_all (ctx->common_headers); + GNUNET_free (ctx->userpass); + GNUNET_free (ctx->certtype); + GNUNET_free (ctx->certfile); + GNUNET_free (ctx->keyfile); + GNUNET_free (ctx->keypass); GNUNET_free (ctx); } diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c index a59997934..3cbf5fc8d 100644 --- a/src/gnsrecord/gnsrecord.c +++ b/src/gnsrecord/gnsrecord.c @@ -102,8 +102,8 @@ init () if (1 == once) return; once = 1; - struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get (); - struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); + const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get (); + const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); if (pd != dpd) GNUNET_OS_init(dpd); @@ -121,8 +121,8 @@ void __attribute__ ((destructor)) GNSRECORD_fini () { struct Plugin *plugin; - struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get (); - struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); + const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get (); + const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); if (pd != dpd) GNUNET_OS_init(dpd); diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h index 875cfa3bd..0bb337ee7 100644 --- a/src/include/gnunet_curl_lib.h +++ b/src/include/gnunet_curl_lib.h @@ -244,6 +244,42 @@ GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx, void *jcc_cls); +/** + * Force use of the provided username and password + * for client authentication for all operations performed + * with @a ctx. + * + * @param ctx context to set authentication data for + * @param userpass string with "$USERNAME:$PASSWORD" + */ +void +GNUNET_CURL_set_userpass (struct GNUNET_CURL_Context *ctx, + const char *userpass); + + +/** + * Force use of the provided TLS client certificate + * for client authentication for all operations performed + * with @a ctx. + * + * Note that if the provided information is incorrect, + * the earliest operation that could fail is + * #GNUNET_CURL_job_add() or #GNUNET_CURL_job_add2()! + * + * @param ctx context to set authentication data for + * @param certtype type of the certificate + * @param certfile file with the certificate + * @param keyfile file with the private key + * @param keypass passphrase to decrypt @a keyfile (or NULL) + */ +void +GNUNET_CURL_set_tlscert (struct GNUNET_CURL_Context *ctx, + const char *certtype, + const char *certfile, + const char *keyfile, + const char *keypass); + + /** * Schedule a CURL request to be executed and call the given @a jcc * upon its completion. Note that the context will make use of the diff --git a/src/util/crypto_kdf.c b/src/util/crypto_kdf.c index 1b3bd686f..4f3830308 100644 --- a/src/util/crypto_kdf.c +++ b/src/util/crypto_kdf.c @@ -62,7 +62,8 @@ GNUNET_CRYPTO_kdf_v (void *result, * hash function." * * http://eprint.iacr.org/2010/264 - */return GNUNET_CRYPTO_hkdf_v (result, + */// + return GNUNET_CRYPTO_hkdf_v (result, out_len, GCRY_MD_SHA512, GCRY_MD_SHA256, @@ -142,7 +143,6 @@ GNUNET_CRYPTO_kdf_mod_mpi (gcry_mpi_t *r, { /* Ain't clear if n is always divisible by 8 */ uint8_t buf[ (nbits - 1) / 8 + 1 ]; - uint16_t ctr_nbo = htons (ctr); rc = GNUNET_CRYPTO_kdf (buf, -- cgit v1.2.3 From bbe0a0501959db1add350cae54b86cbd59d48c77 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 16 Jul 2020 20:36:12 +0200 Subject: avoid boolean argument in GNUNET_CURL_job_add(), see #6188 --- src/curl/curl.c | 48 ++++++++++++++++++++++++++++++------------- src/include/gnunet_curl_lib.h | 27 +++++++++++++++++++----- 2 files changed, 56 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/curl/curl.c b/src/curl/curl.c index f43670944..b3d2af252 100644 --- a/src/curl/curl.c +++ b/src/curl/curl.c @@ -586,33 +586,27 @@ GNUNET_CURL_job_add2 (struct GNUNET_CURL_Context *ctx, * CURLOPT_PRIVATE facility of the CURL @a eh. * * This function modifies the CURL handle to add the - * "Content-Type: application/json" header if @a add_json is set. + * "Content-Type: application/json" header. * * @param ctx context to execute the job in * @param eh curl easy handle for the request, will * be executed AND cleaned up - * @param add_json add "application/json" content type header * @param jcc callback to invoke upon completion * @param jcc_cls closure for @a jcc * @return NULL on error (in this case, @eh is still released!) */ struct GNUNET_CURL_Job * -GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx, - CURL *eh, - int add_json, - GNUNET_CURL_JobCompletionCallback jcc, - void *jcc_cls) +GNUNET_CURL_job_add_with_ct_json (struct GNUNET_CURL_Context *ctx, + CURL *eh, + GNUNET_CURL_JobCompletionCallback jcc, + void *jcc_cls) { struct GNUNET_CURL_Job *job; struct curl_slist *job_headers = NULL; - if (GNUNET_YES == add_json) - { - GNUNET_assert ( - NULL != (job_headers = - curl_slist_append (NULL, "Content-Type: application/json"))); - } - + GNUNET_assert (NULL != (job_headers = + curl_slist_append (NULL, + "Content-Type: application/json"))); job = GNUNET_CURL_job_add2 (ctx, eh, job_headers, @@ -623,6 +617,32 @@ GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx, } +/** + * Schedule a CURL request to be executed and call the given @a jcc + * upon its completion. Note that the context will make use of the + * CURLOPT_PRIVATE facility of the CURL @a eh. + * + * @param ctx context to execute the job in + * @param eh curl easy handle for the request, will + * be executed AND cleaned up + * @param jcc callback to invoke upon completion + * @param jcc_cls closure for @a jcc + * @return NULL on error (in this case, @eh is still released!) + */ +struct GNUNET_CURL_Job * +GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx, + CURL *eh, + GNUNET_CURL_JobCompletionCallback jcc, + void *jcc_cls) +{ + return GNUNET_CURL_job_add2 (ctx, + eh, + NULL, + jcc, + jcc_cls); +} + + /** * Cancel a job. Must only be called before the job completion * callback is called for the respective job. diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h index 0bb337ee7..8f744512d 100644 --- a/src/include/gnunet_curl_lib.h +++ b/src/include/gnunet_curl_lib.h @@ -225,13 +225,9 @@ typedef void * upon its completion. Note that the context will make use of the * CURLOPT_PRIVATE facility of the CURL @a eh. * - * This function modifies the CURL handle to add the - * "Content-Type: application/json" header if @a add_json is set. - * * @param ctx context to execute the job in * @param eh curl easy handle for the request, will * be executed AND cleaned up - * @param add_json add "application/json" content type header * @param jcc callback to invoke upon completion * @param jcc_cls closure for @a jcc * @return NULL on error (in this case, @eh is still released!) @@ -239,11 +235,32 @@ typedef void struct GNUNET_CURL_Job * GNUNET_CURL_job_add (struct GNUNET_CURL_Context *ctx, CURL *eh, - int add_json, GNUNET_CURL_JobCompletionCallback jcc, void *jcc_cls); +/** + * Schedule a CURL request to be executed and call the given @a jcc + * upon its completion. Note that the context will make use of the + * CURLOPT_PRIVATE facility of the CURL @a eh. + * + * This function modifies the CURL handle to add the + * "Content-Type: application/json" header. + * + * @param ctx context to execute the job in + * @param eh curl easy handle for the request, will + * be executed AND cleaned up + * @param jcc callback to invoke upon completion + * @param jcc_cls closure for @a jcc + * @return NULL on error (in this case, @eh is still released!) + */ +struct GNUNET_CURL_Job * +GNUNET_CURL_job_add_with_ct_json (struct GNUNET_CURL_Context *ctx, + CURL *eh, + GNUNET_CURL_JobCompletionCallback jcc, + void *jcc_cls); + + /** * Force use of the provided username and password * for client authentication for all operations performed -- cgit v1.2.3 From 913e08b728cbc8c85cad2751d6837a7c502eb355 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 17 Jul 2020 17:45:43 +0200 Subject: remove const --- src/identity/identity_api.c | 4 ++-- src/include/gnunet_identity_service.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c index 5d17ac5d5..f7aca1655 100644 --- a/src/identity/identity_api.c +++ b/src/identity/identity_api.c @@ -150,9 +150,9 @@ struct GNUNET_IDENTITY_Handle /** * Obtain the ego representing 'anonymous' users. * - * @return handle for the anonymous user, must not be freed + * @return handle for the anonymous user, MUST NOT be freed */ -const struct GNUNET_IDENTITY_Ego * +struct GNUNET_IDENTITY_Ego * GNUNET_IDENTITY_ego_get_anonymous () { static struct GNUNET_IDENTITY_Ego anon; diff --git a/src/include/gnunet_identity_service.h b/src/include/gnunet_identity_service.h index f4e653598..94127248e 100644 --- a/src/include/gnunet_identity_service.h +++ b/src/include/gnunet_identity_service.h @@ -86,9 +86,9 @@ GNUNET_IDENTITY_ego_get_private_key (const struct GNUNET_IDENTITY_Ego *ego); /** * Obtain the ego representing 'anonymous' users. * - * @return handle for the anonymous user, must not be freed + * @return handle for the anonymous user, MUST NOT be freed */ -const struct GNUNET_IDENTITY_Ego * +struct GNUNET_IDENTITY_Ego * GNUNET_IDENTITY_ego_get_anonymous (void); -- cgit v1.2.3 From 931232d1141891232e46f5d6fd1432663e730e7a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 17 Jul 2020 21:52:22 +0200 Subject: fix signature --- src/include/gnunet_os_lib.h | 4 ++-- src/util/os_priority.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index b583cc493..12aeec7f0 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2011 GNUnet e.V. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2011, 2020 GNUnet e.V. GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -555,7 +555,7 @@ GNUNET_OS_start_process_v (int pipe_control, */ struct GNUNET_OS_Process * GNUNET_OS_start_process_s (int pipe_control, - unsigned int std_inheritance, + enum GNUNET_OS_InheritStdioFlags std_inheritance, const int *lsocks, const char *filename, ...); diff --git a/src/util/os_priority.c b/src/util/os_priority.c index 5799d893b..7f3be2a80 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c @@ -760,7 +760,7 @@ GNUNET_OS_start_process_v (int pipe_control, */ struct GNUNET_OS_Process * GNUNET_OS_start_process_s (int pipe_control, - unsigned int std_inheritance, + enum GNUNET_OS_InheritStdioFlags std_inheritance, const int *lsocks, const char *filename, ...) -- cgit v1.2.3 From 28ab2c446fba4980a8295d59fdf203a028a35dd6 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 17 Jul 2020 22:35:36 +0200 Subject: avoid boolean flag in GNUNET_OS_start_process() API (fixes #6188) --- src/arm/arm_api.c | 12 ++---- src/arm/gnunet-service-arm.c | 25 ++++++----- src/core/test_core_api.c | 4 +- src/core/test_core_api_reliability.c | 4 +- src/core/test_core_api_start_only.c | 4 +- src/core/test_core_quota_compliance.c | 4 +- src/fs/gnunet-auto-share.c | 3 +- src/gns/gnunet-gns-import.c | 30 ++++++------- src/hostlist/test_gnunet_daemon_hostlist.c | 4 +- .../test_gnunet_daemon_hostlist_learning.c | 7 +-- .../test_gnunet_daemon_hostlist_reconnect.c | 4 +- src/include/gnunet_os_lib.h | 27 +++++------- src/nat/gnunet-service-nat_helper.c | 6 +-- src/nat/gnunet-service-nat_mini.c | 3 +- src/nat/test_nat_test.c | 4 +- src/nat/test_stun.c | 4 +- src/pq/pq_connect.c | 3 +- src/statistics/test_statistics_api.c | 8 ++-- src/statistics/test_statistics_api_loop.c | 3 +- src/statistics/test_statistics_api_watch.c | 3 +- .../test_statistics_api_watch_zero_value.c | 3 +- src/testbed/gnunet-helper-testbed.c | 9 +--- src/testbed/testbed_api_hosts.c | 3 +- src/testing/testing.c | 12 +----- src/transport/plugin_transport_http_server.c | 2 +- src/transport/transport-testing2.c | 12 +++--- src/util/gnunet-qr.c | 3 +- src/util/gnunet-uri.c | 3 +- src/util/helper.c | 5 ++- src/util/os_priority.c | 50 ++++++++-------------- src/util/test_common_logging_runtime_loglevels.c | 2 +- src/util/test_os_start_process.c | 8 ++-- src/util/test_resolver_api.c | 4 +- 33 files changed, 123 insertions(+), 155 deletions(-) (limited to 'src') diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c index cd5f44565..dea7a70be 100644 --- a/src/arm/arm_api.c +++ b/src/arm/arm_api.c @@ -729,8 +729,7 @@ start_arm_service (struct GNUNET_ARM_Handle *h, /* Means we are ONLY running locally */ /* we're clearly running a test, don't daemonize */ if (NULL == config) - proc = GNUNET_OS_start_process_s (GNUNET_NO, - std_inheritance, + proc = GNUNET_OS_start_process_s (std_inheritance, lsocks, loprefix, quotedbinary, @@ -738,8 +737,7 @@ start_arm_service (struct GNUNET_ARM_Handle *h, lopostfix, NULL); else - proc = GNUNET_OS_start_process_s (GNUNET_NO, - std_inheritance, + proc = GNUNET_OS_start_process_s (std_inheritance, lsocks, loprefix, quotedbinary, @@ -752,8 +750,7 @@ start_arm_service (struct GNUNET_ARM_Handle *h, else { if (NULL == config) - proc = GNUNET_OS_start_process_s (GNUNET_NO, - std_inheritance, + proc = GNUNET_OS_start_process_s (std_inheritance, lsocks, loprefix, quotedbinary, @@ -761,8 +758,7 @@ start_arm_service (struct GNUNET_ARM_Handle *h, lopostfix, NULL); else - proc = GNUNET_OS_start_process_s (GNUNET_NO, - std_inheritance, + proc = GNUNET_OS_start_process_s (std_inheritance, lsocks, loprefix, quotedbinary, diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 5efd8b72b..00b6e7196 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c @@ -858,8 +858,9 @@ start_process (struct ServiceList *sl, * of ''-quoted strings, escaping should be considered. */ if (NULL != options) options = GNUNET_CONFIGURATION_expand_dollar (cfg, options); - sl->proc = GNUNET_OS_start_process_s (sl->pipe_control, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + sl->proc = GNUNET_OS_start_process_s (sl->pipe_control + ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL + : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, lsocks, loprefix, quotedbinary, @@ -880,8 +881,9 @@ start_process (struct ServiceList *sl, if (GNUNET_YES == use_debug) { if (NULL == sl->config) - sl->proc = GNUNET_OS_start_process_s (sl->pipe_control, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + sl->proc = GNUNET_OS_start_process_s (sl->pipe_control + ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL + : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, lsocks, loprefix, quotedbinary, @@ -890,8 +892,9 @@ start_process (struct ServiceList *sl, options, NULL); else - sl->proc = GNUNET_OS_start_process_s (sl->pipe_control, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + sl->proc = GNUNET_OS_start_process_s (sl->pipe_control + ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL + : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, lsocks, loprefix, quotedbinary, @@ -905,16 +908,18 @@ start_process (struct ServiceList *sl, else { if (NULL == sl->config) - sl->proc = GNUNET_OS_start_process_s (sl->pipe_control, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + sl->proc = GNUNET_OS_start_process_s (sl->pipe_control + ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL + : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, lsocks, loprefix, quotedbinary, options, NULL); else - sl->proc = GNUNET_OS_start_process_s (sl->pipe_control, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + sl->proc = GNUNET_OS_start_process_s (sl->pipe_control + ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL + : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, lsocks, loprefix, quotedbinary, diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index dda60215d..064964292 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c @@ -251,8 +251,8 @@ setup_peer (struct PeerContext *p, const char *cfgname) binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); - p->arm_proc = GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + p->arm_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index 136539ed3..debf808ca 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c @@ -419,8 +419,8 @@ setup_peer (struct PeerContext *p, binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); p->arm_proc - = GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, binary, "gnunet-service-arm", diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c index 3cbe50d72..007131134 100644 --- a/src/core/test_core_api_start_only.c +++ b/src/core/test_core_api_start_only.c @@ -118,8 +118,8 @@ setup_peer (struct PeerContext *p, binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); p->arm_proc = - GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, binary, "gnunet-service-arm", diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c index 67f8bb224..cf2da3d97 100644 --- a/src/core/test_core_quota_compliance.c +++ b/src/core/test_core_quota_compliance.c @@ -570,8 +570,8 @@ setup_peer (struct PeerContext *p, binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); p->arm_proc = - GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, binary, "gnunet-service-arm", diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c index ee4a719e0..41dfe781a 100644 --- a/src/fs/gnunet-auto-share.c +++ b/src/fs/gnunet-auto-share.c @@ -478,8 +478,7 @@ work (void *cls) argv[argc] = NULL; GNUNET_log (GNUNET_ERROR_TYPE_INFO, _ ("Publishing `%s'\n"), wi->filename); GNUNET_assert (NULL == publish_proc); - publish_proc = GNUNET_OS_start_process_vap (GNUNET_YES, - 0, + publish_proc = GNUNET_OS_start_process_vap (GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, diff --git a/src/gns/gnunet-gns-import.c b/src/gns/gnunet-gns-import.c index 3c95e782d..78db28cab 100644 --- a/src/gns/gnunet-gns-import.c +++ b/src/gns/gnunet-gns-import.c @@ -87,8 +87,7 @@ static int ret; static int -run_process_and_wait (int pipe_control, - enum GNUNET_OS_InheritStdioFlags std_inheritance, +run_process_and_wait (enum GNUNET_OS_InheritStdioFlags std_inheritance, struct GNUNET_DISK_PipeHandle *pipe_stdin, struct GNUNET_DISK_PipeHandle *pipe_stdout, enum GNUNET_OS_ProcessStatusType *st, @@ -120,7 +119,7 @@ run_process_and_wait (int pipe_control, va_end (apc2); if (arglen > 0) argp[-1] = '\0'; - p = GNUNET_OS_start_process_va (pipe_control, std_inheritance, + p = GNUNET_OS_start_process_va (std_inheritance, pipe_stdin, pipe_stdout, NULL, @@ -222,7 +221,7 @@ zone_iteration_error (void *cls) if (! found_private_rec) { - if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, "gnunet-namestore", "gnunet-namestore", "-z", "master-zone", @@ -236,7 +235,7 @@ zone_iteration_error (void *cls) } if (! found_pin_rec) { - if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, "gnunet-namestore", "gnunet-namestore", "-z", "master-zone", @@ -385,7 +384,8 @@ run (void *cls, char *const *args, const char *cfgfile, cfg = c; - if (0 != run_process_and_wait (GNUNET_NO, 0, NULL, NULL, &st, &code, + if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_NONE, + NULL, NULL, &st, &code, "gnunet-arm", "gnunet-arm", "-I", NULL)) { @@ -395,60 +395,60 @@ run (void *cls, char *const *args, const char *cfgfile, return; } - if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, "gnunet-identity", "gnunet-identity", "-C", "master-zone", NULL)) return; - if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, "gnunet-identity", "gnunet-identity", "-C", "private-zone", NULL)) return; - if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, "gnunet-identity", "gnunet-identity", "-C", "sks-zone", NULL)) return; - if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, "gnunet-identity", "gnunet-identity", "-e", "master-zone", "-s", "gns-master", NULL)) return; - if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, "gnunet-identity", "gnunet-identity", "-e", "master-zone", "-s", "namestore", NULL)) return; - if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, "gnunet-identity", "gnunet-identity", "-e", "master-zone", "-s", "gns-proxy", NULL)) return; - if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, "gnunet-identity", "gnunet-identity", "-e", "master-zone", "-s", "gns-intercept", NULL)) return; - if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, "gnunet-identity", "gnunet-identity", "-e", "private-zone", "-s", "gns-private", NULL)) return; - if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, &st, &code, "gnunet-identity", "gnunet-identity", "-e", "sks-zone", "-s", diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c index d10924eac..063db2f99 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist.c +++ b/src/hostlist/test_gnunet_daemon_hostlist.c @@ -136,8 +136,8 @@ setup_peer (struct PeerContext *p, const char *cfgname) binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); - p->arm_proc = GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + p->arm_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c index a50e7acc2..a0656f770 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c @@ -412,7 +412,8 @@ setup_learn_peer (struct PeerContext *p, binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); p->arm_proc = - GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, binary, "gnunet-service-arm", @@ -459,8 +460,8 @@ setup_adv_peer (struct PeerContext *p, binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); p->arm_proc = - GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, binary, "gnunet-service-arm", diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c index 657b85fd8..321f96f3d 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c @@ -105,8 +105,8 @@ setup_peer (struct PeerContext *p, const char *cfgname) binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); - p->arm_proc = GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + p->arm_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index 12aeec7f0..749f766d2 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h @@ -100,7 +100,12 @@ enum GNUNET_OS_InheritStdioFlags * Use this option to have all of the standard streams * (stdin, stdout and stderror) be inherited. */ - GNUNET_OS_INHERIT_STD_ALL = 7 + GNUNET_OS_INHERIT_STD_ALL = 7, + + /** + * Should a pipe be used to send signals to the child? + */ + GNUNET_OS_USE_PIPE_CONTROL = 8 }; @@ -455,7 +460,6 @@ GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); /** * Start a process. * - * @param pipe_control should a pipe be used to send signals to the child? * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags * @param pipe_stdin pipe to use to send input to child process (or NULL) * @param pipe_stdout pipe to use to get output from child process (or NULL) @@ -465,8 +469,7 @@ GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); * @return pointer to process structure of the new process, NULL on error */ struct GNUNET_OS_Process * -GNUNET_OS_start_process_vap (int pipe_control, - enum GNUNET_OS_InheritStdioFlags std_inheritance, +GNUNET_OS_start_process_vap (enum GNUNET_OS_InheritStdioFlags std_inheritance, struct GNUNET_DISK_PipeHandle *pipe_stdin, struct GNUNET_DISK_PipeHandle *pipe_stdout, struct GNUNET_DISK_PipeHandle *pipe_stderr, @@ -477,7 +480,6 @@ GNUNET_OS_start_process_vap (int pipe_control, /** * Start a process. * - * @param pipe_control should a pipe be used to send signals to the child? * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags * @param pipe_stdin pipe to use to send input to child process (or NULL) * @param pipe_stdout pipe to use to get output from child process (or NULL) @@ -487,8 +489,7 @@ GNUNET_OS_start_process_vap (int pipe_control, * @return pointer to process structure of the new process, NULL on error */ struct GNUNET_OS_Process * -GNUNET_OS_start_process (int pipe_control, - enum GNUNET_OS_InheritStdioFlags std_inheritance, +GNUNET_OS_start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance, struct GNUNET_DISK_PipeHandle *pipe_stdin, struct GNUNET_DISK_PipeHandle *pipe_stdout, struct GNUNET_DISK_PipeHandle *pipe_stderr, @@ -498,7 +499,6 @@ GNUNET_OS_start_process (int pipe_control, /** * Start a process. * - * @param pipe_control should a pipe be used to send signals to the child? * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags * @param pipe_stdin pipe to use to send input to child process (or NULL) * @param pipe_stdout pipe to use to get output from child process (or NULL) @@ -508,8 +508,7 @@ GNUNET_OS_start_process (int pipe_control, * @return pointer to process structure of the new process, NULL on error */ struct GNUNET_OS_Process * -GNUNET_OS_start_process_va (int pipe_control, - enum GNUNET_OS_InheritStdioFlags std_inheritance, +GNUNET_OS_start_process_va (enum GNUNET_OS_InheritStdioFlags std_inheritance, struct GNUNET_DISK_PipeHandle *pipe_stdin, struct GNUNET_DISK_PipeHandle *pipe_stdout, struct GNUNET_DISK_PipeHandle *pipe_stderr, @@ -518,7 +517,6 @@ GNUNET_OS_start_process_va (int pipe_control, /** * Start a process. * - * @param pipe_control should a pipe be used to send signals to the child? * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags * @param lsocks array of listen sockets to dup systemd-style (or NULL); * must be NULL on platforms where dup is not supported @@ -528,8 +526,7 @@ GNUNET_OS_start_process_va (int pipe_control, * @return pointer to process structure of the new process, NULL on error */ struct GNUNET_OS_Process * -GNUNET_OS_start_process_v (int pipe_control, - enum GNUNET_OS_InheritStdioFlags std_inheritance, +GNUNET_OS_start_process_v (enum GNUNET_OS_InheritStdioFlags std_inheritance, const int *lsocks, const char *filename, char *const argv[]); @@ -542,7 +539,6 @@ GNUNET_OS_start_process_v (int pipe_control, * in the order they appear. Arguments containing spaces can be used by * quoting them with @em ". * - * @param pipe_control should a pipe be used to send signals to the child? * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags * @param lsocks array of listen sockets to dup systemd-style (or NULL); * must be NULL on platforms where dup is not supported @@ -554,8 +550,7 @@ GNUNET_OS_start_process_v (int pipe_control, * @return pointer to process structure of the new process, NULL on error */ struct GNUNET_OS_Process * -GNUNET_OS_start_process_s (int pipe_control, - enum GNUNET_OS_InheritStdioFlags std_inheritance, +GNUNET_OS_start_process_s (enum GNUNET_OS_InheritStdioFlags std_inheritance, const int *lsocks, const char *filename, ...); diff --git a/src/nat/gnunet-service-nat_helper.c b/src/nat/gnunet-service-nat_helper.c index 58d7b4c61..80d3559f3 100644 --- a/src/nat/gnunet-service-nat_helper.c +++ b/src/nat/gnunet-service-nat_helper.c @@ -234,8 +234,7 @@ restart_nat_server (void *cls) "Starting `%s' at `%s'\n", "gnunet-helper-nat-server", ia); - h->server_proc = GNUNET_OS_start_process (GNUNET_NO, - 0, + h->server_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_NONE, NULL, h->server_stdout, NULL, @@ -378,8 +377,7 @@ GN_request_connection_reversal (const struct in_addr *internal_address, remv4, internal_port); binary = GNUNET_OS_get_suid_binary_path (cfg, "gnunet-helper-nat-client"); - proc = GNUNET_OS_start_process (GNUNET_NO, - 0, + proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_NONE, NULL, NULL, NULL, diff --git a/src/nat/gnunet-service-nat_mini.c b/src/nat/gnunet-service-nat_mini.c index ae94e3f5b..b98255ad2 100644 --- a/src/nat/gnunet-service-nat_mini.c +++ b/src/nat/gnunet-service-nat_mini.c @@ -199,8 +199,7 @@ GNUNET_NAT_mini_get_external_ipv4_ (GNUNET_NAT_IPCallback cb, void *cb_cls) eh->task = GNUNET_SCHEDULER_add_now (&signal_external_ip_error, eh); return eh; } - eh->eip = GNUNET_OS_start_process (GNUNET_NO, - 0, + eh->eip = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_NONE, NULL, eh->opipe, NULL, diff --git a/src/nat/test_nat_test.c b/src/nat/test_nat_test.c index 43998c97c..2abab4d5f 100644 --- a/src/nat/test_nat_test.c +++ b/src/nat/test_nat_test.c @@ -117,8 +117,8 @@ main (int argc, char *const argv[]) return 0; } - gns = GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + gns = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, "gnunet-nat-server", "gnunet-nat-server", diff --git a/src/nat/test_stun.c b/src/nat/test_stun.c index a41734af1..75eb877b3 100644 --- a/src/nat/test_stun.c +++ b/src/nat/test_stun.c @@ -277,8 +277,8 @@ main (int argc, char *const argv[]) /* Lets start resolver */ fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); - proc = GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, fn, "gnunet-service-resolver", diff --git a/src/pq/pq_connect.c b/src/pq/pq_connect.c index 405dca174..e3a610922 100644 --- a/src/pq/pq_connect.c +++ b/src/pq/pq_connect.c @@ -162,8 +162,7 @@ apply_patch (struct GNUNET_PQ_Context *db, "Applying SQL file `%s' on database %s\n", buf, db->config_str); - psql = GNUNET_OS_start_process (GNUNET_NO, - GNUNET_OS_INHERIT_STD_NONE, + psql = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_NONE, NULL, NULL, NULL, diff --git a/src/statistics/test_statistics_api.c b/src/statistics/test_statistics_api.c index fcdeccad6..c9e568870 100644 --- a/src/statistics/test_statistics_api.c +++ b/src/statistics/test_statistics_api.c @@ -197,8 +197,8 @@ main (int argc, char *argv_ign[]) NULL); binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); proc = - GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, binary, "gnunet-service-statistics", @@ -225,8 +225,8 @@ main (int argc, char *argv_ign[]) ok = 1; /* restart to check persistence! */ proc = - GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, binary, "gnunet-service-statistics", diff --git a/src/statistics/test_statistics_api_loop.c b/src/statistics/test_statistics_api_loop.c index 50507bdc4..ad273287d 100644 --- a/src/statistics/test_statistics_api_loop.c +++ b/src/statistics/test_statistics_api_loop.c @@ -98,7 +98,8 @@ main (int argc, char *argv_ign[]) binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); proc = - GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, binary, "gnunet-service-statistics", diff --git a/src/statistics/test_statistics_api_watch.c b/src/statistics/test_statistics_api_watch.c index 06e639599..2d9d08305 100644 --- a/src/statistics/test_statistics_api_watch.c +++ b/src/statistics/test_statistics_api_watch.c @@ -130,7 +130,8 @@ main (int argc, char *argv_ign[]) binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); proc = - GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, binary, "gnunet-service-statistics", diff --git a/src/statistics/test_statistics_api_watch_zero_value.c b/src/statistics/test_statistics_api_watch_zero_value.c index 80ca57c18..cb2694f8f 100644 --- a/src/statistics/test_statistics_api_watch_zero_value.c +++ b/src/statistics/test_statistics_api_watch_zero_value.c @@ -168,7 +168,8 @@ main (int argc, char *argv_ign[]) binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); proc = - GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, binary, "gnunet-service-statistics", diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c index 24c212d6b..03be376fe 100644 --- a/src/testbed/gnunet-helper-testbed.c +++ b/src/testbed/gnunet-helper-testbed.c @@ -57,12 +57,6 @@ #define LOG_DEBUG(...) LOG (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__) -/** - * We need pipe control only on WINDOWS - */ -#define PIPE_CONTROL GNUNET_NO - - /** * Context for a single write on a chunk of memory */ @@ -435,8 +429,7 @@ tokenizer_cb (void *cls, const struct GNUNET_MessageHeader *message) see putenv(): becomes part of envrionment! */ evstr = NULL; } - testbed = GNUNET_OS_start_process (PIPE_CONTROL, - GNUNET_OS_INHERIT_STD_ERR /*verbose? */, + testbed = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR /*verbose? */, NULL, NULL, NULL, diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index f7352250d..152762280 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c @@ -1384,8 +1384,7 @@ GNUNET_TESTBED_is_host_habitable ( join_argv ((const char **) rsh_args, (const char **) rsh_suffix_args); free_argv (rsh_suffix_args); free_argv (rsh_args); - h->auxp = GNUNET_OS_start_process_vap (GNUNET_NO, - GNUNET_OS_INHERIT_STD_ERR, + h->auxp = GNUNET_OS_start_process_vap (GNUNET_OS_INHERIT_STD_ERR, NULL, NULL, NULL, diff --git a/src/testing/testing.c b/src/testing/testing.c index 0ca4c3063..9724fb55b 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -37,12 +37,6 @@ #define LOG(kind, ...) GNUNET_log_from (kind, "testing-api", __VA_ARGS__) -/** - * We need pipe control only on WINDOWS - */ -#define PIPE_CONTROL GNUNET_NO - - /** * Lowest port used for GNUnet testing. Should be high enough to not * conflict with other applications running on the hosts but be low @@ -492,8 +486,7 @@ start_shared_service_instance (struct SharedServiceInstance *i) (void) GNUNET_asprintf (&binary, "gnunet-service-%s", i->ss->sname); libexec_binary = GNUNET_OS_get_libexec_binary_path (binary); GNUNET_free (binary); - i->proc = GNUNET_OS_start_process (PIPE_CONTROL, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + i->proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, NULL, @@ -1378,8 +1371,7 @@ GNUNET_TESTING_peer_start (struct GNUNET_TESTING_Peer *peer) peer->main_binary = GNUNET_CONFIGURATION_expand_dollar (peer->cfg, peer->main_binary); peer->main_process = - GNUNET_OS_start_process_s (PIPE_CONTROL, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + GNUNET_OS_start_process_s (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, peer->main_binary, peer->args, diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 514f7fd1f..d1b21ba9c 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c @@ -2188,7 +2188,7 @@ server_load_certificate (struct HTTP_Server_Plugin *plugin) "No usable TLS certificate found, creating certificate\n"); errno = 0; cert_creation = - GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, NULL, "gnunet-transport-certificate-creation", "gnunet-transport-certificate-creation", diff --git a/src/transport/transport-testing2.c b/src/transport/transport-testing2.c index 0dc1bb331..2a7a1dfcb 100644 --- a/src/transport/transport-testing2.c +++ b/src/transport/transport-testing2.c @@ -915,8 +915,8 @@ communicator_start ( LOG (GNUNET_ERROR_TYPE_DEBUG, "communicator_start\n"); binary = GNUNET_OS_get_libexec_binary_path (binary_name); - tc_h->c_proc = GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + tc_h->c_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, @@ -967,8 +967,8 @@ resolver_start (struct LOG (GNUNET_ERROR_TYPE_DEBUG, "resolver_start\n"); binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); - tc_h->resolver_proc = GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + tc_h->resolver_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, @@ -999,8 +999,8 @@ nat_start ( LOG (GNUNET_ERROR_TYPE_DEBUG, "nat_start\n"); binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-nat"); - tc_h->nat_proc = GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + tc_h->nat_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c index cd23c3a9c..84a3184bc 100644 --- a/src/util/gnunet-qr.c +++ b/src/util/gnunet-qr.c @@ -192,8 +192,7 @@ gnunet_uri (void *cls, GNUNET_array_append (argv, argc, NULL); - p = GNUNET_OS_start_process_vap (GNUNET_NO, - GNUNET_OS_INHERIT_STD_ALL, + p = GNUNET_OS_start_process_vap (GNUNET_OS_INHERIT_STD_ALL, NULL, NULL, NULL, diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c index 48c46ee49..f8754a6d1 100644 --- a/src/util/gnunet-uri.c +++ b/src/util/gnunet-uri.c @@ -115,8 +115,7 @@ run (void *cls, GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ), &maint_child_death, NULL); - p = GNUNET_OS_start_process (GNUNET_NO, - 0, + p = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_NONE, NULL, NULL, NULL, diff --git a/src/util/helper.c b/src/util/helper.c index 8c8fb7b6a..7985f2eca 100644 --- a/src/util/helper.c +++ b/src/util/helper.c @@ -422,8 +422,9 @@ start_helper (struct GNUNET_HELPER_Handle *h) GNUNET_DISK_pipe_handle (h->helper_out, GNUNET_DISK_PIPE_END_READ); h->fh_to_helper = GNUNET_DISK_pipe_handle (h->helper_in, GNUNET_DISK_PIPE_END_WRITE); - h->helper_proc = GNUNET_OS_start_process_vap (h->with_control_pipe, - GNUNET_OS_INHERIT_STD_ERR, + h->helper_proc = GNUNET_OS_start_process_vap (h->with_control_pipe + ? GNUNET_OS_INHERIT_STD_ERR | GNUNET_OS_USE_PIPE_CONTROL + : GNUNET_OS_INHERIT_STD_ERR, h->helper_in, h->helper_out, NULL, diff --git a/src/util/os_priority.c b/src/util/os_priority.c index 7f3be2a80..2f86f792f 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c @@ -326,7 +326,6 @@ open_dev_null (int target_fd, int flags) /** * Start a process. * - * @param pipe_control should a pipe be used to send signals to the child? * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags controlling which * std handles of the parent are inherited by the child. * pipe_stdin and pipe_stdout take priority over std_inheritance @@ -341,8 +340,7 @@ open_dev_null (int target_fd, int flags) * @return process ID of the new process, -1 on error */ static struct GNUNET_OS_Process * -start_process (int pipe_control, - enum GNUNET_OS_InheritStdioFlags std_inheritance, +start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance, struct GNUNET_DISK_PipeHandle *pipe_stdin, struct GNUNET_DISK_PipeHandle *pipe_stdout, struct GNUNET_DISK_PipeHandle *pipe_stderr, @@ -373,7 +371,7 @@ start_process (int pipe_control, if (GNUNET_SYSERR == GNUNET_OS_check_helper_binary (filename, GNUNET_NO, NULL)) return NULL; /* not executable */ - if (GNUNET_YES == pipe_control) + if (0 != (std_inheritance & GNUNET_OS_USE_PIPE_CONTROL)) { struct GNUNET_DISK_PipeHandle *childpipe; int dup_childpipe_read_fd = -1; @@ -486,7 +484,7 @@ start_process (int pipe_control, gnunet_proc = GNUNET_new (struct GNUNET_OS_Process); gnunet_proc->pid = ret; gnunet_proc->control_pipe = childpipe_write; - if (GNUNET_YES == pipe_control) + if (0 != (std_inheritance & GNUNET_OS_USE_PIPE_CONTROL)) { close (childpipe_read_fd); } @@ -594,7 +592,6 @@ start_process (int pipe_control, /** * Start a process. * - * @param pipe_control should a pipe be used to send signals to the child? * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags * @param pipe_stdin pipe to use to send input to child process (or NULL) * @param pipe_stdout pipe to use to get output from child process (or NULL) @@ -604,16 +601,14 @@ start_process (int pipe_control, * @return pointer to process structure of the new process, NULL on error */ struct GNUNET_OS_Process * -GNUNET_OS_start_process_vap (int pipe_control, - enum GNUNET_OS_InheritStdioFlags std_inheritance, +GNUNET_OS_start_process_vap (enum GNUNET_OS_InheritStdioFlags std_inheritance, struct GNUNET_DISK_PipeHandle *pipe_stdin, struct GNUNET_DISK_PipeHandle *pipe_stdout, struct GNUNET_DISK_PipeHandle *pipe_stderr, const char *filename, char *const argv[]) { - return start_process (pipe_control, - std_inheritance, + return start_process (std_inheritance, pipe_stdin, pipe_stdout, pipe_stderr, @@ -626,7 +621,6 @@ GNUNET_OS_start_process_vap (int pipe_control, /** * Start a process. * - * @param pipe_control should a pipe be used to send signals to the child? * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags * @param pipe_stdin pipe to use to send input to child process (or NULL) * @param pipe_stdout pipe to use to get output from child process (or NULL) @@ -636,8 +630,7 @@ GNUNET_OS_start_process_vap (int pipe_control, * @return pointer to process structure of the new process, NULL on error */ struct GNUNET_OS_Process * -GNUNET_OS_start_process_va (int pipe_control, - enum GNUNET_OS_InheritStdioFlags std_inheritance, +GNUNET_OS_start_process_va (enum GNUNET_OS_InheritStdioFlags std_inheritance, struct GNUNET_DISK_PipeHandle *pipe_stdin, struct GNUNET_DISK_PipeHandle *pipe_stdout, struct GNUNET_DISK_PipeHandle *pipe_stderr, @@ -660,8 +653,7 @@ GNUNET_OS_start_process_va (int pipe_control, while (NULL != (argv[argc] = va_arg (ap, char *))) argc++; va_end (ap); - ret = GNUNET_OS_start_process_vap (pipe_control, - std_inheritance, + ret = GNUNET_OS_start_process_vap (std_inheritance, pipe_stdin, pipe_stdout, pipe_stderr, @@ -675,7 +667,6 @@ GNUNET_OS_start_process_va (int pipe_control, /** * Start a process. * - * @param pipe_control should a pipe be used to send signals to the child? * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags * @param pipe_stdin pipe to use to send input to child process (or NULL) * @param pipe_stdout pipe to use to get output from child process (or NULL) @@ -684,8 +675,7 @@ GNUNET_OS_start_process_va (int pipe_control, * @return pointer to process structure of the new process, NULL on error */ struct GNUNET_OS_Process * -GNUNET_OS_start_process (int pipe_control, - enum GNUNET_OS_InheritStdioFlags std_inheritance, +GNUNET_OS_start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance, struct GNUNET_DISK_PipeHandle *pipe_stdin, struct GNUNET_DISK_PipeHandle *pipe_stdout, struct GNUNET_DISK_PipeHandle *pipe_stderr, @@ -696,8 +686,7 @@ GNUNET_OS_start_process (int pipe_control, va_list ap; va_start (ap, filename); - ret = GNUNET_OS_start_process_va (pipe_control, - std_inheritance, + ret = GNUNET_OS_start_process_va (std_inheritance, pipe_stdin, pipe_stdout, pipe_stderr, @@ -711,7 +700,6 @@ GNUNET_OS_start_process (int pipe_control, /** * Start a process. * - * @param pipe_control should a pipe be used to send signals to the child? * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags controlling which * std handles of the parent are inherited by the child. * pipe_stdin and pipe_stdout take priority over std_inheritance @@ -723,14 +711,12 @@ GNUNET_OS_start_process (int pipe_control, * @return process ID of the new process, -1 on error */ struct GNUNET_OS_Process * -GNUNET_OS_start_process_v (int pipe_control, - enum GNUNET_OS_InheritStdioFlags std_inheritance, +GNUNET_OS_start_process_v (enum GNUNET_OS_InheritStdioFlags std_inheritance, const int *lsocks, const char *filename, char *const argv[]) { - return start_process (pipe_control, - std_inheritance, + return start_process (std_inheritance, NULL, NULL, NULL, @@ -747,7 +733,6 @@ GNUNET_OS_start_process_v (int pipe_control, * in the order they appear. Arguments containing spaces can be used by * quoting them with @em ". * - * @param pipe_control should a pipe be used to send signals to the child? * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags * @param lsocks array of listen sockets to dup systemd-style (or NULL); * must be NULL on platforms where dup is not supported @@ -759,8 +744,7 @@ GNUNET_OS_start_process_v (int pipe_control, * @return pointer to process structure of the new process, NULL on error */ struct GNUNET_OS_Process * -GNUNET_OS_start_process_s (int pipe_control, - enum GNUNET_OS_InheritStdioFlags std_inheritance, +GNUNET_OS_start_process_s (enum GNUNET_OS_InheritStdioFlags std_inheritance, const int *lsocks, const char *filename, ...) @@ -869,8 +853,7 @@ GNUNET_OS_start_process_s (int pipe_control, } } binary_path = argv[0]; - proc = GNUNET_OS_start_process_v (pipe_control, - std_inheritance, + proc = GNUNET_OS_start_process_v (std_inheritance, lsocks, binary_path, argv); @@ -1175,7 +1158,12 @@ GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, va_start (ap, binary); /* redirect stdout, don't inherit stderr/stdin */ eip = - GNUNET_OS_start_process_va (GNUNET_NO, 0, NULL, opipe, NULL, binary, ap); + GNUNET_OS_start_process_va (GNUNET_OS_INHERIT_STD_NONE, + NULL, + opipe, + NULL, + binary, + ap); va_end (ap); if (NULL == eip) { diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c index e6d83d52c..ce1cdadd6 100644 --- a/src/util/test_common_logging_runtime_loglevels.c +++ b/src/util/test_common_logging_runtime_loglevels.c @@ -403,7 +403,7 @@ runone () break; } - proc = GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, pipe_stdout, NULL, "./test_common_logging_dummy", "test_common_logging_dummy", NULL); diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c index 2bdca5c9d..6d4a131bb 100644 --- a/src/util/test_os_start_process.c +++ b/src/util/test_os_start_process.c @@ -138,7 +138,7 @@ run_task (void *cls) } proc = - GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR, hello_pipe_stdin, hello_pipe_stdout, NULL, fn, "test_gnunet_echo_hello", "-", NULL); @@ -212,7 +212,8 @@ check_kill () } fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); proc = - GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR + | GNUNET_OS_USE_PIPE_CONTROL, hello_pipe_stdin, hello_pipe_stdout, NULL, @@ -256,7 +257,8 @@ check_instant_kill () } fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); proc = - GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, + GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR + | GNUNET_OS_USE_PIPE_CONTROL, hello_pipe_stdin, hello_pipe_stdout, NULL, fn, "gnunet-service-resolver", "-", NULL); diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c index 05716741e..eefb20890 100644 --- a/src/util/test_resolver_api.c +++ b/src/util/test_resolver_api.c @@ -348,8 +348,8 @@ main (int argc, char *argv[]) "WARNING", NULL); fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); - proc = GNUNET_OS_start_process (GNUNET_YES, - GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, NULL, NULL, NULL, fn, "gnunet-service-resolver", -- cgit v1.2.3 From 7f4ddbcab8598e3d5e29c23ce883cdfa664408f1 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 18 Jul 2020 00:44:39 +0200 Subject: merge flags into enum for GNUNET_DISK_pipe() API, fixing #6188 --- src/abd/gnunet-abd.c | 31 ++++--- src/abd/plugin_gnsrecord_abd.c | 3 +- src/arm/arm_api.c | 5 +- src/arm/gnunet-service-arm.c | 33 ++++--- src/cadet/cadet.h | 4 +- src/cadet/cadet_api.c | 4 +- src/cadet/cadet_api_drop_message.c | 16 ++-- src/cadet/cadet_protocol.h | 4 +- src/cadet/gnunet-service-cadet.c | 100 +++++++++++---------- src/cadet/gnunet-service-cadet.h | 1 - src/cadet/gnunet-service-cadet_channel.c | 28 +++--- src/cadet/gnunet-service-cadet_connection.c | 3 +- src/cadet/gnunet-service-cadet_core.c | 6 +- src/cadet/gnunet-service-cadet_peer.c | 2 + src/cadet/gnunet-service-cadet_tunnels.c | 2 +- src/cadet/gnunet-service-cadet_tunnels.h | 2 +- src/cadet/test_cadet.c | 11 ++- src/conversation/test_conversation_api.c | 6 +- src/conversation/test_conversation_api_reject.c | 6 +- src/conversation/test_conversation_api_twocalls.c | 6 +- src/curl/curl.c | 8 +- src/fs/fs_namespace.c | 22 ++--- src/fs/gnunet-auto-share.c | 11 +-- src/gns/gns_api.c | 1 + src/gns/gnunet-dns2gns.c | 2 + src/gns/nss/nss_gns.c | 2 +- src/gns/nss/nss_gns_query.c | 2 +- src/gnsrecord/gnsrecord.c | 8 +- src/hostlist/gnunet-daemon-hostlist_client.c | 20 +++-- src/identity/gnunet-identity.c | 6 +- src/identity/plugin_rest_identity.c | 3 +- src/include/gnunet_bio_lib.h | 35 ++++---- src/include/gnunet_buffer_lib.h | 2 +- src/include/gnunet_common.h | 38 ++++---- src/include/gnunet_configuration_lib.h | 2 +- src/include/gnunet_constants.h | 3 +- src/include/gnunet_container_lib.h | 52 +++++------ src/include/gnunet_curl_lib.h | 2 +- src/include/gnunet_disk_lib.h | 46 +++++++--- src/include/gnunet_mq_lib.h | 6 +- src/include/gnunet_reclaim_lib.h | 2 +- src/include/gnunet_reclaim_plugin.h | 6 +- src/include/gnunet_reclaim_service.h | 6 +- src/include/platform.h | 4 +- src/json/json_generator.c | 4 +- src/json/json_gnsrecord.c | 4 +- src/namestore/gnunet-namestore.c | 3 +- src/namestore/gnunet-service-namestore.c | 2 +- src/namestore/plugin_rest_namestore.c | 54 ++++++----- src/nat/gnunet-service-nat_helper.c | 2 +- src/nat/gnunet-service-nat_mini.c | 2 +- src/reclaim/gnunet-service-reclaim_tickets.c | 2 +- src/reclaim/json_reclaim.h | 1 - src/reclaim/plugin_reclaim_attribute_basic.c | 1 + src/reclaim/plugin_rest_reclaim.c | 5 +- src/reclaim/reclaim_attestation.c | 2 +- src/reclaim/reclaim_attribute.c | 3 +- src/revocation/gnunet-revocation-tvg.c | 19 ++-- src/revocation/revocation_api.c | 8 +- src/rps/gnunet-rps-profiler.c | 6 +- src/rps/test_rps.c | 6 +- src/set/gnunet-service-set_intersection.c | 2 +- .../gnunet-service-set_union_strata_estimator.c | 4 +- src/statistics/gnunet-service-statistics.c | 3 +- src/testbed/generate-underlay-topology.c | 12 +-- src/testbed/gnunet-daemon-latency-logger.c | 4 +- src/testbed/gnunet-daemon-testbed-underlay.c | 4 +- src/testbed/gnunet-helper-testbed.c | 2 +- src/testbed/gnunet-service-testbed.h | 2 +- src/testbed/gnunet_testbed_mpi_spawn.c | 3 +- src/testbed/test_testbed_api.c | 2 +- src/testbed/test_testbed_api_2peers_1controller.c | 2 +- src/testbed/test_testbed_api_controllerlink.c | 2 +- .../test_testbed_api_peer_reconfiguration.c | 2 +- .../test_testbed_api_peers_manage_services.c | 2 +- src/testbed/test_testbed_api_statistics.c | 2 +- src/testbed/test_testbed_api_test.c | 4 +- src/testbed/testbed_api_hosts.c | 2 +- src/transport/gnunet-communicator-tcp.c | 19 +++- src/transport/gnunet-communicator-udp.c | 3 +- src/transport/gnunet-communicator-unix.c | 5 +- src/transport/plugin_transport_smtp.c | 6 +- src/transport/test_communicator_basic.c | 54 +++++------ src/transport/transport-testing2.c | 28 +++--- src/transport/transport.h | 1 - src/transport/transport_api2_communication.c | 3 +- src/util/bio.c | 41 ++++----- src/util/configuration.c | 7 +- src/util/crypto_ecc.c | 10 +-- src/util/crypto_hash.c | 4 +- src/util/crypto_mpi.c | 4 +- src/util/disk.c | 44 ++++----- src/util/gnunet-qr.c | 7 +- src/util/gnunet-uri.c | 2 +- src/util/helper.c | 7 +- src/util/os_priority.c | 4 +- src/util/perf_malloc.c | 4 +- src/util/perf_scheduler.c | 4 +- src/util/scheduler.c | 5 +- src/util/service.c | 4 +- src/util/strings.c | 2 +- src/util/test_bio.c | 14 +-- src/util/test_common_logging_runtime_loglevels.c | 5 +- src/util/test_container_multihashmap.c | 2 +- src/util/test_container_multipeermap.c | 2 +- src/util/test_scheduler.c | 2 +- 106 files changed, 556 insertions(+), 477 deletions(-) (limited to 'src') diff --git a/src/abd/gnunet-abd.c b/src/abd/gnunet-abd.c index 963d9207a..ff7dd09c5 100644 --- a/src/abd/gnunet-abd.c +++ b/src/abd/gnunet-abd.c @@ -513,8 +513,8 @@ get_existing_record (void *cls, const struct GNUNET_GNSRECORD_Data *rd) { struct GNUNET_GNSRECORD_Data *rde; - struct GNUNET_GNSRECORD_Data* rdn = - GNUNET_malloc(sizeof(*rdn)*(rd_count + 1)); + struct GNUNET_GNSRECORD_Data*rdn = + GNUNET_malloc (sizeof(*rdn) * (rd_count + 1)); memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data)); GNUNET_memcpy (&rdn[1], rd, @@ -541,7 +541,7 @@ get_existing_record (void *cls, rde, &add_continuation, &add_qe); - GNUNET_free(rdn); + GNUNET_free (rdn); return; } @@ -604,13 +604,18 @@ store_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego) if (GNUNET_OK != GNUNET_GNSRECORD_string_to_value (type, subject, &data, &data_size)) { - if(typestring == NULL) { - fputs("No value for unknown record type\n", stderr); - } else if(subject == NULL) { - fprintf(stderr, - "No value for record type`%s'\n", - typestring); - } else { + if (typestring == NULL) + { + fputs ("No value for unknown record type\n", stderr); + } + else if (subject == NULL) + { + fprintf (stderr, + "No value for record type`%s'\n", + typestring); + } + else + { fprintf (stderr, "Value `%s' invalid for record type `%s'\n", subject, @@ -927,8 +932,8 @@ run (void *cls, int i; while (NULL != (tok = strtok (NULL, ","))) count++; - struct GNUNET_ABD_Delegate* delegates = - GNUNET_malloc(sizeof(*delegates)*count); + struct GNUNET_ABD_Delegate*delegates = + GNUNET_malloc (sizeof(*delegates) * count); struct GNUNET_ABD_Delegate *dele; GNUNET_free (tmp); tmp = GNUNET_strdup (subject_delegate); @@ -961,7 +966,7 @@ run (void *cls, delegates[i].issuer_attribute = NULL; } GNUNET_free (tmp); - GNUNET_free(delegates); + GNUNET_free (delegates); } else { diff --git a/src/abd/plugin_gnsrecord_abd.c b/src/abd/plugin_gnsrecord_abd.c index 850fa9a45..272872e24 100644 --- a/src/abd/plugin_gnsrecord_abd.c +++ b/src/abd/plugin_gnsrecord_abd.c @@ -235,7 +235,8 @@ abd_string_to_value (void *cls, (char *) &sets[1]); for (i = 0; i < entries; i++) { - if (0 != set[i].subject_attribute_len) { + if (0 != set[i].subject_attribute_len) + { GNUNET_free_nz ((char *) set[i].subject_attribute); set[i].subject_attribute = NULL; } diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c index dea7a70be..899b6f152 100644 --- a/src/arm/arm_api.c +++ b/src/arm/arm_api.c @@ -972,10 +972,7 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h, the above check should catch 99.99% of the cases where ARM is already running. */LOG (GNUNET_ERROR_TYPE_DEBUG, "Starting ARM service\n"); - if (NULL == (sig = GNUNET_DISK_pipe (GNUNET_NO, - GNUNET_NO, - GNUNET_NO, - GNUNET_YES))) + if (NULL == (sig = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE))) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "pipe"); diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 00b6e7196..263c99cc4 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c @@ -859,7 +859,8 @@ start_process (struct ServiceList *sl, if (NULL != options) options = GNUNET_CONFIGURATION_expand_dollar (cfg, options); sl->proc = GNUNET_OS_start_process_s (sl->pipe_control - ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL + ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, lsocks, loprefix, @@ -882,8 +883,11 @@ start_process (struct ServiceList *sl, { if (NULL == sl->config) sl->proc = GNUNET_OS_start_process_s (sl->pipe_control - ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL - : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + ? + GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL + : + GNUNET_OS_INHERIT_STD_OUT_AND_ERR, lsocks, loprefix, quotedbinary, @@ -893,8 +897,11 @@ start_process (struct ServiceList *sl, NULL); else sl->proc = GNUNET_OS_start_process_s (sl->pipe_control - ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL - : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + ? + GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL + : + GNUNET_OS_INHERIT_STD_OUT_AND_ERR, lsocks, loprefix, quotedbinary, @@ -909,8 +916,11 @@ start_process (struct ServiceList *sl, { if (NULL == sl->config) sl->proc = GNUNET_OS_start_process_s (sl->pipe_control - ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL - : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + ? + GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL + : + GNUNET_OS_INHERIT_STD_OUT_AND_ERR, lsocks, loprefix, quotedbinary, @@ -918,8 +928,11 @@ start_process (struct ServiceList *sl, NULL); else sl->proc = GNUNET_OS_start_process_s (sl->pipe_control - ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL - : GNUNET_OS_INHERIT_STD_OUT_AND_ERR, + ? + GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL + : + GNUNET_OS_INHERIT_STD_OUT_AND_ERR, lsocks, loprefix, quotedbinary, @@ -2157,7 +2170,7 @@ main (int argc, char *const *argv) GNUNET_MQ_handler_end () }; - sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO); + sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE); GNUNET_assert (NULL != sigpipe); shc_chld = GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, diff --git a/src/cadet/cadet.h b/src/cadet/cadet.h index d17eab1d6..31dad4117 100644 --- a/src/cadet/cadet.h +++ b/src/cadet/cadet.h @@ -325,7 +325,7 @@ struct GNUNET_CADET_RequestDropCadetMessage * Type: #GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE */ struct GNUNET_MessageHeader header; - + /** * Type of the message this handler covers, in host byte order. */ @@ -337,7 +337,7 @@ struct GNUNET_CADET_RequestDropCadetMessage struct GNUNET_CADET_ClientChannelNumber ccn; }; - + /** * Message to inform the client about channels in the service. */ diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c index 67f6571c5..45cc508a6 100644 --- a/src/cadet/cadet_api.c +++ b/src/cadet/cadet_api.c @@ -1001,8 +1001,8 @@ GNUNET_CADET_open_port (struct GNUNET_CADET_Handle *h, p->window_changes = window_changes; p->disconnects = disconnects; p->handlers = (NULL == pd->agpl_url) - ? GNUNET_MQ_copy_handlers (handlers) - : GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL); + ? GNUNET_MQ_copy_handlers (handlers) + : GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL); GNUNET_assert (GNUNET_OK == open_port_cb (h, &p->id, p)); return p; diff --git a/src/cadet/cadet_api_drop_message.c b/src/cadet/cadet_api_drop_message.c index d9f7e003e..2b031b5c0 100644 --- a/src/cadet/cadet_api_drop_message.c +++ b/src/cadet/cadet_api_drop_message.c @@ -11,7 +11,7 @@ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. - + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . @@ -35,8 +35,8 @@ */ void GNUNET_CADET_drop_message (struct GNUNET_MQ_Handle *mq, - struct GNUNET_CADET_ClientChannelNumber ccn, - uint16_t type) + struct GNUNET_CADET_ClientChannelNumber ccn, + uint16_t type) { struct GNUNET_CADET_RequestDropCadetMessage *message; struct GNUNET_MQ_Envelope *env; @@ -45,15 +45,15 @@ GNUNET_CADET_drop_message (struct GNUNET_MQ_Handle *mq, message->ccn = ccn; message->type = type; - + GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Dropping message for channel of type %s (%d)\n", type == GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY ? "GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY" : "UNKNOWN", type); + "Dropping message for channel of type %s (%d)\n", type == + GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY ? + "GNUNET_MESSAGE_TYPE_CADET_CHANNEL_DESTROY" : "UNKNOWN", type); GNUNET_MQ_send (mq, env); - -} - +} /* end of cadet_api_drop_message.c */ diff --git a/src/cadet/cadet_protocol.h b/src/cadet/cadet_protocol.h index 08298e224..117a7922e 100644 --- a/src/cadet/cadet_protocol.h +++ b/src/cadet/cadet_protocol.h @@ -85,11 +85,11 @@ struct GNUNET_CADET_ConnectionCreateMessage uint32_t options GNUNET_PACKED; /** - * This flag indicates the peer sending the connection create + * This flag indicates the peer sending the connection create * meassage likes to trigger a KX handshake. */ int has_monotime; - + /** * This monotonic time is set, if a peer likes to trigger a KX, but is not * the peer that should start the KX. (xrs,t3ss) diff --git a/src/cadet/gnunet-service-cadet.c b/src/cadet/gnunet-service-cadet.c index f3767fb01..2d3b548dd 100644 --- a/src/cadet/gnunet-service-cadet.c +++ b/src/cadet/gnunet-service-cadet.c @@ -1010,6 +1010,7 @@ handle_info_tunnels (void *cls, GNUNET_SERVICE_client_continue (c->client); } + /** * Handler for client's #GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE request. * @@ -1026,11 +1027,12 @@ handle_drop_message (void *cls, ch = lookup_channel (c, message->ccn); - GCCH_assign_type_to_drop(ch, message); - + GCCH_assign_type_to_drop (ch, message); + GNUNET_SERVICE_client_continue (c->client); } + /** * Callback called when a client connects to the service. * @@ -1327,52 +1329,52 @@ run (void *cls, * Define "main" method using service macro. */ GNUNET_SERVICE_MAIN -("cadet", - GNUNET_SERVICE_OPTION_NONE, - &run, - &client_connect_cb, - &client_disconnect_cb, - NULL, - GNUNET_MQ_hd_fixed_size (port_open, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN, - struct GNUNET_CADET_PortMessage, - NULL), - GNUNET_MQ_hd_fixed_size (port_close, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE, - struct GNUNET_CADET_PortMessage, - NULL), - GNUNET_MQ_hd_fixed_size (channel_create, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE, - struct GNUNET_CADET_LocalChannelCreateMessage, - NULL), - GNUNET_MQ_hd_fixed_size (channel_destroy, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY, - struct GNUNET_CADET_LocalChannelDestroyMessage, - NULL), - GNUNET_MQ_hd_var_size (local_data, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA, - struct GNUNET_CADET_LocalData, - NULL), - GNUNET_MQ_hd_fixed_size (local_ack, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK, - struct GNUNET_CADET_LocalAck, - NULL), - GNUNET_MQ_hd_fixed_size (get_peers, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PEERS, - struct GNUNET_MessageHeader, - NULL), - GNUNET_MQ_hd_fixed_size (show_path, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH, - struct GNUNET_CADET_RequestPathInfoMessage, - NULL), - GNUNET_MQ_hd_fixed_size (info_tunnels, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_TUNNELS, - struct GNUNET_MessageHeader, - NULL), - GNUNET_MQ_hd_fixed_size (drop_message, - GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE, - struct GNUNET_CADET_RequestDropCadetMessage, - NULL), - GNUNET_MQ_handler_end ()); + ("cadet", + GNUNET_SERVICE_OPTION_NONE, + &run, + &client_connect_cb, + &client_disconnect_cb, + NULL, + GNUNET_MQ_hd_fixed_size (port_open, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_OPEN, + struct GNUNET_CADET_PortMessage, + NULL), + GNUNET_MQ_hd_fixed_size (port_close, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_CLOSE, + struct GNUNET_CADET_PortMessage, + NULL), + GNUNET_MQ_hd_fixed_size (channel_create, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_CREATE, + struct GNUNET_CADET_LocalChannelCreateMessage, + NULL), + GNUNET_MQ_hd_fixed_size (channel_destroy, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_CHANNEL_DESTROY, + struct GNUNET_CADET_LocalChannelDestroyMessage, + NULL), + GNUNET_MQ_hd_var_size (local_data, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA, + struct GNUNET_CADET_LocalData, + NULL), + GNUNET_MQ_hd_fixed_size (local_ack, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_ACK, + struct GNUNET_CADET_LocalAck, + NULL), + GNUNET_MQ_hd_fixed_size (get_peers, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PEERS, + struct GNUNET_MessageHeader, + NULL), + GNUNET_MQ_hd_fixed_size (show_path, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_PATH, + struct GNUNET_CADET_RequestPathInfoMessage, + NULL), + GNUNET_MQ_hd_fixed_size (info_tunnels, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_TUNNELS, + struct GNUNET_MessageHeader, + NULL), + GNUNET_MQ_hd_fixed_size (drop_message, + GNUNET_MESSAGE_TYPE_CADET_DROP_CADET_MESSAGE, + struct GNUNET_CADET_RequestDropCadetMessage, + NULL), + GNUNET_MQ_handler_end ()); /* end of gnunet-service-cadet-new.c */ diff --git a/src/cadet/gnunet-service-cadet.h b/src/cadet/gnunet-service-cadet.h index ff216f8c3..6da0950f1 100644 --- a/src/cadet/gnunet-service-cadet.h +++ b/src/cadet/gnunet-service-cadet.h @@ -325,5 +325,4 @@ const char * GSC_2s (struct CadetClient *c); - #endif diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c index e6fce562f..dab53b8c4 100644 --- a/src/cadet/gnunet-service-cadet_channel.c +++ b/src/cadet/gnunet-service-cadet_channel.c @@ -385,29 +385,32 @@ struct CadetChannel * Type of message to be droped. See GCT_send. */ uint16_t type GNUNET_PACKED; - + }; /** * Assign type of message to drop. - * @param ch CadetChannel to assign type to drop. + * @param ch CadetChannel to assign type to drop. * @param message GNUNET_CADET_RequestDropCadetMessage to get the type from. */ void -GCCH_assign_type_to_drop(struct CadetChannel *ch, const struct GNUNET_CADET_RequestDropCadetMessage *message) +GCCH_assign_type_to_drop (struct CadetChannel *ch, const struct + GNUNET_CADET_RequestDropCadetMessage *message) { ch->type = message->type; - + } + /** * Check if type of message is the one to drop. - * @param ch CadetChannel to check for message type to drop. + * @param ch CadetChannel to check for message type to drop. * @param message GNUNET_MessageHeader to compare the type with. */ int -GCCH_is_type_to_drop(struct CadetChannel *ch, const struct GNUNET_MessageHeader *message) +GCCH_is_type_to_drop (struct CadetChannel *ch, const struct + GNUNET_MessageHeader *message) { if (ch->type == message->type) @@ -419,6 +422,7 @@ GCCH_is_type_to_drop(struct CadetChannel *ch, const struct GNUNET_MessageHeader return GNUNET_NO; } + /** * Get the static string for identification of the channel. * @@ -854,7 +858,8 @@ send_channel_data_ack (struct CadetChannel *ch) GCCH_2s (ch)); if (NULL != ch->last_control_qe) GCT_send_cancel (ch->last_control_qe); - ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch, &msg.ctn); + ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch, + &msg.ctn); } @@ -881,7 +886,8 @@ send_open_ack (void *cls) msg.port = ch->port; if (NULL != ch->last_control_qe) GCT_send_cancel (ch->last_control_qe); - ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch, &msg.ctn); + ch->last_control_qe = GCT_send (ch->t, &msg.header, &send_ack_cb, ch, + &msg.ctn); } @@ -1513,7 +1519,8 @@ retry_transmission (void *cls) "Retrying transmission on %s of message %u\n", GCCH_2s (ch), (unsigned int) ntohl (crm->data_message->mid.mid)); - crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm, &crm->data_message->ctn); + crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm, + &crm->data_message->ctn); GNUNET_assert (NULL == ch->retry_data_task); } @@ -1901,7 +1908,8 @@ GCCH_handle_local_data (struct CadetChannel *ch, GNUNET_SCHEDULER_cancel (ch->retry_data_task); ch->retry_data_task = NULL; } - crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm, &crm->data_message->ctn); + crm->qe = GCT_send (ch->t, &crm->data_message->header, &data_sent_cb, crm, + &crm->data_message->ctn); GNUNET_assert (NULL == ch->retry_data_task); return GNUNET_OK; } diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c index a7c1d9fb0..3e1f779ad 100644 --- a/src/cadet/gnunet-service-cadet_connection.c +++ b/src/cadet/gnunet-service-cadet_connection.c @@ -614,6 +614,7 @@ set_monotime_sig (struct GNUNET_CADET_ConnectionCreateMessage *msg) } + /** * Send a #GNUNET_MESSAGE_TYPE_CADET_CONNECTION_CREATE message to the * first hop. @@ -641,7 +642,7 @@ send_create (void *cls) // check for tunnel state and set signed monotime (xrs,t3ss) t = GCP_get_tunnel (cc->destination, GNUNET_YES); - if ((NULL != t)&& (GCT_get_estate (t) == CADET_TUNNEL_KEY_UNINITIALIZED) && + if ((NULL != t) && (GCT_get_estate (t) == CADET_TUNNEL_KEY_UNINITIALIZED) && (GCT_alice_or_betty (GCP_get_id (cc->destination)) == GNUNET_NO)) { create_msg->has_monotime = GNUNET_YES; diff --git a/src/cadet/gnunet-service-cadet_core.c b/src/cadet/gnunet-service-cadet_core.c index db47c8a90..9a83fa31d 100644 --- a/src/cadet/gnunet-service-cadet_core.c +++ b/src/cadet/gnunet-service-cadet_core.c @@ -826,9 +826,9 @@ handle_connection_create ( // Check for CADET state in case the other side has lost the tunnel (xrs,t3ss) if ((GNUNET_YES == msg->has_monotime) && - (GNUNET_YES == GCP_check_and_update_monotime(origin, msg->monotime)) && - ( GNUNET_OK == GCP_check_monotime_sig(origin, msg)) && - (CADET_TUNNEL_KEY_OK == GCT_get_estate(t))) + (GNUNET_YES == GCP_check_and_update_monotime (origin, msg->monotime)) && + (GNUNET_OK == GCP_check_monotime_sig (origin, msg)) && + (CADET_TUNNEL_KEY_OK == GCT_get_estate (t))) { GCT_change_estate (t, CADET_TUNNEL_KEY_UNINITIALIZED); } diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c index e5885278b..a2068b31b 100644 --- a/src/cadet/gnunet-service-cadet_peer.c +++ b/src/cadet/gnunet-service-cadet_peer.c @@ -1552,6 +1552,7 @@ GCP_send_ooo (struct CadetPeer *cp, env); } + /** * Checking if a monotime value is newer than the last monotime value received from a peer. If the time value is newer it will be stored at the peer. * @@ -1574,6 +1575,7 @@ GCP_check_and_update_monotime (struct CadetPeer *peer, return GNUNET_NO; } + /** * Checking the signature for a monotime of a GNUNET_CADET_ConnectionCreateMessage. * diff --git a/src/cadet/gnunet-service-cadet_tunnels.c b/src/cadet/gnunet-service-cadet_tunnels.c index 66e7d5b1e..2ca46b5aa 100644 --- a/src/cadet/gnunet-service-cadet_tunnels.c +++ b/src/cadet/gnunet-service-cadet_tunnels.c @@ -3476,7 +3476,7 @@ GCT_send (struct CadetTunnel *t, { ch = lookup_channel (t, *ctn); - if ((NULL != ch)&& GCCH_is_type_to_drop (ch, message)) + if ((NULL != ch) && GCCH_is_type_to_drop (ch, message)) { GNUNET_break (0); return NULL; diff --git a/src/cadet/gnunet-service-cadet_tunnels.h b/src/cadet/gnunet-service-cadet_tunnels.h index 147f2e56f..075cd03f8 100644 --- a/src/cadet/gnunet-service-cadet_tunnels.h +++ b/src/cadet/gnunet-service-cadet_tunnels.h @@ -235,7 +235,7 @@ GCT_send (struct CadetTunnel *t, const struct GNUNET_MessageHeader *message, GCT_SendContinuation cont, void *cont_cls, - struct GNUNET_CADET_ChannelTunnelNumber *ctn); + struct GNUNET_CADET_ChannelTunnelNumber *ctn); /** diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c index 779d3bc9f..23f2ccbe3 100644 --- a/src/cadet/test_cadet.c +++ b/src/cadet/test_cadet.c @@ -550,6 +550,7 @@ get_from_p_ids () } } + static struct GNUNET_CADET_Handle * get_from_cadets () { @@ -568,6 +569,7 @@ get_from_cadets () } + static unsigned int get_peer_nr (int outgoing) { @@ -581,6 +583,7 @@ get_peer_nr (int outgoing) } } + /** * Task to reconnect to other peer. * @@ -626,6 +629,7 @@ reconnect_op (void *cls) send_test_message (outgoing_ch); } + void reopen_channel () { @@ -659,6 +663,7 @@ reopen_channel () send_test_message (outgoing_ch); } + static void peers_callback (void *cls, const struct GNUNET_CADET_PeerListEntry *ple); @@ -676,6 +681,7 @@ get_peers (void *cls) } + /** * Method called to retrieve information about all peers in CADET, called * once per peer. @@ -712,7 +718,7 @@ peers_callback (void *cls, const struct GNUNET_CADET_PeerListEntry *ple) "p_id %s\n", GNUNET_i2s_full (p_id)); - if ((0 == GNUNET_memcmp (&ple->peer, p_id))&& ple->have_tunnel) + if ((0 == GNUNET_memcmp (&ple->peer, p_id)) && ple->have_tunnel) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, @@ -733,6 +739,7 @@ peers_callback (void *cls, const struct GNUNET_CADET_PeerListEntry *ple) } } + /** * Function called whenever an MQ-channel is destroyed, unless the destruction * was requested by #GNUNET_CADET_channel_destroy. @@ -1169,7 +1176,7 @@ connect_handler (void *cls, if (peer == get_peer_nr (GNUNET_NO)) { - if ((DESTROY != test)&&(NULL != incoming_ch)) + if ((DESTROY != test) && (NULL != incoming_ch)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Duplicate incoming channel for client %lu\n", diff --git a/src/conversation/test_conversation_api.c b/src/conversation/test_conversation_api.c index dbb742d91..b51186dc8 100644 --- a/src/conversation/test_conversation_api.c +++ b/src/conversation/test_conversation_api.c @@ -402,7 +402,8 @@ namestore_put_cont (void *cls, int32_t success, const char *emsg) GNUNET_assert (GNUNET_YES == success); GNUNET_assert (NULL == emsg); GNUNET_assert (NULL == op); - op = GNUNET_IDENTITY_create (id, "caller-ego", NULL, &caller_ego_create_cont, NULL); + op = GNUNET_IDENTITY_create (id, "caller-ego", NULL, &caller_ego_create_cont, + NULL); } @@ -483,7 +484,8 @@ run (void *cls, cfg = c; GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, NULL); id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL); - op = GNUNET_IDENTITY_create (id, "phone-ego", NULL, &phone_ego_create_cont, NULL); + op = GNUNET_IDENTITY_create (id, "phone-ego", NULL, &phone_ego_create_cont, + NULL); ns = GNUNET_NAMESTORE_connect (cfg); } diff --git a/src/conversation/test_conversation_api_reject.c b/src/conversation/test_conversation_api_reject.c index 855b21fd7..69fa9f1dc 100644 --- a/src/conversation/test_conversation_api_reject.c +++ b/src/conversation/test_conversation_api_reject.c @@ -255,7 +255,8 @@ namestore_put_cont (void *cls, int32_t success, const char *emsg) GNUNET_assert (GNUNET_YES == success); GNUNET_assert (NULL == emsg); GNUNET_assert (NULL == op); - op = GNUNET_IDENTITY_create (id, "caller-ego", NULL, &caller_ego_create_cont, NULL); + op = GNUNET_IDENTITY_create (id, "caller-ego", NULL, &caller_ego_create_cont, + NULL); } @@ -336,7 +337,8 @@ run (void *cls, cfg = c; GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, NULL); id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL); - op = GNUNET_IDENTITY_create (id, "phone-ego", NULL, &phone_ego_create_cont, NULL); + op = GNUNET_IDENTITY_create (id, "phone-ego", NULL, &phone_ego_create_cont, + NULL); ns = GNUNET_NAMESTORE_connect (cfg); } diff --git a/src/conversation/test_conversation_api_twocalls.c b/src/conversation/test_conversation_api_twocalls.c index 6d434a3e1..83e8cb55a 100644 --- a/src/conversation/test_conversation_api_twocalls.c +++ b/src/conversation/test_conversation_api_twocalls.c @@ -524,7 +524,8 @@ namestore_put_cont (void *cls, int32_t success, const char *emsg) GNUNET_assert (GNUNET_YES == success); GNUNET_assert (NULL == emsg); GNUNET_assert (NULL == op); - op = GNUNET_IDENTITY_create (id, "caller-ego", NULL, &caller_ego_create_cont, NULL); + op = GNUNET_IDENTITY_create (id, "caller-ego", NULL, &caller_ego_create_cont, + NULL); } @@ -613,7 +614,8 @@ run (void *cls, timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_test, NULL); GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL); - op = GNUNET_IDENTITY_create (id, "phone-ego", NULL, &phone_ego_create_cont, NULL); + op = GNUNET_IDENTITY_create (id, "phone-ego", NULL, &phone_ego_create_cont, + NULL); ns = GNUNET_NAMESTORE_connect (cfg); } diff --git a/src/curl/curl.c b/src/curl/curl.c index b3d2af252..eb9dd6a29 100644 --- a/src/curl/curl.c +++ b/src/curl/curl.c @@ -195,14 +195,14 @@ struct GNUNET_CURL_Context /** * Passphrase to decrypt @e keyfile, or NULL. - */ + */ char *keypass; }; /** - * Force use of the provided username and password + * Force use of the provided username and password * for client authentication for all operations performed * with @a ctx. * @@ -605,8 +605,8 @@ GNUNET_CURL_job_add_with_ct_json (struct GNUNET_CURL_Context *ctx, struct curl_slist *job_headers = NULL; GNUNET_assert (NULL != (job_headers = - curl_slist_append (NULL, - "Content-Type: application/json"))); + curl_slist_append (NULL, + "Content-Type: application/json"))); job = GNUNET_CURL_job_add2 (ctx, eh, job_headers, diff --git a/src/fs/fs_namespace.c b/src/fs/fs_namespace.c index 508f9cadc..155486be5 100644 --- a/src/fs/fs_namespace.c +++ b/src/fs/fs_namespace.c @@ -214,13 +214,13 @@ write_update_information_graph (struct GNUNET_FS_UpdateInformationGraph *uig) n = uig->update_nodes[i]; uris = GNUNET_FS_uri_to_string (n->uri); struct GNUNET_BIO_WriteSpec ws[] = { - GNUNET_BIO_write_spec_string("fs-namespace-node-id", n->id), - GNUNET_BIO_write_spec_meta_data("fs-namespace-node-meta", n->md), - GNUNET_BIO_write_spec_string("fs-namespace-node-update", n->update), - GNUNET_BIO_write_spec_string("fs-namespace-uris", uris), - GNUNET_BIO_write_spec_end(), + GNUNET_BIO_write_spec_string ("fs-namespace-node-id", n->id), + GNUNET_BIO_write_spec_meta_data ("fs-namespace-node-meta", n->md), + GNUNET_BIO_write_spec_string ("fs-namespace-node-update", n->update), + GNUNET_BIO_write_spec_string ("fs-namespace-uris", uris), + GNUNET_BIO_write_spec_end (), }; - if (GNUNET_OK != GNUNET_BIO_write_spec_commit(wh, ws)) + if (GNUNET_OK != GNUNET_BIO_write_spec_commit (wh, ws)) { GNUNET_free (uris); break; @@ -292,11 +292,11 @@ read_update_information_graph (struct GNUNET_FS_Handle *h, { n = GNUNET_new (struct NamespaceUpdateNode); struct GNUNET_BIO_ReadSpec rs[] = { - GNUNET_BIO_read_spec_string("identifier", &n->id, 1024), - GNUNET_BIO_read_spec_meta_data("meta", &n->md), - GNUNET_BIO_read_spec_string("update-id", &n->update, 1024), - GNUNET_BIO_read_spec_string("uri", &uris, 1024 * 2), - GNUNET_BIO_read_spec_end(), + GNUNET_BIO_read_spec_string ("identifier", &n->id, 1024), + GNUNET_BIO_read_spec_meta_data ("meta", &n->md), + GNUNET_BIO_read_spec_string ("update-id", &n->update, 1024), + GNUNET_BIO_read_spec_string ("uri", &uris, 1024 * 2), + GNUNET_BIO_read_spec_end (), }; if (GNUNET_OK != GNUNET_BIO_read_spec_commit (rh, rs)) { diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c index 41dfe781a..f91e9d00d 100644 --- a/src/fs/gnunet-auto-share.c +++ b/src/fs/gnunet-auto-share.c @@ -201,9 +201,9 @@ load_state () while (n-- > 0) { struct GNUNET_BIO_ReadSpec rs[] = { - GNUNET_BIO_read_spec_string("filename", &fn, 1024), - GNUNET_BIO_read_spec_object("id", &id, sizeof(struct GNUNET_HashCode)), - GNUNET_BIO_read_spec_end(), + GNUNET_BIO_read_spec_string ("filename", &fn, 1024), + GNUNET_BIO_read_spec_object ("id", &id, sizeof(struct GNUNET_HashCode)), + GNUNET_BIO_read_spec_end (), }; if (GNUNET_OK != GNUNET_BIO_read_spec_commit (rh, rs)) goto error; @@ -258,7 +258,8 @@ write_item (void *cls, const struct GNUNET_HashCode *key, void *value) struct GNUNET_BIO_WriteSpec ws[] = { GNUNET_BIO_write_spec_string ("auto-share-write-item-filename", wi->filename), - GNUNET_BIO_write_spec_object ("id", &wi->id, sizeof(struct GNUNET_HashCode)), + GNUNET_BIO_write_spec_object ("id", &wi->id, sizeof(struct + GNUNET_HashCode)), GNUNET_BIO_write_spec_end (), }; if (GNUNET_OK != GNUNET_BIO_write_spec_commit (wh, ws)) @@ -747,7 +748,7 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO); + sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE); GNUNET_assert (NULL != sigpipe); shc_chld = GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death); diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c index 0d99d822e..bf95bf340 100644 --- a/src/gns/gns_api.c +++ b/src/gns/gns_api.c @@ -427,4 +427,5 @@ GNUNET_GNS_lookup (struct GNUNET_GNS_Handle *handle, proc_cls); } + /* end of gns_api.c */ diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c index 74309f554..0a9b7c861 100644 --- a/src/gns/gnunet-dns2gns.c +++ b/src/gns/gnunet-dns2gns.c @@ -190,6 +190,7 @@ do_shutdown (void *cls) } } + /** * Shuffle answers * Fisher-Yates (aka Knuth) Shuffle @@ -216,6 +217,7 @@ shuffle_answers (struct Request *request) } } + /** * Send the response for the given request and clean up. * diff --git a/src/gns/nss/nss_gns.c b/src/gns/nss/nss_gns.c index 36799ba3a..77b4340ee 100644 --- a/src/gns/nss/nss_gns.c +++ b/src/gns/nss/nss_gns.c @@ -38,7 +38,7 @@ /** macro to align idx to 32bit boundary */ #define ALIGN(idx) do { \ if (idx % sizeof(void*)) \ - idx += (sizeof(void*) - idx % sizeof(void*)); /* Align on 32 bit boundary */ \ + idx += (sizeof(void*) - idx % sizeof(void*)); /* Align on 32 bit boundary */ \ } while (0) diff --git a/src/gns/nss/nss_gns_query.c b/src/gns/nss/nss_gns_query.c index 11e46ad7f..96e8e10da 100644 --- a/src/gns/nss/nss_gns_query.c +++ b/src/gns/nss/nss_gns_query.c @@ -150,7 +150,7 @@ query_gns: if (1 == retry) return -2; /* no go -> service unavailable */ retry = 1; - system("gnunet-arm -s"); + system ("gnunet-arm -s"); goto query_gns; /* Try again */ } if (3 == WEXITSTATUS (ret)) diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c index 3cbf5fc8d..8d5a6d95b 100644 --- a/src/gnsrecord/gnsrecord.c +++ b/src/gnsrecord/gnsrecord.c @@ -106,11 +106,11 @@ init () const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); if (pd != dpd) - GNUNET_OS_init(dpd); + GNUNET_OS_init (dpd); GNUNET_PLUGIN_load_all ("libgnunet_plugin_gnsrecord_", NULL, &add_plugin, NULL); if (pd != dpd) - GNUNET_OS_init(pd); + GNUNET_OS_init (pd); } @@ -125,7 +125,7 @@ GNSRECORD_fini () const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); if (pd != dpd) - GNUNET_OS_init(dpd); + GNUNET_OS_init (dpd); for (unsigned int i = 0; i < num_plugins; i++) { @@ -139,7 +139,7 @@ GNSRECORD_fini () GNUNET_free (gns_plugins); if (pd != dpd) - GNUNET_OS_init(pd); + GNUNET_OS_init (pd); gns_plugins = NULL; once = 0; diff --git a/src/hostlist/gnunet-daemon-hostlist_client.c b/src/hostlist/gnunet-daemon-hostlist_client.c index 5dc2e7f2a..b377f2041 100644 --- a/src/hostlist/gnunet-daemon-hostlist_client.c +++ b/src/hostlist/gnunet-daemon-hostlist_client.c @@ -540,12 +540,12 @@ download_get_url () { \ ret = curl_easy_setopt (c, a, b); \ if (CURLE_OK != ret) \ - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \ - _ ("%s failed at %s:%d: `%s'\n"), \ - "curl_easy_setopt", \ - __FILE__, \ - __LINE__, \ - curl_easy_strerror (ret)); \ + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \ + _ ("%s failed at %s:%d: `%s'\n"), \ + "curl_easy_setopt", \ + __FILE__, \ + __LINE__, \ + curl_easy_strerror (ret)); \ } while (0) @@ -1418,11 +1418,12 @@ load_hostlist_file () counter = 0; struct GNUNET_BIO_ReadSpec rs[] = { - GNUNET_BIO_read_spec_int32 ("times used", (int32_t *)×_used), + GNUNET_BIO_read_spec_int32 ("times used", (int32_t *) ×_used), GNUNET_BIO_read_spec_int64 ("quality", (int64_t *) &quality), GNUNET_BIO_read_spec_int64 ("last used", (int64_t *) &last_used), GNUNET_BIO_read_spec_int64 ("created", (int64_t *) &created), - GNUNET_BIO_read_spec_int32 ("hellos returned", (int32_t *) &hellos_returned), + GNUNET_BIO_read_spec_int32 ("hellos returned", + (int32_t *) &hellos_returned), GNUNET_BIO_read_spec_end (), }; while ((GNUNET_OK == GNUNET_BIO_read_string (rh, "url", &uri, MAX_URL_LEN)) && @@ -1527,7 +1528,8 @@ save_hostlist_file (int shutdown) { struct GNUNET_BIO_WriteSpec ws[] = { GNUNET_BIO_write_spec_string ("hostlist uri", pos->hostlist_uri), - GNUNET_BIO_write_spec_int32 ("times used", (int32_t *) &pos->times_used), + GNUNET_BIO_write_spec_int32 ("times used", + (int32_t *) &pos->times_used), GNUNET_BIO_write_spec_int64 ("quality", (int64_t *) &pos->quality), GNUNET_BIO_write_spec_int64 ( "last usage", diff --git a/src/identity/gnunet-identity.c b/src/identity/gnunet-identity.c index cf44afd1f..d0f5546f3 100644 --- a/src/identity/gnunet-identity.c +++ b/src/identity/gnunet-identity.c @@ -406,7 +406,8 @@ run (void *cls, GNUNET_STRINGS_string_to_data (privkey_ego, strlen (privkey_ego), &pk, - sizeof(struct GNUNET_CRYPTO_EcdsaPrivateKey)); + sizeof(struct + GNUNET_CRYPTO_EcdsaPrivateKey)); create_op = GNUNET_IDENTITY_create (sh, create_ego, @@ -452,7 +453,8 @@ main (int argc, char *const *argv) GNUNET_GETOPT_option_string ('P', "privkey", "PRIVATE_KEY", - gettext_noop ("set the private key for the identity to PRIVATE_KEY (use together with -C)"), + gettext_noop ( + "set the private key for the identity to PRIVATE_KEY (use together with -C)"), &privkey_ego), GNUNET_GETOPT_option_flag ('d', "display", diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c index 5aca07ddf..02e42d03f 100644 --- a/src/identity/plugin_rest_identity.c +++ b/src/identity/plugin_rest_identity.c @@ -1065,7 +1065,8 @@ ego_create (struct GNUNET_REST_RequestHandle *con_handle, GNUNET_STRINGS_string_to_data (privkey, strlen (privkey), &pk, - sizeof(struct GNUNET_CRYPTO_EcdsaPrivateKey)); + sizeof(struct + GNUNET_CRYPTO_EcdsaPrivateKey)); pk_ptr = &pk; } else diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h index 687334c1c..e49ce1354 100644 --- a/src/include/gnunet_bio_lib.h +++ b/src/include/gnunet_bio_lib.h @@ -138,9 +138,9 @@ GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, * @param f address of float to read */ int -GNUNET_BIO_read_float(struct GNUNET_BIO_ReadHandle *h, - const char *what, - float *f); +GNUNET_BIO_read_float (struct GNUNET_BIO_ReadHandle *h, + const char *what, + float *f); /** @@ -151,10 +151,9 @@ GNUNET_BIO_read_float(struct GNUNET_BIO_ReadHandle *h, * @param f address of double to read */ int -GNUNET_BIO_read_double(struct GNUNET_BIO_ReadHandle *h, - const char *what, - double *f); - +GNUNET_BIO_read_double (struct GNUNET_BIO_ReadHandle *h, + const char *what, + double *f); /** @@ -171,7 +170,6 @@ GNUNET_BIO_read_int32 (struct GNUNET_BIO_ReadHandle *h, int32_t *i); - /** * Read an (u)int64_t. * @@ -186,7 +184,6 @@ GNUNET_BIO_read_int64 (struct GNUNET_BIO_ReadHandle *h, int64_t *i); - /****************************** WRITING API *******************************/ /** @@ -310,9 +307,9 @@ GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, * @param f float to write (must be a variable) */ int -GNUNET_BIO_write_float(struct GNUNET_BIO_WriteHandle *h, - const char *what, - float f); +GNUNET_BIO_write_float (struct GNUNET_BIO_WriteHandle *h, + const char *what, + float f); /** * Write a double. @@ -322,9 +319,9 @@ GNUNET_BIO_write_float(struct GNUNET_BIO_WriteHandle *h, * @param f double to write (must be a variable) */ int -GNUNET_BIO_write_double(struct GNUNET_BIO_WriteHandle *h, - const char *what, - double f); +GNUNET_BIO_write_double (struct GNUNET_BIO_WriteHandle *h, + const char *what, + double f); /** @@ -490,7 +487,7 @@ GNUNET_BIO_read_spec_int64 (const char *what, * @param f address of float to read */ struct GNUNET_BIO_ReadSpec -GNUNET_BIO_read_spec_float(const char *what, float *f); +GNUNET_BIO_read_spec_float (const char *what, float *f); /** @@ -500,7 +497,7 @@ GNUNET_BIO_read_spec_float(const char *what, float *f); * @param f address of double to read */ struct GNUNET_BIO_ReadSpec -GNUNET_BIO_read_spec_double(const char *what, double *f); +GNUNET_BIO_read_spec_double (const char *what, double *f); /** @@ -647,7 +644,7 @@ GNUNET_BIO_write_spec_int64 (const char *what, * @return the write spec */ struct GNUNET_BIO_WriteSpec -GNUNET_BIO_write_spec_float(const char *what, float *f); +GNUNET_BIO_write_spec_float (const char *what, float *f); /** @@ -658,7 +655,7 @@ GNUNET_BIO_write_spec_float(const char *what, float *f); * @return the write spec */ struct GNUNET_BIO_WriteSpec -GNUNET_BIO_write_spec_double(const char *what, double *f); +GNUNET_BIO_write_spec_double (const char *what, double *f); /** diff --git a/src/include/gnunet_buffer_lib.h b/src/include/gnunet_buffer_lib.h index e23536ab2..e09ec130a 100644 --- a/src/include/gnunet_buffer_lib.h +++ b/src/include/gnunet_buffer_lib.h @@ -147,7 +147,7 @@ GNUNET_buffer_write_fstr (struct GNUNET_Buffer *buf, const char *fmt, ...); */ void GNUNET_buffer_write_vfstr (struct GNUNET_Buffer *buf, const char *fmt, va_list - args); + args); /** diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index b2f99cd55..91d4a5bd4 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -457,11 +457,11 @@ __attribute__ ((format (printf, 2, 3))); __extension__ ({ \ int _gnunet_boolean_var_; \ if (expr) \ - _gnunet_boolean_var_ = 1; \ + _gnunet_boolean_var_ = 1; \ else \ - _gnunet_boolean_var_ = 0; \ + _gnunet_boolean_var_ = 0; \ _gnunet_boolean_var_; \ - }) + }) #define GN_LIKELY(expr) (__builtin_expect (_GNUNET_BOOLEAN_EXPR (expr), 1)) #define GN_UNLIKELY(expr) (__builtin_expect (_GNUNET_BOOLEAN_EXPR (expr), 0)) #else @@ -499,12 +499,12 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \ { \ if (GN_UNLIKELY (log_call_enabled == -1)) \ - log_call_enabled = \ - GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \ - (comp), \ - __FILE__, \ - __FUNCTION__, \ - __LINE__); \ + log_call_enabled = \ + GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \ + (comp), \ + __FILE__, \ + __FUNCTION__, \ + __LINE__); \ if (GN_UNLIKELY (GNUNET_get_log_skip () > 0)) \ { \ GNUNET_log_skip (-1, GNUNET_NO); \ @@ -512,7 +512,7 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, else \ { \ if (GN_UNLIKELY (log_call_enabled)) \ - GNUNET_log_from_nocheck ((kind), comp, __VA_ARGS__); \ + GNUNET_log_from_nocheck ((kind), comp, __VA_ARGS__); \ } \ } \ } while (0) @@ -525,12 +525,12 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, ((GNUNET_ERROR_TYPE_DEBUG & (kind)) == 0)) \ { \ if (GN_UNLIKELY (log_call_enabled == -1)) \ - log_call_enabled = \ - GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \ - NULL, \ - __FILE__, \ - __FUNCTION__, \ - __LINE__); \ + log_call_enabled = \ + GNUNET_get_log_call_status ((kind) & (~GNUNET_ERROR_TYPE_BULK), \ + NULL, \ + __FILE__, \ + __FUNCTION__, \ + __LINE__); \ if (GN_UNLIKELY (GNUNET_get_log_skip () > 0)) \ { \ GNUNET_log_skip (-1, GNUNET_NO); \ @@ -538,7 +538,7 @@ GNUNET_log_from_nocheck (enum GNUNET_ErrorType kind, else \ { \ if (GN_UNLIKELY (log_call_enabled)) \ - GNUNET_log_nocheck ((kind), __VA_ARGS__); \ + GNUNET_log_nocheck ((kind), __VA_ARGS__); \ } \ } \ } while (0) @@ -1319,8 +1319,8 @@ GNUNET_is_zero_ (const void *a, * been returned by #GNUNET_strdup, #GNUNET_strndup, #GNUNET_malloc or #GNUNET_array_grow earlier. NULL is allowed. */ #define GNUNET_free(ptr) do { \ - GNUNET_xfree_ (ptr, __FILE__, __LINE__); \ - ptr = NULL; \ + GNUNET_xfree_ (ptr, __FILE__, __LINE__); \ + ptr = NULL; \ } while (0) diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index b5ceb5b94..f782509eb 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h @@ -109,7 +109,7 @@ GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, * @return a freshly allocated configuration */ struct GNUNET_CONFIGURATION_Handle * -GNUNET_CONFIGURATION_default(void); +GNUNET_CONFIGURATION_default (void); /** diff --git a/src/include/gnunet_constants.h b/src/include/gnunet_constants.h index c83bec683..8b3cbc7e6 100644 --- a/src/include/gnunet_constants.h +++ b/src/include/gnunet_constants.h @@ -47,7 +47,8 @@ extern "C" * so that at least one maximum-size message can be send roughly once * per minute. */ -#define GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT GNUNET_BANDWIDTH_value_init (1024*1024) +#define GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT GNUNET_BANDWIDTH_value_init (1024 \ + * 1024) /** * After how long do we consider a connection to a peer dead diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index f3325a064..8d8cbf4c1 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h @@ -2158,9 +2158,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( (element)->next = (head); \ (element)->prev = NULL; \ if ((tail) == NULL) \ - (tail) = element; \ + (tail) = element; \ else \ - (head)->prev = element; \ + (head)->prev = element; \ (head) = (element); \ } while (0) @@ -2182,9 +2182,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( (element)->prev = (tail); \ (element)->next = NULL; \ if ((head) == NULL) \ - (head) = element; \ + (head) = element; \ else \ - (tail)->next = element; \ + (tail)->next = element; \ (tail) = (element); \ } while (0) @@ -2216,9 +2216,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( (other)->next = (element); \ } \ if (NULL == (element)->next) \ - (tail) = (element); \ + (tail) = (element); \ else \ - (element)->next->prev = (element); \ + (element)->next->prev = (element); \ } while (0) @@ -2249,9 +2249,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( (other)->prev = (element); \ } \ if (NULL == (element)->prev) \ - (head) = (element); \ + (head) = (element); \ else \ - (element)->prev->next = (element); \ + (element)->prev->next = (element); \ } while (0) @@ -2275,13 +2275,13 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( GNUNET_assert (((element)->prev != NULL) || ((head) == (element))); \ GNUNET_assert (((element)->next != NULL) || ((tail) == (element))); \ if ((element)->prev == NULL) \ - (head) = (element)->next; \ + (head) = (element)->next; \ else \ - (element)->prev->next = (element)->next; \ + (element)->prev->next = (element)->next; \ if ((element)->next == NULL) \ - (tail) = (element)->prev; \ + (tail) = (element)->prev; \ else \ - (element)->next->prev = (element)->prev; \ + (element)->next->prev = (element)->prev; \ (element)->next = NULL; \ (element)->prev = NULL; \ } while (0) @@ -2308,9 +2308,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( (element)->next_ ## mdll = (head); \ (element)->prev_ ## mdll = NULL; \ if ((tail) == NULL) \ - (tail) = element; \ + (tail) = element; \ else \ - (head)->prev_ ## mdll = element; \ + (head)->prev_ ## mdll = element; \ (head) = (element); \ } while (0) @@ -2333,9 +2333,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( (element)->prev_ ## mdll = (tail); \ (element)->next_ ## mdll = NULL; \ if ((head) == NULL) \ - (head) = element; \ + (head) = element; \ else \ - (tail)->next_ ## mdll = element; \ + (tail)->next_ ## mdll = element; \ (tail) = (element); \ } while (0) @@ -2368,9 +2368,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( (other)->next_ ## mdll = (element); \ } \ if (NULL == (element)->next_ ## mdll) \ - (tail) = (element); \ + (tail) = (element); \ else \ - (element)->next_ ## mdll->prev_ ## mdll = (element); \ + (element)->next_ ## mdll->prev_ ## mdll = (element); \ } while (0) @@ -2402,9 +2402,9 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( (other)->prev_ ## mdll = (element); \ } \ if (NULL == (element)->prev_ ## mdll) \ - (head) = (element); \ + (head) = (element); \ else \ - (element)->prev_ ## mdll->next_ ## mdll = (element); \ + (element)->prev_ ## mdll->next_ ## mdll = (element); \ } while (0) @@ -2425,13 +2425,13 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( GNUNET_assert (((element)->prev_ ## mdll != NULL) || ((head) == (element))); \ GNUNET_assert (((element)->next_ ## mdll != NULL) || ((tail) == (element))); \ if ((element)->prev_ ## mdll == NULL) \ - (head) = (element)->next_ ## mdll; \ + (head) = (element)->next_ ## mdll; \ else \ - (element)->prev_ ## mdll->next_ ## mdll = (element)->next_ ## mdll; \ + (element)->prev_ ## mdll->next_ ## mdll = (element)->next_ ## mdll; \ if ((element)->next_ ## mdll == NULL) \ - (tail) = (element)->prev_ ## mdll; \ + (tail) = (element)->prev_ ## mdll; \ else \ - (element)->next_ ## mdll->prev_ ## mdll = (element)->prev_ ## mdll; \ + (element)->next_ ## mdll->prev_ ## mdll = (element)->prev_ ## mdll; \ (element)->next_ ## mdll = NULL; \ (element)->prev_ ## mdll = NULL; \ } while (0) @@ -2468,8 +2468,8 @@ GNUNET_CONTAINER_multihashmap32_iterator_destroy ( TYPE *pos; \ \ for (pos = head; NULL != pos; pos = pos->next) \ - if (0 < comparator (comparator_cls, element, pos)) \ - break; /* element < pos */ \ + if (0 < comparator (comparator_cls, element, pos)) \ + break; /* element < pos */ \ if (NULL == pos) /* => element > tail */ \ { \ GNUNET_CONTAINER_DLL_insert_tail (head, tail, element); \ diff --git a/src/include/gnunet_curl_lib.h b/src/include/gnunet_curl_lib.h index 8f744512d..9de58d608 100644 --- a/src/include/gnunet_curl_lib.h +++ b/src/include/gnunet_curl_lib.h @@ -262,7 +262,7 @@ GNUNET_CURL_job_add_with_ct_json (struct GNUNET_CURL_Context *ctx, /** - * Force use of the provided username and password + * Force use of the provided username and password * for client authentication for all operations performed * with @a ctx. * diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index f43cf8943..51ae7d8d5 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h @@ -390,34 +390,55 @@ GNUNET_DISK_file_handle_size (struct GNUNET_DISK_FileHandle *fh, off_t *size); +/** + * Flags for #GNUNET_DISK_pipe(). + */ +enum GNUNET_DISK_PipeFlags +{ + + /** + * No special options, use non-blocking read/write operations. + */ + GNUNET_DISK_PF_NONE, + + /** + * Configure read end to block when reading if set. + */ + GNUNET_DISK_PF_BLOCKING_READ = 1, + /** + * Configure write end to block when writing if set. + */ + GNUNET_DISK_PF_BLOCKING_WRITE = 2, + + /** + * Configure both pipe ends for blocking operations if set. + */ + GNUNET_DISK_PF_BLOCKING_RW = GNUNET_DISK_PF_BLOCKING_READ + | GNUNET_DISK_PF_BLOCKING_WRITE + +}; + + /** * Creates an interprocess channel * - * @param blocking_read creates an asynchronous pipe for reading if set to #GNUNET_NO - * @param blocking_write creates an asynchronous pipe for writing if set to #GNUNET_NO - * @param inherit_read 1 to make read handle inheritable, 0 otherwise (NT only) - * @param inherit_write 1 to make write handle inheritable, 0 otherwise (NT only) + * @param pf how to configure the pipe * @return handle to the new pipe, NULL on error */ struct GNUNET_DISK_PipeHandle * -GNUNET_DISK_pipe (int blocking_read, - int blocking_write, - int inherit_read, - int inherit_write); +GNUNET_DISK_pipe (enum GNUNET_DISK_PipeFlags pf); /** * Creates a pipe object from a couple of file descriptors. * Useful for wrapping existing pipe FDs. * - * @param blocking_read creates an asynchronous pipe for reading if set to #GNUNET_NO - * @param blocking_write creates an asynchronous pipe for writing if set to #GNUNET_NO + * @param pf how to configure the pipe * @param fd an array of two fd values. One of them may be -1 for read-only or write-only pipes * @return handle to the new pipe, NULL on error */ struct GNUNET_DISK_PipeHandle * -GNUNET_DISK_pipe_from_fd (int blocking_read, - int blocking_write, +GNUNET_DISK_pipe_from_fd (enum GNUNET_DISK_PipeFlags pf, int fd[2]); @@ -479,6 +500,7 @@ const struct GNUNET_DISK_FileHandle * GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p, enum GNUNET_DISK_PipeEnd n); + /** * Update POSIX permissions mask of a file on disk. If both argumets * are #GNUNET_NO, the file is made world-read-write-executable (777). diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h index 520027dbb..37f21e5b1 100644 --- a/src/include/gnunet_mq_lib.h +++ b/src/include/gnunet_mq_lib.h @@ -547,7 +547,7 @@ struct GNUNET_MQ_MessageHandler */ #define GNUNET_MQ_hd_fixed_size(name, code, str, ctx) \ ({ \ - void (*_cb)(void *cls, const str * msg) = &handle_ ## name; \ + void (*_cb)(void *cls, const str *msg) = &handle_ ## name; \ ((struct GNUNET_MQ_MessageHandler){ NULL, \ (GNUNET_MQ_MessageCallback) _cb, \ (ctx), \ @@ -598,8 +598,8 @@ struct GNUNET_MQ_MessageHandler */ #define GNUNET_MQ_hd_var_size(name, code, str, ctx) \ __extension__ ({ \ - int (*_mv)(void *cls, const str * msg) = &check_ ## name; \ - void (*_cb)(void *cls, const str * msg) = &handle_ ## name; \ + int (*_mv)(void *cls, const str *msg) = &check_ ## name; \ + void (*_cb)(void *cls, const str *msg) = &handle_ ## name; \ ((struct GNUNET_MQ_MessageHandler){ (GNUNET_MQ_MessageValidationCallback) \ _mv, \ (GNUNET_MQ_MessageCallback) _cb, \ diff --git a/src/include/gnunet_reclaim_lib.h b/src/include/gnunet_reclaim_lib.h index 54d284f3c..4f2d6dba5 100644 --- a/src/include/gnunet_reclaim_lib.h +++ b/src/include/gnunet_reclaim_lib.h @@ -80,7 +80,7 @@ static const struct GNUNET_RECLAIM_Identifier GNUNET_RECLAIM_ID_ZERO; memcmp (a, \ b, \ sizeof (GNUNET_RECLAIM_ID_ZERO))) \ - ? \ + ? \ GNUNET_YES : GNUNET_NO) diff --git a/src/include/gnunet_reclaim_plugin.h b/src/include/gnunet_reclaim_plugin.h index 992ad0cc3..7ee9e730f 100644 --- a/src/include/gnunet_reclaim_plugin.h +++ b/src/include/gnunet_reclaim_plugin.h @@ -172,7 +172,9 @@ typedef const char *(*GNUNET_RECLAIM_AttestationNumberToTypenameFunction) ( * @param attest the attestation object * @return an attribute list */ -typedef struct GNUNET_RECLAIM_AttributeList *(*GNUNET_RECLAIM_AttestationGetAttributesFunction) ( +typedef struct + GNUNET_RECLAIM_AttributeList *(* +GNUNET_RECLAIM_AttestationGetAttributesFunction) ( void *cls, const struct GNUNET_RECLAIM_Attestation *attest); @@ -201,7 +203,6 @@ typedef int (*GNUNET_RECLAIM_AttestationGetExpirationFunction) ( struct GNUNET_TIME_Absolute *expiration); - /** * Each plugin is required to return a pointer to a struct of this * type as the return value from its entry point. @@ -283,7 +284,6 @@ struct GNUNET_RECLAIM_AttestationPluginFunctions }; - #if 0 /* keep Emacsens' auto-indent happy */ { #endif diff --git a/src/include/gnunet_reclaim_service.h b/src/include/gnunet_reclaim_service.h index 813bc1a59..139c44ae7 100644 --- a/src/include/gnunet_reclaim_service.h +++ b/src/include/gnunet_reclaim_service.h @@ -335,7 +335,8 @@ GNUNET_RECLAIM_get_attestations_start ( * @param it the iterator */ void -GNUNET_RECLAIM_get_attestations_next (struct GNUNET_RECLAIM_AttestationIterator *ait); +GNUNET_RECLAIM_get_attestations_next (struct + GNUNET_RECLAIM_AttestationIterator *ait); /** @@ -346,7 +347,8 @@ GNUNET_RECLAIM_get_attestations_next (struct GNUNET_RECLAIM_AttestationIterator * @param it the iterator */ void -GNUNET_RECLAIM_get_attestations_stop (struct GNUNET_RECLAIM_AttestationIterator *ait); +GNUNET_RECLAIM_get_attestations_stop (struct + GNUNET_RECLAIM_AttestationIterator *ait); /** diff --git a/src/include/platform.h b/src/include/platform.h index baaf26ad6..10248e5bb 100644 --- a/src/include/platform.h +++ b/src/include/platform.h @@ -233,8 +233,8 @@ atoll (const char *nptr); #if defined(__sparc__) -#define MAKE_UNALIGNED(val) ({ __typeof__((val))__tmp; memmove (&__tmp, &(val), \ - sizeof((val))); \ +#define MAKE_UNALIGNED(val) ({ __typeof__((val)) __tmp; memmove (&__tmp, &(val), \ + sizeof((val))); \ __tmp; }) #else #define MAKE_UNALIGNED(val) val diff --git a/src/json/json_generator.c b/src/json/json_generator.c index 594fcaf27..3f82a5f17 100644 --- a/src/json/json_generator.c +++ b/src/json/json_generator.c @@ -254,7 +254,9 @@ GNUNET_JSON_from_gnsrecord (const char*rname, rel_exp.rel_value_us = rd[i].expiration_time; expiration_time_str = GNUNET_STRINGS_relative_time_to_string (rel_exp, GNUNET_NO); - } else { + } + else + { abs_exp.abs_value_us = rd[i].expiration_time; expiration_time_str = GNUNET_STRINGS_absolute_time_to_string (abs_exp); } diff --git a/src/json/json_gnsrecord.c b/src/json/json_gnsrecord.c index fe5858f06..7e11aba94 100644 --- a/src/json/json_gnsrecord.c +++ b/src/json/json_gnsrecord.c @@ -136,8 +136,8 @@ parse_record (json_t *data, struct GNUNET_GNSRECORD_Data *rd) } else if ((1 != rel_exp) && (GNUNET_OK == - GNUNET_STRINGS_fancy_time_to_absolute (expiration_time, - &abs_expiration_time))) + GNUNET_STRINGS_fancy_time_to_absolute (expiration_time, + &abs_expiration_time))) { rd->expiration_time = abs_expiration_time.abs_value_us; } 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) return; } add = 1; - typestring = GNUNET_strdup (GNUNET_GNSRECORD_number_to_typename (GNUNET_GNSRECORD_TYPE_NICK)); + typestring = GNUNET_strdup (GNUNET_GNSRECORD_number_to_typename ( + GNUNET_GNSRECORD_TYPE_NICK)); name = GNUNET_strdup (GNUNET_GNS_EMPTY_LABEL_AT); value = GNUNET_strdup (nickstring); 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, nick = get_nick_record (zone_key); res_count = rd_count; res = (struct GNUNET_GNSRECORD_Data *) rd; /* fixme: a bit unclean... */ - if (NULL != nick && (0 != strcmp (name, GNUNET_GNS_EMPTY_LABEL_AT))) + if ((NULL != nick) && (0 != strcmp (name, GNUNET_GNS_EMPTY_LABEL_AT))) { nick->flags = (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, GNUNET_NAMESTORE_zone_iterator_next (handle->list_it, 1); } + /** * Handle lookup error * @@ -553,10 +554,10 @@ ns_lookup_error_cb (void *cls) static void ns_get_lookup_cb (void *cls, - const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, - const char *label, - unsigned int rd_len, - const struct GNUNET_GNSRECORD_Data *rd) + const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, + const char *label, + unsigned int rd_len, + const struct GNUNET_GNSRECORD_Data *rd) { struct RequestHandle *handle = cls; struct GNUNET_GNSRECORD_Data rd_filtered[rd_len]; @@ -588,8 +589,6 @@ ns_get_lookup_cb (void *cls, } - - /** * Handle namestore GET request * @@ -666,12 +665,12 @@ namestore_get (struct GNUNET_REST_RequestHandle *con_handle, } handle->record_name = GNUNET_strdup (labelname + 1); handle->ns_qe = GNUNET_NAMESTORE_records_lookup (handle->ns_handle, - handle->zone_pkey, - handle->record_name, - &ns_lookup_error_cb, - handle, - &ns_get_lookup_cb, - handle); + handle->zone_pkey, + handle->record_name, + &ns_lookup_error_cb, + handle, + &ns_get_lookup_cb, + handle); if (NULL == handle->ns_qe) { handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); @@ -681,7 +680,6 @@ namestore_get (struct GNUNET_REST_RequestHandle *con_handle, } - static void ns_lookup_cb (void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, @@ -702,12 +700,12 @@ ns_lookup_cb (void *cls, for (j = 0; j < handle->rd_count; j++) rd_new[i + j] = handle->rd[j]; handle->ns_qe = GNUNET_NAMESTORE_records_store (handle->ns_handle, - handle->zone_pkey, - handle->record_name, - i + j, - rd_new, - &create_finished, - handle); + handle->zone_pkey, + handle->record_name, + i + j, + rd_new, + &create_finished, + handle); if (NULL == handle->ns_qe) { handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); @@ -794,12 +792,12 @@ namestore_add_or_update (struct GNUNET_REST_RequestHandle *con_handle, } handle->zone_pkey = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego); handle->ns_qe = GNUNET_NAMESTORE_records_lookup (handle->ns_handle, - handle->zone_pkey, - handle->record_name, - &ns_lookup_error_cb, - handle, - &ns_lookup_cb, - handle); + handle->zone_pkey, + handle->record_name, + &ns_lookup_error_cb, + handle, + &ns_lookup_cb, + handle); if (NULL == handle->ns_qe) { handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); @@ -898,9 +896,9 @@ namestore_delete (struct GNUNET_REST_RequestHandle *con_handle, handle->zone_pkey, handle->record_name, 0, - NULL, - &del_finished, - handle); + NULL, + &del_finished, + handle); if (NULL == handle->ns_qe) { handle->emsg = GNUNET_strdup (GNUNET_REST_NAMESTORE_FAILED); diff --git a/src/nat/gnunet-service-nat_helper.c b/src/nat/gnunet-service-nat_helper.c index 80d3559f3..bd1645d25 100644 --- a/src/nat/gnunet-service-nat_helper.c +++ b/src/nat/gnunet-service-nat_helper.c @@ -222,7 +222,7 @@ restart_nat_server (void *cls) return; } h->server_stdout = - GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); + GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW); if (NULL == h->server_stdout) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "pipe"); diff --git a/src/nat/gnunet-service-nat_mini.c b/src/nat/gnunet-service-nat_mini.c index b98255ad2..24f77d9cc 100644 --- a/src/nat/gnunet-service-nat_mini.c +++ b/src/nat/gnunet-service-nat_mini.c @@ -192,7 +192,7 @@ GNUNET_NAT_mini_get_external_ipv4_ (GNUNET_NAT_IPCallback cb, void *cb_cls) } LOG (GNUNET_ERROR_TYPE_DEBUG, "Running `external-ip' to determine our external IP\n"); - eh->opipe = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); + eh->opipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW); if (NULL == eh->opipe) { eh->ret = GNUNET_NAT_ERROR_IPC_FAILURE; diff --git a/src/reclaim/gnunet-service-reclaim_tickets.c b/src/reclaim/gnunet-service-reclaim_tickets.c index f170b6d84..7e6b07514 100644 --- a/src/reclaim/gnunet-service-reclaim_tickets.c +++ b/src/reclaim/gnunet-service-reclaim_tickets.c @@ -1292,7 +1292,7 @@ issue_ticket (struct TicketIssueHandle *ih) for (le = ih->attrs->list_head; NULL != le; le = le->next) attrs_count++; - //Worst case we have one attestation per attribute + // Worst case we have one attestation per attribute attrs_record = GNUNET_malloc (2 * attrs_count * sizeof(struct GNUNET_GNSRECORD_Data)); i = 0; diff --git a/src/reclaim/json_reclaim.h b/src/reclaim/json_reclaim.h index 61ddb4378..c57971dcb 100644 --- a/src/reclaim/json_reclaim.h +++ b/src/reclaim/json_reclaim.h @@ -56,4 +56,3 @@ GNUNET_RECLAIM_JSON_spec_ticket (struct GNUNET_RECLAIM_Ticket **ticket); struct GNUNET_JSON_Specification GNUNET_RECLAIM_JSON_spec_claim_attest (struct GNUNET_RECLAIM_Attestation **attr); - diff --git a/src/reclaim/plugin_reclaim_attribute_basic.c b/src/reclaim/plugin_reclaim_attribute_basic.c index 47fdd5f11..286186a93 100644 --- a/src/reclaim/plugin_reclaim_attribute_basic.c +++ b/src/reclaim/plugin_reclaim_attribute_basic.c @@ -90,6 +90,7 @@ basic_string_to_value (void *cls, } } + /** * Mapping of attribute type numbers to human-readable * attribute type names. diff --git a/src/reclaim/plugin_rest_reclaim.c b/src/reclaim/plugin_rest_reclaim.c index 654df175e..10ee2f801 100644 --- a/src/reclaim/plugin_rest_reclaim.c +++ b/src/reclaim/plugin_rest_reclaim.c @@ -576,7 +576,8 @@ attest_collect (void *cls, if (GNUNET_OK == GNUNET_RECLAIM_attestation_get_expiration (attest, &exp)) { - json_object_set_new (attest_obj, "expiration", json_integer (exp.abs_value_us)); + json_object_set_new (attest_obj, "expiration", json_integer ( + exp.abs_value_us)); } id_str = GNUNET_STRINGS_data_to_string_alloc (&attest->id, sizeof(attest->id)); @@ -597,7 +598,7 @@ attest_collect (void *cls, json_object_set_new (attr_obj, "name", json_string ( ale->attribute->name)); - json_object_set_new (attr_obj, "flag", json_string ("1")); //FIXME + json_object_set_new (attr_obj, "flag", json_string ("1")); // FIXME type = GNUNET_RECLAIM_attribute_number_to_typename (ale->attribute->type); json_object_set_new (attr_obj, "type", json_string (type)); json_object_set_new (attr_obj, "id", json_string ("")); diff --git a/src/reclaim/reclaim_attestation.c b/src/reclaim/reclaim_attestation.c index bdf80a709..1f2b1890b 100644 --- a/src/reclaim/reclaim_attestation.c +++ b/src/reclaim/reclaim_attestation.c @@ -552,7 +552,7 @@ GNUNET_RECLAIM_attestation_get_issuer (const struct int GNUNET_RECLAIM_attestation_get_expiration (const struct GNUNET_RECLAIM_Attestation *attest, - struct GNUNET_TIME_Absolute* exp) + struct GNUNET_TIME_Absolute*exp) { unsigned int i; struct Plugin *plugin; diff --git a/src/reclaim/reclaim_attribute.c b/src/reclaim/reclaim_attribute.c index 69c5351d3..05bdc1ac6 100644 --- a/src/reclaim/reclaim_attribute.c +++ b/src/reclaim/reclaim_attribute.c @@ -230,7 +230,8 @@ GNUNET_RECLAIM_attribute_value_to_string (uint32_t type, */ struct GNUNET_RECLAIM_Attribute * GNUNET_RECLAIM_attribute_new (const char *attr_name, - const struct GNUNET_RECLAIM_Identifier *attestation, + const struct + GNUNET_RECLAIM_Identifier *attestation, uint32_t type, const void *data, size_t data_size) diff --git a/src/revocation/gnunet-revocation-tvg.c b/src/revocation/gnunet-revocation-tvg.c index b8f462b28..29df1bb4d 100644 --- a/src/revocation/gnunet-revocation-tvg.c +++ b/src/revocation/gnunet-revocation-tvg.c @@ -43,13 +43,14 @@ print_bytes (void *buf, for (i = 0; i < buf_len; i++) { - if ((0 != i) && (0 != fold) && (i%fold == 0)) - printf("\n"); - printf("%02x", ((unsigned char*)buf)[i]); + if ((0 != i) && (0 != fold) && (i % fold == 0)) + printf ("\n"); + printf ("%02x", ((unsigned char*) buf)[i]); } - printf("\n"); + printf ("\n"); } + /** * Main function that will be run. * @@ -73,12 +74,12 @@ run (void *cls, GNUNET_CRYPTO_ecdsa_key_create (&id_priv); GNUNET_CRYPTO_ecdsa_key_get_public (&id_priv, &id_pub); - fprintf(stdout, "Zone private key (d, little-endian scalar):\n"); + fprintf (stdout, "Zone private key (d, little-endian scalar):\n"); print_bytes (&id_priv, sizeof(id_priv), 0); - fprintf(stdout, "\n"); - fprintf(stdout, "Zone public key (zk):\n"); + fprintf (stdout, "\n"); + fprintf (stdout, "Zone public key (zk):\n"); print_bytes (&id_pub, sizeof(id_pub), 0); - fprintf(stdout, "\n"); + fprintf (stdout, "\n"); memset (&pow, 0, sizeof (pow)); GNUNET_REVOCATION_pow_init (&id_priv, &pow); @@ -99,7 +100,7 @@ run (void *cls, GNUNET_assert (GNUNET_OK == GNUNET_REVOCATION_check_pow (&pow, TEST_DIFFICULTY, exp)); - fprintf(stdout, "Proof:\n"); + fprintf (stdout, "Proof:\n"); print_bytes (&pow, sizeof (pow), 8); diff --git a/src/revocation/revocation_api.c b/src/revocation/revocation_api.c index 3815e47b0..e0b195aa9 100644 --- a/src/revocation/revocation_api.c +++ b/src/revocation/revocation_api.c @@ -468,9 +468,9 @@ GNUNET_REVOCATION_check_pow (const struct GNUNET_REVOCATION_PowP *pow, /** * First, check if PoW set is strictly monotically increasing */ - for (unsigned int i = 0; i < POW_COUNT-1; i++) + for (unsigned int i = 0; i < POW_COUNT - 1; i++) { - if (GNUNET_ntohll (pow->pow[i]) >= GNUNET_ntohll (pow->pow[i+1])) + if (GNUNET_ntohll (pow->pow[i]) >= GNUNET_ntohll (pow->pow[i + 1])) return GNUNET_NO; } GNUNET_memcpy (&buf[sizeof(uint64_t)], @@ -592,6 +592,7 @@ GNUNET_REVOCATION_pow_start (struct GNUNET_REVOCATION_PowP *pow, return pc; } + /** * Comparison function for quicksort * @@ -602,9 +603,10 @@ GNUNET_REVOCATION_pow_start (struct GNUNET_REVOCATION_PowP *pow, static int cmp_pow_value (const void *a, const void *b) { - return ( GNUNET_ntohll(*(uint64_t*)a) - GNUNET_ntohll(*(uint64_t*)b)); + return (GNUNET_ntohll (*(uint64_t*) a) - GNUNET_ntohll (*(uint64_t*) b)); } + /** * Calculate a key revocation valid for broadcasting for a number * of epochs. diff --git a/src/rps/gnunet-rps-profiler.c b/src/rps/gnunet-rps-profiler.c index af43a0fa1..08d1d2d34 100644 --- a/src/rps/gnunet-rps-profiler.c +++ b/src/rps/gnunet-rps-profiler.c @@ -924,10 +924,10 @@ tofile_ (const char *file_name, const char *line) int size; \ size = GNUNET_snprintf (tmp_buf, sizeof(tmp_buf), __VA_ARGS__); \ if (0 > size) \ - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \ - "Failed to create tmp_buf\n"); \ + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \ + "Failed to create tmp_buf\n"); \ else \ - tofile_ (file_name, tmp_buf); \ + tofile_ (file_name, tmp_buf); \ } while (0); diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c index 81cf63c72..a7dc3aa00 100644 --- a/src/rps/test_rps.c +++ b/src/rps/test_rps.c @@ -656,10 +656,10 @@ tofile_ (const char *file_name, const char *line) int size; \ size = GNUNET_snprintf (tmp_buf, sizeof(tmp_buf), __VA_ARGS__); \ if (0 > size) \ - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \ - "Failed to create tmp_buf\n"); \ + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, \ + "Failed to create tmp_buf\n"); \ else \ - tofile_ (file_name, tmp_buf); \ + tofile_ (file_name, tmp_buf); \ } while (0); diff --git a/src/set/gnunet-service-set_intersection.c b/src/set/gnunet-service-set_intersection.c index 993cead11..9313483bb 100644 --- a/src/set/gnunet-service-set_intersection.c +++ b/src/set/gnunet-service-set_intersection.c @@ -868,7 +868,7 @@ process_bf (struct Operation *op) GNUNET_CONTAINER_multihashmap_size (op->state->my_elements)); op->state->full_result_iter = GNUNET_CONTAINER_multihashmap_iterator_create ( - op->state->my_elements); + op->state->my_elements); send_remaining_elements (op); return; } diff --git a/src/set/gnunet-service-set_union_strata_estimator.c b/src/set/gnunet-service-set_union_strata_estimator.c index 1101a56a6..97b4a1f98 100644 --- a/src/set/gnunet-service-set_union_strata_estimator.c +++ b/src/set/gnunet-service-set_union_strata_estimator.c @@ -149,7 +149,7 @@ strata_estimator_insert (struct StrataEstimator *se, v = key.key_val; /* count trailing '1'-bits of v */ - for (i = 0; v &1; v >>= 1, i++) + for (i = 0; v & 1; v >>= 1, i++) /* empty */; ibf_insert (se->strata[i], key); } @@ -170,7 +170,7 @@ strata_estimator_remove (struct StrataEstimator *se, v = key.key_val; /* count trailing '1'-bits of v */ - for (i = 0; v &1; v >>= 1, i++) + for (i = 0; v & 1; v >>= 1, i++) /* empty */; ibf_remove (se->strata[i], key); } diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c index be2a49201..31c367e91 100644 --- a/src/statistics/gnunet-service-statistics.c +++ b/src/statistics/gnunet-service-statistics.c @@ -290,7 +290,8 @@ save () msg->flags = htonl (pos->persistent ? GNUNET_STATISTICS_SETFLAG_PERSISTENT : 0); msg->value = GNUNET_htonll (pos->value); - if (GNUNET_OK != GNUNET_BIO_write (wh, "statistics-save-msg", msg, size)) + if (GNUNET_OK != GNUNET_BIO_write (wh, "statistics-save-msg", msg, + size)) { GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "write", fn); if (GNUNET_OK != GNUNET_BIO_write_close (wh, NULL)) diff --git a/src/testbed/generate-underlay-topology.c b/src/testbed/generate-underlay-topology.c index 726bed179..97c3c1e67 100644 --- a/src/testbed/generate-underlay-topology.c +++ b/src/testbed/generate-underlay-topology.c @@ -51,12 +51,12 @@ __LINE__, \ sqlite3_errmsg (db)); \ if (msg != NULL) \ - GNUNET_asprintf (msg, \ - _ ("`%s' failed at %s:%u with error: %s"), \ - cmd, \ - __FILE__, \ - __LINE__, \ - sqlite3_errmsg (db)); \ + GNUNET_asprintf (msg, \ + _ ("`%s' failed at %s:%u with error: %s"), \ + cmd, \ + __FILE__, \ + __LINE__, \ + sqlite3_errmsg (db)); \ } while (0) diff --git a/src/testbed/gnunet-daemon-latency-logger.c b/src/testbed/gnunet-daemon-latency-logger.c index c13750db7..cbc9cfdbf 100644 --- a/src/testbed/gnunet-daemon-latency-logger.c +++ b/src/testbed/gnunet-daemon-latency-logger.c @@ -53,8 +53,8 @@ "`%s' failed at %s:%d with error: %s\n"), \ cmd, __FILE__, __LINE__, sqlite3_errmsg (db)); \ if (msg != NULL) \ - GNUNET_asprintf (msg, _ ("`%s' failed at %s:%u with error: %s"), cmd, \ - __FILE__, __LINE__, sqlite3_errmsg (db)); \ + GNUNET_asprintf (msg, _ ("`%s' failed at %s:%u with error: %s"), cmd, \ + __FILE__, __LINE__, sqlite3_errmsg (db)); \ } while (0) diff --git a/src/testbed/gnunet-daemon-testbed-underlay.c b/src/testbed/gnunet-daemon-testbed-underlay.c index 2bff7cdd4..c3b424c9b 100644 --- a/src/testbed/gnunet-daemon-testbed-underlay.c +++ b/src/testbed/gnunet-daemon-testbed-underlay.c @@ -57,8 +57,8 @@ "`%s' failed at %s:%d with error: %s\n"), \ cmd, __FILE__, __LINE__, sqlite3_errmsg (db)); \ if (msg != NULL) \ - GNUNET_asprintf (msg, _ ("`%s' failed at %s:%u with error: %s"), cmd, \ - __FILE__, __LINE__, sqlite3_errmsg (db)); \ + GNUNET_asprintf (msg, _ ("`%s' failed at %s:%u with error: %s"), cmd, \ + __FILE__, __LINE__, sqlite3_errmsg (db)); \ } while (0) diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c index 03be376fe..5d0c3b048 100644 --- a/src/testbed/gnunet-helper-testbed.c +++ b/src/testbed/gnunet-helper-testbed.c @@ -587,7 +587,7 @@ main (int argc, char **argv) status = GNUNET_OK; if (NULL == - (sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO))) + (sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE))) { GNUNET_break (0); return 1; diff --git a/src/testbed/gnunet-service-testbed.h b/src/testbed/gnunet-service-testbed.h index 03955327c..ae477ccb4 100644 --- a/src/testbed/gnunet-service-testbed.h +++ b/src/testbed/gnunet-service-testbed.h @@ -498,7 +498,7 @@ extern char *GST_stats_dir; GNUNET_assert (size <= accommodate_size); \ growth_size = size; \ while (growth_size <= accommodate_size) \ - growth_size += LIST_GROW_STEP; \ + growth_size += LIST_GROW_STEP; \ GNUNET_array_grow (ptr, size, growth_size); \ GNUNET_assert (size > accommodate_size); \ } while (0) diff --git a/src/testbed/gnunet_testbed_mpi_spawn.c b/src/testbed/gnunet_testbed_mpi_spawn.c index 353cc2881..577ffbeba 100644 --- a/src/testbed/gnunet_testbed_mpi_spawn.c +++ b/src/testbed/gnunet_testbed_mpi_spawn.c @@ -299,8 +299,7 @@ main (int argc, char *argv[]) GNUNET_break (0); return 1; } - if (NULL == (sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, - GNUNET_NO, GNUNET_NO))) + if (NULL == (sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE))) { GNUNET_break (0); ret = GNUNET_SYSERR; diff --git a/src/testbed/test_testbed_api.c b/src/testbed/test_testbed_api.c index dd270df17..49f1d9ae9 100644 --- a/src/testbed/test_testbed_api.c +++ b/src/testbed/test_testbed_api.c @@ -163,7 +163,7 @@ do_shutdown (void *cls) if (! (cond)) { \ GNUNET_break (0); \ if (NULL != abort_task) \ - GNUNET_SCHEDULER_cancel (abort_task); \ + GNUNET_SCHEDULER_cancel (abort_task); \ abort_task = NULL; \ GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \ ret; \ diff --git a/src/testbed/test_testbed_api_2peers_1controller.c b/src/testbed/test_testbed_api_2peers_1controller.c index c854d1ccc..4a8b8a584 100644 --- a/src/testbed/test_testbed_api_2peers_1controller.c +++ b/src/testbed/test_testbed_api_2peers_1controller.c @@ -173,7 +173,7 @@ static enum Stage result; if (! (cond)) { \ GNUNET_break (0); \ if (NULL != abort_task) \ - GNUNET_SCHEDULER_cancel (abort_task); \ + GNUNET_SCHEDULER_cancel (abort_task); \ abort_task = NULL; \ GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \ return; \ diff --git a/src/testbed/test_testbed_api_controllerlink.c b/src/testbed/test_testbed_api_controllerlink.c index 16a3f7b91..784407520 100644 --- a/src/testbed/test_testbed_api_controllerlink.c +++ b/src/testbed/test_testbed_api_controllerlink.c @@ -298,7 +298,7 @@ static enum Stage result; { \ GNUNET_break (0); \ if (NULL != abort_task) \ - GNUNET_SCHEDULER_cancel (abort_task); \ + GNUNET_SCHEDULER_cancel (abort_task); \ abort_task = NULL; \ GNUNET_SCHEDULER_shutdown (); \ return; \ diff --git a/src/testbed/test_testbed_api_peer_reconfiguration.c b/src/testbed/test_testbed_api_peer_reconfiguration.c index 91955c13d..22dd46b53 100644 --- a/src/testbed/test_testbed_api_peer_reconfiguration.c +++ b/src/testbed/test_testbed_api_peer_reconfiguration.c @@ -77,7 +77,7 @@ enum if (! (cond)) { \ GNUNET_break (0); \ if (NULL != abort_task) \ - GNUNET_SCHEDULER_cancel (abort_task); \ + GNUNET_SCHEDULER_cancel (abort_task); \ abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \ ret; \ } \ diff --git a/src/testbed/test_testbed_api_peers_manage_services.c b/src/testbed/test_testbed_api_peers_manage_services.c index 6d4f8196a..93b0da550 100644 --- a/src/testbed/test_testbed_api_peers_manage_services.c +++ b/src/testbed/test_testbed_api_peers_manage_services.c @@ -92,7 +92,7 @@ enum if (! (cond)) { \ GNUNET_break (0); \ if (NULL != abort_task) \ - GNUNET_SCHEDULER_cancel (abort_task); \ + GNUNET_SCHEDULER_cancel (abort_task); \ abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \ ret; \ } \ diff --git a/src/testbed/test_testbed_api_statistics.c b/src/testbed/test_testbed_api_statistics.c index dc305d008..4d42cda6a 100644 --- a/src/testbed/test_testbed_api_statistics.c +++ b/src/testbed/test_testbed_api_statistics.c @@ -76,7 +76,7 @@ static unsigned int num_seen_peers; if (! (cond)) { \ GNUNET_break (0); \ if (NULL != abort_task) \ - GNUNET_SCHEDULER_cancel (abort_task); \ + GNUNET_SCHEDULER_cancel (abort_task); \ abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \ ret; \ } \ diff --git a/src/testbed/test_testbed_api_test.c b/src/testbed/test_testbed_api_test.c index d3fec78d9..aefbd340e 100644 --- a/src/testbed/test_testbed_api_test.c +++ b/src/testbed/test_testbed_api_test.c @@ -90,10 +90,10 @@ do_shutdown (void *cls) if (! (cond)) { \ GNUNET_break (0); \ if (NULL != abort_task) \ - GNUNET_SCHEDULER_cancel (abort_task); \ + GNUNET_SCHEDULER_cancel (abort_task); \ abort_task = NULL; \ if (NULL == shutdown_task) \ - shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); \ + shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); \ return; \ } \ } while (0) diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index 152762280..95a6bf76f 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c @@ -56,7 +56,7 @@ do \ { \ if (cond) \ - break; \ + break; \ LOG (GNUNET_ERROR_TYPE_ERROR, "API violation detected: %s\n", errstr); \ GNUNET_assert (0); \ } while (0) diff --git a/src/transport/gnunet-communicator-tcp.c b/src/transport/gnunet-communicator-tcp.c index e25cdf139..177b5c26c 100644 --- a/src/transport/gnunet-communicator-tcp.c +++ b/src/transport/gnunet-communicator-tcp.c @@ -577,7 +577,6 @@ struct Addresses }; - /** * Maximum queue length before we stop reading towards the transport service. */ @@ -1203,6 +1202,7 @@ queue_read (void *cls) queue_finish (queue); } + /** * Convert a `struct sockaddr_in6 to a `struct sockaddr *` * @@ -1234,6 +1234,7 @@ tcp_address_to_sockaddr_numeric_v6 (socklen_t *sock_len, struct sockaddr_in6 v6, return in; } + /** * Convert a `struct sockaddr_in4 to a `struct sockaddr *` * @@ -1257,6 +1258,7 @@ tcp_address_to_sockaddr_numeric_v4 (socklen_t *sock_len, struct sockaddr_in v4, return in; } + /** * Convert TCP bind specification to a `struct PortOnlyIpv4Ipv6 *` * @@ -1318,6 +1320,7 @@ tcp_address_to_sockaddr_port_only (const char *bindto, unsigned int *port) return po; } + /** * This Method extracts the address part of the BINDTO string. * @@ -1344,7 +1347,8 @@ extract_address (const char *bindto) start++; /* skip over '['*/ cp[strlen (cp) - 1] = '\0'; /* eat ']'*/ } - else { + else + { token = strtok_r (cp, "]", &rest); if (strlen (bindto) == strlen (token)) { @@ -1362,6 +1366,7 @@ extract_address (const char *bindto) return start; } + /** * This Method extracts the port part of the BINDTO string. * @@ -1440,6 +1445,7 @@ extract_port (const char *addr_and_port) return port; } + /** * Convert TCP bind specification to a `struct sockaddr *` * @@ -2140,6 +2146,7 @@ queue_read_kx (void *cls) queue->read_task = GNUNET_SCHEDULER_add_now (&queue_read, queue); } + /** * Function called by the transport service to initialize a * message queue given address information about another peer. @@ -2229,6 +2236,7 @@ mq_init (void *cls, const struct GNUNET_PeerIdentity *peer, const char *address) return GNUNET_OK; } + /** * Iterator over all message queues to clean up. * @@ -2367,6 +2375,7 @@ nat_address_cb (void *cls, } } + /** * This method launch network interactions for each address we like to bind to. * @@ -2474,7 +2483,7 @@ init_socket (const struct sockaddr *addr, if (NULL == queue_map) queue_map = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO); - if (NULL == ch ) + if (NULL == ch) ch = GNUNET_TRANSPORT_communicator_connect (cfg, COMMUNICATOR_CONFIG_SECTION, COMMUNICATOR_ADDRESS_PREFIX, @@ -2496,6 +2505,7 @@ init_socket (const struct sockaddr *addr, } + /** * This method reads from the DLL addrs_head to register them at the NAT service. */ @@ -2557,6 +2567,7 @@ nat_register () } } + /** * This method adds addresses to the DLL, that are later register at the NAT service. */ @@ -2573,6 +2584,7 @@ add_addr (struct sockaddr *in, socklen_t in_len) addrs_lens++; } + /** * This method is the callback called by the resolver API, and wraps method init_socket. * @@ -2625,6 +2637,7 @@ init_socket_resolv (void *cls, } } + /** * Setup communicator and launch network interactions. * diff --git a/src/transport/gnunet-communicator-udp.c b/src/transport/gnunet-communicator-udp.c index efbbd08a7..03c120cc9 100644 --- a/src/transport/gnunet-communicator-udp.c +++ b/src/transport/gnunet-communicator-udp.c @@ -1309,7 +1309,8 @@ handle_ack (void *cls, const struct GNUNET_PeerIdentity *pid, void *value) "Tell transport we have more acks!\n"); GNUNET_TRANSPORT_communicator_mq_update (ch, receiver->d_qh, - (allowed - ss->sequence_allowed), + (allowed + - ss->sequence_allowed), 1); ss->sequence_allowed = allowed; /* move ss to head to avoid discarding it anytime soon! */ diff --git a/src/transport/gnunet-communicator-unix.c b/src/transport/gnunet-communicator-unix.c index 6ea0ea360..d7e18f87a 100644 --- a/src/transport/gnunet-communicator-unix.c +++ b/src/transport/gnunet-communicator-unix.c @@ -673,7 +673,8 @@ setup_queue (const struct GNUNET_PeerIdentity *target, queue->qh = GNUNET_TRANSPORT_communicator_mq_add (ch, &queue->target, foreign_addr, - UNIX_MTU - sizeof (struct UNIXMessage), + UNIX_MTU - sizeof (struct + UNIXMessage), GNUNET_TRANSPORT_QUEUE_LENGTH_UNLIMITED, 0, GNUNET_NT_LOOPBACK, @@ -799,7 +800,7 @@ select_read_cb (void *cls) /* ensure aligned access */ memcpy (&al_hdr, currhdr, sizeof(al_hdr)); if ((tsize < sizeof(struct GNUNET_MessageHeader)) || - (tsize != ntohs(al_hdr.size))) + (tsize != ntohs (al_hdr.size))) { GNUNET_break_op (0); return; diff --git a/src/transport/plugin_transport_smtp.c b/src/transport/plugin_transport_smtp.c index 330023118..f3db4fc5a 100644 --- a/src/transport/plugin_transport_smtp.c +++ b/src/transport/plugin_transport_smtp.c @@ -174,9 +174,9 @@ listenAndDistribute (void *unused) goto END; \ } \ if (core_api->load_monitor != NULL) \ - GNUNET_network_monitor_notify_transmission (core_api->load_monitor, \ - GNUNET_ND_DOWNLOAD, \ - strlen (retl)); \ + GNUNET_network_monitor_notify_transmission (core_api->load_monitor, \ + GNUNET_ND_DOWNLOAD, \ + strlen (retl)); \ } while (0) diff --git a/src/transport/test_communicator_basic.c b/src/transport/test_communicator_basic.c index 290167960..45c268684 100644 --- a/src/transport/test_communicator_basic.c +++ b/src/transport/test_communicator_basic.c @@ -224,8 +224,8 @@ latency_timeout (void *cls) } LOG (GNUNET_ERROR_TYPE_ERROR, - "Latency too high. Test failed. (Phase: %d. Sent: %lu, Received: %lu)\n", - phase, num_sent, num_received); + "Latency too high. Test failed. (Phase: %d. Sent: %lu, Received: %lu)\n", + phase, num_sent, num_received); ret = 2; GNUNET_SCHEDULER_shutdown (); } @@ -403,7 +403,7 @@ incoming_message_cb (void *cls, if (0 != strcmp ((char*) cls, cfg_peers_name[NUM_PEERS - 1])) { LOG (GNUNET_ERROR_TYPE_WARNING, - "unexpected receiver...\n"); + "unexpected receiver...\n"); return; } /* Reset timeout */ @@ -422,18 +422,18 @@ incoming_message_cb (void *cls, if (num_received == BURST_PACKETS) { LOG (GNUNET_ERROR_TYPE_MESSAGE, - "Short size packet test done.\n"); + "Short size packet test done.\n"); char *goodput = GNUNET_STRINGS_byte_size_fancy ((SHORT_MESSAGE_SIZE * num_received * 1000 * 1000) / duration.rel_value_us); LOG (GNUNET_ERROR_TYPE_MESSAGE, - "%lu/%lu packets in %llu us (%s/s) -- avg latency: %llu us\n", - (unsigned long) num_received, - (unsigned long) num_sent, - (unsigned long long) duration.rel_value_us, - goodput, - (unsigned long long) avg_latency); + "%lu/%lu packets in %llu us (%s/s) -- avg latency: %llu us\n", + (unsigned long) num_received, + (unsigned long) num_sent, + (unsigned long long) duration.rel_value_us, + goodput, + (unsigned long long) avg_latency); GNUNET_free (goodput); start_long = GNUNET_TIME_absolute_get (); phase = TP_BURST_LONG; @@ -449,7 +449,7 @@ incoming_message_cb (void *cls, if (long_message_size != payload_len) { LOG (GNUNET_ERROR_TYPE_WARNING, - "Ignoring packet with wrong length\n"); + "Ignoring packet with wrong length\n"); return; // Ignore } num_received++; @@ -458,19 +458,19 @@ incoming_message_cb (void *cls, if (num_received == BURST_PACKETS) { LOG (GNUNET_ERROR_TYPE_MESSAGE, - "Long size packet test done.\n"); + "Long size packet test done.\n"); char *goodput = GNUNET_STRINGS_byte_size_fancy ((long_message_size * num_received * 1000 * 1000) / duration.rel_value_us); LOG (GNUNET_ERROR_TYPE_MESSAGE, - "%lu/%lu packets in %llu us (%s/s) -- avg latency: %llu us\n", - (unsigned long) num_received, - (unsigned long) num_sent, - (unsigned long long) duration.rel_value_us, - goodput, - (unsigned long long) avg_latency); + "%lu/%lu packets in %llu us (%s/s) -- avg latency: %llu us\n", + (unsigned long) num_received, + (unsigned long) num_sent, + (unsigned long long) duration.rel_value_us, + goodput, + (unsigned long long) avg_latency); GNUNET_free (goodput); ack = 0; phase = TP_SIZE_CHECK; @@ -493,12 +493,12 @@ incoming_message_cb (void *cls, if (num_received >= (max_size) / 10) { LOG (GNUNET_ERROR_TYPE_MESSAGE, - "Size packet test done.\n"); + "Size packet test done.\n"); LOG (GNUNET_ERROR_TYPE_MESSAGE, - "%lu/%lu packets -- avg latency: %llu us\n", - (unsigned long) num_received, - (unsigned long) num_sent, - (unsigned long long) avg_latency); + "%lu/%lu packets -- avg latency: %llu us\n", + (unsigned long) num_received, + (unsigned long) num_sent, + (unsigned long long) avg_latency); num_received = 0; num_sent = 0; avg_latency = 0; @@ -511,7 +511,7 @@ incoming_message_cb (void *cls, break; } LOG (GNUNET_ERROR_TYPE_DEBUG, - "Finished\n"); + "Finished\n"); GNUNET_SCHEDULER_shutdown (); } break; @@ -640,9 +640,9 @@ main (int argc, &peer_id[i].public_key); GNUNET_free (private_key); LOG (GNUNET_ERROR_TYPE_INFO, - "Identity of peer %u is %s\n", - i, - GNUNET_i2s_full (&peer_id[i])); + "Identity of peer %u is %s\n", + i, + GNUNET_i2s_full (&peer_id[i])); } LOG (GNUNET_ERROR_TYPE_MESSAGE, "Starting test...\n"); GNUNET_SCHEDULER_run (&run, diff --git a/src/transport/transport-testing2.c b/src/transport/transport-testing2.c index 2a7a1dfcb..772ad9f2d 100644 --- a/src/transport/transport-testing2.c +++ b/src/transport/transport-testing2.c @@ -671,8 +671,8 @@ handle_update_queue_message (void *cls, struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorQueue *tc_queue; LOG (GNUNET_ERROR_TYPE_DEBUG, - "Received queue update message for %u with q_len %"PRIu64"\n", - msg->qid, GNUNET_ntohll(msg->q_len)); + "Received queue update message for %u with q_len %" PRIu64 "\n", + msg->qid, GNUNET_ntohll (msg->q_len)); tc_queue = tc_h->queue_head; if (NULL != tc_queue) { @@ -947,6 +947,7 @@ shutdown_nat (void *cls) shutdown_process (proc); } + /** * @brief Task run at shutdown to kill the resolver process * @@ -959,6 +960,7 @@ shutdown_resolver (void *cls) shutdown_process (proc); } + static void resolver_start (struct GNUNET_TRANSPORT_TESTING_TransportCommunicatorHandle *tc_h) @@ -967,16 +969,17 @@ resolver_start (struct LOG (GNUNET_ERROR_TYPE_DEBUG, "resolver_start\n"); binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); - tc_h->resolver_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR - | GNUNET_OS_USE_PIPE_CONTROL, - NULL, - NULL, - NULL, - binary, - "gnunet-service-resolver", - "-c", - tc_h->cfg_filename, - NULL); + tc_h->resolver_proc = GNUNET_OS_start_process ( + GNUNET_OS_INHERIT_STD_OUT_AND_ERR + | GNUNET_OS_USE_PIPE_CONTROL, + NULL, + NULL, + NULL, + binary, + "gnunet-service-resolver", + "-c", + tc_h->cfg_filename, + NULL); if (NULL == tc_h->resolver_proc) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to start resolver service!"); @@ -987,6 +990,7 @@ resolver_start (struct } + /** * @brief Start NAT * diff --git a/src/transport/transport.h b/src/transport/transport.h index a64ffd5c6..dbae4ecfb 100644 --- a/src/transport/transport.h +++ b/src/transport/transport.h @@ -903,7 +903,6 @@ struct GNUNET_TRANSPORT_UpdateQueueMessage }; - /** * Remove queue, it is no longer available. */ diff --git a/src/transport/transport_api2_communication.c b/src/transport/transport_api2_communication.c index cfa144415..d1e28cc36 100644 --- a/src/transport/transport_api2_communication.c +++ b/src/transport/transport_api2_communication.c @@ -420,6 +420,7 @@ send_add_queue (struct GNUNET_TRANSPORT_QueueHandle *qh) GNUNET_MQ_send (qh->ch->mq, env); } + /** * Send message to the transport service about queue @a qh * updated. @@ -446,7 +447,6 @@ send_update_queue (struct GNUNET_TRANSPORT_QueueHandle *qh) } - /** * Send message to the transport service about queue @a qh * being no longer available. @@ -1033,7 +1033,6 @@ GNUNET_TRANSPORT_communicator_mq_update ( } - /** * Notify transport service that an MQ became unavailable due to a * disconnect or timeout. diff --git a/src/util/bio.c b/src/util/bio.c index b27230240..39050bb87 100644 --- a/src/util/bio.c +++ b/src/util/bio.c @@ -260,7 +260,7 @@ read_from_buffer (struct GNUNET_BIO_ReadHandle *h, char *result, size_t len) { - if (h->size < len || h->size - h->pos < len) + if ((h->size < len) || (h->size - h->pos < len)) { GNUNET_asprintf (&h->emsg, _ ("Error while reading `%s' from buffer: %s"), @@ -431,6 +431,7 @@ GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, return GNUNET_OK; } + /** * Read a float. * @@ -439,9 +440,9 @@ GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, * @param f address of float to read */ int -GNUNET_BIO_read_float(struct GNUNET_BIO_ReadHandle *h, - const char *what, - float *f) +GNUNET_BIO_read_float (struct GNUNET_BIO_ReadHandle *h, + const char *what, + float *f) { int32_t *i = (int32_t *) f; return GNUNET_BIO_read_int32 (h, what, i); @@ -456,9 +457,9 @@ GNUNET_BIO_read_float(struct GNUNET_BIO_ReadHandle *h, * @param f address of double to read */ int -GNUNET_BIO_read_double(struct GNUNET_BIO_ReadHandle *h, - const char *what, - double *f) +GNUNET_BIO_read_double (struct GNUNET_BIO_ReadHandle *h, + const char *what, + double *f) { int64_t *i = (int64_t *) f; return GNUNET_BIO_read_int64 (h, what, i); @@ -692,7 +693,7 @@ GNUNET_BIO_get_buffer_contents (struct GNUNET_BIO_WriteHandle *h, { if (IO_BUFFER != h->type) return GNUNET_SYSERR; - if (NULL == contents || NULL == size) + if ((NULL == contents) || (NULL == size)) return GNUNET_SYSERR; int ret = (NULL != h->emsg) ? GNUNET_SYSERR : GNUNET_OK; if (NULL != emsg) @@ -897,9 +898,9 @@ GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, * @param f float to write */ int -GNUNET_BIO_write_float(struct GNUNET_BIO_WriteHandle *h, - const char *what, - float f) +GNUNET_BIO_write_float (struct GNUNET_BIO_WriteHandle *h, + const char *what, + float f) { int32_t i = f; return GNUNET_BIO_write_int32 (h, what, i); @@ -914,9 +915,9 @@ GNUNET_BIO_write_float(struct GNUNET_BIO_WriteHandle *h, * @param f double to write */ int -GNUNET_BIO_write_double(struct GNUNET_BIO_WriteHandle *h, - const char *what, - double f) +GNUNET_BIO_write_double (struct GNUNET_BIO_WriteHandle *h, + const char *what, + double f) { int64_t i = f; return GNUNET_BIO_write_int64 (h, what, i); @@ -1196,7 +1197,7 @@ GNUNET_BIO_read_spec_int64 (const char *what, * @param f address of float to read */ struct GNUNET_BIO_ReadSpec -GNUNET_BIO_read_spec_float(const char *what, float *f) +GNUNET_BIO_read_spec_float (const char *what, float *f) { struct GNUNET_BIO_ReadSpec rs = { .rh = &read_spec_handler_int32, @@ -1216,7 +1217,7 @@ GNUNET_BIO_read_spec_float(const char *what, float *f) * @param f address of double to read */ struct GNUNET_BIO_ReadSpec -GNUNET_BIO_read_spec_double(const char *what, double *f) +GNUNET_BIO_read_spec_double (const char *what, double *f) { struct GNUNET_BIO_ReadSpec rs = { .rh = &read_spec_handler_int64, @@ -1243,7 +1244,7 @@ GNUNET_BIO_read_spec_commit (struct GNUNET_BIO_ReadHandle *h, { int ret = GNUNET_OK; - for (size_t i=0; NULL!=rs[i].rh; ++i) + for (size_t i = 0; NULL!=rs[i].rh; ++i) { ret = rs[i].rh (rs[i].cls, h, rs[i].what, rs[i].target, rs[i].size); if (GNUNET_OK != ret) @@ -1490,7 +1491,7 @@ GNUNET_BIO_write_spec_int64 (const char *what, * @return the write spec */ struct GNUNET_BIO_WriteSpec -GNUNET_BIO_write_spec_float(const char *what, float *f) +GNUNET_BIO_write_spec_float (const char *what, float *f) { struct GNUNET_BIO_WriteSpec ws = { .wh = &write_spec_handler_int32, @@ -1512,7 +1513,7 @@ GNUNET_BIO_write_spec_float(const char *what, float *f) * @return the write spec */ struct GNUNET_BIO_WriteSpec -GNUNET_BIO_write_spec_double(const char *what, double *f) +GNUNET_BIO_write_spec_double (const char *what, double *f) { struct GNUNET_BIO_WriteSpec ws = { .wh = &write_spec_handler_int64, @@ -1540,7 +1541,7 @@ GNUNET_BIO_write_spec_commit (struct GNUNET_BIO_WriteHandle *h, { int ret = GNUNET_OK; - for (size_t i=0; NULL!=ws[i].wh; ++i) + for (size_t i = 0; NULL!=ws[i].wh; ++i) { ret = ws[i].wh (ws[i].cls, h, ws[i].what, ws[i].source, ws[i].source_size); if (GNUNET_OK != ret) diff --git a/src/util/configuration.c b/src/util/configuration.c index faee9e3bf..26beacaff 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c @@ -1819,12 +1819,12 @@ GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, * @return a freshly allocated configuration */ struct GNUNET_CONFIGURATION_Handle * -GNUNET_CONFIGURATION_default(void) +GNUNET_CONFIGURATION_default (void) { const struct GNUNET_OS_ProjectData *pd = GNUNET_OS_project_data_get (); const struct GNUNET_OS_ProjectData *dpd = GNUNET_OS_project_data_default (); - GNUNET_OS_init(dpd); + GNUNET_OS_init (dpd); struct GNUNET_CONFIGURATION_Handle *cfg = GNUNET_CONFIGURATION_create (); const char *xdg = getenv ("XDG_CONFIG_HOME"); @@ -1835,7 +1835,8 @@ GNUNET_CONFIGURATION_default(void) else cfgname = GNUNET_strdup (pd->user_config_file); - if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cfgname)) { + if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cfgname)) + { GNUNET_OS_init (pd); GNUNET_CONFIGURATION_destroy (cfg); GNUNET_free (cfgname); diff --git a/src/util/crypto_ecc.c b/src/util/crypto_ecc.c index e1608ae55..019dbe94e 100644 --- a/src/util/crypto_ecc.c +++ b/src/util/crypto_ecc.c @@ -141,7 +141,7 @@ decode_private_ecdsa_key (const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv) int rc; uint8_t d[32]; - for (size_t i=0; i<32; i++) + for (size_t i = 0; i<32; i++) d[i] = priv->d[31 - i]; rc = gcry_sexp_build (&result, @@ -195,7 +195,7 @@ GNUNET_CRYPTO_eddsa_key_get_public ( struct GNUNET_CRYPTO_EddsaPublicKey *pub) { unsigned char pk[crypto_sign_PUBLICKEYBYTES]; - unsigned char sk[crypto_sign_SECRETKEYBYTES]; + unsigned char sk[crypto_sign_SECRETKEYBYTES]; BENCHMARK_START (eddsa_key_get_public); GNUNET_assert (0 == crypto_sign_seed_keypair (pk, sk, priv->d)); @@ -929,7 +929,7 @@ GNUNET_CRYPTO_ecdsa_private_key_derive ( h = derive_h (&pub, label, context); /* Convert to big endian for libgcrypt */ - for (size_t i=0; i < 32; i++) + for (size_t i = 0; i < 32; i++) dc[i] = priv->d[31 - i]; GNUNET_CRYPTO_mpi_scan_unsigned (&x, dc, sizeof(dc)); d = gcry_mpi_new (256); @@ -941,9 +941,9 @@ GNUNET_CRYPTO_ecdsa_private_key_derive ( ret = GNUNET_new (struct GNUNET_CRYPTO_EcdsaPrivateKey); GNUNET_CRYPTO_mpi_print_unsigned (dc, sizeof(dc), d); /* Convert to big endian for libgcrypt */ - for (size_t i=0; i < 32; i++) + for (size_t i = 0; i < 32; i++) ret->d[i] = dc[31 - i]; - sodium_memzero(dc, sizeof(dc)); + sodium_memzero (dc, sizeof(dc)); gcry_mpi_release (d); return ret; } diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c index 622953476..0dbe9dbe8 100644 --- a/src/util/crypto_hash.c +++ b/src/util/crypto_hash.c @@ -250,12 +250,13 @@ GNUNET_CRYPTO_hash_to_aes_key (const struct GNUNET_HashCode *hc, */ int GNUNET_CRYPTO_hash_get_bit_ltr (const struct GNUNET_HashCode *code, - unsigned int bit) + unsigned int bit) { GNUNET_assert (bit < 8 * sizeof(struct GNUNET_HashCode)); return (((unsigned char *) code)[bit >> 3] & (128 >> (bit & 7))) > 0; } + /** * Obtain a bit from a hashcode. * @param code the GNUNET_CRYPTO_hash to index bit-wise @@ -272,7 +273,6 @@ GNUNET_CRYPTO_hash_get_bit_rtl (const struct GNUNET_HashCode *code, } - /** * Determine how many low order bits match in two * `struct GNUNET_HashCode`s. i.e. - 010011 and 011111 share diff --git a/src/util/crypto_mpi.c b/src/util/crypto_mpi.c index 099921611..6df47c7e1 100644 --- a/src/util/crypto_mpi.c +++ b/src/util/crypto_mpi.c @@ -157,8 +157,8 @@ GNUNET_CRYPTO_mpi_scan_unsigned (gcry_mpi_t *result, */ void GNUNET_CRYPTO_mpi_scan_unsigned_le (gcry_mpi_t *result, - const void *data, - size_t size) + const void *data, + size_t size) { int rc; diff --git a/src/util/disk.c b/src/util/disk.c index cdead59d2..6560726ea 100644 --- a/src/util/disk.c +++ b/src/util/disk.c @@ -1451,33 +1451,23 @@ GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h) /** * Creates an interprocess channel * - * @param blocking_read creates an asynchronous pipe for reading if set to GNUNET_NO - * @param blocking_write creates an asynchronous pipe for writing if set to GNUNET_NO - * @param inherit_read inherit the parent processes stdin (only for windows) - * @param inherit_write inherit the parent processes stdout (only for windows) + * @param pf how to configure the pipe * @return handle to the new pipe, NULL on error */ struct GNUNET_DISK_PipeHandle * -GNUNET_DISK_pipe (int blocking_read, - int blocking_write, - int inherit_read, - int inherit_write) +GNUNET_DISK_pipe (enum GNUNET_DISK_PipeFlags pf) { int fd[2]; - int ret; - int eno; - (void) inherit_read; - (void) inherit_write; - ret = pipe (fd); - if (ret == -1) + if (-1 == pipe (fd)) { - eno = errno; + int eno = errno; + LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "pipe"); errno = eno; return NULL; } - return GNUNET_DISK_pipe_from_fd (blocking_read, blocking_write, fd); + return GNUNET_DISK_pipe_from_fd (pf, fd); } @@ -1485,29 +1475,26 @@ GNUNET_DISK_pipe (int blocking_read, * Creates a pipe object from a couple of file descriptors. * Useful for wrapping existing pipe FDs. * - * @param blocking_read creates an asynchronous pipe for reading if set to GNUNET_NO - * @param blocking_write creates an asynchronous pipe for writing if set to GNUNET_NO + * @param pf how to configure the pipe * @param fd an array of two fd values. One of them may be -1 for read-only or write-only pipes * * @return handle to the new pipe, NULL on error */ struct GNUNET_DISK_PipeHandle * -GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2]) +GNUNET_DISK_pipe_from_fd (enum GNUNET_DISK_PipeFlags pf, + int fd[2]) { struct GNUNET_DISK_PipeHandle *p; - - p = GNUNET_new (struct GNUNET_DISK_PipeHandle); - - int ret; + int ret = 0; int flags; int eno = 0; /* make gcc happy */ - ret = 0; + p = GNUNET_new (struct GNUNET_DISK_PipeHandle); if (fd[0] >= 0) { p->fd[0] = GNUNET_new (struct GNUNET_DISK_FileHandle); p->fd[0]->fd = fd[0]; - if (! blocking_read) + if (0 == (GNUNET_DISK_PF_BLOCKING_READ & pf)) { flags = fcntl (fd[0], F_GETFL); flags |= O_NONBLOCK; @@ -1530,7 +1517,7 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2]) { p->fd[1] = GNUNET_new (struct GNUNET_DISK_FileHandle); p->fd[1]->fd = fd[1]; - if (! blocking_write) + if (0 == (GNUNET_DISK_PF_BLOCKING_WRITE & pf)) { flags = fcntl (fd[1], F_GETFL); flags |= O_NONBLOCK; @@ -1562,7 +1549,6 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2]) errno = eno; return NULL; } - return p; } @@ -1572,7 +1558,7 @@ GNUNET_DISK_pipe_from_fd (int blocking_read, int blocking_write, int fd[2]) * * @param p pipe to close * @param end which end of the pipe to close - * @return GNUNET_OK on success, GNUNET_SYSERR otherwise + * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise */ int GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, @@ -1644,7 +1630,7 @@ GNUNET_DISK_pipe_detach_end (struct GNUNET_DISK_PipeHandle *p, * Closes an interprocess channel * * @param p pipe to close - * @return GNUNET_OK on success, GNUNET_SYSERR otherwise + * @return #GNUNET_OK on success, #GNUNET_SYSERR otherwise */ int GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p) diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c index 84a3184bc..83b2af2fc 100644 --- a/src/util/gnunet-qr.c +++ b/src/util/gnunet-qr.c @@ -31,7 +31,7 @@ #define LOG(fmt, ...) \ if (verbose) \ - printf (fmt, ## __VA_ARGS__) + printf (fmt, ## __VA_ARGS__) /** * Video device to capture from. Sane default for GNU/Linux systems. @@ -161,10 +161,7 @@ gnunet_uri (void *cls, return; } GNUNET_free (subsystem); - sigpipe = GNUNET_DISK_pipe (GNUNET_NO, - GNUNET_NO, - GNUNET_NO, - GNUNET_NO); + sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE); GNUNET_assert (NULL != sigpipe); rt = GNUNET_SCHEDULER_add_read_file ( GNUNET_TIME_UNIT_FOREVER_REL, diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c index f8754a6d1..9443c9120 100644 --- a/src/util/gnunet-uri.c +++ b/src/util/gnunet-uri.c @@ -167,7 +167,7 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO); + sigpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE); GNUNET_assert (sigpipe != NULL); shc_chld = GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death); diff --git a/src/util/helper.c b/src/util/helper.c index 7985f2eca..7360b7d4b 100644 --- a/src/util/helper.c +++ b/src/util/helper.c @@ -401,9 +401,9 @@ static void start_helper (struct GNUNET_HELPER_Handle *h) { h->helper_in = - GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_YES, GNUNET_NO); + GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW); h->helper_out = - GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); + GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW); if ((h->helper_in == NULL) || (h->helper_out == NULL)) { /* out of file descriptors? try again later... */ @@ -423,7 +423,8 @@ start_helper (struct GNUNET_HELPER_Handle *h) h->fh_to_helper = GNUNET_DISK_pipe_handle (h->helper_in, GNUNET_DISK_PIPE_END_WRITE); h->helper_proc = GNUNET_OS_start_process_vap (h->with_control_pipe - ? GNUNET_OS_INHERIT_STD_ERR | GNUNET_OS_USE_PIPE_CONTROL + ? GNUNET_OS_INHERIT_STD_ERR + | GNUNET_OS_USE_PIPE_CONTROL : GNUNET_OS_INHERIT_STD_ERR, h->helper_in, h->helper_out, diff --git a/src/util/os_priority.c b/src/util/os_priority.c index 2f86f792f..8d045c72b 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c @@ -376,7 +376,7 @@ start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance, struct GNUNET_DISK_PipeHandle *childpipe; int dup_childpipe_read_fd = -1; - childpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_YES, GNUNET_NO); + childpipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE); if (NULL == childpipe) return NULL; childpipe_read = @@ -1152,7 +1152,7 @@ GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, struct GNUNET_DISK_PipeHandle *opipe; va_list ap; - opipe = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, GNUNET_YES); + opipe = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW); if (NULL == opipe) return NULL; va_start (ap, binary); diff --git a/src/util/perf_malloc.c b/src/util/perf_malloc.c index 6582505c8..1c91402da 100644 --- a/src/util/perf_malloc.c +++ b/src/util/perf_malloc.c @@ -56,11 +56,11 @@ perf_realloc () ptr = GNUNET_malloc (i); memset (ptr, 1, i); ptr = GNUNET_realloc (ptr, i + 5); - for (size_t j=0;jagpl_url) - ? GNUNET_MQ_copy_handlers (handlers) - : GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL); + ? GNUNET_MQ_copy_handlers (handlers) + : GNUNET_MQ_copy_handlers2 (handlers, &return_agpl, NULL); sh.service_name = service_name; sh.ret = 0; /* setup subsystems */ diff --git a/src/util/strings.c b/src/util/strings.c index 5148d0368..41180dd71 100644 --- a/src/util/strings.c +++ b/src/util/strings.c @@ -1985,7 +1985,7 @@ GNUNET_STRINGS_base64_decode (const char *data, size_t len, void **out) "ignoring CR/LF\n"); \ i++; \ if (i >= len) \ - goto END; \ + goto END; \ } GNUNET_assert (len / 3 < SIZE_MAX); diff --git a/src/util/test_bio.c b/src/util/test_bio.c index 0c8453121..f18014719 100644 --- a/src/util/test_bio.c +++ b/src/util/test_bio.c @@ -52,14 +52,14 @@ test_normal_rw (void) GNUNET_BIO_write_spec_string ("test-normal-rw-string", TESTSTRING), GNUNET_BIO_write_spec_meta_data ("test-normal-rw-metadata", mdW), GNUNET_BIO_write_spec_int64 ("test-normal-rw-int64", &wNum), - GNUNET_BIO_write_spec_end(), + GNUNET_BIO_write_spec_end (), }; struct GNUNET_BIO_ReadSpec rs[] = { GNUNET_BIO_read_spec_string ("test-normal-rw-string", &rString, 200), GNUNET_BIO_read_spec_meta_data ("test-normal-rw-metadata", &mdR), GNUNET_BIO_read_spec_int64 ("test-normal-rw-int64", &rNum), - GNUNET_BIO_read_spec_end(), + GNUNET_BIO_read_spec_end (), }; /* I/O on file */ @@ -73,12 +73,13 @@ test_normal_rw (void) GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_spec_commit (rh, rs)); GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_close (rh, NULL)); GNUNET_assert (0 == strcmp (TESTSTRING, rString)); - GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_meta_data_test_equal (mdR, mdW)); + GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_meta_data_test_equal (mdR, + mdW)); GNUNET_assert (wNum == rNum); GNUNET_CONTAINER_meta_data_destroy (mdR); GNUNET_assert (GNUNET_OK == GNUNET_DISK_directory_remove (filename)); - GNUNET_free(filename); + GNUNET_free (filename); /* I/O on buffer */ wh = GNUNET_BIO_write_open_buffer (); @@ -96,7 +97,8 @@ test_normal_rw (void) GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_spec_commit (rh, rs)); GNUNET_assert (GNUNET_OK == GNUNET_BIO_read_close (rh, NULL)); GNUNET_assert (0 == strcmp (TESTSTRING, rString)); - GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_meta_data_test_equal (mdR, mdW)); + GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_meta_data_test_equal (mdR, + mdW)); GNUNET_assert (wNum == rNum); GNUNET_free (buffer); @@ -314,7 +316,7 @@ test_fullfile_rw (void) 200), GNUNET_BIO_read_spec_meta_data ("test-fullfile-rw-metadata", &mdR), - GNUNET_BIO_read_spec_end(), + GNUNET_BIO_read_spec_end (), }; wh = GNUNET_BIO_write_open_file ("/dev/full"); diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c index ce1cdadd6..79cf9d53a 100644 --- a/src/util/test_common_logging_runtime_loglevels.c +++ b/src/util/test_common_logging_runtime_loglevels.c @@ -207,7 +207,7 @@ read_output_line (int phase_from1, int phase_to1, int phase_from2, */ #define LOG_MAX_LINE_LENGTH (17) -#define LOG_BUFFER_SIZE LOG_MAX_NUM_LINES * LOG_MAX_LINE_LENGTH +#define LOG_BUFFER_SIZE LOG_MAX_NUM_LINES *LOG_MAX_LINE_LENGTH static char buf[LOG_BUFFER_SIZE]; @@ -347,8 +347,7 @@ runone () { const struct GNUNET_DISK_FileHandle *stdout_read_handle; - pipe_stdout = GNUNET_DISK_pipe (GNUNET_YES, GNUNET_YES, GNUNET_NO, - GNUNET_YES); + pipe_stdout = GNUNET_DISK_pipe (GNUNET_DISK_PF_BLOCKING_RW); if (pipe_stdout == NULL) { diff --git a/src/util/test_container_multihashmap.c b/src/util/test_container_multihashmap.c index bd9e7af31..f46b9f56e 100644 --- a/src/util/test_container_multihashmap.c +++ b/src/util/test_container_multihashmap.c @@ -31,7 +31,7 @@ if (m != NULL) GNUNET_CONTAINER_multihashmap_destroy (m); \ if (NULL != \ iter) \ - GNUNET_CONTAINER_multihashmap_iterator_destroy (iter); \ + GNUNET_CONTAINER_multihashmap_iterator_destroy (iter); \ return 1; } #define CHECK(c) { if (! (c)) ABORT (); } diff --git a/src/util/test_container_multipeermap.c b/src/util/test_container_multipeermap.c index 9aeead56c..cb6fc30d2 100644 --- a/src/util/test_container_multipeermap.c +++ b/src/util/test_container_multipeermap.c @@ -31,7 +31,7 @@ if (NULL != m) GNUNET_CONTAINER_multipeermap_destroy (m); \ if (NULL != \ iter) \ - GNUNET_CONTAINER_multipeermap_iterator_destroy (iter); \ + GNUNET_CONTAINER_multipeermap_iterator_destroy (iter); \ return 1; } #define CHECK(c) { if (! (c)) ABORT (); } diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c index 471ca64e5..0e2e7f760 100644 --- a/src/util/test_scheduler.c +++ b/src/util/test_scheduler.c @@ -133,7 +133,7 @@ task4 (void *cls) GNUNET_assert (4 == *ok); (*ok) = 6; - p = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO); + p = GNUNET_DISK_pipe (GNUNET_DISK_PF_NONE); GNUNET_assert (NULL != p); fds[0] = GNUNET_DISK_pipe_handle (p, GNUNET_DISK_PIPE_END_READ); fds[1] = GNUNET_DISK_pipe_handle (p, GNUNET_DISK_PIPE_END_WRITE); -- cgit v1.2.3