src/arm/gnunet-arm.c
src/arm/gnunet-service-arm.c
src/arm/mockup-service.c
-src/ats-tests/ats-testing-experiment.c
-src/ats-tests/ats-testing-log.c
-src/ats-tests/ats-testing-preferences.c
-src/ats-tests/ats-testing-traffic.c
-src/ats-tests/ats-testing.c
-src/ats-tests/gnunet-ats-sim.c
-src/ats-tests/gnunet-solver-eval.c
-src/ats-tool/gnunet-ats.c
src/ats/ats_api2_application.c
src/ats/ats_api2_transport.c
src/ats/ats_api_connectivity.c
src/ats/ats_api_scanner.c
src/ats/ats_api_scheduling.c
src/ats/gnunet-ats-solver-eval.c
-src/ats/gnunet-service-ats-new.c
-src/ats/gnunet-service-ats.c
src/ats/gnunet-service-ats_addresses.c
+src/ats/gnunet-service-ats.c
src/ats/gnunet-service-ats_connectivity.c
+src/ats/gnunet-service-ats-new.c
src/ats/gnunet-service-ats_normalization.c
src/ats/gnunet-service-ats_performance.c
src/ats/gnunet-service-ats_plugins.c
src/ats/plugin_ats_mlp.c
src/ats/plugin_ats_proportional.c
src/ats/plugin_ats_ril.c
+src/ats-tests/ats-testing.c
+src/ats-tests/ats-testing-experiment.c
+src/ats-tests/ats-testing-log.c
+src/ats-tests/ats-testing-preferences.c
+src/ats-tests/ats-testing-traffic.c
+src/ats-tests/gnunet-ats-sim.c
+src/ats-tests/gnunet-solver-eval.c
+src/ats-tool/gnunet-ats.c
src/auction/gnunet-auction-create.c
src/auction/gnunet-auction-info.c
src/auction/gnunet-auction-join.c
src/cadet/cadet_api_list_tunnels.c
src/cadet/cadet_test_lib.c
src/cadet/desirability_table.c
-src/cadet/gnunet-cadet-profiler.c
src/cadet/gnunet-cadet.c
+src/cadet/gnunet-cadet-profiler.c
src/cadet/gnunet-service-cadet.c
src/cadet/gnunet-service-cadet_channel.c
src/cadet/gnunet-service-cadet_connection.c
src/consensus/plugin_block_consensus.c
src/conversation/conversation_api.c
src/conversation/conversation_api_call.c
-src/conversation/gnunet-conversation-test.c
src/conversation/gnunet-conversation.c
-src/conversation/gnunet-helper-audio-playback-gst.c
+src/conversation/gnunet-conversation-test.c
+src/conversation/gnunet_gst.c
+src/conversation/gnunet_gst_test.c
src/conversation/gnunet-helper-audio-playback.c
-src/conversation/gnunet-helper-audio-record-gst.c
+src/conversation/gnunet-helper-audio-playback-gst.c
src/conversation/gnunet-helper-audio-record.c
+src/conversation/gnunet-helper-audio-record-gst.c
src/conversation/gnunet-service-conversation.c
-src/conversation/gnunet_gst.c
-src/conversation/gnunet_gst_test.c
src/conversation/microphone.c
src/conversation/plugin_gnsrecord_conversation.c
src/conversation/speaker.c
src/dht/dht_test_lib.c
src/dht/gnunet-dht-get.c
src/dht/gnunet-dht-monitor.c
+src/dht/gnunet_dht_profiler.c
src/dht/gnunet-dht-put.c
src/dht/gnunet-service-dht.c
src/dht/gnunet-service-dht_clients.c
src/dht/gnunet-service-dht_neighbours.c
src/dht/gnunet-service-dht_nse.c
src/dht/gnunet-service-dht_routing.c
-src/dht/gnunet_dht_profiler.c
src/dht/plugin_block_dht.c
src/dns/dns_api.c
src/dns/gnunet-dns-monitor.c
src/dns/gnunet-zonewalk.c
src/dns/plugin_block_dns.c
src/exit/gnunet-daemon-exit.c
-src/exit/gnunet-helper-exit-windows.c
src/exit/gnunet-helper-exit.c
+src/exit/gnunet-helper-exit-windows.c
src/fragmentation/defragmentation.c
src/fragmentation/fragmentation.c
src/fs/fs_api.c
src/fs/gnunet-daemon-fsprofiler.c
src/fs/gnunet-directory.c
src/fs/gnunet-download.c
-src/fs/gnunet-fs-profiler.c
src/fs/gnunet-fs.c
+src/fs/gnunet-fs-profiler.c
src/fs/gnunet-helper-fs-publish.c
src/fs/gnunet-publish.c
src/fs/gnunet-search.c
src/gns/gnunet-bcd.c
src/gns/gnunet-dns2gns.c
src/gns/gnunet-gns-benchmark.c
+src/gns/gnunet-gns.c
src/gns/gnunet-gns-helper-service-w32.c
src/gns/gnunet-gns-import.c
src/gns/gnunet-gns-proxy.c
-src/gns/gnunet-gns.c
src/gns/gnunet-service-gns.c
src/gns/gnunet-service-gns_interceptor.c
src/gns/gnunet-service-gns_resolver.c
src/gns/nss/nss_gns_query.c
src/gns/plugin_block_gns.c
src/gns/plugin_gnsrecord_gns.c
-src/gns/w32nsp-install.c
-src/gns/w32nsp-resolve.c
-src/gns/w32nsp-uninstall.c
-src/gns/w32nsp.c
src/gnsrecord/gnsrecord.c
src/gnsrecord/gnsrecord_crypto.c
src/gnsrecord/gnsrecord_misc.c
src/gnsrecord/gnsrecord_serialization.c
src/gnsrecord/plugin_gnsrecord_dns.c
+src/gns/w32nsp.c
+src/gns/w32nsp-install.c
+src/gns/w32nsp-resolve.c
+src/gns/w32nsp-uninstall.c
src/hello/address.c
src/hello/gnunet-hello.c
-src/hello/hello-ng.c
src/hello/hello.c
+src/hello/hello-ng.c
src/hostlist/gnunet-daemon-hostlist.c
src/hostlist/gnunet-daemon-hostlist_client.c
src/hostlist/gnunet-daemon-hostlist_server.c
src/namecache/plugin_namecache_flat.c
src/namecache/plugin_namecache_postgres.c
src/namecache/plugin_namecache_sqlite.c
-src/namestore/gnunet-namestore-fcfsd.c
src/namestore/gnunet-namestore.c
+src/namestore/gnunet-namestore-fcfsd.c
src/namestore/gnunet-service-namestore.c
src/namestore/gnunet-zoneimport.c
src/namestore/namestore_api.c
src/nat-auto/gnunet-service-nat-auto_legacy.c
src/nat-auto/nat_auto_api.c
src/nat-auto/nat_auto_api_test.c
-src/nat/gnunet-helper-nat-client-windows.c
src/nat/gnunet-helper-nat-client.c
-src/nat/gnunet-helper-nat-server-windows.c
+src/nat/gnunet-helper-nat-client-windows.c
src/nat/gnunet-helper-nat-server.c
+src/nat/gnunet-helper-nat-server-windows.c
src/nat/gnunet-nat.c
src/nat/gnunet-service-nat.c
src/nat/gnunet-service-nat_externalip.c
src/nat/gnunet-service-nat_stun.c
src/nat/nat_api.c
src/nat/nat_api_stun.c
-src/nse/gnunet-nse-profiler.c
src/nse/gnunet-nse.c
+src/nse/gnunet-nse-profiler.c
src/nse/gnunet-service-nse.c
src/nse/nse_api.c
src/nt/nt.c
-src/peerinfo-tool/gnunet-peerinfo.c
-src/peerinfo-tool/gnunet-peerinfo_plugins.c
src/peerinfo/gnunet-service-peerinfo.c
src/peerinfo/peerinfo_api.c
src/peerinfo/peerinfo_api_notify.c
+src/peerinfo-tool/gnunet-peerinfo.c
+src/peerinfo-tool/gnunet-peerinfo_plugins.c
src/peerstore/gnunet-peerstore.c
src/peerstore/gnunet-service-peerstore.c
src/peerstore/peerstore_api.c
src/regex/regex_test_graph.c
src/regex/regex_test_lib.c
src/regex/regex_test_random.c
+src/rest/gnunet-rest-server.c
src/rest-plugins/json_reclaim.c
src/rest-plugins/oidc_helper.c
src/rest-plugins/plugin_rest_copying.c
src/rest-plugins/plugin_rest_openid_connect.c
src/rest-plugins/plugin_rest_peerinfo.c
src/rest-plugins/plugin_rest_reclaim.c
-src/rest/gnunet-rest-server.c
src/rest/rest.c
src/revocation/gnunet-revocation.c
src/revocation/gnunet-service-revocation.c
src/revocation/plugin_block_revocation.c
src/revocation/revocation_api.c
-src/rps/gnunet-rps-profiler.c
src/rps/gnunet-rps.c
+src/rps/gnunet-rps-profiler.c
src/rps/gnunet-service-rps.c
src/rps/gnunet-service-rps_custommap.c
src/rps/gnunet-service-rps_sampler.c
src/rps/gnunet-service-rps_sampler_elem.c
src/rps/gnunet-service-rps_view.c
+src/rps/rps_api.c
src/rps/rps-sampler_client.c
src/rps/rps-sampler_common.c
src/rps/rps-test_util.c
-src/rps/rps_api.c
src/scalarproduct/gnunet-scalarproduct.c
-src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
-src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
src/scalarproduct/gnunet-service-scalarproduct_alice.c
src/scalarproduct/gnunet-service-scalarproduct_bob.c
+src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
+src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
src/scalarproduct/scalarproduct_api.c
src/secretsharing/gnunet-secretsharing-profiler.c
src/secretsharing/gnunet-service-secretsharing.c
src/statistics/statistics_api.c
src/template/gnunet-service-template.c
src/template/gnunet-template.c
-src/testbed-logger/gnunet-service-testbed-logger.c
-src/testbed-logger/testbed_logger_api.c
src/testbed/generate-underlay-topology.c
src/testbed/gnunet-daemon-latency-logger.c
src/testbed/gnunet-daemon-testbed-blacklist.c
src/testbed/gnunet-daemon-testbed-underlay.c
src/testbed/gnunet-helper-testbed.c
+src/testbed/gnunet_mpi_test.c
src/testbed/gnunet-service-test-barriers.c
-src/testbed/gnunet-service-testbed.c
src/testbed/gnunet-service-testbed_barriers.c
+src/testbed/gnunet-service-testbed.c
src/testbed/gnunet-service-testbed_cache.c
src/testbed/gnunet-service-testbed_connectionpool.c
src/testbed/gnunet-service-testbed_cpustatus.c
src/testbed/gnunet-service-testbed_meminfo.c
src/testbed/gnunet-service-testbed_oc.c
src/testbed/gnunet-service-testbed_peers.c
-src/testbed/gnunet-testbed-profiler.c
-src/testbed/gnunet_mpi_test.c
src/testbed/gnunet_testbed_mpi_spawn.c
-src/testbed/testbed_api.c
+src/testbed/gnunet-testbed-profiler.c
+src/testbed-logger/gnunet-service-testbed-logger.c
+src/testbed-logger/testbed_logger_api.c
src/testbed/testbed_api_barriers.c
+src/testbed/testbed_api.c
src/testbed/testbed_api_hosts.c
src/testbed/testbed_api_operations.c
src/testbed/testbed_api_peers.c
src/testbed/testbed_api_sd.c
src/testbed/testbed_api_services.c
src/testbed/testbed_api_statistics.c
-src/testbed/testbed_api_test.c
src/testbed/testbed_api_testbed.c
+src/testbed/testbed_api_test.c
src/testbed/testbed_api_topology.c
src/testbed/testbed_api_underlay.c
src/testing/gnunet-testing.c
src/transport/gnunet-communicator-udp.c
src/transport/gnunet-communicator-unix.c
src/transport/gnunet-helper-transport-bluetooth.c
-src/transport/gnunet-helper-transport-wlan-dummy.c
src/transport/gnunet-helper-transport-wlan.c
+src/transport/gnunet-helper-transport-wlan-dummy.c
src/transport/gnunet-service-tng.c
-src/transport/gnunet-service-transport.c
src/transport/gnunet-service-transport_ats.c
+src/transport/gnunet-service-transport.c
src/transport/gnunet-service-transport_hello.c
src/transport/gnunet-service-transport_manipulation.c
src/transport/gnunet-service-transport_neighbours.c
src/transport/gnunet-service-transport_plugins.c
src/transport/gnunet-service-transport_validation.c
+src/transport/gnunet-transport.c
src/transport/gnunet-transport-certificate-creation.c
src/transport/gnunet-transport-profiler.c
src/transport/gnunet-transport-wlan-receiver.c
src/transport/gnunet-transport-wlan-sender.c
-src/transport/gnunet-transport.c
src/transport/plugin_transport_http_client.c
src/transport/plugin_transport_http_common.c
src/transport/plugin_transport_http_server.c
src/transport/plugin_transport_smtp.c
src/transport/plugin_transport_tcp.c
src/transport/plugin_transport_template.c
-src/transport/plugin_transport_udp.c
src/transport/plugin_transport_udp_broadcasting.c
+src/transport/plugin_transport_udp.c
src/transport/plugin_transport_unix.c
src/transport/plugin_transport_wlan.c
src/transport/plugin_transport_xt.c
src/transport/tcp_server_legacy.c
src/transport/tcp_server_mst_legacy.c
src/transport/tcp_service_legacy.c
-src/transport/transport-testing-filenames.c
-src/transport/transport-testing-loggers.c
-src/transport/transport-testing-main.c
-src/transport/transport-testing-send.c
-src/transport/transport-testing.c
src/transport/transport_api2_address.c
src/transport/transport_api2_communication.c
src/transport/transport_api2_core.c
src/transport/transport_api_monitor_peers.c
src/transport/transport_api_monitor_plugins.c
src/transport/transport_api_offer_hello.c
+src/transport/transport-testing.c
+src/transport/transport-testing-filenames.c
+src/transport/transport-testing-loggers.c
+src/transport/transport-testing-main.c
+src/transport/transport-testing-send.c
src/util/bandwidth.c
src/util/benchmark.c
src/util/bio.c
src/util/container_bloomfilter.c
src/util/container_heap.c
src/util/container_meta_data.c
-src/util/container_multihashmap.c
src/util/container_multihashmap32.c
+src/util/container_multihashmap.c
src/util/container_multipeermap.c
src/util/container_multishortmap.c
src/util/crypto_abe.c
src/util/dnsstub.c
src/util/getopt.c
src/util/getopt_helpers.c
-src/util/gnunet-config-diff.c
src/util/gnunet-config.c
+src/util/gnunet-config-diff.c
src/util/gnunet-ecc.c
src/util/gnunet-helper-w32-console.c
src/util/gnunet-resolver.c
src/util/gnunet-scrypt.c
src/util/gnunet-service-resolver.c
-src/util/gnunet-timeout-w32.c
src/util/gnunet-timeout.c
+src/util/gnunet-timeout-w32.c
src/util/gnunet-uri.c
src/util/helper.c
src/util/load.c
src/util/w32cat.c
src/util/win.c
src/util/winproc.c
-src/vpn/gnunet-helper-vpn-windows.c
src/vpn/gnunet-helper-vpn.c
+src/vpn/gnunet-helper-vpn-windows.c
src/vpn/gnunet-service-vpn.c
src/vpn/gnunet-vpn.c
src/vpn/vpn_api.c
-src/zonemaster/gnunet-service-zonemaster-monitor.c
src/zonemaster/gnunet-service-zonemaster.c
+src/zonemaster/gnunet-service-zonemaster-monitor.c
src/fs/fs_api.h
src/include/compat.h
src/include/gnunet_common.h
static struct GNUNET_NAMESTORE_Handle * nsh;
-static struct GNUNET_SCHEDULER_Task * endbadly_task;
-
static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey2;
* @param tc scheduler context
*/
static void
-endbadly (void *cls)
+end (void *cls)
{
if (NULL != zi)
{
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_non_null (s_name_1);
+ GNUNET_free_non_null (s_name_2);
+ GNUNET_free_non_null (s_name_3);
if (s_rd_1 != NULL)
{
}
if (privkey != NULL)
- GNUNET_free (privkey);
- privkey = NULL;
-
- if (privkey2 != NULL)
- GNUNET_free (privkey2);
- privkey2 = NULL;
- res = 1;
-}
-
-
-static void
-end (void *cls)
-{
- if (NULL != zi)
{
- GNUNET_NAMESTORE_zone_iteration_stop (zi);
- zi = NULL;
- }
- if (endbadly_task != NULL)
- {
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = NULL;
- }
-
- if (privkey != NULL)
GNUNET_free (privkey);
- privkey = NULL;
-
- if (privkey2 != NULL)
- GNUNET_free (privkey2);
- privkey2 = NULL;
-
- GNUNET_free (s_name_1);
- GNUNET_free (s_name_2);
- GNUNET_free (s_name_3);
- if (s_rd_1 != NULL)
- {
- GNUNET_free ((void *)s_rd_1->data);
- GNUNET_free (s_rd_1);
+ privkey = NULL;
}
- if (s_rd_2 != NULL)
- {
- GNUNET_free ((void *)s_rd_2->data);
- GNUNET_free (s_rd_2);
- }
- if (s_rd_3 != NULL)
+ if (privkey2 != NULL)
{
- GNUNET_free ((void *)s_rd_3->data);
- GNUNET_free (s_rd_3);
+ GNUNET_free (privkey2);
+ privkey2 = NULL;
}
- if (nsh != NULL)
- GNUNET_NAMESTORE_disconnect (nsh);
- nsh = NULL;
}
static int
check_zone_1 (const char *label, unsigned int rd_count,
- const struct GNUNET_GNSRECORD_Data *rd)
+ const struct GNUNET_GNSRECORD_Data *rd)
{
- int failed = GNUNET_NO;
- int c;
- for (c = 0; c< rd_count ; c++)
+ for (unsigned int c = 0; c< rd_count ; c++)
{
- if (rd[c].record_type == GNUNET_GNSRECORD_TYPE_NICK)
- if (0 != strcmp (rd[c].data, ZONE_NICK_1))
- {
- GNUNET_break (0);
- return GNUNET_YES;
- }
+ if ( (rd[c].record_type == GNUNET_GNSRECORD_TYPE_NICK) &&
+ (0 != strcmp (rd[c].data, ZONE_NICK_1)) )
+ {
+ GNUNET_break (0);
+ return GNUNET_YES;
+ }
}
- return failed;
+ return GNUNET_NO;
}
+
static int
check_zone_2 (const char *label,
- unsigned int rd_count,
- const struct GNUNET_GNSRECORD_Data *rd)
+ unsigned int rd_count,
+ const struct GNUNET_GNSRECORD_Data *rd)
{
- int failed = GNUNET_NO;
- int c;
-
- for (c = 0; c< rd_count ; c++)
+ for (unsigned int c = 0; c< rd_count ; c++)
{
- if (rd[c].record_type == GNUNET_GNSRECORD_TYPE_NICK)
- if (0 != strcmp (rd[c].data, ZONE_NICK_2))
- {
- GNUNET_break (0);
- return GNUNET_YES;
- }
+ if ( (rd[c].record_type == GNUNET_GNSRECORD_TYPE_NICK) &&
+ (0 != strcmp (rd[c].data, ZONE_NICK_2)) )
+ {
+ GNUNET_break (0);
+ return GNUNET_YES;
+ }
}
-
- return failed;
+ return GNUNET_NO;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received last result, iteration done after receing %u results\n",
returned_records);
- GNUNET_SCHEDULER_add_now (&end, NULL);
+ GNUNET_SCHEDULER_shutdown ();
}
{
GNUNET_break (0);
res = 1;
- GNUNET_SCHEDULER_add_now (&end, NULL);
+ GNUNET_SCHEDULER_shutdown ();
}
}
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to created records: `%s'\n",
emsg);
GNUNET_break (0);
- if (NULL != endbadly_task)
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
+ GNUNET_SCHEDULER_shutdown ();
return;
}
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to create zone iterator\n");
GNUNET_break (0);
- if (NULL != endbadly_task)
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
+ GNUNET_SCHEDULER_shutdown ();
return;
}
}
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Expected empty zone but received zone private key\n"));
GNUNET_break (0);
- if (endbadly_task != NULL)
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
+ GNUNET_SCHEDULER_shutdown ();
return;
}
if ((NULL != label) || (NULL != rd) || (0 != rd_count))
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Expected no zone content but received data\n"));
GNUNET_break (0);
- if (endbadly_task != NULL)
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
+ GNUNET_SCHEDULER_shutdown ();
return;
}
GNUNET_assert (0);
const struct GNUNET_CONFIGURATION_Handle *cfg,
struct GNUNET_TESTING_Peer *peer)
{
- endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
- &endbadly,
- NULL);
nsh = GNUNET_NAMESTORE_connect (cfg);
GNUNET_break (NULL != nsh);
-
+ GNUNET_SCHEDULER_add_shutdown (&end,
+ NULL);
/* first, iterate over empty namestore */
zi = GNUNET_NAMESTORE_zone_iteration_start(nsh,
NULL,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to create zone iterator\n");
GNUNET_break (0);
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
+ GNUNET_SCHEDULER_shutdown ();
}
}
SPDX-License-Identifier: AGPL3.0-or-later
*/
/**
- * @file namestore/test_namestore_api_zone_iteration.c
+ * @file namestore/test_namestore_api_zone_iteration_stop.c
* @brief testcase for zone iteration functionality: stop iterating of zones
*/
#include "platform.h"
static struct GNUNET_NAMESTORE_Handle * nsh;
-static struct GNUNET_SCHEDULER_Task * endbadly_task;
-
static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey2;
static struct GNUNET_GNSRECORD_Data *s_rd_3;
-
/**
* Re-establish the connection to the service.
*
* @param cls handle to use to re-connect.
*/
static void
-endbadly (void *cls)
+end (void *cls)
{
if (NULL != zi)
{
GNUNET_NAMESTORE_zone_iteration_stop (zi);
zi = NULL;
}
-
if (nsh != NULL)
+ {
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);
-
+ nsh = NULL;
+ }
+ GNUNET_free_non_null (s_name_1);
+ GNUNET_free_non_null (s_name_2);
+ GNUNET_free_non_null (s_name_3);
if (s_rd_1 != NULL)
{
GNUNET_free ((void *)s_rd_1->data);
GNUNET_free ((void *)s_rd_3->data);
GNUNET_free (s_rd_3);
}
-
if (privkey != NULL)
+ {
GNUNET_free (privkey);
- privkey = NULL;
-
+ privkey = NULL;
+ }
if (privkey2 != NULL)
+ {
GNUNET_free (privkey2);
- privkey2 = NULL;
- res = 1;
+ privkey2 = NULL;
+ }
}
static void
-end (void *cls)
+delayed_end (void *cls)
{
- if (NULL != zi)
- {
- GNUNET_NAMESTORE_zone_iteration_stop (zi);
- zi = NULL;
- }
-
- if (endbadly_task != NULL)
- {
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = NULL;
- }
-
- if (privkey != NULL)
- GNUNET_free (privkey);
- privkey = NULL;
-
- if (privkey2 != NULL)
- GNUNET_free (privkey2);
- privkey2 = NULL;
-
- GNUNET_free (s_name_1);
- GNUNET_free (s_name_2);
- GNUNET_free (s_name_3);
- if (s_rd_1 != NULL)
- {
- GNUNET_free ((void *)s_rd_1->data);
- GNUNET_free (s_rd_1);
- }
- if (s_rd_2 != NULL)
- {
- GNUNET_free ((void *)s_rd_2->data);
- GNUNET_free (s_rd_2);
- }
- if (s_rd_3 != NULL)
- {
- GNUNET_free ((void *)s_rd_3->data);
- GNUNET_free (s_rd_3);
- }
- if (nsh != NULL)
- GNUNET_NAMESTORE_disconnect (nsh);
- nsh = NULL;
+ GNUNET_SCHEDULER_shutdown ();
}
if (1 == returned_records)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Telling namestore to stop zone iteration\n");
- GNUNET_NAMESTORE_zone_iteration_stop (zi);
- zi = NULL;
- if (NULL != endbadly_task)
- {
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = NULL;
- }
+ "Telling namestore to stop zone iteration\n");
+ GNUNET_NAMESTORE_zone_iteration_stop (zi);
+ zi = NULL;
res = 0;
- GNUNET_SCHEDULER_add_delayed (WAIT, &end, NULL);
+ GNUNET_SCHEDULER_add_delayed (WAIT,
+ &delayed_end,
+ NULL);
return;
}
returned_records ++;
else
{
GNUNET_break (0);
- GNUNET_SCHEDULER_add_now (&end, NULL);
+ GNUNET_SCHEDULER_shutdown ();
}
}
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to created records: `%s'\n",
emsg);
GNUNET_break (0);
- if (NULL != endbadly_task)
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
+ GNUNET_SCHEDULER_shutdown ();
return;
}
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to create zone iterator\n");
GNUNET_break (0);
- if (NULL != endbadly_task)
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
+ GNUNET_SCHEDULER_shutdown ();
return;
}
}
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Expected empty zone but received zone private key\n"));
GNUNET_break (0);
- if (endbadly_task != NULL)
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
+ GNUNET_SCHEDULER_shutdown ();
return;
}
if ((NULL != label) || (NULL != rd) || (0 != rd_count))
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Expected no zone content but received data\n"));
GNUNET_break (0);
- if (endbadly_task != NULL)
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
+ GNUNET_SCHEDULER_shutdown ();
return;
}
GNUNET_assert (0);
const struct GNUNET_CONFIGURATION_Handle *cfg,
struct GNUNET_TESTING_Peer *peer)
{
- endbadly_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
- &endbadly,
- NULL);
nsh = GNUNET_NAMESTORE_connect (cfg);
GNUNET_break (NULL != nsh);
+ GNUNET_SCHEDULER_add_shutdown (&end,
+ NULL);
/* first, iterate over empty namestore */
- zi = GNUNET_NAMESTORE_zone_iteration_start(nsh,
- NULL,
- &fail_cb,
- NULL,
- &empty_zone_proc,
- nsh,
- &empty_zone_proc_end,
- nsh);
+ zi = GNUNET_NAMESTORE_zone_iteration_start (nsh,
+ NULL,
+ &fail_cb,
+ NULL,
+ &empty_zone_proc,
+ nsh,
+ &empty_zone_proc_end,
+ nsh);
if (NULL == zi)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to create zone iterator\n");
GNUNET_break (0);
- GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
+ GNUNET_SCHEDULER_shutdown ();
}
}
+#include "test_common.c"
+
+
int
main (int argc, char *argv[])
{
const char *plugin_name;
char *cfg_name;
- plugin_name = GNUNET_TESTING_get_testname_from_underscore (argv[0]);
- GNUNET_asprintf (&cfg_name,
- "test_namestore_api_%s.conf",
- plugin_name);
- GNUNET_DISK_purge_cfg_dir (cfg_name,
- "GNUNET_TEST_HOME");
+ SETUP_CFG (plugin_name, cfg_name);
res = 1;
if (0 !=
GNUNET_TESTING_peer_run ("test-namestore-api-zone-iteration-stop",