From 0e4c7cdccfc4105f9c6e529cfa0e3722104b0ddf Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 4 Nov 2012 21:01:22 +0000 Subject: -misc bugfixes, travel hacking --- src/arm/gnunet-arm.c | 3 +- src/arm/test_arm_api_data.conf | 4 - src/arm/test_exponential_backoff.c | 13 --- src/ats/gnunet-service-ats_addresses.c | 29 ++++--- src/ats/perf_ats_mlp.c | 3 +- src/ats/test_ats_api.conf | 1 - src/ats/test_ats_api_update_address.c | 1 - src/chat/test_chat.c | 97 ++++++++-------------- src/chat/test_chat_private.c | 8 -- src/core/core.conf.in | 1 - src/core/test_core_api.c | 27 +----- src/core/test_core_api_reliability.c | 13 +-- ...t_core_quota_asymmetric_recv_limited_peer1.conf | 1 - ...t_core_quota_asymmetric_recv_limited_peer2.conf | 1 - ...est_core_quota_asymmetric_send_limit_peer1.conf | 1 - ...est_core_quota_asymmetric_send_limit_peer2.conf | 1 - src/core/test_core_quota_compliance.c | 10 +-- src/core/test_core_quota_peer1.conf | 1 - src/core/test_core_quota_peer2.conf | 1 - src/datastore/test_plugin_datastore.c | 2 + src/dht/dht.conf.in | 1 - src/dht/test_dht_api_data.conf | 2 - src/dht/test_dht_api_peer1.conf | 3 - src/dns/gnunet-dns-monitor.c | 13 +-- src/dns/gnunet-dns-redirector.c | 12 +-- src/dv/dv.conf.in | 1 - src/dv/test_transport_api_dv.c | 82 +----------------- src/dv/test_transport_dv_data.conf | 3 - src/fragmentation/test_fragmentation.c | 10 --- src/fs/fs.conf.in | 1 - src/fs/gnunet-auto-share.c | 1 + src/fs/gnunet-directory.c | 12 +-- src/fs/gnunet-download.c | 12 +-- src/fs/gnunet-fs.c | 11 +-- src/fs/gnunet-helper-fs-publish.c | 17 ++-- src/fs/gnunet-pseudonym.c | 10 ++- src/fs/gnunet-publish.c | 15 ++-- src/fs/gnunet-search.c | 12 +-- src/fs/gnunet-unindex.c | 12 +-- src/gns/gnunet-dns2gns.c | 2 +- src/gns/gnunet-gns-fcfsd.c | 2 +- src/gns/gnunet-gns.c | 2 +- src/gns/test_gns_dht_default.conf | 1 - src/gns/test_gns_simple_lookup.conf | 3 - src/gns/w32nsp-resolve.c | 13 ++- src/hello/gnunet-hello.c | 4 - src/hello/test_hello.c | 71 ++++++---------- src/hostlist/gnunet-daemon-hostlist.c | 2 +- .../test_gnunet_daemon_hostlist_peer1.conf | 1 - .../test_gnunet_daemon_hostlist_reconnect.c | 21 ----- src/hostlist/test_hostlist_defaults.conf | 2 +- src/include/platform.h | 12 ++- src/integration-tests/confs/c_no_nat_client.conf | 1 - .../confs/c_no_nat_client_http.conf | 1 - .../confs/c_no_nat_client_unix.conf | 1 - src/integration-tests/connection_watchdog.c | 11 +-- src/lockmanager/test_lockmanager_api.conf | 4 - src/mesh/gnunet-regex-profiler.c | 1 + src/mesh/regex_profiler_test.conf | 3 - src/mesh/test_mesh.conf | 4 - src/mesh/test_mesh_2dtorus.c | 28 +------ src/mesh/test_mesh_2dtorus.conf | 4 - src/mesh/test_mesh_path.conf | 4 - src/mesh/test_mesh_regex.c | 27 +----- src/mesh/test_mesh_small.c | 35 +------- src/mesh/test_mesh_small.conf | 4 - src/mesh/test_mesh_tree_api.c | 14 +--- src/namestore/gnunet-namestore.c | 5 +- src/namestore/namestore_api.c | 4 +- .../test_namestore_record_serialization.c | 2 - src/nat/gnunet-nat-server.c | 4 + src/nat/test_nat_mini.c | 11 --- src/nse/nse_profiler_test.conf | 3 - src/nse/test_nse.conf | 3 - src/peerinfo-tool/gnunet-peerinfo.c | 11 ++- src/peerinfo/test_peerinfo_api_data.conf | 1 - src/pt/gnunet-daemon-pt.c | 14 ++-- src/regex/test_regex_graph_api.c | 37 ++++----- src/statistics/gnunet-statistics.c | 16 ++-- src/statistics/test_statistics_api_data.conf | 2 - src/stream/test_stream_2peers_halfclose.c | 5 -- src/stream/test_stream_local.conf | 5 -- src/template/gnunet-template.c | 11 +-- src/testbed/gnunet-testbed-profiler.c | 1 + src/testbed/test_testbed_api.conf | 3 - ...est_testbed_api_testbed_run_topologyclique.conf | 3 - .../test_testbed_api_testbed_run_topologyline.conf | 3 - ...est_testbed_api_testbed_run_topologyrandom.conf | 3 - src/testing/gnunet-testing.c | 11 +-- src/testing_old/Makefile.am | 13 +-- src/testing_old/test_testing_2dtorus.conf | 3 - src/topology/gnunet-daemon-topology.c | 1 + src/topology/test_gnunet_daemon_topology_data.conf | 3 - src/transport/gnunet-transport.c | 6 +- src/transport/template_cfg_peer1.conf | 2 - src/transport/template_cfg_peer2.conf | 1 - ..._transport_api_bidirectional_connect_peer1.conf | 1 - .../test_transport_api_disconnect_tcp_peer1.conf | 1 - src/transport/test_transport_api_http_peer1.conf | 1 - src/transport/test_transport_api_http_peer2.conf | 1 - .../test_transport_api_http_reverse_peer1.conf | 2 - src/transport/test_transport_api_https_peer1.conf | 1 - src/transport/test_transport_api_https_peer2.conf | 1 - .../test_transport_api_reliability_http_peer1.conf | 1 - .../test_transport_api_reliability_http_peer2.conf | 1 - .../test_transport_api_reliability_tcp_peer2.conf | 1 - .../test_transport_api_tcp_nat_peer1.conf | 1 - .../test_transport_api_tcp_nat_peer2.conf | 1 - src/transport/test_transport_api_tcp_peer1.conf | 1 - .../test_transport_api_timeout_http_peer1.conf | 1 - .../test_transport_api_timeout_http_peer2.conf | 1 - .../test_transport_api_timeout_https_peer1.conf | 1 - .../test_transport_api_timeout_https_peer2.conf | 1 - .../test_transport_api_udp_nat_peer1.conf | 1 - .../test_transport_api_udp_nat_peer2.conf | 1 - src/transport/test_transport_api_wlan_peer1.conf | 2 - src/transport/test_transport_api_wlan_peer2.conf | 2 - src/transport/transport-testing.c | 15 ++-- src/util/gnunet-config.c | 11 +-- src/util/gnunet-ecc.c | 11 ++- src/util/gnunet-resolver.c | 11 ++- src/util/gnunet-rsa.c | 13 +-- src/util/gnunet-uri.c | 12 +-- src/util/os_installation.c | 2 +- src/util/test_common_logging_runtime_loglevels.c | 20 +++-- src/util/test_os_start_process.c | 2 + src/util/test_plugin.c | 1 + src/util/test_resolver_api_data.conf | 1 - src/util/test_server_mst_interrupt.c | 37 +++------ src/vpn/gnunet-vpn.c | 11 +-- 130 files changed, 342 insertions(+), 742 deletions(-) diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index c155577d0..49315687f 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c @@ -450,9 +450,10 @@ main (int argc, char *const *argv) ("Control services and the Automated Restart Manager (ARM)"), options, &run, NULL)) { + GNUNET_free ((void *) argv); return ret; } - + GNUNET_free ((void*) argv); return 1; } diff --git a/src/arm/test_arm_api_data.conf b/src/arm/test_arm_api_data.conf index cbadc47d2..8ebd6976c 100644 --- a/src/arm/test_arm_api_data.conf +++ b/src/arm/test_arm_api_data.conf @@ -6,16 +6,13 @@ PORT = 23354 DEFAULTSERVICES = BINARY = gnunet-service-arm OPTIONS = -L ERROR -# DEBUG = YES #PREFIX = valgrind --tool=memcheck --leak-check=yes [resolver] -# DEBUG = YES PORT = 23355 # PREFIX = valgrind [do-nothing] -#DEBUG = YES AUTOSTART = NO PORT = 2223 HOSTNAME = localhost @@ -42,7 +39,6 @@ AUTOSTART = NO [statistics] AUTOSTART = YES -# DEBUG = NO [dns] diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c index 1709dbdba..34ebad164 100644 --- a/src/arm/test_exponential_backoff.c +++ b/src/arm/test_exponential_backoff.c @@ -28,8 +28,6 @@ #include "gnunet_program_lib.h" #include "gnunet_protocols.h" -#define VERBOSE GNUNET_NO - #define START_ARM GNUNET_YES #define LOG_BACKOFF GNUNET_NO @@ -115,9 +113,7 @@ service_shutdown_handler (void *cls, const struct GNUNET_MessageHeader *msg) if (msg == NULL) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Service shutdown complete.\n"); -#endif if (shutdown_ctx->cont != NULL) shutdown_ctx->cont (shutdown_ctx->cont_cls, GNUNET_NO); @@ -131,10 +127,8 @@ service_shutdown_handler (void *cls, const struct GNUNET_MessageHeader *msg) switch (ntohs (msg->type)) { case GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN: -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received confirmation for service shutdown.\n"); -#endif shutdown_ctx->confirmed = GNUNET_YES; GNUNET_CLIENT_receive (shutdown_ctx->sock, &service_shutdown_handler, shutdown_ctx, @@ -379,9 +373,6 @@ check () char *const argv[] = { "test-exponential-backoff", "-c", "test_arm_api_data.conf", -#if VERBOSE - "-L", "DEBUG", -#endif NULL }; struct GNUNET_GETOPT_CommandLineOption options[] = { @@ -431,11 +422,7 @@ main (int argc, char *argv[]) int ret; GNUNET_log_setup ("test-exponential-backoff", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); init (); diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index ff4222780..c471a70f9 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c @@ -35,8 +35,6 @@ #include "gnunet-service-ats_addresses_mlp.h" #endif -#define VERBOSE GNUNET_NO - #define ATS_BLOCKING_DELTA GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MILLISECONDS, 100) enum ATS_Mode @@ -356,6 +354,8 @@ lookup_address (const struct GNUNET_PeerIdentity *peer, return old; } + +#if DEADCODE static int compare_address_session_it (void *cls, const struct GNUNET_HashCode * key, void *value) { @@ -383,7 +383,7 @@ compare_address_session_it (void *cls, const struct GNUNET_HashCode * key, void * @param addr existing address record * @return existing address record, NULL for none */ -struct ATS_Address * +static struct ATS_Address * find_exact_address (const struct GNUNET_PeerIdentity *peer, const struct ATS_Address *addr) { @@ -395,6 +395,7 @@ find_exact_address (const struct GNUNET_PeerIdentity *peer, &compare_address_session_it, &cac); return cac.exact_address; } +#endif void @@ -569,11 +570,9 @@ destroy_by_session_id (void *cls, const struct GNUNET_HashCode * key, void *valu if (aa->session_id != 0) GNUNET_break (0 == strcmp (info->plugin, aa->plugin)); /* session died */ -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Deleting session for peer `%s': `%s' %u\n", GNUNET_i2s (&aa->peer), aa->plugin, aa->session_id); -#endif aa->session_id = 0; if (GNUNET_YES == aa->active) @@ -586,11 +585,9 @@ destroy_by_session_id (void *cls, const struct GNUNET_HashCode * key, void *valu /* session == 0 and addrlen == 0 : destroy address */ if (aa->addr_len == 0) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Deleting session and address for peer `%s': `%s' %u\n", GNUNET_i2s (&aa->peer), aa->plugin, aa->session_id); -#endif (void) destroy_address (aa); } else @@ -605,6 +602,7 @@ destroy_by_session_id (void *cls, const struct GNUNET_HashCode * key, void *valu return GNUNET_OK; } + void GAS_addresses_destroy (const struct GNUNET_PeerIdentity *peer, const char *plugin_name, const void *plugin_addr, @@ -773,7 +771,8 @@ GAS_addresses_in_use (const struct GNUNET_PeerIdentity *peer, } -void request_address_mlp (const struct GNUNET_PeerIdentity *peer) +static void +request_address_mlp (const struct GNUNET_PeerIdentity *peer) { struct ATS_Address *aa; aa = NULL; @@ -815,7 +814,9 @@ void request_address_mlp (const struct GNUNET_PeerIdentity *peer) } -void request_address_simple (const struct GNUNET_PeerIdentity *peer) + +static void +request_address_simple (const struct GNUNET_PeerIdentity *peer) { struct ATS_Address *aa; aa = NULL; @@ -884,6 +885,7 @@ reset_address_it (void *cls, const struct GNUNET_HashCode * key, void *value) return GNUNET_OK; } + void GAS_addresses_handle_backoff_reset (const struct GNUNET_PeerIdentity *peer) { @@ -1112,9 +1114,11 @@ struct PeerInfoIteratorContext void *it_cls; }; -int peerinfo_it (void *cls, - const struct GNUNET_HashCode * key, - void *value) + +static int +peerinfo_it (void *cls, + const struct GNUNET_HashCode * key, + void *value) { struct PeerInfoIteratorContext *pi_ctx = cls; struct ATS_Address *addr = (struct ATS_Address *) value; @@ -1130,6 +1134,7 @@ int peerinfo_it (void *cls, return GNUNET_YES; } + /** * Return all peers currently known to ATS * diff --git a/src/ats/perf_ats_mlp.c b/src/ats/perf_ats_mlp.c index 51f910256..751fad51a 100644 --- a/src/ats/perf_ats_mlp.c +++ b/src/ats/perf_ats_mlp.c @@ -366,8 +366,7 @@ main (int argc, char *const *argv) GNUNET_PROGRAM_run (argc, argv, "perf_ats_mlp", "nohelp", options, &check, NULL); - - + GNUNET_free ((void *) argv); return ret; } diff --git a/src/ats/test_ats_api.conf b/src/ats/test_ats_api.conf index ab96f655e..2ac499c66 100644 --- a/src/ats/test_ats_api.conf +++ b/src/ats/test_ats_api.conf @@ -7,7 +7,6 @@ DEFAULTSERVICES = ats UNIXPATH = /tmp/test-ats-scheduling-arm.sock [ats] -#DEBUG = YES #PREFIX = valgrind --leak-check=full AUTOSTART = YES PORT = 12002 diff --git a/src/ats/test_ats_api_update_address.c b/src/ats/test_ats_api_update_address.c index 12d283aac..6a9e33800 100644 --- a/src/ats/test_ats_api_update_address.c +++ b/src/ats/test_ats_api_update_address.c @@ -34,7 +34,6 @@ #include "gnunet_ats_service.h" #include "gnunet_transport_service.h" -#define START_ARM GNUNET_YES #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) diff --git a/src/chat/test_chat.c b/src/chat/test_chat.c index 24a1e38da..78b31f1b1 100644 --- a/src/chat/test_chat.c +++ b/src/chat/test_chat.c @@ -37,10 +37,6 @@ #include "gnunet_arm_service.h" #include "gnunet_chat_service.h" -#define VERBOSE GNUNET_NO - -#define START_ARM GNUNET_YES - /** * How long until we give up on passing the test? */ @@ -49,9 +45,7 @@ struct PeerContext { struct GNUNET_CONFIGURATION_Handle *cfg; -#if START_ARM struct GNUNET_OS_Process *arm_proc; -#endif }; struct Wanted @@ -120,12 +114,10 @@ setup_peer (struct PeerContext *p, const char *cfgname) binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); -#if START_ARM p->arm_proc = GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, "gnunet-service-arm", "-c", cfgname, NULL); -#endif GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); GNUNET_free (binary); } @@ -134,7 +126,6 @@ setup_peer (struct PeerContext *p, const char *cfgname) static void stop_arm (struct PeerContext *p) { -#if START_ARM if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) @@ -143,7 +134,6 @@ stop_arm (struct PeerContext *p) GNUNET_OS_process_get_pid (p->arm_proc)); GNUNET_OS_process_destroy (p->arm_proc); p->arm_proc = NULL; -#endif GNUNET_CONFIGURATION_destroy (p->cfg); } @@ -168,9 +158,8 @@ abort_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void timeout_kill (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { -#if VERBOSE - printf ("Timed out, stopping the test.\n"); -#endif + fprintf (stderr, + "Timed out, stopping the test.\n"); kill_task = GNUNET_SCHEDULER_NO_TASK; if (wait_task != GNUNET_SCHEDULER_NO_TASK) { @@ -187,9 +176,8 @@ join_cb (void *cls) { struct Wanted *want = cls; -#if VERBOSE - printf ("%s has joined\n", want->me); -#endif + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "%s has joined\n", want->me); if (NULL != want->next_task) GNUNET_SCHEDULER_add_now (want->next_task, want->next_task_cls); return GNUNET_OK; @@ -204,13 +192,12 @@ member_list_cb (void *cls, const struct GNUNET_CONTAINER_MetaData *member_info, struct Wanted *want = cls; struct GNUNET_HashCode sender; -#if VERBOSE - printf ("%s - told that %s has %s\n", want->me, - member_info == - NULL ? NULL : GNUNET_CONTAINER_meta_data_get_by_type (member_info, - EXTRACTOR_METATYPE_TITLE), - member_info == NULL ? "left" : "joined"); -#endif + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "%s - told that %s has %s\n", want->me, + member_info == + NULL ? NULL : GNUNET_CONTAINER_meta_data_get_by_type (member_info, + EXTRACTOR_METATYPE_TITLE), + member_info == NULL ? "left" : "joined"); GNUNET_CRYPTO_hash (member_id, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &sender); @@ -242,12 +229,12 @@ receive_cb (void *cls, struct GNUNET_CHAT_Room *room, { struct Wanted *want = cls; -#if VERBOSE - printf ("%s - told that %s said %s\n", want->me, - meta == NULL ? NULL : GNUNET_CONTAINER_meta_data_get_by_type (meta, - EXTRACTOR_METATYPE_TITLE), - message); -#endif + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + + "%s - told that %s said %s\n", want->me, + meta == NULL ? NULL : GNUNET_CONTAINER_meta_data_get_by_type (meta, + EXTRACTOR_METATYPE_TITLE), + message); if ((0 == strcmp (message, want->msg)) && (((sender == NULL) && (want->sender == NULL)) || ((sender != NULL) && (want->sender != NULL) && @@ -280,12 +267,11 @@ confirmation_cb (void *cls, struct GNUNET_CHAT_Room *room, { struct Wanted *want = cls; -#if VERBOSE - printf ("%s - told that %s acknowledged message #%d\n", want->me, - GNUNET_CONTAINER_meta_data_get_by_type (want->meta, - EXTRACTOR_METATYPE_TITLE), - orig_seq_number); -#endif + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "%s - told that %s acknowledged message #%d\n", want->me, + GNUNET_CONTAINER_meta_data_get_by_type (want->meta, + EXTRACTOR_METATYPE_TITLE), + orig_seq_number); if ((0 == memcmp (receiver, want->sender, sizeof (struct GNUNET_HashCode))) && (orig_seq_number == want->sequence_number) && (timestamp.abs_value >= want->timestamp.abs_value)) @@ -308,9 +294,6 @@ wait_until_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { GNUNET_SCHEDULER_Task task = cls; -#if VERBOSE - printf ("Waiting...\n"); -#endif if (is_ready) { wait_task = GNUNET_SCHEDULER_NO_TASK; @@ -327,9 +310,8 @@ wait_until_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void disconnect_alice (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { -#if VERBOSE - printf ("Alice is leaving.\n"); -#endif + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Alice is leaving.\n"); if (is_p2p) stop_arm (&p2); GNUNET_CHAT_leave_room (alice_room); @@ -342,9 +324,8 @@ disconnect_alice (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void disconnect_bob (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { -#if VERBOSE - printf ("Bod is leaving.\n"); -#endif + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Bob is leaving.\n"); alice_wanted.meta = NULL; alice_wanted.sender = &bob; alice_wanted.msg = NULL; @@ -366,10 +347,8 @@ set_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void send_to_alice (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { -#if VERBOSE - printf ("Bob says 'Hi!'\n"); -#endif - + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Bob says 'Hi!'\n"); alice_wanted.meta = bob_meta; alice_wanted.sender = &bob; alice_wanted.msg = "Hi Alice!"; @@ -388,9 +367,8 @@ send_to_bob (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) enum GNUNET_CHAT_MsgOptions options; uint32_t *seq = NULL; -#if VERBOSE - printf ("Alice says 'Hi!'\n"); -#endif + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Alice says 'Hi!'\n"); if (is_ackn) { options = GNUNET_CHAT_MSG_ACKNOWLEDGED; @@ -449,9 +427,8 @@ prepare_for_alice_task (void *cls, static void join_bob_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { -#if VERBOSE - printf ("Bob joining\n"); -#endif + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Bob joining\n"); alice_wanted.meta = bob_meta; alice_wanted.sender = &bob; alice_wanted.msg = NULL; @@ -480,9 +457,8 @@ join_bob_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void join_alice_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { -#if VERBOSE - printf ("Alice joining\n"); -#endif + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Alice joining\n"); alice_wanted.next_task = &join_bob_task; alice_wanted.next_task_cls = NULL; alice_room = @@ -537,9 +513,6 @@ main (int argc, char *argv[]) "test-chat", "-c", "test_chat_data.conf", -#if VERBOSE - "-L", "DEBUG", -#endif NULL }; struct GNUNET_GETOPT_CommandLineOption options[] = { @@ -547,11 +520,7 @@ main (int argc, char *argv[]) }; GNUNET_log_setup ("test_chat", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); if (strstr (argv[0], "p2p") != NULL) { diff --git a/src/chat/test_chat_private.c b/src/chat/test_chat_private.c index 64150c107..b911d091f 100644 --- a/src/chat/test_chat_private.c +++ b/src/chat/test_chat_private.c @@ -32,8 +32,6 @@ #define VERBOSE GNUNET_NO -#define START_ARM GNUNET_YES - /** * How long until we give up on passing the test? */ @@ -47,9 +45,7 @@ struct PeerContext { struct GNUNET_CONFIGURATION_Handle *cfg; -#if START_ARM struct GNUNET_OS_Process *arm_proc; -#endif }; struct Wanted @@ -134,12 +130,10 @@ setup_peer (struct PeerContext *p, const char *cfgname) binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); -#if START_ARM p->arm_proc = GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, "gnunet-service-arm", "-c", cfgname, NULL); -#endif GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); GNUNET_free (binary); } @@ -148,7 +142,6 @@ setup_peer (struct PeerContext *p, const char *cfgname) static void stop_arm (struct PeerContext *p) { -#if START_ARM if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) @@ -157,7 +150,6 @@ stop_arm (struct PeerContext *p) GNUNET_OS_process_get_pid (p->arm_proc)); GNUNET_OS_process_destroy (p->arm_proc); p->arm_proc = NULL; -#endif GNUNET_CONFIGURATION_destroy (p->cfg); } diff --git a/src/core/core.conf.in b/src/core/core.conf.in index fbe2f7948..ad39a8a79 100644 --- a/src/core/core.conf.in +++ b/src/core/core.conf.in @@ -10,7 +10,6 @@ UNIXPATH = /tmp/gnunet-service-core.sock UNIX_MATCH_UID = YES UNIX_MATCH_GID = YES # DISABLE_SOCKET_FORWARDING = NO -# DEBUG = YES # USERNAME = # MAXBUF = # TIMEOUT = diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index 11fd14504..68ae39df2 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c @@ -31,10 +31,6 @@ #include "gnunet_scheduler_lib.h" #include "gnunet_transport_service.h" -#define VERBOSE GNUNET_NO - -#define START_ARM GNUNET_YES - #define MTYPE 12345 struct PeerContext @@ -46,9 +42,7 @@ struct PeerContext struct GNUNET_TRANSPORT_GetHelloHandle *ghh; struct GNUNET_MessageHeader *hello; int connect_status; -#if START_ARM struct GNUNET_OS_Process *arm_proc; -#endif }; static struct PeerContext p1; @@ -61,11 +55,7 @@ static GNUNET_SCHEDULER_TaskIdentifier con_task; static int ok; -#if VERBOSE #define OKPP do { ok++; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) -#else -#define OKPP do { ok++; } while (0) -#endif static void @@ -111,9 +101,8 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { -#if VERBOSE - FPRINTF (stderr, "ENDING ANGRILY %u\n", ok); -#endif + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "ENDING ANGRILY %u\n", ok); GNUNET_break (0); if (NULL != p1.ch) { @@ -320,14 +309,12 @@ setup_peer (struct PeerContext *p, const char *cfgname) binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); -#if START_ARM p->arm_proc = GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, "gnunet-service-arm", "-c", cfgname, NULL); -#endif GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL); GNUNET_assert (p->th != NULL); @@ -358,7 +345,6 @@ run (void *cls, char *const *args, const char *cfgfile, static void stop_arm (struct PeerContext *p) { -#if START_ARM if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) @@ -367,19 +353,16 @@ stop_arm (struct PeerContext *p) GNUNET_OS_process_get_pid (p->arm_proc)); GNUNET_OS_process_destroy (p->arm_proc); p->arm_proc = NULL; -#endif GNUNET_CONFIGURATION_destroy (p->cfg); } + static int check () { char *const argv[] = { "test-core-api", "-c", "test_core_api_data.conf", -#if VERBOSE - "-L", "DEBUG", -#endif NULL }; struct GNUNET_GETOPT_CommandLineOption options[] = { @@ -399,11 +382,7 @@ main (int argc, char *argv[]) int ret; GNUNET_log_setup ("test-core-api", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); ret = check (); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-core-peer-1"); diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index dd70d438a..38c40da12 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c @@ -33,8 +33,6 @@ #include "gnunet_transport_service.h" #include -#define START_ARM GNUNET_YES - /** * Note that this value must not significantly exceed * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise @@ -73,9 +71,7 @@ struct PeerContext struct GNUNET_MessageHeader *hello; struct GNUNET_TRANSPORT_GetHelloHandle *ghh; int connect_status; -#if START_ARM struct GNUNET_OS_Process *arm_proc; -#endif }; static struct PeerContext p1; @@ -121,8 +117,10 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_TRANSPORT_get_hello_cancel (p2.ghh); GNUNET_CORE_disconnect (p1.ch); p1.ch = NULL; + GNUNET_free_non_null (p1.hello); GNUNET_CORE_disconnect (p2.ch); p2.ch = NULL; + GNUNET_free_non_null (p2.hello); if (connect_task != GNUNET_SCHEDULER_NO_TASK) GNUNET_SCHEDULER_cancel (connect_task); GNUNET_TRANSPORT_disconnect (p1.th); @@ -409,8 +407,7 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received (my) `%s' from transport service\n", "HELLO"); GNUNET_assert (message != NULL); - p->hello = GNUNET_malloc (ntohs (message->size)); - memcpy (p->hello, message, ntohs (message->size)); + p->hello = GNUNET_copy_message (message); if ((p == &p1) && (p2.th != NULL)) GNUNET_TRANSPORT_offer_hello (p2.th, message, NULL, NULL); if ((p == &p2) && (p1.th != NULL)) @@ -430,12 +427,10 @@ setup_peer (struct PeerContext *p, const char *cfgname) binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); -#if START_ARM p->arm_proc = GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, "gnunet-service-arm", "-c", cfgname, NULL); -#endif GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL); GNUNET_assert (p->th != NULL); @@ -463,7 +458,6 @@ run (void *cls, char *const *args, const char *cfgfile, static void stop_arm (struct PeerContext *p) { -#if START_ARM if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) @@ -472,7 +466,6 @@ stop_arm (struct PeerContext *p) GNUNET_OS_process_get_pid (p->arm_proc)); GNUNET_OS_process_destroy (p->arm_proc); p->arm_proc = NULL; -#endif GNUNET_CONFIGURATION_destroy (p->cfg); } 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 dcd886280..25eb25b96 100644 --- a/src/core/test_core_quota_asymmetric_recv_limited_peer1.conf +++ b/src/core/test_core_quota_asymmetric_recv_limited_peer1.conf @@ -34,5 +34,4 @@ WAN_QUOTA_OUT = 1 MB [core] PORT = 12490 UNIXPATH = /tmp/gnunet-core-asym-recv-p1-service-core.sock -DEBUG = NO 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 13f29e91a..062f12ae6 100644 --- a/src/core/test_core_quota_asymmetric_recv_limited_peer2.conf +++ b/src/core/test_core_quota_asymmetric_recv_limited_peer2.conf @@ -26,7 +26,6 @@ UNIXPATH = /tmp/gnunet-core-asym-recv-p2-service-transport.sock [core] PORT = 22490 UNIXPATH = /tmp/gnunet-core-asym-recv-p2-service-core.sock -DEBUG = NO [ats] PORT = 22491 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 09c4ed049..36d60f1ac 100644 --- a/src/core/test_core_quota_asymmetric_send_limit_peer1.conf +++ b/src/core/test_core_quota_asymmetric_send_limit_peer1.conf @@ -34,4 +34,3 @@ UNIXPATH = /tmp/gnunet-core-asym-send-p1-service-ats.sock [core] PORT = 12490 UNIXPATH = /tmp/gnunet-core-asym-send-p1-service-core.sock -DEBUG = NO 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 03d5bce12..b6e417483 100644 --- a/src/core/test_core_quota_asymmetric_send_limit_peer2.conf +++ b/src/core/test_core_quota_asymmetric_send_limit_peer2.conf @@ -25,7 +25,6 @@ UNIXPATH = /tmp/gnunet-core-asym-send-p2-service-transport.sock [core] PORT = 22490 UNIXPATH = /tmp/gnunet-core-asym-send-p2-service-core.sock -DEBUG = NO [ats] PORT = 22491 diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c index 88a915095..7f675a637 100644 --- a/src/core/test_core_quota_compliance.c +++ b/src/core/test_core_quota_compliance.c @@ -38,8 +38,6 @@ #define ASYMMETRIC_SEND_LIMITED 1 #define ASYMMETRIC_RECV_LIMITED 2 -#define START_ARM GNUNET_YES - /** * Note that this value must not significantly exceed * 'MAX_PENDING' in 'gnunet-service-transport.c', otherwise @@ -84,9 +82,7 @@ struct PeerContext struct GNUNET_STATISTICS_Handle *stats; struct GNUNET_TRANSPORT_GetHelloHandle *ghh; int connect_status; -#if START_ARM struct GNUNET_OS_Process *arm_proc; -#endif }; static struct PeerContext p1; @@ -146,6 +142,8 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) p1.th = NULL; GNUNET_TRANSPORT_disconnect (p2.th); p2.th = NULL; + GNUNET_free_non_null (p1.hello); + GNUNET_free_non_null (p2.hello); } @@ -574,12 +572,10 @@ setup_peer (struct PeerContext *p, const char *cfgname) binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); -#if START_ARM p->arm_proc = GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, "gnunet-service-arm", "-c", cfgname, NULL); -#endif GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); p->stats = GNUNET_STATISTICS_create ("core", p->cfg); GNUNET_assert (p->stats != NULL); @@ -642,7 +638,6 @@ run (void *cls, char *const *args, const char *cfgfile, static void stop_arm (struct PeerContext *p) { -#if START_ARM if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) @@ -651,7 +646,6 @@ stop_arm (struct PeerContext *p) GNUNET_OS_process_get_pid (p->arm_proc)); GNUNET_OS_process_destroy (p->arm_proc); p->arm_proc = NULL; -#endif GNUNET_CONFIGURATION_destroy (p->cfg); } diff --git a/src/core/test_core_quota_peer1.conf b/src/core/test_core_quota_peer1.conf index 4a67bfe66..43ef84505 100644 --- a/src/core/test_core_quota_peer1.conf +++ b/src/core/test_core_quota_peer1.conf @@ -32,7 +32,6 @@ WAN_QUOTA_OUT = 10240 [core] PORT = 12480 UNIXPATH = /tmp/gnunet-core-sym-p1-service-core.sock -DEBUG = NO [ats] PORT = 12481 diff --git a/src/core/test_core_quota_peer2.conf b/src/core/test_core_quota_peer2.conf index e288da064..b100f9fb4 100644 --- a/src/core/test_core_quota_peer2.conf +++ b/src/core/test_core_quota_peer2.conf @@ -25,7 +25,6 @@ UNIXPATH = /tmp/gnunet-core-sym-p2-service-transport.sock [core] PORT = 22480 UNIXPATH = /tmp/gnunet-core-sym-p2-service-core.sock -DEBUG = NO [ats] PORT = 22482 diff --git a/src/datastore/test_plugin_datastore.c b/src/datastore/test_plugin_datastore.c index 96a5aebe5..5aba51123 100644 --- a/src/datastore/test_plugin_datastore.c +++ b/src/datastore/test_plugin_datastore.c @@ -320,6 +320,8 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg) if (NULL == (ret = GNUNET_PLUGIN_load (libname, &env))) { FPRINTF (stderr, "Failed to load plugin `%s'!\n", name); + GNUNET_free (libname); + GNUNET_free (name); return NULL; } GNUNET_free (libname); diff --git a/src/dht/dht.conf.in b/src/dht/dht.conf.in index 553429dc8..d6afe39e9 100644 --- a/src/dht/dht.conf.in +++ b/src/dht/dht.conf.in @@ -12,7 +12,6 @@ UNIXPATH = /tmp/gnunet-service-dht.sock UNIX_MATCH_UID = YES UNIX_MATCH_GID = YES # DISABLE_SOCKET_FORWARDING = NO -# DEBUG = YES # USERNAME = # MAXBUF = # TIMEOUT = diff --git a/src/dht/test_dht_api_data.conf b/src/dht/test_dht_api_data.conf index 42ccf9687..58e509cbb 100644 --- a/src/dht/test_dht_api_data.conf +++ b/src/dht/test_dht_api_data.conf @@ -27,7 +27,6 @@ WAN_QUOTA_OUT = 1 GB PORT = 2092 [dht] -DEBUG = NO PORT = 12370 [block] @@ -35,7 +34,6 @@ plugins = dht test [transport] plugins = tcp -DEBUG = NO NEIGHBOUR_LIMIT = 50 PORT = 2091 diff --git a/src/dht/test_dht_api_peer1.conf b/src/dht/test_dht_api_peer1.conf index eea39e031..fd2ee804f 100644 --- a/src/dht/test_dht_api_peer1.conf +++ b/src/dht/test_dht_api_peer1.conf @@ -5,7 +5,6 @@ AUTOSTART = NO AUTOSTART = NO [dht] -DEBUG = NO AUTOSTART = YES ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; @@ -22,7 +21,6 @@ DATABASE = sqlite [transport] PLUGINS = tcp -DEBUG = NO ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; NEIGHBOUR_LIMIT = 50 @@ -38,7 +36,6 @@ PORT = 12092 [arm] DEFAULTSERVICES = core PORT = 12366 -DEBUG = NO [transport-tcp] TIMEOUT = 300 s diff --git a/src/dns/gnunet-dns-monitor.c b/src/dns/gnunet-dns-monitor.c index 8f05403fb..747a87556 100644 --- a/src/dns/gnunet-dns-monitor.c +++ b/src/dns/gnunet-dns-monitor.c @@ -363,12 +363,13 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-dns-monitor", - gettext_noop - ("Monitor DNS queries."), options, - &run, NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-dns-monitor", + gettext_noop + ("Monitor DNS queries."), options, + &run, NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } diff --git a/src/dns/gnunet-dns-redirector.c b/src/dns/gnunet-dns-redirector.c index 5ba7e87c6..3df2ac21a 100644 --- a/src/dns/gnunet-dns-redirector.c +++ b/src/dns/gnunet-dns-redirector.c @@ -245,11 +245,13 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-dns-redirector", - gettext_noop - ("Change DNS replies to point elsewhere."), options, - &run, NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-dns-redirector", + gettext_noop + ("Change DNS replies to point elsewhere."), options, + &run, NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } diff --git a/src/dv/dv.conf.in b/src/dv/dv.conf.in index 158bbcdd6..c0dc21bfd 100644 --- a/src/dv/dv.conf.in +++ b/src/dv/dv.conf.in @@ -1,6 +1,5 @@ [dv] AUTOSTART = YES -DEBUG = NO ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; BINARY = gnunet-service-dv diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c index c78d5072d..da822ca8f 100644 --- a/src/dv/test_transport_api_dv.c +++ b/src/dv/test_transport_api_dv.c @@ -25,8 +25,6 @@ #include "gnunet_testing_lib.h" #include "gnunet_core_service.h" -#define VERBOSE 1 - #define TEST_ALL GNUNET_NO /** @@ -176,17 +174,13 @@ shutdown_callback (void *cls, const char *emsg) { if (emsg != NULL) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n"); -#endif if (ok == 0) ok = 666; } else { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers successfully shut down!\n"); -#endif } } @@ -200,10 +194,8 @@ finish_testing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) struct TestMessageContext *free_pos; die_task = GNUNET_SCHEDULER_NO_TASK; -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called finish testing, stopping daemons.\n"); -#endif peer_pos = all_peers; while (peer_pos != NULL) { @@ -258,20 +250,11 @@ finish_testing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } GNUNET_free (free_pos); } -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "transmit_ready's scheduled %d, failed %d, transmit_ready's called %d\n", transmit_ready_scheduled, transmit_ready_failed, transmit_ready_called); -#endif - -#if VERBOSE - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling daemons_stop\n"); -#endif GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); -#if VERBOSE - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "daemons_stop finished\n"); -#endif if (dotOutFile != NULL) { FPRINTF (dotOutFile, "%s", "}"); @@ -288,16 +271,12 @@ disconnect_cores (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) struct TestMessageContext *pos = cls; /* Disconnect from the respective cores */ -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from peer 1 `%4s'\n", GNUNET_i2s (&pos->peer1->id)); -#endif if (pos->peer1handle != NULL) GNUNET_CORE_disconnect (pos->peer1handle); -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from peer 2 `%4s'\n", GNUNET_i2s (&pos->peer2->id)); -#endif if (pos->peer2handle != NULL) GNUNET_CORE_disconnect (pos->peer2handle); /* Set handles to NULL so test case can be ended properly */ @@ -422,23 +401,17 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, { struct TestMessageContext *pos = cls; struct GNUNET_TestMessage *msg = (struct GNUNET_TestMessage *) message; - -#if VERBOSE uint32_t distance; -#endif + if (pos->uid != ntohl (msg->uid)) return GNUNET_OK; - -#if VERBOSE distance = get_atsi_distance (atsi, atsi_count); -#endif GNUNET_assert (0 == memcmp (peer, &pos->peer1->id, sizeof (struct GNUNET_PeerIdentity))); if (total_other_expected_messages == 0) { total_messages_received++; -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from `%4s', type %d, uid %u, distance %u.\n", GNUNET_i2s (peer), ntohs (message->type), ntohl (msg->uid), @@ -446,12 +419,10 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Total messages received %d, expected %d.\n", total_messages_received, expected_messages); -#endif } else { total_other_messages++; -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from `%4s', type %d, uid %u, distance %u.\n", GNUNET_i2s (peer), ntohs (message->type), ntohl (msg->uid), @@ -459,17 +430,14 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Total OTHER messages received %d, expected %d.\n", total_other_messages, total_other_expected_messages); -#endif } if ((total_messages_received == expected_messages) && (total_other_messages == 0)) { GNUNET_SCHEDULER_cancel (die_task); -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Scheduling timeout from DV connections.\n"); -#endif die_task = GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT, &end_badly, "waiting for DV peers to connect!"); @@ -500,12 +468,10 @@ transmit_ready (void *cls, size_t size, void *buf) m->header.size = htons (sizeof (struct GNUNET_TestMessage)); m->uid = htonl (pos->uid); transmit_ready_called++; -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "transmit ready for peer %s\ntransmit_ready's scheduled %d, transmit_ready's called %d\n", GNUNET_i2s (&pos->peer1->id), transmit_ready_scheduled, transmit_ready_called); -#endif return sizeof (struct GNUNET_TestMessage); } @@ -537,11 +503,9 @@ connect_notify_peer2 (void *cls, const struct GNUNET_PeerIdentity *peer, if (0 == memcmp (&pos->peer1->id, peer, sizeof (struct GNUNET_PeerIdentity))) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core connection from `%s' to `%4s' verfied, sending message!\n", GNUNET_i2s (&pos->peer2->id), GNUNET_h2s (&peer->hashPubKey)); -#endif if (NULL == GNUNET_CORE_notify_transmit_ready (pos->peer1handle, GNUNET_YES, 0, TIMEOUT, &pos->peer2->id, @@ -566,11 +530,9 @@ static void init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server, const struct GNUNET_PeerIdentity *my_identity) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core connection to `%4s' established, awaiting connections.\n", GNUNET_i2s (my_identity)); -#endif total_server_connections++; } @@ -592,11 +554,9 @@ connect_notify_peer1 (void *cls, const struct GNUNET_PeerIdentity *peer, if (0 == memcmp (&pos->peer2->id, peer, sizeof (struct GNUNET_PeerIdentity))) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core connection from `%s' to `%4s' verified.\n", GNUNET_i2s (&pos->peer1->id), GNUNET_h2s (&peer->hashPubKey)); -#endif /* * Connect to the receiving peer */ @@ -612,11 +572,9 @@ init_notify_peer1 (void *cls, struct GNUNET_CORE_Handle *server, const struct GNUNET_PeerIdentity *my_identity) { total_server_connections++; -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core connection to `%4s' established, awaiting connections...\n", GNUNET_i2s (my_identity)); -#endif } @@ -642,11 +600,9 @@ send_test_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) &send_test_messages, pos); return; /* Otherwise we'll double schedule messages here! */ } -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Attempting to send test message from %s to %s\n", pos->peer1->shortname, pos->peer2->shortname); -#endif /* * Connect to the sending peer */ @@ -739,12 +695,9 @@ send_other_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_SCHEDULER_add_now (&end_badly, "send_other_messages had 0 messages to send, no DV connections made!"); } -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Preparing to send %d other test messages\n", total_other_expected_messages); -#endif - GNUNET_SCHEDULER_add_now (&send_test_messages, other_test_messages); if (GNUNET_SCHEDULER_NO_TASK != die_task) GNUNET_SCHEDULER_cancel (die_task); @@ -768,11 +721,9 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, if (emsg == NULL) { total_connections++; -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "connected peer %s to peer %s, distance %u\n", first_daemon->shortname, second_daemon->shortname, distance); -#endif temp_context = GNUNET_malloc (sizeof (struct TestMessageContext)); temp_context->peer1 = first_daemon; temp_context->peer2 = second_daemon; @@ -782,7 +733,6 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, test_messages = temp_context; expected_messages++; } -#if VERBOSE else { failed_connections++; @@ -790,15 +740,12 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, "Failed to connect peer %s to peer %s with error :\n%s\n", first_daemon->shortname, second_daemon->shortname, emsg); } -#endif if (total_connections == expected_connections) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created %u total connections, which is our target number! Calling send messages.\n", total_connections); -#endif if (GNUNET_SCHEDULER_NO_TASK != die_task) GNUNET_SCHEDULER_cancel (die_task); die_task = GNUNET_SCHEDULER_NO_TASK; @@ -825,13 +772,11 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, } else { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Have %d total connections, %d failed connections, Want %d (at least %d)\n", total_connections, failed_connections, expected_connections, expected_connections - (unsigned int) (fail_percentage * expected_connections)); -#endif } } @@ -864,12 +809,9 @@ all_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer, second_shortname = GNUNET_strdup (GNUNET_i2s (peer)); distance = get_atsi_distance (atsi, atsi_count); -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "connected peer %s to peer %s, distance %u\n", d->shortname, second_shortname, distance); -#endif - second_daemon = GNUNET_CONTAINER_multihashmap_get (peer_daemon_hash, &peer->hashPubKey); @@ -933,10 +875,8 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, return; } GNUNET_assert (id != NULL); -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started daemon %llu out of %llu\n", (num_peers - peers_left) + 1, num_peers); -#endif GNUNET_assert (GNUNET_SYSERR != GNUNET_CONTAINER_multihashmap_put (peer_daemon_hash, &id->hashPubKey, d, @@ -953,10 +893,8 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, if (peers_left == 0) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All %d daemons started, now creating topology!\n", num_peers); -#endif GNUNET_SCHEDULER_cancel (die_task); die_task = GNUNET_SCHEDULER_NO_TASK; expected_connections = -1; @@ -967,10 +905,8 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, connect_topology_option, connect_topology_option_modifier, TIMEOUT, 12, NULL, NULL); -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Have %d expected connections\n", expected_connections); -#endif } if (expected_connections == GNUNET_SYSERR) @@ -1009,17 +945,13 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, "Hostkey callback received error: %s\n", emsg); } -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostkey created for peer `%s'\n", GNUNET_i2s (id)); -#endif peers_left--; if (peers_left == 0) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All %d hostkeys created, now creating topology!\n", num_peers); -#endif if (GNUNET_SCHEDULER_NO_TASK != die_task) { GNUNET_SCHEDULER_cancel (die_task); @@ -1031,10 +963,8 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, (pg, topology, blacklist_topology, blacklist_transports) != GNUNET_SYSERR) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Topology set up, now starting peers!\n"); -#endif GNUNET_TESTING_daemons_continue_startup (pg); /* Set up task in case topology creation doesn't finish * within a reasonable amount of time */ @@ -1070,11 +1000,8 @@ run (void *cls, char *const *args, const char *cfgfile, FPRINTF (dotOutFile, "%s", "strict graph G {\n"); } -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons based on config file %s\n", cfgfile); -#endif - if (GNUNET_YES != GNUNET_CONFIGURATION_get_value_string (cfg, "paths", "servicehome", &test_directory)) @@ -1198,9 +1125,6 @@ check () char *const argv[] = { "test-transport-dv", "-c", "test_transport_dv_data.conf", -#if VERBOSE - "-L", "DEBUG", -#endif NULL }; struct GNUNET_GETOPT_CommandLineOption options[] = { @@ -1223,11 +1147,7 @@ main (int argc, char *argv[]) int ret; GNUNET_log_setup ("test-transport-dv", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); ret = check (); /** diff --git a/src/dv/test_transport_dv_data.conf b/src/dv/test_transport_dv_data.conf index 3daa6a7f4..8232461e5 100644 --- a/src/dv/test_transport_dv_data.conf +++ b/src/dv/test_transport_dv_data.conf @@ -5,7 +5,6 @@ SERVICEHOME = /tmp/test-gnunet-dv-testing/ PORT = 2564 [transport] -DEBUG = YES PORT = 2565 PLUGINS = tcp dv BLACKLIST_FILE = $SERVICEHOME/blacklist @@ -34,7 +33,6 @@ PORT = 2570 [dv] AUTOSTART = YES -DEBUG = NO ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; BINARY = gnunet-service-dv @@ -45,7 +43,6 @@ PORT = 2571 [testing] NUM_PEERS = 3 ADDITIONAL_MESSAGES = 10 -DEBUG = NO WEAKRANDOM = YES TOPOLOGY = CLIQUE CONNECT_TOPOLOGY = LINE diff --git a/src/fragmentation/test_fragmentation.c b/src/fragmentation/test_fragmentation.c index ecbcdddab..2a30d7d93 100644 --- a/src/fragmentation/test_fragmentation.c +++ b/src/fragmentation/test_fragmentation.c @@ -25,8 +25,6 @@ #include "platform.h" #include "gnunet_fragmentation_lib.h" -#define VERBOSE GNUNET_NO - #define DETAILS GNUNET_NO /** @@ -234,21 +232,13 @@ main (int argc, char *argv[]) "-c", "test_fragmentation_data.conf", "-L", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL }; unsigned int i; GNUNET_log_setup ("test-fragmentation", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); for (i = 0; i < NUM_MSGS; i++) GNUNET_BANDWIDTH_tracker_init (&trackers[i], diff --git a/src/fs/fs.conf.in b/src/fs/fs.conf.in index 007b0fd41..52bb52f5a 100644 --- a/src/fs/fs.conf.in +++ b/src/fs/fs.conf.in @@ -30,7 +30,6 @@ UNIX_MATCH_UID = NO # Do we require users that want to access file-sharing to be in the 'gnunet' group? UNIX_MATCH_GID = YES -# DEBUG = YES # Maximum number of requests this peer tracks (important for # memory consumption; 2k RAM/request is not unusual) diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c index 073b768db..e0514bc8f 100644 --- a/src/fs/gnunet-auto-share.c +++ b/src/fs/gnunet-auto-share.c @@ -788,6 +788,7 @@ main (int argc, char *const *argv) sigpipe = NULL; GNUNET_free (cfg_filename); cfg_filename = NULL; + GNUNET_free ((void*) argv); return ok; } diff --git a/src/fs/gnunet-directory.c b/src/fs/gnunet-directory.c index 4122cb154..2f25e282e 100644 --- a/src/fs/gnunet-directory.c +++ b/src/fs/gnunet-directory.c @@ -177,11 +177,13 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-directory [OPTIONS] FILENAME", - gettext_noop - ("Display contents of a GNUnet directory"), - options, &run, NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-directory [OPTIONS] FILENAME", + gettext_noop + ("Display contents of a GNUnet directory"), + options, &run, NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-directory.c */ diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index 093dd7bdc..04edc66c8 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c @@ -333,11 +333,13 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-download [OPTIONS] URI", - gettext_noop - ("Download files from GNUnet using a GNUnet CHK or LOC URI (gnunet://fs/chk/...)"), - options, &run, NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-download [OPTIONS] URI", + gettext_noop + ("Download files from GNUnet using a GNUnet CHK or LOC URI (gnunet://fs/chk/...)"), + options, &run, NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-download.c */ diff --git a/src/fs/gnunet-fs.c b/src/fs/gnunet-fs.c index ce6284aa4..1d791377c 100644 --- a/src/fs/gnunet-fs.c +++ b/src/fs/gnunet-fs.c @@ -122,11 +122,12 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-fs [OPTIONS]", - gettext_noop ("Special file-sharing operations"), - options, &run, NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-fs [OPTIONS]", + gettext_noop ("Special file-sharing operations"), + options, &run, NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-fs.c */ diff --git a/src/fs/gnunet-helper-fs-publish.c b/src/fs/gnunet-helper-fs-publish.c index 8df53a6c3..d429f603d 100644 --- a/src/fs/gnunet-helper-fs-publish.c +++ b/src/fs/gnunet-helper-fs-publish.c @@ -364,8 +364,7 @@ extract_files (struct ScanTreeNode *item) /* this is the expensive operation, *afterwards* we'll check for aborts */ meta = GNUNET_CONTAINER_meta_data_create (); - if (NULL != plugins) - EXTRACTOR_extract (plugins, item->filename, NULL, 0, &add_to_md, meta); + EXTRACTOR_extract (plugins, item->filename, NULL, 0, &add_to_md, meta); slen = strlen (item->filename) + 1; size = GNUNET_CONTAINER_meta_data_get_serialized_size (meta); if (-1 == size) @@ -462,6 +461,7 @@ int main(int argc, FPRINTF (stderr, "%s", "gnunet-helper-fs-publish needs exactly one or two arguments\n"); + GNUNET_free ((void*) argv); return 1; } filename_expanded = argv[1]; @@ -480,13 +480,19 @@ int main(int argc, &root)) { (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0); + EXTRACTOR_plugin_remove_all (plugins); + GNUNET_free ((void*) argv); return 2; } /* signal that we're done counting files, so that a percentage of progress can now be calculated */ if (GNUNET_OK != write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_COUNTING_DONE, NULL, 0)) + { + EXTRACTOR_plugin_remove_all (plugins); + GNUNET_free ((void*) argv); return 3; + } if (NULL != root) { if (GNUNET_OK != @@ -494,15 +500,16 @@ int main(int argc, { (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_ERROR, NULL, 0); free_tree (root); + EXTRACTOR_plugin_remove_all (plugins); + GNUNET_free ((void*) argv); return 4; } free_tree (root); } /* enable "clean" shutdown by telling parent that we are done */ (void) write_message (GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_FINISHED, NULL, 0); - if (NULL != plugins) - EXTRACTOR_plugin_remove_all (plugins); - + EXTRACTOR_plugin_remove_all (plugins); + GNUNET_free ((void*) argv); return 0; } diff --git a/src/fs/gnunet-pseudonym.c b/src/fs/gnunet-pseudonym.c index 02b71b513..a692917da 100644 --- a/src/fs/gnunet-pseudonym.c +++ b/src/fs/gnunet-pseudonym.c @@ -317,10 +317,12 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-pseudonym [OPTIONS]", - gettext_noop ("Manage GNUnet pseudonyms."), - options, &run, NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-pseudonym [OPTIONS]", + gettext_noop ("Manage GNUnet pseudonyms."), + options, &run, NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-pseudonym.c */ diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c index eb64cc4cc..dbbdfda8c 100644 --- a/src/fs/gnunet-publish.c +++ b/src/fs/gnunet-publish.c @@ -734,19 +734,18 @@ main (int argc, char *const *argv) 0, &GNUNET_GETOPT_set_one, &verbose}, GNUNET_GETOPT_OPTION_END }; - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "GNUnet publish starts\n"); bo.expiration_time = GNUNET_FS_year_to_time (GNUNET_FS_get_current_year () + 2); if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-publish [OPTIONS] FILENAME", - gettext_noop - ("Publish a file or directory on GNUnet"), - options, &run, NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-publish [OPTIONS] FILENAME", + gettext_noop + ("Publish a file or directory on GNUnet"), + options, &run, NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-publish.c */ diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index 200dc77ab..e90b761d7 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c @@ -303,11 +303,13 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-search [OPTIONS] KEYWORD", - gettext_noop - ("Search GNUnet for files that were published on GNUnet"), - options, &run, NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-search [OPTIONS] KEYWORD", + gettext_noop + ("Search GNUnet for files that were published on GNUnet"), + options, &run, NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-search.c */ diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c index be16e9100..094d8868d 100644 --- a/src/fs/gnunet-unindex.c +++ b/src/fs/gnunet-unindex.c @@ -173,11 +173,13 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-unindex [OPTIONS] FILENAME", - gettext_noop - ("Unindex a file that was previously indexed with gnunet-publish."), - options, &run, NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-unindex [OPTIONS] FILENAME", + gettext_noop + ("Unindex a file that was previously indexed with gnunet-publish."), + options, &run, NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-unindex.c */ diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c index 4954e3b4c..5329e4917 100644 --- a/src/gns/gnunet-dns2gns.c +++ b/src/gns/gnunet-dns2gns.c @@ -692,7 +692,7 @@ main (int argc, _("GNUnet DNS-to-GNS proxy (a DNS server)"), options, &run, NULL)) ? 0 : 1; - + GNUNET_free ((void*) argv); return ret; } diff --git a/src/gns/gnunet-gns-fcfsd.c b/src/gns/gnunet-gns-fcfsd.c index 5503000ac..c29c7838a 100644 --- a/src/gns/gnunet-gns-fcfsd.c +++ b/src/gns/gnunet-gns-fcfsd.c @@ -970,7 +970,7 @@ main (int argc, char *const *argv) _("GNUnet GNS first come first serve registration service"), options, &run, NULL)) ? 0 : 1; - + GNUNET_free ((void*) argv); return ret; } diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c index ba30b56fb..d7e8309dd 100644 --- a/src/gns/gnunet-gns.c +++ b/src/gns/gnunet-gns.c @@ -381,7 +381,7 @@ main (int argc, char *const *argv) _("GNUnet GNS access tool"), options, &run, NULL)) ? 0 : 1; - + GNUNET_free ((void*) argv); return ret; } diff --git a/src/gns/test_gns_dht_default.conf b/src/gns/test_gns_dht_default.conf index b22f002fb..a14588c41 100644 --- a/src/gns/test_gns_dht_default.conf +++ b/src/gns/test_gns_dht_default.conf @@ -7,7 +7,6 @@ PORT = 22568 [dht] UNIXPATH = /tmp/gnunet-service-dht.sock -DEBUG = NO AUTOSTART = YES ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; diff --git a/src/gns/test_gns_simple_lookup.conf b/src/gns/test_gns_simple_lookup.conf index ca1699c2f..f759ba448 100644 --- a/src/gns/test_gns_simple_lookup.conf +++ b/src/gns/test_gns_simple_lookup.conf @@ -7,7 +7,6 @@ AUTOSTART = YES HOSTNAME = localhost [dht] -DEBUG = NO AUTOSTART = YES ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; @@ -24,7 +23,6 @@ DATABASE = sqlite [transport] PLUGINS = tcp -DEBUG = NO ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; NEIGHBOUR_LIMIT = 50 @@ -40,7 +38,6 @@ PORT = 12092 [arm] DEFAULTSERVICES = core dht namestore gns PORT = 12366 -DEBUG = NO [transport-tcp] TIMEOUT = 300 s diff --git a/src/gns/w32nsp-resolve.c b/src/gns/w32nsp-resolve.c index 4a116f594..3234a1ee5 100644 --- a/src/gns/w32nsp-resolve.c +++ b/src/gns/w32nsp-resolve.c @@ -57,7 +57,8 @@ DEFINE_GUID(SVCID_INET_HOSTADDRBYNAME, 0x0002a803, 0x0000, 0x0000, 0xc0, 0x00, 0 // to convert structures returned as BLOBs. // -VOID FixList(PCHAR ** List, PCHAR Base) +VOID +FixList(PCHAR ** List, PCHAR Base) { if(*List) { @@ -77,7 +78,8 @@ VOID FixList(PCHAR ** List, PCHAR Base) // Routine to convert a hostent returned in a BLOB to one with // usable pointers. The structure is converted in-place. // -VOID UnpackHostEnt(struct hostent * hostent) +VOID +UnpackHostEnt(struct hostent * hostent) { PCHAR pch; @@ -91,13 +93,15 @@ VOID UnpackHostEnt(struct hostent * hostent) FixList(&hostent->h_addr_list, pch); } -void + +static void print_hostent (struct hostent *he) { int i; char **pAlias; + printf("\tOfficial name: %s\n", he->h_name); - for (pAlias = he->h_aliases; *pAlias != 0; pAlias++) { + for (i=0, pAlias = he->h_aliases; *pAlias != 0; pAlias++) { printf("\tAlternate name #%d: %s\n", ++i, *pAlias); } printf("\tAddress type: "); @@ -150,6 +154,7 @@ print_hostent (struct hostent *he) } } + int main (int argc, char **argv) { diff --git a/src/hello/gnunet-hello.c b/src/hello/gnunet-hello.c index bc35cdd32..eae16a90b 100644 --- a/src/hello/gnunet-hello.c +++ b/src/hello/gnunet-hello.c @@ -25,10 +25,6 @@ #include "platform.h" #include "gnunet_hello_lib.h" -#define DEBUG GNUNET_EXTRA_LOGGING - -#define VERBOSE GNUNET_NO - /** * Closure for 'add_to_buf'. */ diff --git a/src/hello/test_hello.c b/src/hello/test_hello.c index bdabc72ea..ac482efe5 100644 --- a/src/hello/test_hello.c +++ b/src/hello/test_hello.c @@ -25,11 +25,6 @@ #include "platform.h" #include "gnunet_hello_lib.h" -#define DEBUG GNUNET_NO - -#define VERBOSE GNUNET_NO - - static size_t my_addr_gen (void *cls, size_t max, void *buf) { @@ -37,9 +32,8 @@ my_addr_gen (void *cls, size_t max, void *buf) size_t ret; struct GNUNET_HELLO_Address address; -#if DEBUG - FPRINTF (stderr, "DEBUG: my_addr_gen called with i = %d\n", *i); -#endif + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "DEBUG: my_addr_gen called with i = %d\n", *i); if (0 == *i) return 0; memset (&address.peer, 0, sizeof (struct GNUNET_PeerIdentity)); @@ -60,10 +54,9 @@ check_addr (void *cls, const struct GNUNET_HELLO_Address *address, { unsigned int *i = cls; -#if DEBUG - FPRINTF (stderr, "DEBUG: check_addr called with i = %d and addrlen = %u\n", + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "DEBUG: check_addr called with i = %d and addrlen = %u\n", *i, (unsigned int) address->address_length); -#endif GNUNET_assert (address->address_length > 0); GNUNET_assert (*i & (1 << (address->address_length - 1))); *i -= (1 << (address->address_length - 1)); @@ -81,10 +74,9 @@ remove_some (void *cls, const struct GNUNET_HELLO_Address *address, { unsigned int *i = cls; -#if DEBUG - FPRINTF (stderr, "DEBUG: remove_some called with i = %d and addrlen = %u\n", + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "DEBUG: remove_some called with i = %d and addrlen = %u\n", *i, (unsigned int) address->address_length); -#endif GNUNET_assert (address->address_length > 0); if (*i & (1 << (address->address_length - 1))) { @@ -109,65 +101,56 @@ main (int argc, char *argv[]) GNUNET_log_setup ("test-hello", "DEBUG", NULL); startup_time = GNUNET_TIME_absolute_get (); memset (&publicKey, 42, sizeof (publicKey)); -#if VERBOSE - FPRINTF (stderr, "%s", "Testing HELLO creation (without addresses)...\n"); -#endif + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "Testing HELLO creation (without addresses)...\n"); i = 0; msg1 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i); GNUNET_assert (msg1 != NULL); GNUNET_assert (0 < GNUNET_HELLO_size (msg1)); -#if VERBOSE - FPRINTF (stderr, "%s", "Testing address iteration (empty set)...\n"); -#endif + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "Testing address iteration (empty set)...\n"); GNUNET_assert (NULL == GNUNET_HELLO_iterate_addresses (msg1, GNUNET_NO, &check_addr, &i)); - -#if VERBOSE - FPRINTF (stderr, "%s", "Testing HELLO creation (with one address)...\n"); -#endif + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "Testing HELLO creation (with one address)...\n"); i = 1; msg2 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i); GNUNET_assert (msg2 != NULL); GNUNET_assert (GNUNET_HELLO_size (msg1) < GNUNET_HELLO_size (msg2)); -#if VERBOSE - FPRINTF (stderr, "%s", "Testing address iteration (one address)...\n"); -#endif + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "Testing address iteration (one address)...\n"); i = 1; GNUNET_assert (NULL == GNUNET_HELLO_iterate_addresses (msg2, GNUNET_NO, &check_addr, &i)); GNUNET_assert (i == 0); -#if VERBOSE - FPRINTF (stderr, "%s", "Testing get_key from HELLO...\n"); -#endif + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "Testing get_key from HELLO...\n"); GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_key (msg2, &pk)); GNUNET_assert (0 == memcmp (&publicKey, &pk, sizeof (pk))); GNUNET_free (msg1); -#if VERBOSE - FPRINTF (stderr, "%s", "Testing HELLO creation (with two addresses)...\n"); -#endif + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "Testing HELLO creation (with two addresses)...\n"); i = 2; msg3 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i); GNUNET_assert (msg3 != NULL); GNUNET_assert (GNUNET_HELLO_size (msg2) < GNUNET_HELLO_size (msg3)); -#if VERBOSE - FPRINTF (stderr, "%s", "Testing address iteration (two addresses)...\n"); -#endif + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "Testing address iteration (two addresses)...\n"); i = 3; GNUNET_assert (NULL == GNUNET_HELLO_iterate_addresses (msg3, GNUNET_NO, &check_addr, &i)); GNUNET_assert (i == 0); -#if VERBOSE - FPRINTF (stderr, "%s", "Testing HELLO merge...\n"); -#endif + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "Testing HELLO merge...\n"); msg1 = GNUNET_HELLO_merge (msg2, msg3); GNUNET_assert (GNUNET_HELLO_size (msg1) == GNUNET_HELLO_size (msg3)); @@ -178,9 +161,8 @@ main (int argc, char *argv[]) GNUNET_assert (i == 0); GNUNET_free (msg1); -#if VERBOSE - FPRINTF (stderr, "%s", "Testing address iteration to copy HELLO...\n"); -#endif + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "Testing address iteration to copy HELLO...\n"); i = 2; msg1 = GNUNET_HELLO_iterate_addresses (msg3, GNUNET_YES, &remove_some, &i); GNUNET_assert (msg1 != NULL); @@ -192,9 +174,8 @@ main (int argc, char *argv[]) GNUNET_assert (i == 0); GNUNET_free (msg1); -#if VERBOSE - FPRINTF (stderr, "%s", "Testing delta address iteration...\n"); -#endif + GNUNTE_log (GNUNET_ERROR_TYPE_DEBUG, + "Testing delta address iteration...\n"); i = 2; GNUNET_HELLO_iterate_new_addresses (msg3, msg2, startup_time, &check_addr, &i); diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c index 6637f37ce..255f0d544 100644 --- a/src/hostlist/gnunet-daemon-hostlist.c +++ b/src/hostlist/gnunet-daemon-hostlist.c @@ -343,7 +343,7 @@ main (int argc, char *const *argv) GNUNET_PROGRAM_run (argc, argv, "hostlist", _("GNUnet hostlist server and client"), options, &run, NULL)) ? 0 : 1; - + GNUNET_free ((void*) argv); return ret; } diff --git a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf index c880190a1..0a345f6bf 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf +++ b/src/hostlist/test_gnunet_daemon_hostlist_peer1.conf @@ -25,7 +25,6 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock [transport] PORT = 12965 UNIXPATH = /tmp/gnunet-p1-service-transport.sock -DEBUG = NO [core] PORT = 12970 diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c index 63baced46..74ef37f16 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c @@ -28,11 +28,6 @@ #include "gnunet_arm_service.h" #include "gnunet_transport_service.h" -#define VERBOSE GNUNET_NO - -#define START_ARM GNUNET_YES - - /** * How long until we give up on transmitting the message? */ @@ -48,9 +43,7 @@ struct PeerContext struct GNUNET_TRANSPORT_Handle *th; struct GNUNET_MessageHeader *hello; struct GNUNET_TRANSPORT_GetHelloHandle *ghh; -#if START_ARM struct GNUNET_OS_Process *arm_proc; -#endif }; static struct PeerContext p1; @@ -112,9 +105,6 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, { if (peer == NULL) return; -#if VERBOSE - FPRINTF (stderr, "Peer %s connected\n", GNUNET_i2s (peer)); -#endif GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected, shutting down.\n"); ok = 0; if (timeout_task != GNUNET_SCHEDULER_NO_TASK) @@ -145,12 +135,10 @@ setup_peer (struct PeerContext *p, const char *cfgname) binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); p->cfg = GNUNET_CONFIGURATION_create (); -#if START_ARM p->arm_proc = GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, "gnunet-service-arm", "-c", cfgname, NULL); -#endif GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, ¬ify_connect, NULL); @@ -165,7 +153,6 @@ waitpid_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { struct PeerContext *p = cls; -#if START_ARM GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Killing ARM process.\n"); if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); @@ -175,7 +162,6 @@ waitpid_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_OS_process_get_pid (p->arm_proc)); GNUNET_OS_process_destroy (p->arm_proc); p->arm_proc = NULL; -#endif GNUNET_CONFIGURATION_destroy (p->cfg); } @@ -218,9 +204,6 @@ check () { char *const argv[] = { "test-gnunet-daemon-hostlist", "-c", "test_gnunet_daemon_hostlist_data.conf", -#if VERBOSE - "-L", "DEBUG", -#endif NULL }; struct GNUNET_GETOPT_CommandLineOption options[] = { @@ -244,11 +227,7 @@ main (int argc, char *argv[]) GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-3"); GNUNET_log_setup ("test-gnunet-daemon-hostlist", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); ret = check (); if (ret == 0) diff --git a/src/hostlist/test_hostlist_defaults.conf b/src/hostlist/test_hostlist_defaults.conf index d7383005c..fe3756a1e 100644 --- a/src/hostlist/test_hostlist_defaults.conf +++ b/src/hostlist/test_hostlist_defaults.conf @@ -67,4 +67,4 @@ AUTOSTART = NO AUTOSTART = NO [nat] -RETURN_LOCAL_ADDRESSES = YES \ No newline at end of file +RETURN_LOCAL_ADDRESSES = YES diff --git a/src/include/platform.h b/src/include/platform.h index 912601dad..c44f67f67 100644 --- a/src/include/platform.h +++ b/src/include/platform.h @@ -1,6 +1,6 @@ /* This file is part of GNUnet. - (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 Christian Grothoff (and other contributing authors) + (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2012 Christian Grothoff (and other contributing authors) GNUnet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -20,14 +20,12 @@ /** * @file include/platform.h - * @brief plaform specifics - * + * @brief plaform specific includes and defines * @author Nils Durner - * + * @author Christian Grothoff * This file should never be included by installed - * header files (thos starting with "gnunet_"). + * header files (those starting with "gnunet_"). */ - #ifndef PLATFORM_H #define PLATFORM_H @@ -141,7 +139,7 @@ #ifdef SOMEBSD #include #endif -#ifdef GNUNET_freeBSD +#ifdef FREEBSD #include #endif #ifdef DARWIN diff --git a/src/integration-tests/confs/c_no_nat_client.conf b/src/integration-tests/confs/c_no_nat_client.conf index 8d4c7e3e8..8e89f3f6e 100644 --- a/src/integration-tests/confs/c_no_nat_client.conf +++ b/src/integration-tests/confs/c_no_nat_client.conf @@ -140,7 +140,6 @@ ATS_MIN_INTERVAL = 15000 ATS_EXEC_INTERVAL = 30000 [transport] -#DEBUG = YES #PREFIX = valgrind --alloc-fn=GNUNET_xmalloc_ --alloc-fn=GNUNET_xmalloc_unchecked_ --alloc-fn=GNUNET_xrealloc_ --alloc-fn=GNUNET_xgrow_ --massif-out-file=massif_client.out --tool=massif AUTOSTART = YES PORT = 20029 diff --git a/src/integration-tests/confs/c_no_nat_client_http.conf b/src/integration-tests/confs/c_no_nat_client_http.conf index 523a4fdcf..bbf6a64ec 100644 --- a/src/integration-tests/confs/c_no_nat_client_http.conf +++ b/src/integration-tests/confs/c_no_nat_client_http.conf @@ -141,7 +141,6 @@ ATS_EXEC_INTERVAL = 30000 [transport] PREFIX = valgrind --leak-check=full -#DEBUG = YES AUTOSTART = YES PORT = 20029 HOSTNAME = localhost diff --git a/src/integration-tests/confs/c_no_nat_client_unix.conf b/src/integration-tests/confs/c_no_nat_client_unix.conf index 62d679fd2..25373c927 100644 --- a/src/integration-tests/confs/c_no_nat_client_unix.conf +++ b/src/integration-tests/confs/c_no_nat_client_unix.conf @@ -141,7 +141,6 @@ ATS_EXEC_INTERVAL = 30000 [transport] PREFIX = valgrind --leak-check=full -#DEBUG = YES AUTOSTART = YES PORT = 20029 HOSTNAME = localhost diff --git a/src/integration-tests/connection_watchdog.c b/src/integration-tests/connection_watchdog.c index 17aab2159..0998a367e 100644 --- a/src/integration-tests/connection_watchdog.c +++ b/src/integration-tests/connection_watchdog.c @@ -1097,11 +1097,12 @@ main (int argc, char *const *argv) if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "cn", - gettext_noop ("help text"), options, &run, - NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "cn", + gettext_noop ("help text"), options, &run, + NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of connection_watchdog.c */ diff --git a/src/lockmanager/test_lockmanager_api.conf b/src/lockmanager/test_lockmanager_api.conf index af0d99319..2be9caef1 100644 --- a/src/lockmanager/test_lockmanager_api.conf +++ b/src/lockmanager/test_lockmanager_api.conf @@ -1,5 +1,4 @@ [lockmanager] -DEBUG = YES AUTOSTART = NO PORT = 12112 ACCEPT_FROM = 127.0.0.1; @@ -28,7 +27,6 @@ DATABASE = sqlite [transport] PLUGINS = tcp -DEBUG = NO ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; NEIGHBOUR_LIMIT = 50 @@ -44,7 +42,6 @@ PORT = 12092 [arm] DEFAULTSERVICES = core lockmanager PORT = 12366 -DEBUG = NO [transport-tcp] TIMEOUT = 300 s @@ -53,7 +50,6 @@ PORT = 12368 [TESTING] NUM_PEERS = 5 WEAKRANDOM = YES -DEBUG = YES HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat MAX_CONCURRENT_SSH = 10 USE_PROGRESSBARS = YES diff --git a/src/mesh/gnunet-regex-profiler.c b/src/mesh/gnunet-regex-profiler.c index fac7b02e5..128ed905e 100644 --- a/src/mesh/gnunet-regex-profiler.c +++ b/src/mesh/gnunet-regex-profiler.c @@ -1872,6 +1872,7 @@ main (int argc, char *const *argv) GNUNET_PROGRAM_run (argc, argv, "gnunet-regex-profiler [OPTIONS] hosts-file policy-dir search-strings-file", _("Profiler for regex/mesh"), options, &run, NULL); + GNUNET_free ((void*) argv); if (GNUNET_OK != ret) return ret; if (GNUNET_OK != result) diff --git a/src/mesh/regex_profiler_test.conf b/src/mesh/regex_profiler_test.conf index ebbc9ee2f..938ea3cad 100644 --- a/src/mesh/regex_profiler_test.conf +++ b/src/mesh/regex_profiler_test.conf @@ -26,7 +26,6 @@ DISABLE_TRY_CONNECT = YES [arm] DEFAULTSERVICES = core mesh dht statistics PORT = 12003 -DEBUG = NO [fs] AUTOSTART = NO @@ -40,7 +39,6 @@ plugins = dht mesh [transport] AUTOSTART = YES PLUGINS = tcp -DEBUG = NO ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24; ACCEPT_FROM6 = ::1; NEIGHBOUR_LIMIT = 50 @@ -67,7 +65,6 @@ ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24; [TESTING] NUM_PEERS = 5 WEAKRANDOM = YES -DEBUG = YES HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat MAX_CONCURRENT_SSH = 10 USE_PROGRESSBARS = YES diff --git a/src/mesh/test_mesh.conf b/src/mesh/test_mesh.conf index d8bdd7a13..8b9ca158e 100644 --- a/src/mesh/test_mesh.conf +++ b/src/mesh/test_mesh.conf @@ -5,7 +5,6 @@ AUTOSTART = NO AUTOSTART = NO [mesh] -DEBUG = YES AUTOSTART = YES ACCEPT_FROM = 127.0.0.1; HOSTNAME = localhost @@ -27,7 +26,6 @@ AUTOSTART = NO PORT = 10012 [dht] -DEBUG = NO AUTOSTART = YES ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; @@ -43,7 +41,6 @@ DATABASE = sqlite [transport] PLUGINS = tcp -DEBUG = NO ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; NEIGHBOUR_LIMIT = 50 @@ -59,7 +56,6 @@ PORT = 12092 [arm] DEFAULTSERVICES = core PORT = 12366 -DEBUG = NO [transport-tcp] TIMEOUT = 300 s diff --git a/src/mesh/test_mesh_2dtorus.c b/src/mesh/test_mesh_2dtorus.c index 58777c001..4c1e406ef 100644 --- a/src/mesh/test_mesh_2dtorus.c +++ b/src/mesh/test_mesh_2dtorus.c @@ -25,7 +25,6 @@ #include "platform.h" #include "gnunet_testing_lib.h" -#define VERBOSE GNUNET_YES #define REMOVE_DIR GNUNET_YES /** @@ -107,13 +106,11 @@ shutdown_callback (void *cls, const char *emsg) "test: Shutdown of peers failed! (%s)\n", emsg); ok--; } -#if VERBOSE else { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: All peers successfully shut down!\n"); } -#endif GNUNET_CONFIGURATION_destroy (testing_cfg); } @@ -121,10 +118,7 @@ shutdown_callback (void *cls, const char *emsg) static void shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Ending test.\n"); -#endif - GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); } @@ -201,15 +195,9 @@ peergroup_ready (void *cls, const char *emsg) GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); return; } -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "************************************************************\n"); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "test: Peer Group started successfully!\n"); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Have %u connections\n", + "test: Peer Group started successfully with %u connections\n", total_connections); -#endif - peers_running = GNUNET_TESTING_daemons_running (pg); if (0 < failed_connections) { @@ -287,19 +275,11 @@ run (void *cls, char *const *args, const char *cfgfile, testing_cfg = GNUNET_CONFIGURATION_dup (cfg); GNUNET_log_setup ("test_mesh_2dtorus", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); -#if VERBOSE - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Starting daemons.\n"); - GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing_old", - "use_progressbars", "YES"); -#endif + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Starting daemons.\n"); if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing_old", "num_peers", &num_peers)) @@ -342,10 +322,6 @@ main (int argc, char *argv[]) argv[0], "-c", "test_mesh_2dtorus.conf", -#if VERBOSE - "-L", - "DEBUG", -#endif NULL }; diff --git a/src/mesh/test_mesh_2dtorus.conf b/src/mesh/test_mesh_2dtorus.conf index b6291fff5..826257139 100644 --- a/src/mesh/test_mesh_2dtorus.conf +++ b/src/mesh/test_mesh_2dtorus.conf @@ -4,14 +4,12 @@ SERVICEHOME = /tmp/test_mesh_small/ [arm] PORT = 10010 DEFAULTSERVICES = core dht mesh -#DEBUG = YES [statistics] AUTOSTART = YES PORT = 10000 [dht] -DEBUG = NO AUTOSTART = YES ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; @@ -53,7 +51,6 @@ PORT = 10004 [mesh] PORT = 10005 -DEBUG=YES ACCEPT_FROM = 127.0.0.1; HOSTNAME = localhost # PREFIX = valgrind --leak-check=full @@ -78,7 +75,6 @@ CONNECT_TOPOLOGY = 2D_TORUS F2F = NO CONNECT_TIMEOUT = 600 s CONNECT_ATTEMPTS = 2 -DEBUG = YES HOSTKEYSFILE = ${DATADIR}/testing_hostkeys.dat MAX_CONCURRENT_SSH = 10 USE_PROGRESSBARS = YES diff --git a/src/mesh/test_mesh_path.conf b/src/mesh/test_mesh_path.conf index 5ac9710d4..9a9cf3087 100644 --- a/src/mesh/test_mesh_path.conf +++ b/src/mesh/test_mesh_path.conf @@ -5,7 +5,6 @@ AUTOSTART = NO AUTOSTART = NO [mesh] -DEBUG = YES AUTOSTART = YES ACCEPT_FROM = 127.0.0.1; HOSTNAME = localhost @@ -14,7 +13,6 @@ PORT = 10511 # PREFIX = xterm -geometry 100x85 -T peer1 -e gdb --args [dht] -DEBUG = NO AUTOSTART = YES ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; @@ -30,7 +28,6 @@ DATABASE = sqlite [transport] PLUGINS = tcp -DEBUG = NO ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; NEIGHBOUR_LIMIT = 50 @@ -56,7 +53,6 @@ PORT = 12092 [arm] DEFAULTSERVICES = core PORT = 12366 -DEBUG = NO [transport-tcp] TIMEOUT = 300 s diff --git a/src/mesh/test_mesh_regex.c b/src/mesh/test_mesh_regex.c index 8e65324df..4bb0c8ddf 100644 --- a/src/mesh/test_mesh_regex.c +++ b/src/mesh/test_mesh_regex.c @@ -27,7 +27,6 @@ #include "gnunet_testing_lib.h" #include "gnunet_mesh_service.h" -#define VERBOSE GNUNET_YES #define REMOVE_DIR GNUNET_YES #define MESH_REGEX_PEERS 4 @@ -159,13 +158,11 @@ shutdown_callback (void *cls, const char *emsg) for (i = 0; i < MESH_REGEX_PEERS; i++) ok[i] = GNUNET_NO; } -#if VERBOSE else { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: All peers successfully shut down!\n"); } -#endif GNUNET_CONFIGURATION_destroy (testing_cfg); } @@ -180,9 +177,7 @@ shutdown_callback (void *cls, const char *emsg) static void shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Ending test.\n"); -#endif shutdown_handle = GNUNET_SCHEDULER_NO_TASK; GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); } @@ -407,13 +402,9 @@ peergroup_ready (void *cls, const char *emsg) GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); return; } -#if VERBOSE - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "test: Peer Group started successfully!\n"); - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "test: Have %u connections\n", + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Peer Group started successfully with %u connections\n", total_connections); -#endif - peers_running = GNUNET_TESTING_daemons_running (pg); if (0 < failed_connections) { @@ -519,19 +510,9 @@ run (void *cls, char *const *args, const char *cfgfile, testing_cfg = GNUNET_CONFIGURATION_dup (cfg); GNUNET_log_setup ("test_mesh_regex", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); - -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: Starting daemons.\n"); - GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing_old", - "use_progressbars", "YES"); -#endif - if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing_old", "num_peers", &num_peers)) @@ -574,10 +555,6 @@ main (int argc, char *argv[]) argv[0], "-c", "test_mesh_2dtorus.conf", -#if VERBOSE - "-L", - "DEBUG", -#endif NULL }; int result; diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c index 3f9e1c2ae..80edad496 100644 --- a/src/mesh/test_mesh_small.c +++ b/src/mesh/test_mesh_small.c @@ -29,7 +29,6 @@ #include -#define VERBOSE GNUNET_YES #define REMOVE_DIR GNUNET_YES struct MeshPeer @@ -289,18 +288,14 @@ shutdown_callback (void *cls, const char *emsg) { if (emsg != NULL) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n"); -#endif ok--; } else { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers successfully shut down!\n"); -#endif } GNUNET_CONFIGURATION_destroy (testing_cfg); } @@ -315,11 +310,8 @@ shutdown_callback (void *cls, const char *emsg) static void shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending test.\n"); -#endif - if (disconnect_task != GNUNET_SCHEDULER_NO_TASK) { GNUNET_SCHEDULER_cancel (disconnect_task); @@ -877,7 +869,6 @@ connect_mesh_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } app = (GNUNET_MESH_ApplicationType) 0; -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "connecting to mesh service of peer %s\n", GNUNET_i2s (&d1->id)); @@ -890,7 +881,6 @@ connect_mesh_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) "connecting to mesh service of peer %s\n", GNUNET_i2s (&d3->id)); } -#endif h1 = GNUNET_MESH_connect (d1->cfg, (void *) 1L, NULL, &tunnel_cleaner, handlers, &app); h2 = GNUNET_MESH_connect (d2->cfg, (void *) 2L, &incoming_tunnel, @@ -943,16 +933,9 @@ peergroup_ready (void *cls, const char *emsg) GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); return; } -#if VERBOSE - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "************************************************************\n"); - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Peer Group started successfully!\n"); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Have %u connections\n", + "Peer Group started successfully with %u connections\n", total_connections); -#endif - if (data_file != NULL) { buf = NULL; @@ -1041,20 +1024,11 @@ run (void *cls, char *const *args, const char *cfgfile, testing_cfg = GNUNET_CONFIGURATION_dup (cfg); GNUNET_log_setup ("test_mesh_small", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); -#if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting daemons.\n"); - GNUNET_CONFIGURATION_set_value_string (testing_cfg, "testing_old", - "use_progressbars", "YES"); -#endif - if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (testing_cfg, "testing_old", "num_peers", &num_peers)) @@ -1152,10 +1126,6 @@ main (int argc, char *argv[]) argv[0], "-c", "test_mesh_small.conf", -#if VERBOSE - "-L", - "DEBUG", -#endif NULL }; int argc2 = (sizeof (argv2) / sizeof (char *)) - 1; @@ -1193,9 +1163,6 @@ main (int argc, char *argv[]) test_name = "speed ack"; ok_goal = TOTAL_PACKETS * 2 + 3; argv2 [3] = NULL; // remove -L DEBUG -#if VERBOSE - argc2 -= 2; -#endif } else if (strstr (argv[0], "test_mesh_small_speed") != NULL) { diff --git a/src/mesh/test_mesh_small.conf b/src/mesh/test_mesh_small.conf index 2277a9a76..4083e8e79 100644 --- a/src/mesh/test_mesh_small.conf +++ b/src/mesh/test_mesh_small.conf @@ -3,7 +3,6 @@ SERVICEHOME = /tmp/test_mesh_small/ [mesh] PORT = 10005 -DEBUG = YES ACCEPT_FROM = 127.0.0.1; HOSTNAME = localhost REFRESH_PATH_TIME = 5 s @@ -19,14 +18,12 @@ DHT_REPLICAITON_LEVEL = 10 [arm] PORT = 10010 DEFAULTSERVICES = core dht mesh -#DEBUG = YES [statistics] AUTOSTART = YES PORT = 10000 [dht] -DEBUG = NO AUTOSTART = YES ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; @@ -90,7 +87,6 @@ BLACKLIST_TRANSPORTS = tcp udp http unix F2F = NO CONNECT_TIMEOUT = 660 s CONNECT_ATTEMPTS = 2 -DEBUG = YES HOSTKEYSFILE = ${DATADIR}/testing_hostkeys.dat MAX_CONCURRENT_SSH = 10 USE_PROGRESSBARS = YES diff --git a/src/mesh/test_mesh_tree_api.c b/src/mesh/test_mesh_tree_api.c index 1d43135e4..60b88239c 100644 --- a/src/mesh/test_mesh_tree_api.c +++ b/src/mesh/test_mesh_tree_api.c @@ -35,12 +35,10 @@ #define MESH_TUNNEL_TREE_C #endif -#define VERBOSE 1 - -int failed; -int cb_call; -struct GNUNET_PeerIdentity *pi[10]; -struct MeshTunnelTree *tree; +static int failed; +static int cb_call; +static struct GNUNET_PeerIdentity *pi[10]; +static struct MeshTunnelTree *tree; static void cb (void *cls, GNUNET_PEER_Id peer_id) @@ -155,11 +153,7 @@ main (int argc, char *argv[]) failed = 0; cb_call = 0; GNUNET_log_setup ("test_mesh_api_tree", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); for (i = 0; i < 10; i++) { diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c index 94303a9e2..a79ec5e78 100644 --- a/src/namestore/gnunet-namestore.c +++ b/src/namestore/gnunet-namestore.c @@ -718,8 +718,11 @@ main (int argc, char *const *argv) _("GNUnet zone manipulation tool"), options, &run, NULL)) + { + GNUNET_free ((void*) argv); return 1; - + } + GNUNET_free ((void*) argv); return ret; } diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c index 4028e5e21..5e82e08ba 100644 --- a/src/namestore/namestore_api.c +++ b/src/namestore/namestore_api.c @@ -1097,8 +1097,8 @@ GNUNET_NAMESTORE_verify_signature (const struct GNUNET_CRYPTO_RsaPublicKeyBinary { size_t rd_ser_len; size_t name_len; - char * name_tmp; - char * rd_ser; + char *name_tmp; + char *rd_ser; struct GNUNET_CRYPTO_RsaSignaturePurpose *sig_purpose; struct GNUNET_TIME_AbsoluteNBO *expire_tmp; struct GNUNET_TIME_AbsoluteNBO expire_nbo = GNUNET_TIME_absolute_hton (freshness); diff --git a/src/namestore/test_namestore_record_serialization.c b/src/namestore/test_namestore_record_serialization.c index b8818a6c7..7b7cc8b5a 100644 --- a/src/namestore/test_namestore_record_serialization.c +++ b/src/namestore/test_namestore_record_serialization.c @@ -26,8 +26,6 @@ #include "gnunet_namestore_service.h" #include "namestore.h" -#define VERBOSE GNUNET_NO - #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 100) static int res; diff --git a/src/nat/gnunet-nat-server.c b/src/nat/gnunet-nat-server.c index e971bd3b1..1a98cdc96 100644 --- a/src/nat/gnunet-nat-server.c +++ b/src/nat/gnunet-nat-server.c @@ -320,7 +320,11 @@ main (int argc, char *const argv[]) GNUNET_PROGRAM_run (argc, argv, "gnunet-nat-server [options] PORT", _("GNUnet NAT traversal test helper daemon"), options, &run, NULL)) + { + GNUNET_free ((void*) argv); return 1; + } + GNUNET_free ((void*) argv); return 0; } diff --git a/src/nat/test_nat_mini.c b/src/nat/test_nat_mini.c index 2c6da3b57..f2e1ee97a 100644 --- a/src/nat/test_nat_mini.c +++ b/src/nat/test_nat_mini.c @@ -35,9 +35,6 @@ #include "gnunet_scheduler_lib.h" #include "gnunet_nat_lib.h" - -#define VERBOSE GNUNET_NO - /* Time to wait before stopping NAT, in seconds */ #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) @@ -104,20 +101,12 @@ main (int argc, char *const argv[]) "-c", "test_nat_data.conf", "-L", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL }; GNUNET_log_setup ("test-nat-mini", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); GNUNET_log (GNUNET_ERROR_TYPE_INFO, diff --git a/src/nse/nse_profiler_test.conf b/src/nse/nse_profiler_test.conf index b4709dd38..398eb27de 100644 --- a/src/nse/nse_profiler_test.conf +++ b/src/nse/nse_profiler_test.conf @@ -8,7 +8,6 @@ BINARY = gnunet-service-nse #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/nse/.libs/gnunet-service-nse #PREFIX = valgrind --leak-check=full --log-file=valgrind_nse.%p AUTOSTART = NO -DEBUG = YES # Overriding network settings for faster testing (do NOT use # these values in production just because they are here) WORKDELAY = 60 s @@ -20,7 +19,6 @@ PROOFFILE = $SERVICEHOME/nse.proof PORT = 0 DEFAULTSERVICES = core UNIXPATH = /tmp/test-nse-service-arm.unix -#DEBUG = YES [statistics] AUTOSTART = YES @@ -116,7 +114,6 @@ PROBABILITY = .1 F2F = NO CONNECT_TIMEOUT = 360 s CONNECT_ATTEMPTS = 3 -DEBUG = YES #HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat HOSTKEYSFILE = hostkeys.dat MAX_CONCURRENT_SSH = 20 diff --git a/src/nse/test_nse.conf b/src/nse/test_nse.conf index 625d059ee..003703bb7 100644 --- a/src/nse/test_nse.conf +++ b/src/nse/test_nse.conf @@ -8,7 +8,6 @@ BINARY = gnunet-service-nse #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/nse/.libs/gnunet-service-nse #PREFIX = valgrind --leak-check=full --log-file=valgrind_nse.%p AUTOSTART = YES -DEBUG = NO PROOFFILE = $SERVICEHOME/proof.nse # Overriding network settings for faster testing (do NOT use # these values in production just because they are here) @@ -23,7 +22,6 @@ HISTOGRAM = $SERVICEHOME/nse-histogram PORT = 22354 DEFAULTSERVICES = nse core UNIXPATH = /tmp/test-nse-service-arm.unix -#DEBUG = YES [fs] AUTOSTART = NO @@ -66,7 +64,6 @@ PERCENTAGE = 3 F2F = NO CONNECT_TIMEOUT = 60 s CONNECT_ATTEMPTS = 3 -#DEBUG = YES HOSTKEYSFILE = ${DATADIR}/testing_hostkeys.dat MAX_CONCURRENT_SSH = 20 USE_PROGRESSBARS = YES diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index b847c0f96..c2520fac0 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c @@ -959,14 +959,17 @@ main (int argc, char *const *argv) 1, &GNUNET_GETOPT_set_string, &put_uri}, GNUNET_GETOPT_OPTION_END }; + int ret; if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-peerinfo", - gettext_noop ("Print information about peers."), - options, &run, NULL)) ? 0 : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-peerinfo", + gettext_noop ("Print information about peers."), + options, &run, NULL)) ? 0 : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-peerinfo.c */ diff --git a/src/peerinfo/test_peerinfo_api_data.conf b/src/peerinfo/test_peerinfo_api_data.conf index 6caa1e46b..ddbd02b5e 100644 --- a/src/peerinfo/test_peerinfo_api_data.conf +++ b/src/peerinfo/test_peerinfo_api_data.conf @@ -3,7 +3,6 @@ SERVICEHOME = /tmp/test-gnunet-peerinfo/ [peerinfo] PORT = 22354 -DEBUG = NO [dns] AUTOSTART = NO diff --git a/src/pt/gnunet-daemon-pt.c b/src/pt/gnunet-daemon-pt.c index 2658ae165..8044f930c 100644 --- a/src/pt/gnunet-daemon-pt.c +++ b/src/pt/gnunet-daemon-pt.c @@ -966,15 +966,17 @@ main (int argc, char *const *argv) static const struct GNUNET_GETOPT_CommandLineOption options[] = { GNUNET_GETOPT_OPTION_END }; + int ret; if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-daemon-pt", - gettext_noop - ("Daemon to run to perform IP protocol translation to GNUnet"), - options, &run, NULL)) ? 0 : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-daemon-pt", + gettext_noop + ("Daemon to run to perform IP protocol translation to GNUnet"), + options, &run, NULL)) ? 0 : 1; + GNUNET_free ((void*) argv); + return ret; } diff --git a/src/regex/test_regex_graph_api.c b/src/regex/test_regex_graph_api.c index d429025d9..c2c1c74e1 100644 --- a/src/regex/test_regex_graph_api.c +++ b/src/regex/test_regex_graph_api.c @@ -37,56 +37,47 @@ * * @return 0 if ok, non 0 on error. */ -int +static int filecheck (const char *filename) { int error = 0; - FILE *fp = NULL; + FILE *fp; // Check if file was created and delete it again - fp = fopen (filename, "r"); - - if (NULL == fp) + if (NULL == (fp = fopen (filename, "r"))) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not find graph %s\n", filename); - return ++error; + return 1; } - fseek (fp, 0L, SEEK_END); + GNUNET_break (0 == fseek (fp, 0L, SEEK_END)); if (1 > ftell (fp)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Graph writing failed, got empty file (%s)!\n", filename); - error++; + "Graph writing failed, got empty file (%s)!\n", + filename); + error = 2; } - - error += fclose (fp); + + GNUNET_assert (0 == fclose (fp)); if (!KEEP_FILES) { if (0 != unlink (filename)) - { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not remove temp files (%s)\n", - filename); - } + GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, + "unlink", filename); } - - return error; } + int main (int argc, char *argv[]) { - GNUNET_log_setup ("test-regex", "WARNING", NULL); - int error; struct GNUNET_REGEX_Automaton *a; unsigned int i; const char *filename = "test_graph.dot"; - - error = 0; - const char *regex[12] = { "ab(c|d)+c*(a(b|c)+d)+(bla)+", "(bla)*", @@ -103,6 +94,8 @@ main (int argc, char *argv[]) "PADPADPADPADPADPabcdefghixxxxxxxxxxxxxjklmnop*qstoisdjfguisdfguihsdfgbdsuivggsd" }; + GNUNET_log_setup ("test-regex", "WARNING", NULL); + error = 0; for (i = 0; i < 12; i++) { // Check NFA graph creation diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c index 13468592a..2331aace0 100644 --- a/src/statistics/gnunet-statistics.c +++ b/src/statistics/gnunet-statistics.c @@ -277,19 +277,19 @@ main (int argc, char *const *argv) &GNUNET_GETOPT_set_uint, &remote_port}, GNUNET_GETOPT_OPTION_END }; - remote_port = 0; remote_host = NULL; if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-statistics [options [value]]", - gettext_noop - ("Print statistics about GNUnet operations."), - options, &run, NULL)) ? ret : 1; - - GNUNET_free_non_null(remote_host); + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-statistics [options [value]]", + gettext_noop + ("Print statistics about GNUnet operations."), + options, &run, NULL)) ? ret : 1; + GNUNET_free_non_null (remote_host); + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-statistics.c */ diff --git a/src/statistics/test_statistics_api_data.conf b/src/statistics/test_statistics_api_data.conf index c52ff35b3..2099c3bd1 100644 --- a/src/statistics/test_statistics_api_data.conf +++ b/src/statistics/test_statistics_api_data.conf @@ -4,13 +4,11 @@ SERVICEHOME = /tmp/test-gnunetd-statistics/ [statistics] PORT = 22353 UNIXPATH = /tmp/test-statistics-service-statistics.unix -#DEBUG = YES [arm] PORT = 22354 DEFAULTSERVICES = UNIXPATH = /tmp/test-statistics-service-arm.unix -# DEBUG = YES [fs] AUTOSTART = NO diff --git a/src/stream/test_stream_2peers_halfclose.c b/src/stream/test_stream_2peers_halfclose.c index 2502615c2..617ab99a8 100644 --- a/src/stream/test_stream_2peers_halfclose.c +++ b/src/stream/test_stream_2peers_halfclose.c @@ -23,17 +23,12 @@ * @brief Testcases for Stream API halfclosed connections between 2 peers * @author Sree Harsha Totakura */ - -#include - #include "platform.h" #include "gnunet_util_lib.h" #include "gnunet_testbed_service.h" #include "gnunet_mesh_service.h" #include "gnunet_stream_lib.h" -#define VERBOSE 1 - /** * Number of peers */ diff --git a/src/stream/test_stream_local.conf b/src/stream/test_stream_local.conf index 5e4ccc519..5a517cb3f 100644 --- a/src/stream/test_stream_local.conf +++ b/src/stream/test_stream_local.conf @@ -11,7 +11,6 @@ AUTOSTART = NO AUTOSTART = NO [mesh] -DEBUG = YES AUTOSTART = YES ACCEPT_FROM = 127.0.0.1; HOSTNAME = localhost @@ -20,7 +19,6 @@ PORT = 10700 # PREFIX = xterm -geometry 100x85 -T peer1 -e gdb --args [dht] -DEBUG = NO AUTOSTART = YES ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; @@ -36,7 +34,6 @@ DATABASE = sqlite [transport] PLUGINS = tcp -DEBUG = NO ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; NEIGHBOUR_LIMIT = 50 @@ -52,7 +49,6 @@ PORT = 12092 [arm] DEFAULTSERVICES = core lockmanager PORT = 12366 -DEBUG = NO [transport-tcp] TIMEOUT = 300 s @@ -63,7 +59,6 @@ WEAKRANDOM = YES [testing_old] NUM_PEERS = 5 -DEBUG = YES HOSTKEYSFILE = ${DATADIR}/testing_hostkeys.dat MAX_CONCURRENT_SSH = 10 USE_PROGRESSBARS = YES diff --git a/src/template/gnunet-template.c b/src/template/gnunet-template.c index 0bbbc558f..b0d25dc33 100644 --- a/src/template/gnunet-template.c +++ b/src/template/gnunet-template.c @@ -62,14 +62,15 @@ main (int argc, char *const *argv) /* FIMXE: add options here */ GNUNET_GETOPT_OPTION_END }; - if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-template", - gettext_noop ("help text"), options, &run, - NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-template", + gettext_noop ("help text"), options, &run, + NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-template.c */ diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c index 6a5b3cf71..3bddfac09 100644 --- a/src/testbed/gnunet-testbed-profiler.c +++ b/src/testbed/gnunet-testbed-profiler.c @@ -817,6 +817,7 @@ main (int argc, char *const *argv) GNUNET_PROGRAM_run (argc, argv, "gnunet-testbed-profiler [OPTIONS] hosts-file", _("Profiler for testbed"), options, &run, NULL); + GNUNET_free ((void*) argv); if (GNUNET_OK != ret) return ret; if (GNUNET_OK != result) diff --git a/src/testbed/test_testbed_api.conf b/src/testbed/test_testbed_api.conf index 17fdba862..e52b5df0e 100644 --- a/src/testbed/test_testbed_api.conf +++ b/src/testbed/test_testbed_api.conf @@ -29,7 +29,6 @@ DATABASE = sqlite [transport] PLUGINS = tcp -DEBUG = NO ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; NEIGHBOUR_LIMIT = 50 @@ -46,7 +45,6 @@ AUTOSTART = YES [arm] DEFAULTSERVICES = core transport PORT = 12366 -DEBUG = NO [transport-tcp] TIMEOUT = 300 s @@ -55,7 +53,6 @@ PORT = 12368 [TESTING] NUM_PEERS = 5 WEAKRANDOM = YES -DEBUG = YES HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat MAX_CONCURRENT_SSH = 10 USE_PROGRESSBARS = YES diff --git a/src/testbed/test_testbed_api_testbed_run_topologyclique.conf b/src/testbed/test_testbed_api_testbed_run_topologyclique.conf index 37fc7342d..e54b0b238 100644 --- a/src/testbed/test_testbed_api_testbed_run_topologyclique.conf +++ b/src/testbed/test_testbed_api_testbed_run_topologyclique.conf @@ -29,7 +29,6 @@ DATABASE = sqlite [transport] PLUGINS = tcp -DEBUG = NO ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; NEIGHBOUR_LIMIT = 50 @@ -46,7 +45,6 @@ AUTOSTART = YES [arm] DEFAULTSERVICES = core transport PORT = 12366 -DEBUG = NO [transport-tcp] TIMEOUT = 300 s @@ -55,7 +53,6 @@ PORT = 12368 [TESTING] NUM_PEERS = 5 WEAKRANDOM = YES -DEBUG = YES HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat MAX_CONCURRENT_SSH = 10 USE_PROGRESSBARS = YES diff --git a/src/testbed/test_testbed_api_testbed_run_topologyline.conf b/src/testbed/test_testbed_api_testbed_run_topologyline.conf index 2958f765c..d3c840dd1 100644 --- a/src/testbed/test_testbed_api_testbed_run_topologyline.conf +++ b/src/testbed/test_testbed_api_testbed_run_topologyline.conf @@ -29,7 +29,6 @@ DATABASE = sqlite [transport] PLUGINS = tcp -DEBUG = NO ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; NEIGHBOUR_LIMIT = 50 @@ -46,7 +45,6 @@ AUTOSTART = YES [arm] DEFAULTSERVICES = core transport PORT = 12366 -DEBUG = NO [transport-tcp] TIMEOUT = 300 s @@ -55,7 +53,6 @@ PORT = 12368 [TESTING] NUM_PEERS = 5 WEAKRANDOM = YES -DEBUG = YES HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat MAX_CONCURRENT_SSH = 10 USE_PROGRESSBARS = YES diff --git a/src/testbed/test_testbed_api_testbed_run_topologyrandom.conf b/src/testbed/test_testbed_api_testbed_run_topologyrandom.conf index 3c7980682..5ba272cfa 100644 --- a/src/testbed/test_testbed_api_testbed_run_topologyrandom.conf +++ b/src/testbed/test_testbed_api_testbed_run_topologyrandom.conf @@ -30,7 +30,6 @@ DATABASE = sqlite [transport] PLUGINS = tcp -DEBUG = NO ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; NEIGHBOUR_LIMIT = 50 @@ -47,7 +46,6 @@ AUTOSTART = YES [arm] DEFAULTSERVICES = core transport PORT = 12366 -DEBUG = NO [transport-tcp] TIMEOUT = 300 s @@ -56,7 +54,6 @@ PORT = 12368 [TESTING] NUM_PEERS = 5 WEAKRANDOM = YES -DEBUG = YES HOSTKEYSFILE = ../../contrib/testing_hostkeys.dat MAX_CONCURRENT_SSH = 10 USE_PROGRESSBARS = YES diff --git a/src/testing/gnunet-testing.c b/src/testing/gnunet-testing.c index cc5c6f50c..ba864e3f0 100644 --- a/src/testing/gnunet-testing.c +++ b/src/testing/gnunet-testing.c @@ -209,14 +209,15 @@ main (int argc, char *const *argv) GNUNET_YES, &GNUNET_GETOPT_set_string, &create_cfg_template}, GNUNET_GETOPT_OPTION_END }; - if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-testing", - gettext_noop ("Command line tool to access the testing library"), options, &run, - NULL)) ? ret : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-testing", + gettext_noop ("Command line tool to access the testing library"), options, &run, + NULL)) ? ret : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-testing.c */ diff --git a/src/testing_old/Makefile.am b/src/testing_old/Makefile.am index 7a7f19364..2e5eb4bf7 100644 --- a/src/testing_old/Makefile.am +++ b/src/testing_old/Makefile.am @@ -80,12 +80,13 @@ check_PROGRAMS = \ test_testing_topology_scale_free if ENABLE_TEST_RUN -TESTS = \ - test_testing \ - test_testing_connect \ - test_testing_reconnect \ - test_testing_group \ - test_testing_peergroup +# Don't bother to test old-testing at this point +#TESTS = \ +# test_testing \ +# test_testing_connect \ +# test_testing_reconnect \ +# test_testing_group \ +# test_testing_peergroup endif diff --git a/src/testing_old/test_testing_2dtorus.conf b/src/testing_old/test_testing_2dtorus.conf index 4ec3db83e..993ab372d 100644 --- a/src/testing_old/test_testing_2dtorus.conf +++ b/src/testing_old/test_testing_2dtorus.conf @@ -5,14 +5,12 @@ SERVICEHOME = /tmp/test_testing_2dtorus/ [arm] PORT = 10010 DEFAULTSERVICES = core -#DEBUG = YES [statistics] AUTOSTART = YES PORT = 10000 [dht] -DEBUG = NO AUTOSTART = YES ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; @@ -66,7 +64,6 @@ CONNECT_TOPOLOGY = 2D_TORUS F2F = NO CONNECT_TIMEOUT = 600 s CONNECT_ATTEMPTS = 2 -DEBUG = YES HOSTKEYSFILE = ${DATADIR}/testing_hostkeys.dat MAX_CONCURRENT_SSH = 10 USE_PROGRESSBARS = YES diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index 682ad417c..fc1f461ed 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c @@ -1364,6 +1364,7 @@ main (int argc, char *const *argv) _ ("GNUnet topology control (maintaining P2P mesh and F2F constraints)"), options, &run, NULL)) ? 0 : 1; + GNUNET_free ((void*) argv); return ret; } diff --git a/src/topology/test_gnunet_daemon_topology_data.conf b/src/topology/test_gnunet_daemon_topology_data.conf index c4e01aced..178f50fda 100644 --- a/src/topology/test_gnunet_daemon_topology_data.conf +++ b/src/topology/test_gnunet_daemon_topology_data.conf @@ -7,7 +7,6 @@ PORT = 2664 [transport] PORT = 2665 PLUGINS = tcp -#DEBUG = YES #PREFIX = xterm -e xterm -T transport -e gdb -x cmd --args #PREFIX = valgrind --tool=memcheck --log-file=logs%p @@ -37,10 +36,8 @@ PORT = 2669 [core] PORT = 2670 -#DEBUG = YES [topology] -# DEBUG = YES #PREFIX = valgrind --tool=memcheck [fs] diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index 5978de6bb..18b1b9839 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c @@ -745,13 +745,9 @@ main (int argc, char *const *argv) ("Direct access to transport service."), options, &run, NULL); GNUNET_free ((void *) argv); - if (GNUNET_OK == res) return ret; - else - return 1; - - + return 1; } diff --git a/src/transport/template_cfg_peer1.conf b/src/transport/template_cfg_peer1.conf index 05309d53c..8856418b3 100644 --- a/src/transport/template_cfg_peer1.conf +++ b/src/transport/template_cfg_peer1.conf @@ -39,11 +39,9 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock [transport] #PREFIX = valgrind --leak-check=full PORT = 12001 -#DEBUG = YES UNIXPATH = /tmp/gnunet-p1-service-transport.sock [ats] -#DEBUG = YES WAN_QUOTA_IN = unlimited WAN_QUOTA_OUT = unlimited PORT = 12006 diff --git a/src/transport/template_cfg_peer2.conf b/src/transport/template_cfg_peer2.conf index 210ee51c5..54636ca6b 100644 --- a/src/transport/template_cfg_peer2.conf +++ b/src/transport/template_cfg_peer2.conf @@ -43,7 +43,6 @@ PORT = 12010 UNIXPATH = /tmp/gnunet-p2-service-transport.sock [ats] -#DEBUG = YES WAN_QUOTA_IN = unlimited WAN_QUOTA_OUT = unlimited PORT = 12016 diff --git a/src/transport/test_transport_api_bidirectional_connect_peer1.conf b/src/transport/test_transport_api_bidirectional_connect_peer1.conf index 614d89d21..ba6afbe6e 100644 --- a/src/transport/test_transport_api_bidirectional_connect_peer1.conf +++ b/src/transport/test_transport_api_bidirectional_connect_peer1.conf @@ -22,7 +22,6 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock [transport] PORT = 12004 UNIXPATH = /tmp/gnunet-p1-service-transport.sock -#DEBUG = YES [transport-tcp] PORT = 12005 diff --git a/src/transport/test_transport_api_disconnect_tcp_peer1.conf b/src/transport/test_transport_api_disconnect_tcp_peer1.conf index 6879d0534..5f1d693a8 100644 --- a/src/transport/test_transport_api_disconnect_tcp_peer1.conf +++ b/src/transport/test_transport_api_disconnect_tcp_peer1.conf @@ -27,5 +27,4 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock PORT = 12001 PLUGINS = tcp UNIXPATH = /tmp/gnunet-p1-service-transport.sock -#DEBUG = YES diff --git a/src/transport/test_transport_api_http_peer1.conf b/src/transport/test_transport_api_http_peer1.conf index e0b60e37f..3c1b41d06 100644 --- a/src/transport/test_transport_api_http_peer1.conf +++ b/src/transport/test_transport_api_http_peer1.conf @@ -22,7 +22,6 @@ PORT = 12082 UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock [transport] -#DEBUG = YES PORT = 12081 PLUGINS = http_client #BINARY = .libs/gnunet-service-transport diff --git a/src/transport/test_transport_api_http_peer2.conf b/src/transport/test_transport_api_http_peer2.conf index 4e4c22e30..f348bf404 100644 --- a/src/transport/test_transport_api_http_peer2.conf +++ b/src/transport/test_transport_api_http_peer2.conf @@ -25,7 +25,6 @@ PORT = 12092 UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock [transport] -#DEBUG = YES PORT = 12091 PLUGINS = http_server UNIXPATH = /tmp/gnunet-p2-service-transport.sock diff --git a/src/transport/test_transport_api_http_reverse_peer1.conf b/src/transport/test_transport_api_http_reverse_peer1.conf index c38c36a18..93d8bd34b 100644 --- a/src/transport/test_transport_api_http_reverse_peer1.conf +++ b/src/transport/test_transport_api_http_reverse_peer1.conf @@ -23,7 +23,6 @@ PORT = 12092 UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock [transport] -#DEBUG = YES PORT = 12091 PLUGINS = http_client #BINARY = .libs/gnunet-service-transport @@ -33,7 +32,6 @@ PREFIX = valgrind --leak-check=full [ats] -#DEBUG = YES WAN_QUOTA_IN = unlimited WAN_QUOTA_OUT = unlimited PORT = 12006 diff --git a/src/transport/test_transport_api_https_peer1.conf b/src/transport/test_transport_api_https_peer1.conf index 78d3ca0a4..48302a640 100644 --- a/src/transport/test_transport_api_https_peer1.conf +++ b/src/transport/test_transport_api_https_peer1.conf @@ -26,6 +26,5 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock PORT = 12101 PLUGINS = https_client UNIXPATH = /tmp/gnunet-p1-service-transport.sock -DEBUG = NO diff --git a/src/transport/test_transport_api_https_peer2.conf b/src/transport/test_transport_api_https_peer2.conf index a347887bb..566997f93 100644 --- a/src/transport/test_transport_api_https_peer2.conf +++ b/src/transport/test_transport_api_https_peer2.conf @@ -29,6 +29,5 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock PORT = 12111 PLUGINS = https_server UNIXPATH = /tmp/gnunet-p2-service-transport.sock -DEBUG = NO diff --git a/src/transport/test_transport_api_reliability_http_peer1.conf b/src/transport/test_transport_api_reliability_http_peer1.conf index 9e39e3e41..ea5de0bc9 100644 --- a/src/transport/test_transport_api_reliability_http_peer1.conf +++ b/src/transport/test_transport_api_reliability_http_peer1.conf @@ -30,5 +30,4 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock PORT = 12181 PLUGINS = http_client UNIXPATH = /tmp/gnunet-p1-service-transport.sock -#DEBUG = YES diff --git a/src/transport/test_transport_api_reliability_http_peer2.conf b/src/transport/test_transport_api_reliability_http_peer2.conf index 3174e3d00..083cd4dd8 100644 --- a/src/transport/test_transport_api_reliability_http_peer2.conf +++ b/src/transport/test_transport_api_reliability_http_peer2.conf @@ -27,5 +27,4 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock PORT = 12191 PLUGINS = http_server UNIXPATH = /tmp/gnunet-p2-service-transport.sock -#DEBUG = YES diff --git a/src/transport/test_transport_api_reliability_tcp_peer2.conf b/src/transport/test_transport_api_reliability_tcp_peer2.conf index 3cb42c0b6..181aab3de 100644 --- a/src/transport/test_transport_api_reliability_tcp_peer2.conf +++ b/src/transport/test_transport_api_reliability_tcp_peer2.conf @@ -27,4 +27,3 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock PORT = 12010 PLUGINS = tcp UNIXPATH = /tmp/gnunet-p2-service-transport.sock -#DEBUG = YES diff --git a/src/transport/test_transport_api_tcp_nat_peer1.conf b/src/transport/test_transport_api_tcp_nat_peer1.conf index 4ebf5b3be..8e33f273d 100644 --- a/src/transport/test_transport_api_tcp_nat_peer1.conf +++ b/src/transport/test_transport_api_tcp_nat_peer1.conf @@ -32,5 +32,4 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock PORT = 29542 PLUGINS = tcp UNIXPATH = /tmp/gnunet-p1-service-transport.sock -#DEBUG = YES diff --git a/src/transport/test_transport_api_tcp_nat_peer2.conf b/src/transport/test_transport_api_tcp_nat_peer2.conf index 1ef51c9c9..f8b8b013e 100644 --- a/src/transport/test_transport_api_tcp_nat_peer2.conf +++ b/src/transport/test_transport_api_tcp_nat_peer2.conf @@ -31,4 +31,3 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock PORT = 45923 PLUGINS = tcp UNIXPATH = /tmp/gnunet-p2-service-transport.sock -#DEBUG = YES diff --git a/src/transport/test_transport_api_tcp_peer1.conf b/src/transport/test_transport_api_tcp_peer1.conf index 54abfa5ba..db662826b 100644 --- a/src/transport/test_transport_api_tcp_peer1.conf +++ b/src/transport/test_transport_api_tcp_peer1.conf @@ -27,5 +27,4 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock PORT = 12001 UNIXPATH = /tmp/gnunet-p1-service-transport.sock PLUGINS = tcp -#DEBUG = YES diff --git a/src/transport/test_transport_api_timeout_http_peer1.conf b/src/transport/test_transport_api_timeout_http_peer1.conf index 2eb23662a..665527b3e 100644 --- a/src/transport/test_transport_api_timeout_http_peer1.conf +++ b/src/transport/test_transport_api_timeout_http_peer1.conf @@ -24,7 +24,6 @@ PORT = 12082 UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock [transport] -#DEBUG = YES PORT = 12081 PLUGINS = http_client #BINARY = .libs/gnunet-service-transport diff --git a/src/transport/test_transport_api_timeout_http_peer2.conf b/src/transport/test_transport_api_timeout_http_peer2.conf index 0aa77a9b9..1fdc94788 100644 --- a/src/transport/test_transport_api_timeout_http_peer2.conf +++ b/src/transport/test_transport_api_timeout_http_peer2.conf @@ -28,7 +28,6 @@ PORT = 12092 UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock [transport] -#DEBUG = YES PORT = 12091 PLUGINS = http_server UNIXPATH = /tmp/gnunet-p2-service-transport.sock diff --git a/src/transport/test_transport_api_timeout_https_peer1.conf b/src/transport/test_transport_api_timeout_https_peer1.conf index ff1ef47bd..fda69ae5c 100644 --- a/src/transport/test_transport_api_timeout_https_peer1.conf +++ b/src/transport/test_transport_api_timeout_https_peer1.conf @@ -23,6 +23,5 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock PORT = 12101 PLUGINS = https_client UNIXPATH = /tmp/gnunet-p1-service-transport.sock -DEBUG = NO diff --git a/src/transport/test_transport_api_timeout_https_peer2.conf b/src/transport/test_transport_api_timeout_https_peer2.conf index 35fba0a83..ca54e1718 100644 --- a/src/transport/test_transport_api_timeout_https_peer2.conf +++ b/src/transport/test_transport_api_timeout_https_peer2.conf @@ -27,6 +27,5 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock PORT = 12111 PLUGINS = https_server UNIXPATH = /tmp/gnunet-p2-service-transport.sock -DEBUG = NO diff --git a/src/transport/test_transport_api_udp_nat_peer1.conf b/src/transport/test_transport_api_udp_nat_peer1.conf index 6e643d5af..e406883e4 100644 --- a/src/transport/test_transport_api_udp_nat_peer1.conf +++ b/src/transport/test_transport_api_udp_nat_peer1.conf @@ -31,6 +31,5 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock PORT = 12061 PLUGINS = udp UNIXPATH = /tmp/gnunet-p1-service-transport.sock -DEBUG = NO diff --git a/src/transport/test_transport_api_udp_nat_peer2.conf b/src/transport/test_transport_api_udp_nat_peer2.conf index 1c1258ad1..43ed3a91b 100644 --- a/src/transport/test_transport_api_udp_nat_peer2.conf +++ b/src/transport/test_transport_api_udp_nat_peer2.conf @@ -29,6 +29,5 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock PORT = 12071 PLUGINS = udp UNIXPATH = /tmp/gnunet-p2-service-transport.sock -DEBUG = NO diff --git a/src/transport/test_transport_api_wlan_peer1.conf b/src/transport/test_transport_api_wlan_peer1.conf index ff37415a4..3f12ce505 100644 --- a/src/transport/test_transport_api_wlan_peer1.conf +++ b/src/transport/test_transport_api_wlan_peer1.conf @@ -7,7 +7,6 @@ INTERFACE = mon0 TESTMODE = 1 [arm] -DEBUG = YES PORT = 12164 UNIXPATH = /tmp/gnunet-p1-service-arm.sock @@ -26,7 +25,6 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock [transport] PORT = 12160 PLUGINS = wlan -#DEBUG = YES UNIXPATH = /tmp/gnunet-p1-service-transport.sock #PREFIX = xterm -T transport2 -e gdb --command=cmd --args #PREFIX = valgrind --leak-check=full --show-reachable=yes --main-stacksize=104857600 diff --git a/src/transport/test_transport_api_wlan_peer2.conf b/src/transport/test_transport_api_wlan_peer2.conf index 87a6036fb..451a2a666 100644 --- a/src/transport/test_transport_api_wlan_peer2.conf +++ b/src/transport/test_transport_api_wlan_peer2.conf @@ -8,7 +8,6 @@ TESTMODE = 2 [arm] PORT = 12174 -DEBUG = YES UNIXPATH = /tmp/gnunet-p2-service-arm.sock [statistics] @@ -26,7 +25,6 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock [transport] PORT = 12170 PLUGINS = wlan -#DEBUG = YES UNIXPATH = /tmp/gnunet-p2-service-transport.sock #PREFIX = xterm -T transport2 -e gdb --command=cmd --args #PREFIX = valgrind --leak-check=full --show-reachable=yes --main-stacksize=104857600 diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c index f1c06ebc0..0c51ef334 100644 --- a/src/transport/transport-testing.c +++ b/src/transport/transport-testing.c @@ -71,19 +71,15 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_ATS_Information *ats, uint32_t ats_count) { struct PeerContext *p = cls; + char *p2_s; + struct PeerContext *p2; - /* Find PeerContext */ - GNUNET_assert (p != 0); - GNUNET_assert (p->tth != NULL); - struct PeerContext *p2 = find_peer_context (p->tth, peer); - - if (p == NULL) - return; + GNUNET_assert (NULL != p); + GNUNET_assert (NULL != p->tth); + p2 = find_peer_context (p->tth, peer); if (p->nc != NULL) p->nc (p->cb_cls, peer, ats, ats_count); - char *p2_s; - if (p2 != NULL) GNUNET_asprintf (&p2_s, "%u (`%s')", p2->no, GNUNET_i2s (&p2->id)); else @@ -788,5 +784,4 @@ fail: } - /* end of transport-testing.c */ diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c index 78c93c3b8..e1aa94a5c 100644 --- a/src/util/gnunet-config.c +++ b/src/util/gnunet-config.c @@ -170,14 +170,15 @@ main (int argc, char *const *argv) 1, &GNUNET_GETOPT_set_string, &value }, GNUNET_GETOPT_OPTION_END }; - if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-config [OPTIONS]", - gettext_noop ("Manipulate GNUnet configuration files"), - options, &run, NULL)) ? 0 : ret; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-config [OPTIONS]", + gettext_noop ("Manipulate GNUnet configuration files"), + options, &run, NULL)) ? 0 : ret; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-config.c */ diff --git a/src/util/gnunet-ecc.c b/src/util/gnunet-ecc.c index f966763a8..ad6b68a95 100644 --- a/src/util/gnunet-ecc.c +++ b/src/util/gnunet-ecc.c @@ -233,14 +233,17 @@ main (int argc, char *const *argv) 0, &GNUNET_GETOPT_set_one, &weak_random }, GNUNET_GETOPT_OPTION_END }; + int ret; if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-ecc [OPTIONS] keyfile", - gettext_noop ("Manipulate GNUnet private ECC key files"), - options, &run, NULL)) ? 0 : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-ecc [OPTIONS] keyfile", + gettext_noop ("Manipulate GNUnet private ECC key files"), + options, &run, NULL)) ? 0 : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-ecc.c */ diff --git a/src/util/gnunet-resolver.c b/src/util/gnunet-resolver.c index 559637748..6cb6ac564 100644 --- a/src/util/gnunet-resolver.c +++ b/src/util/gnunet-resolver.c @@ -149,14 +149,17 @@ main (int argc, char *const *argv) 0, &GNUNET_GETOPT_set_one, &reverse }, GNUNET_GETOPT_OPTION_END }; + int ret; if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-resolver [hostname]", - gettext_noop ("Use build-in GNUnet stub resolver"), - options, &run, NULL)) ? 0 : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-resolver [hostname]", + gettext_noop ("Use build-in GNUnet stub resolver"), + options, &run, NULL)) ? 0 : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-resolver.c */ diff --git a/src/util/gnunet-rsa.c b/src/util/gnunet-rsa.c index d509bde67..597093ab1 100644 --- a/src/util/gnunet-rsa.c +++ b/src/util/gnunet-rsa.c @@ -222,7 +222,7 @@ run (void *cls, char *const *args, const char *cfgfile, * @return 0 ok, 1 on error */ int -main (int argc, char *const *argv) +main (int argc, char *const*argv) { static const struct GNUNET_GETOPT_CommandLineOption options[] = { { 'g', "generate-keys", "COUNT", @@ -242,14 +242,17 @@ main (int argc, char *const *argv) 0, &GNUNET_GETOPT_set_one, &weak_random }, GNUNET_GETOPT_OPTION_END }; + int ret; if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-rsa [OPTIONS] keyfile", - gettext_noop ("Manipulate GNUnet private RSA key files"), - options, &run, NULL)) ? 0 : 1; + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-rsa [OPTIONS] keyfile", + gettext_noop ("Manipulate GNUnet private RSA key files"), + options, &run, NULL)) ? 0 : 1; + GNUNET_free ((void*) argv); + return ret; } /* end of gnunet-rsa.c */ diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c index 8cc813be5..5ca1f4efc 100644 --- a/src/util/gnunet-uri.c +++ b/src/util/gnunet-uri.c @@ -162,6 +162,7 @@ main (int argc, char *const *argv) GNUNET_GETOPT_OPTION_END }; struct GNUNET_SIGNAL_Context *shc_chld; + int ret; if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; @@ -169,16 +170,15 @@ main (int argc, char *const *argv) GNUNET_assert (sigpipe != NULL); shc_chld = GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, &sighandler_child_death); - if (GNUNET_OK != - GNUNET_PROGRAM_run (argc, argv, "gnunet-uri URI", - gettext_noop ("Perform default-actions for GNUnet URIs"), - options, &run, NULL)) - return 1; + ret = GNUNET_PROGRAM_run (argc, argv, "gnunet-uri URI", + gettext_noop ("Perform default-actions for GNUnet URIs"), + options, &run, NULL); GNUNET_SIGNAL_handler_uninstall (shc_chld); shc_chld = NULL; GNUNET_DISK_pipe_close (sigpipe); sigpipe = NULL; - return ret; + GNUNET_free ((void *) argv); + return (GNUNET_OK == ret) ? 0 : 1; } /* end of gnunet-uri.c */ diff --git a/src/util/os_installation.c b/src/util/os_installation.c index 3e0efa0bf..ef3eda2ff 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c @@ -65,7 +65,7 @@ get_path_from_proc_maps () while (NULL != fgets (line, sizeof (line), f)) { if ((1 == - SSCANF (line, "%*x-%*x %*c%*c%*c%*c %*x %*2u:%*2u %*u%*[ ]%s", dir)) && + SSCANF (line, "%*x-%*x %*c%*c%*c%*c %*x %*2u:%*2u %*u%*[ ]%1023s", dir)) && (NULL != (lgu = strstr (dir, "libgnunetutil")))) { lgu[0] = '\0'; diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c index 4c6ae0039..7be48d0f9 100644 --- a/src/util/test_common_logging_runtime_loglevels.c +++ b/src/util/test_common_logging_runtime_loglevels.c @@ -42,6 +42,8 @@ static struct GNUNET_DISK_PipeHandle *pipe_stdout; static GNUNET_SCHEDULER_TaskIdentifier die_task; +static GNUNET_SCHEDULER_TaskIdentifier read_task; + static void runone (void); @@ -60,6 +62,11 @@ end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_OS_process_destroy (proc); proc = NULL; } + if (GNUNET_SCHEDULER_NO_TASK != read_task) + { + GNUNET_SCHEDULER_cancel (read_task); + read_task = GNUNET_SCHEDULER_NO_TASK; + } GNUNET_DISK_pipe_close (pipe_stdout); if (ok == 1) { @@ -167,6 +174,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) long delays[8]; int rd; + read_task = GNUNET_SCHEDULER_NO_TASK; rd = GNUNET_DISK_file_read (stdout_read_handle, buf_ptr, sizeof (buf) - bytes); if (rd > 0) @@ -176,9 +184,9 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) #if VERBOSE FPRINTF (stderr, "got %d bytes, reading more\n", rd); #endif - GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, - stdout_read_handle, &read_call, - (void *) stdout_read_handle); + read_task = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, + stdout_read_handle, &read_call, + stdout_read_handle); return; } @@ -343,9 +351,9 @@ runone () buf_ptr = buf; memset (&buf, 0, sizeof (buf)); - GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, - stdout_read_handle, &read_call, - (void *) stdout_read_handle); + read_task = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, + stdout_read_handle, &read_call, + stdout_read_handle); } static void diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c index f732fbbdf..599451898 100644 --- a/src/util/test_os_start_process.c +++ b/src/util/test_os_start_process.c @@ -204,6 +204,7 @@ check_kill () GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, hello_pipe_stdin, hello_pipe_stdout, fn, "gnunet-service-resolver", "-", NULL); sleep (1); /* give process time to start, so we actually use the pipe-kill mechanism! */ + GNUNET_free (fn); if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); GNUNET_assert (GNUNET_OK == GNUNET_OS_process_wait (proc)); @@ -241,6 +242,7 @@ check_instant_kill () { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); } + GNUNET_free (fn); GNUNET_assert (GNUNET_OK == GNUNET_OS_process_wait (proc)); GNUNET_OS_process_destroy (proc); proc = NULL; diff --git a/src/util/test_plugin.c b/src/util/test_plugin.c index 122d5f480..f2abfa77d 100644 --- a/src/util/test_plugin.c +++ b/src/util/test_plugin.c @@ -35,6 +35,7 @@ test_cb (void *cls, const char *libname, void *lib_ret) ret = GNUNET_PLUGIN_unload (libname, "out"); GNUNET_assert (NULL != ret); GNUNET_assert (0 == strcmp (ret, "World")); + GNUNET_free (ret); } diff --git a/src/util/test_resolver_api_data.conf b/src/util/test_resolver_api_data.conf index 745cb7bbe..3e264ebb7 100644 --- a/src/util/test_resolver_api_data.conf +++ b/src/util/test_resolver_api_data.conf @@ -4,5 +4,4 @@ SERVICEHOME = /tmp/test-gnunetd-statistics/ [resolver] PORT = 22354 HOSTNAME = localhost -DEBUG = YES diff --git a/src/util/test_server_mst_interrupt.c b/src/util/test_server_mst_interrupt.c index fd34bd00a..8fd7a2b54 100644 --- a/src/util/test_server_mst_interrupt.c +++ b/src/util/test_server_mst_interrupt.c @@ -30,7 +30,7 @@ #include "gnunet_time_lib.h" static struct GNUNET_SERVER_MessageStreamTokenizer * mst; -static int ret; + /* Callback destroying mst with data in buffer */ static int @@ -42,40 +42,23 @@ mst_cb (void *cls, void *client, return GNUNET_SYSERR; } -/** - * Main method - */ -static int -check () -{ +int +main (int argc, char *argv[]) +{ struct GNUNET_PeerIdentity id; struct GNUNET_MessageHeader msg[2]; - /* Prepare */ - memset (&id, sizeof (id), '\0'); + GNUNET_log_setup ("test_server_mst_interrupt", "WARNING", NULL); + memset (&id, 0, sizeof (id)); msg[0].size = htons (sizeof (msg)); msg[0].type = htons (sizeof (GNUNET_MESSAGE_TYPE_DUMMY)); - mst = GNUNET_SERVER_mst_create(mst_cb, NULL); - - GNUNET_SERVER_mst_receive(mst, &id, (const char *) &msg, 2 * sizeof (msg), GNUNET_NO, GNUNET_NO); - + GNUNET_SERVER_mst_receive (mst, &id, + (const char *) &msg, 2 * sizeof (msg), + GNUNET_NO, GNUNET_NO); /* If we reach this line, it did not crash */ - ret = 0; - - return ret; -} - -int -main (int argc, char *argv[]) -{ - ret = 1; - - GNUNET_log_setup ("test_server", "WARNING", NULL); - check (); - - return ret; + return 0; } /* end of test_server_mst_interrupt.c */ diff --git a/src/vpn/gnunet-vpn.c b/src/vpn/gnunet-vpn.c index a03a12e87..61d145c6e 100644 --- a/src/vpn/gnunet-vpn.c +++ b/src/vpn/gnunet-vpn.c @@ -323,15 +323,16 @@ main (int argc, char *const *argv) GNUNET_GETOPT_OPTION_VERBOSE (&verbosity), GNUNET_GETOPT_OPTION_END }; - if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) return 2; - return (GNUNET_OK == - GNUNET_PROGRAM_run (argc, argv, "gnunet-vpn", - gettext_noop - ("Setup tunnels via VPN."), options, + ret = (GNUNET_OK == + GNUNET_PROGRAM_run (argc, argv, "gnunet-vpn", + gettext_noop + ("Setup tunnels via VPN."), options, &run, NULL)) ? ret : 1; + GNUNET_free ((void *) argv); + return ret; } -- cgit v1.2.3