-misc bugfixes, travel hacking
authorChristian Grothoff <christian@grothoff.org>
Sun, 4 Nov 2012 21:01:22 +0000 (21:01 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 4 Nov 2012 21:01:22 +0000 (21:01 +0000)
130 files changed:
src/arm/gnunet-arm.c
src/arm/test_arm_api_data.conf
src/arm/test_exponential_backoff.c
src/ats/gnunet-service-ats_addresses.c
src/ats/perf_ats_mlp.c
src/ats/test_ats_api.conf
src/ats/test_ats_api_update_address.c
src/chat/test_chat.c
src/chat/test_chat_private.c
src/core/core.conf.in
src/core/test_core_api.c
src/core/test_core_api_reliability.c
src/core/test_core_quota_asymmetric_recv_limited_peer1.conf
src/core/test_core_quota_asymmetric_recv_limited_peer2.conf
src/core/test_core_quota_asymmetric_send_limit_peer1.conf
src/core/test_core_quota_asymmetric_send_limit_peer2.conf
src/core/test_core_quota_compliance.c
src/core/test_core_quota_peer1.conf
src/core/test_core_quota_peer2.conf
src/datastore/test_plugin_datastore.c
src/dht/dht.conf.in
src/dht/test_dht_api_data.conf
src/dht/test_dht_api_peer1.conf
src/dns/gnunet-dns-monitor.c
src/dns/gnunet-dns-redirector.c
src/dv/dv.conf.in
src/dv/test_transport_api_dv.c
src/dv/test_transport_dv_data.conf
src/fragmentation/test_fragmentation.c
src/fs/fs.conf.in
src/fs/gnunet-auto-share.c
src/fs/gnunet-directory.c
src/fs/gnunet-download.c
src/fs/gnunet-fs.c
src/fs/gnunet-helper-fs-publish.c
src/fs/gnunet-pseudonym.c
src/fs/gnunet-publish.c
src/fs/gnunet-search.c
src/fs/gnunet-unindex.c
src/gns/gnunet-dns2gns.c
src/gns/gnunet-gns-fcfsd.c
src/gns/gnunet-gns.c
src/gns/test_gns_dht_default.conf
src/gns/test_gns_simple_lookup.conf
src/gns/w32nsp-resolve.c
src/hello/gnunet-hello.c
src/hello/test_hello.c
src/hostlist/gnunet-daemon-hostlist.c
src/hostlist/test_gnunet_daemon_hostlist_peer1.conf
src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
src/hostlist/test_hostlist_defaults.conf
src/include/platform.h
src/integration-tests/confs/c_no_nat_client.conf
src/integration-tests/confs/c_no_nat_client_http.conf
src/integration-tests/confs/c_no_nat_client_unix.conf
src/integration-tests/connection_watchdog.c
src/lockmanager/test_lockmanager_api.conf
src/mesh/gnunet-regex-profiler.c
src/mesh/regex_profiler_test.conf
src/mesh/test_mesh.conf
src/mesh/test_mesh_2dtorus.c
src/mesh/test_mesh_2dtorus.conf
src/mesh/test_mesh_path.conf
src/mesh/test_mesh_regex.c
src/mesh/test_mesh_small.c
src/mesh/test_mesh_small.conf
src/mesh/test_mesh_tree_api.c
src/namestore/gnunet-namestore.c
src/namestore/namestore_api.c
src/namestore/test_namestore_record_serialization.c
src/nat/gnunet-nat-server.c
src/nat/test_nat_mini.c
src/nse/nse_profiler_test.conf
src/nse/test_nse.conf
src/peerinfo-tool/gnunet-peerinfo.c
src/peerinfo/test_peerinfo_api_data.conf
src/pt/gnunet-daemon-pt.c
src/regex/test_regex_graph_api.c
src/statistics/gnunet-statistics.c
src/statistics/test_statistics_api_data.conf
src/stream/test_stream_2peers_halfclose.c
src/stream/test_stream_local.conf
src/template/gnunet-template.c
src/testbed/gnunet-testbed-profiler.c
src/testbed/test_testbed_api.conf
src/testbed/test_testbed_api_testbed_run_topologyclique.conf
src/testbed/test_testbed_api_testbed_run_topologyline.conf
src/testbed/test_testbed_api_testbed_run_topologyrandom.conf
src/testing/gnunet-testing.c
src/testing_old/Makefile.am
src/testing_old/test_testing_2dtorus.conf
src/topology/gnunet-daemon-topology.c
src/topology/test_gnunet_daemon_topology_data.conf
src/transport/gnunet-transport.c
src/transport/template_cfg_peer1.conf
src/transport/template_cfg_peer2.conf
src/transport/test_transport_api_bidirectional_connect_peer1.conf
src/transport/test_transport_api_disconnect_tcp_peer1.conf
src/transport/test_transport_api_http_peer1.conf
src/transport/test_transport_api_http_peer2.conf
src/transport/test_transport_api_http_reverse_peer1.conf
src/transport/test_transport_api_https_peer1.conf
src/transport/test_transport_api_https_peer2.conf
src/transport/test_transport_api_reliability_http_peer1.conf
src/transport/test_transport_api_reliability_http_peer2.conf
src/transport/test_transport_api_reliability_tcp_peer2.conf
src/transport/test_transport_api_tcp_nat_peer1.conf
src/transport/test_transport_api_tcp_nat_peer2.conf
src/transport/test_transport_api_tcp_peer1.conf
src/transport/test_transport_api_timeout_http_peer1.conf
src/transport/test_transport_api_timeout_http_peer2.conf
src/transport/test_transport_api_timeout_https_peer1.conf
src/transport/test_transport_api_timeout_https_peer2.conf
src/transport/test_transport_api_udp_nat_peer1.conf
src/transport/test_transport_api_udp_nat_peer2.conf
src/transport/test_transport_api_wlan_peer1.conf
src/transport/test_transport_api_wlan_peer2.conf
src/transport/transport-testing.c
src/util/gnunet-config.c
src/util/gnunet-ecc.c
src/util/gnunet-resolver.c
src/util/gnunet-rsa.c
src/util/gnunet-uri.c
src/util/os_installation.c
src/util/test_common_logging_runtime_loglevels.c
src/util/test_os_start_process.c
src/util/test_plugin.c
src/util/test_resolver_api_data.conf
src/util/test_server_mst_interrupt.c
src/vpn/gnunet-vpn.c

index c155577d0e0e2ecede8d3eae5cdce453c4769b2e..49315687fed98881933d273bd29b5759ef84414d 100644 (file)
@@ -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;
 }
 
index cbadc47d2409b3dab86e06ac31d33def0f6b6c0f..8ebd6976c575a33a5bc0d9e1a2120abac4100fd5 100644 (file)
@@ -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]
index 1709dbdbac89b54b1c82e2d5586ff544e2eb1b24..34ebad1644a5da739456c0fdd27ead26adf3c09b 100644 (file)
@@ -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 ();
index ff422278049013ca424fe0673c75fa5a6dd532d8..c471a70f982d81d9e910ef03f69e76c083235c47 100644 (file)
@@ -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
  *
index 51f9102569ebbe1b857acb435f351da7bd98e07b..751fad51a04a11af73bf2541c7b461b68dca72d4 100644 (file)
@@ -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;
 }
 
index ab96f655e74981a8551fddf3ded832faf91f43bd..2ac499c663ff6b28d84a4e45a785a727c7b76865 100644 (file)
@@ -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
index 12d283aacd7beb750803a10c96a002c2786aa2b2..6a9e33800b72ac649c8a3cabe8cca2e993aec775 100644 (file)
@@ -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)
 
index 24a1e38da8551cbebd64c6c8745252c52be51fb0..78b31f1b10f856d8774726000984b7a53f8b1160 100644 (file)
 #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)
   {
index 64150c107793aa84ec6a62c778bc39c6990ad9ac..b911d091fbef7ccedaccb7dcfcd0d4ee2d453cb7 100644 (file)
@@ -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);
 }
 
index fbe2f794848caa1897d4f5663c0df6b32f13fe4a..ad39a8a797ad86818f9c94f9f5880d93af7a084e 100644 (file)
@@ -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 =
index 11fd145042c763e29955e1de712a2cc589b39e83..68ae39df2c36fce0b7ec61249cc152fd2dcaef0e 100644 (file)
 #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");
index dd70d438abacbf7ccb6ce919a631049bda43a831..38c40da12fbe2b4c5ee410d2077182d1d5e0cdb0 100644 (file)
@@ -33,8 +33,6 @@
 #include "gnunet_transport_service.h"
 #include <gauger.h>
 
-#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);
 }
 
index dcd886280e7a37ebeace842950064e59061d13c9..25eb25b96f0e36c08bd52199e10fab054e9d2773 100644 (file)
@@ -34,5 +34,4 @@ WAN_QUOTA_OUT = 1 MB
 [core]
 PORT = 12490
 UNIXPATH = /tmp/gnunet-core-asym-recv-p1-service-core.sock
-DEBUG = NO
 
index 13f29e91ad76d5fe03af824421c8a49d727a739a..062f12ae641ada0314b0e2d6c95774fe6769a364 100644 (file)
@@ -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
index 09c4ed049f1f694ea0497a24646d47454bcbb394..36d60f1ac6c56aa833d5a6b256ef46a6bbd41d31 100644 (file)
@@ -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
index 03d5bce12fe8cc16d5b9ddcd193978757ddb8c45..b6e417483bcd30c0455c09ef7f1a6773c94e2108 100644 (file)
@@ -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
index 88a9150950990ce9f81de0023f57400f1222022b..7f675a63731c638dd7d4d8745f30d29d5a1aecbe 100644 (file)
@@ -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);
 }
 
index 4a67bfe6615fe6a5ebde2be4af031b059201395e..43ef8450503028c51d055598089b591155163c66 100644 (file)
@@ -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
index e288da06456b99fb5c9921a431d062d6ce4d2ce5..b100f9fb4fe792003da9b49a6a510f6fcaed8356 100644 (file)
@@ -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
index 96a5aebe50fc97aa434b4dd6a181b57d91c3766b..5aba51123db7cc10c1ca14cd38e5ff576d53b11d 100644 (file)
@@ -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);
index 553429dc8715358f83a46455940a0c21eb8a8551..d6afe39e94de349a4d868cc2c5f828c9b78466d5 100644 (file)
@@ -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 =
index 42ccf9687cf5352fe30e4346a30fd522bb3c6c69..58e509cbb05fba368f2feaa010847de8a9c0e7db 100644 (file)
@@ -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
 
index eea39e031c5680fe0dd533eb87353bec5cbe390a..fd2ee804fa4c52be6a3c5a7623c259234b426c51 100644 (file)
@@ -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
index 8f05403fbd2f4fb403d349214f03869d439ac65a..747a875567515af10a304e1af76d72e5169a5f12 100644 (file)
@@ -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;
 }
 
 
index 5ba7e87c6f3c512e0ea6a3553265aafaf0f4320a..3df2ac21a0883ba23a056e64ebce915f735e3c0c 100644 (file)
@@ -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;
 }
 
 
index 158bbcdd6e5a89e16d3d2b576268d6874a699b0f..c0dc21bfd3d9890aca5d733719c0adc549b8daae 100644 (file)
@@ -1,6 +1,5 @@
 [dv]
 AUTOSTART = YES
-DEBUG = NO
 ACCEPT_FROM6 = ::1;
 ACCEPT_FROM = 127.0.0.1;
 BINARY = gnunet-service-dv
index c78d5072dba0d3e63bcb3c34b3df1e86e5303348..da822ca8fc5f298b1ffb138e7896154cb4774593 100644 (file)
@@ -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 ();
   /**
index 3daa6a7f4b7c5228e81ed512e766fdb7f7e87a21..8232461e53873ea037d523d09e1efe5e0c0349ac 100644 (file)
@@ -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
index ecbcdddab6741075deca7463787c4792a368a7d5..2a30d7d93e716cd373cfca58168f67d978d085f4 100644 (file)
@@ -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],
index 007b0fd41ce2737b4a01020ce6ce25af5781e841..52bb52f5a1fa2941f7d2d1361d7cf406ed536e53 100644 (file)
@@ -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)
index 073b768db70b6b747ac9b1bf94b9bfae00871a38..e0514bc8f993e3ba220cf2fc7d7e660ad305ac25 100644 (file)
@@ -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;
 }
 
index 4122cb154fcb8cc5a4a876d5f1dd3222df0747fe..2f25e282efd43a6beb8841579f55d1ff375baff7 100644 (file)
@@ -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 */
index 093dd7bdc5c01616f900ce0324ab393d89ce004c..04edc66c8864a37b4aa7a5e253afb1fcea30c5e3 100644 (file)
@@ -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 */
index ce6284aa4ef90415cdeb5682dab3704a3cda9521..1d791377c3a5ee750dc5a8873c3c54755da712dd 100644 (file)
@@ -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 */
index 8df53a6c39b3f8902bce6b8716349d6801e15dac..d429f603db1efa7648a71625d84b5f09fde93c3a 100644 (file)
@@ -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;
 }
 
index 02b71b5138de854f7a6ff0c7cbd2d8dceaeca5fc..a692917da360e753195844b066948bd64a4ec4cb 100644 (file)
@@ -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 */
index eb64cc4cc32c4bb6b3cdb4689fe457dd842ec9d0..dbbdfda8c3adf460346c51a905a0abc56dc1b0a9 100644 (file)
@@ -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 */
index 200dc77abab57baa11be7e2ed7d7fcb8f76492c0..e90b761d77c14262aa77821124ebd01a0fdc577f 100644 (file)
@@ -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 */
index be16e910093cbc33ce85ca41b2714ce38ed89a1e..094d8868d5efb821a3a3da545d6263a50987b44f 100644 (file)
@@ -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 */
index 4954e3b4cf91d6511c01d2ce40227fe73509eb95..5329e491748b53d75f5e1844b30c408350ab9ab8 100644 (file)
@@ -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;
 }
 
index 5503000aca79e8a98438664a562a620728d8585c..c29c7838ad4fa2eccebc77f9266373575e859119 100644 (file)
@@ -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;
 }
 
index ba30b56fb7f349a93ee37274dfb85d31be2a7896..d7e8309dd5d2a5065f39ec54bbf03b7ece6db653 100644 (file)
@@ -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;
 }
 
index b22f002fb180ebe355b654ff2571dd415ab0a6b2..a14588c41dccadc6b79b62d94eae0e3fe8866479 100644 (file)
@@ -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;
index ca1699c2f41e2a4128023316176a54178ff95795..f759ba448c97af47aef603e0a9ca05609977caf4 100644 (file)
@@ -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
index 4a116f5948d496aa90f76a77b89bf1892fa82741..3234a1ee5228962b753327cdac1034df62e97120 100644 (file)
@@ -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)
 {
index bc35cdd3214c63ed7417e98138d9c0d5198587f5..eae16a90b00ff68664cf2e8c00fe0980f4357339 100644 (file)
 #include "platform.h"
 #include "gnunet_hello_lib.h"
 
-#define DEBUG GNUNET_EXTRA_LOGGING
-
-#define VERBOSE GNUNET_NO
-
 /**
  * Closure for 'add_to_buf'.
  */
index bdabc72ea8679abe309516de86767991cb206fc2..ac482efe5724b13169022c1e0139c5159c97c8cd 100644 (file)
 #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);
index 6637f37cee8a4d1475521c1d1d330e15cc8046c5..255f0d5443fab80bc9f4f3dbf8a087f7c7611b21 100644 (file)
@@ -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;
 }
 
index c880190a114eba19c21087d6f7d3c76ab0242ad6..0a345f6bfd94181566feb33eece114a2ed8cb30e 100644 (file)
@@ -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
index 63baced463194b958faa7f27e495ad9171e9498c..74ef37f1618034d5147aea58fde176823263a18c 100644 (file)
 #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, &notify_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)
index d7383005c79c38020d3e371b6ce1a7b8aa92557a..fe3756a1eff6113b0d72294da258a9ce6f28dc51 100644 (file)
@@ -67,4 +67,4 @@ AUTOSTART = NO
 AUTOSTART = NO
 
 [nat]
-RETURN_LOCAL_ADDRESSES = YES
\ No newline at end of file
+RETURN_LOCAL_ADDRESSES = YES
index 912601dad177e7e2a1d25e6dd6ca1a6963a562d2..c44f67f677eb457cc63c70ce1c7eae646ce6b530 100644 (file)
@@ -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
 
 /**
  * @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
 
 #ifdef SOMEBSD
 #include <net/if.h>
 #endif
-#ifdef GNUNET_freeBSD
+#ifdef FREEBSD
 #include <semaphore.h>
 #endif
 #ifdef DARWIN
index 8d4c7e3e8ed539d4e4f6a3c42c82237af58f2818..8e89f3f6e655b0be202d9080f3bfcfbd364574a4 100644 (file)
@@ -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
index 523a4fdcf44d7932811576ec7075bfe462b725d5..bbf6a64ec58aae1fe439cf8c4721a9d191b0e740 100644 (file)
@@ -141,7 +141,6 @@ ATS_EXEC_INTERVAL = 30000
 
 [transport]
 PREFIX = valgrind --leak-check=full
-#DEBUG = YES
 AUTOSTART = YES
 PORT = 20029
 HOSTNAME = localhost
index 62d679fd232335712c820f774269c14b823cd0b6..25373c927bc3f76ed5fee8b657c6c5fc9390437b 100644 (file)
@@ -141,7 +141,6 @@ ATS_EXEC_INTERVAL = 30000
 
 [transport]
 PREFIX = valgrind --leak-check=full
-#DEBUG = YES
 AUTOSTART = YES
 PORT = 20029
 HOSTNAME = localhost
index 17aab2159fff006d8a813594554c2014de49f487..0998a367e697dc2d8f197417be41c0877162669c 100644 (file)
@@ -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 */
index af0d9931910e66848b17ec39f296677b59db0f20..2be9caef1bc3943bf262d33908b0c2cc5ec57a12 100644 (file)
@@ -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
index fac7b02e5e02e20f3c6c7e0352e2e7a29405b535..128ed905eb2f3a7848507ba1ea62b6c73a396644 100644 (file)
@@ -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)
index ebbc9ee2f04022734e9e777eccf8b63bc0c3b5a9..938ea3cadd3552e7ead608943bd04bcae16402c2 100644 (file)
@@ -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
index d8bdd7a13e4e640a32d657562b4d9791284bb938..8b9ca158e8f2740aea38934aa6846a3bb6c84e2d 100644 (file)
@@ -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
index 58777c001a12f652bd3f0947377de97402cf0333..4c1e406efe96eab1cc0657cd3433f673ca0f8a96 100644 (file)
@@ -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
   };
 
index b6291fff58035138e97949a938d60e53d83945c2..8262571399e542506d82e66cd3923be06cf29a28 100644 (file)
@@ -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
index 5ac9710d4e38d5a85108e8c90521498ade600cf7..9a9cf3087bf55994bb62b9b90f899fc7bbcbfc64 100644 (file)
@@ -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
index 8e65324dffe7be2a2bf2ebbd350efd96bef35df1..4bb0c8ddf40cc35700b339d0644e961f5319e00d 100644 (file)
@@ -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;
index 3f9e1c2aea91d4b8d0ba248c2d78771ab44848b6..80edad4965d6b6db5c86ff291d5c384bd7600ea9 100644 (file)
@@ -29,7 +29,6 @@
 #include <gauger.h>
 
 
-#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)
   {
index 2277a9a76ec42081e15363eaf02594b4868a7a0c..4083e8e79438f97e1d561c40d3a5edc5ec8f2b61 100644 (file)
@@ -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
index 1d43135e4ff058b8eaa95785accd32778faad644..60b88239ceb8915630b3828feabc1dad42bf68f3 100644 (file)
 #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++)
   {
index 94303a9e2575afb6980482ab964c32b0e44f6de6..a79ec5e78d59aa8fc113712e5a35043baafc72a1 100644 (file)
@@ -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;
 }
 
index 4028e5e21c6eb81667c2d015e70a97f006ea56d3..5e82e08babac3e16bc64404fde6b6de30f26bb9a 100644 (file)
@@ -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);
index b8818a6c76608c0d9de19aa7570e808d0bd6be7b..7b7cc8b5a5833b22deba05612cb947bbf98866c6 100644 (file)
@@ -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;
index e971bd3b1d5715ba0928d9618c430e0592ed57f9..1a98cdc9628f1f871dc98a41bd91b47f8e0907e7 100644 (file)
@@ -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;
 }
 
index 2c6da3b57416286ec707075592fee9131e2db410..f2e1ee97a6ce45889f4de7db21a47ae0bccd2f77 100644 (file)
@@ -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,
index b4709dd3881b7a0f50ec5c7290ec7d6edbacd3bd..398eb27defb225541d9fae50285e8e0446d649e0 100644 (file)
@@ -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
index 625d059eeb67de8fdb448740d5a2e533b077b37e..003703bb7d841120412d42fe43a94c18642bbff2 100644 (file)
@@ -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
index b847c0f9638191276368e297ae1b6d38ea2cf460..c2520fac0d193a5bd2260c2bd1d4c11823764223 100644 (file)
@@ -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 */
index 6caa1e46b1f00514c12bcfd687c95b986b65f403..ddbd02b5e94e6cac4f8f043cc51b53433a2360d6 100644 (file)
@@ -3,7 +3,6 @@ SERVICEHOME = /tmp/test-gnunet-peerinfo/
 
 [peerinfo]
 PORT = 22354
-DEBUG = NO
 
 [dns]
 AUTOSTART = NO
index 2658ae1655f958f0b298de514cc7492169fd6956..8044f930c87c05b8e83abbe74a5b096db8ccd0a4 100644 (file)
@@ -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;
 }
 
 
index d429025d9d01c7a00c9f9c773dacb7743ab59217..c2c1c74e1a497018f98d27f41a49c174dd56f64d 100644 (file)
  *
  * @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
index 13468592a84b9611425332b4b6eec9cd15474490..2331aace0c4bedbc18c939a1d3093416a1bbf7a4 100644 (file)
@@ -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 */
index c52ff35b3c4bde35521146dd042f0dd024fe5acf..2099c3bd1f4deb632487e6c803a43d3f9dfc0e5c 100644 (file)
@@ -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
index 2502615c2e65b0a035552bb6d5c1976a15f6a2d1..617ab99a8f46c13e56f16e07dce3bbf23a2424f2 100644 (file)
  * @brief Testcases for Stream API halfclosed connections between 2 peers
  * @author Sree Harsha Totakura
  */
-
-#include <string.h>
-
 #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
  */
index 5e4ccc5193a5b1963ac7f4568910f13ee70bcc0e..5a517cb3f370faef3cfd9d5575d48d11f1925560 100644 (file)
@@ -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
index 0bbbc558fe8bd5b9de8dd511a635ea79bebf9625..b0d25dc33ab9991a0547453f32332e8f11ec56c1 100644 (file)
@@ -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 */
index 6a5b3cf717f98c89269036d32109d406af780b21..3bddfac09e99318c5da4739641e89c565e594d66 100644 (file)
@@ -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)
index 17fdba862e1795690be65c892fb0ecd6cfc6f308..e52b5df0e53511747b90744f72b179fa09caf5fc 100644 (file)
@@ -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
index 37fc7342d08e788f5b9f6b1cc524c05d393f0ab9..e54b0b2389cb28c020a36228fc3e64cc457119ae 100644 (file)
@@ -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
index 2958f765c03836a30f8fe8bf6e642f2e3f29e919..d3c840dd10142cf04b2c182ffb594a95d24c2cc1 100644 (file)
@@ -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
index 3c79806829005b2b9d5401ab383dd31fce98b0a8..5ba272cfa1da96470e225d5084733ec33085113c 100644 (file)
@@ -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
index cc5c6f50ce8598969c973205fb9aea48f109ecf2..ba864e3f0d6032a280d8385c39c68d2a863f3eb6 100644 (file)
@@ -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 */
index 7a7f193641e40ff3103da4ee34f3cb6a0b5186fa..2e5eb4bf7594f99f00be413df646f3b6285de91a 100644 (file)
@@ -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
 
 
index 4ec3db83e7ce8a855519d8563a942c15cc250747..993ab372d0a5a1d555a291950519658e4b9b9bcc 100644 (file)
@@ -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
index 682ad417c882aeb68af82f39405066aad17a8112..fc1f461ed04870f212d29cbdc4749efa516a92b6 100644 (file)
@@ -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;
 }
 
index c4e01acedc3babd48cc21d40e8371605018bf0cd..178f50fdacc494f8b509f4e07a55daee82fa38f6 100644 (file)
@@ -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]
index 5978de6bbc30d014c1373a3ffa3432ccfc1252c0..18b1b983957184179d866c80b8a2ecd31e6b77c1 100644 (file)
@@ -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;
 }
 
 
index 05309d53cedb636efd19019f86a4852930e14681..8856418b318a89acbf119292809906e439872b96 100644 (file)
@@ -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
index 210ee51c50707bbe36928a7ad84fd2f64d91fcd1..54636ca6b52b1101987bdc7ae6a932aac92ad13c 100644 (file)
@@ -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
index 614d89d21e3fecac5e0ebd70f4093ff04517344a..ba6afbe6ea414272adb698df19b876bd08182ba5 100644 (file)
@@ -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
index 6879d0534b893234c400b977e71a51bbd8023567..5f1d693a81f492cfb9cb7731e9756f939470b43a 100644 (file)
@@ -27,5 +27,4 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
 PORT = 12001
 PLUGINS = tcp
 UNIXPATH = /tmp/gnunet-p1-service-transport.sock
-#DEBUG = YES
 
index e0b60e37fc57a2a6e20f44c5dbec4cdfe0a09039..3c1b41d069acfc946d0fb303579b1f1e272f7431 100644 (file)
@@ -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
index 4e4c22e30884593d0c927a739f23e9f2a8737347..f348bf40462d81c078781cc8f3dd718ff22826d5 100644 (file)
@@ -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
index c38c36a189419662ca91a10d3e63b633e2ec4594..93d8bd34b358327b47cb2349b2315b7500086f89 100644 (file)
@@ -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
index 78d3ca0a43d51c25bb749a37ecbc37bee0e25e7d..48302a640d5b549e81c557aff85e004c4a5abb16 100644 (file)
@@ -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
 
 
index a347887bbafa363d3be3fe540a6a86ff4ef209f0..566997f935c66f1dfea3b153797223bace6eb2df 100644 (file)
@@ -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
 
 
index 9e39e3e416b2134d9e14b26f6aeb053490de691c..ea5de0bc9b278ab39e2f456b0aeb1843b4e72197 100644 (file)
@@ -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
 
index 3174e3d00a8a066637f68e41307b9fed55435819..083cd4dd80a5cfc351f21652aee35fb760aa54fb 100644 (file)
@@ -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
 
index 3cb42c0b6f5a6535223669d872e5d6af9d204431..181aab3debfbcc4c0ff5814bc8757400b77e761c 100644 (file)
@@ -27,4 +27,3 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock
 PORT = 12010
 PLUGINS = tcp
 UNIXPATH = /tmp/gnunet-p2-service-transport.sock
-#DEBUG = YES
index 4ebf5b3be5bf4d2b0f5e7e59a11c4aab582bf64b..8e33f273ddfb7eba728b4e0e2bda4abc0e47694c 100644 (file)
@@ -32,5 +32,4 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
 PORT = 29542
 PLUGINS = tcp
 UNIXPATH = /tmp/gnunet-p1-service-transport.sock
-#DEBUG = YES
 
index 1ef51c9c95ba9d9c50739fbab5bfec250328f0d5..f8b8b013eb8e805e58ba6d6c5062f53b1d701b83 100644 (file)
@@ -31,4 +31,3 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock
 PORT = 45923
 PLUGINS = tcp
 UNIXPATH = /tmp/gnunet-p2-service-transport.sock
-#DEBUG = YES
index 54abfa5ba64acadd0e73a752c40d92a5379bf906..db662826b8b8271b4de56549789b6a390b67501c 100644 (file)
@@ -27,5 +27,4 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
 PORT = 12001
 UNIXPATH = /tmp/gnunet-p1-service-transport.sock
 PLUGINS = tcp
-#DEBUG = YES
 
index 2eb23662a7907a92223358ef72f62ba513a3feb4..665527b3e66df5ef9798b53452774d995db2b649 100644 (file)
@@ -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
index 0aa77a9b99caff7a408f4d90fbd015535086aa59..1fdc947882ccd06bdb31d277b34ff4fbac24cfb9 100644 (file)
@@ -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
index ff1ef47bd2588779d4a11a8e44e192137ff28107..fda69ae5ca47bc071b1fb915f71ef5c3cfa78520 100644 (file)
@@ -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
 
 
index 35fba0a83b103dc5d12d131a6af6fa935ac70519..ca54e1718a7a5f96bf974fffade95aeff6a9b5db 100644 (file)
@@ -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
 
 
index 6e643d5af70b111b9776bedb0b9f7e9fae9c8b28..e406883e4bb8359bdf1cc2d4f57860823aa47208 100644 (file)
@@ -31,6 +31,5 @@ UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock
 PORT = 12061
 PLUGINS = udp
 UNIXPATH = /tmp/gnunet-p1-service-transport.sock
-DEBUG = NO
 
 
index 1c1258ad155a6991d51111a6a85e3693462d4be3..43ed3a91b578ab5035d2dfa0c36a63bc6558e333 100644 (file)
@@ -29,6 +29,5 @@ UNIXPATH = /tmp/gnunet-p2-service-peerinfo.sock
 PORT = 12071
 PLUGINS = udp
 UNIXPATH = /tmp/gnunet-p2-service-transport.sock
-DEBUG = NO
 
 
index ff37415a4b03157f2cdf12ea943f80708671cabf..3f12ce5052974ca982eb34d364cf2a8caf3f66bd 100644 (file)
@@ -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
index 87a6036fb9117cc44a4462716f00ff852a31673a..451a2a6665a1969be40ee91bc5bb7ef8b01c214f 100644 (file)
@@ -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
index f1c06ebc018b068f8aa866a3318c30f0d67fe3a5..0c51ef33412a9e3626ea9babd33886d6b35c05c3 100644 (file)
@@ -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 */
index 78c93c3b854900d0c4f37b4d4fdfdb5e63852d6b..e1aa94a5c774f4ab5edb57f88c4cb0283c608ffe 100644 (file)
@@ -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 */
index f966763a85415ff4157f2d65ee74527992881a1b..ad6b68a95a312c43a14b82931cccc0892338a6f6 100644 (file)
@@ -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 */
index 55963774835d7d49ad119e0d78dbb6803a9332e3..6cb6ac56496079280feeabb591617dcff5ce6bb3 100644 (file)
@@ -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 */
index d509bde67dd12a1d58110840de5a71cc9c4e7869..597093ab15814fe9f16081452ff3cf9faebf167f 100644 (file)
@@ -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 */
index 8cc813be51e3ab0292ff46fb741ef99927225e69..5ca1f4efc6bc8017de4d104f9fe8a4942d46da8f 100644 (file)
@@ -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 */
index 3e0efa0bfa49402e683e9c95d5cd0616e9859a68..ef3eda2ff21d877ac354229e8e6dd43418c37523 100644 (file)
@@ -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';
index 4c6ae003936f40e8f4de40135b1f2a07e4797b3d..7be48d0f90509d46feeb12b5816c63c345d5e148 100644 (file)
@@ -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
index f732fbbdf9a39b94bad9735bea270189800be6e1..599451898051c767088279eed78b17bfb862b179 100644 (file)
@@ -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;
index 122d5f480351f92139ba74c78eee02457d5e9ef2..f2abfa77d79cd35bc9ff84bdb375c3d070f90750 100644 (file)
@@ -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);
 }
 
 
index 745cb7bbe42d9bcb5db5d18f89a92befc76293d2..3e264ebb7d968d39826c33fdb9832346f756adce 100644 (file)
@@ -4,5 +4,4 @@ SERVICEHOME = /tmp/test-gnunetd-statistics/
 [resolver]
 PORT = 22354
 HOSTNAME = localhost
-DEBUG = YES
 
index fd34bd00a4dafc0e0c66af0d88036b0458779784..8fd7a2b54ff808d540c846dad58631a0aa71095a 100644 (file)
@@ -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 */
index a03a12e870f6debe5ad8065ff9b2c91313c47ce2..61d145c6e6516f418ecf7ec02ca45ec00718e403 100644 (file)
@@ -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;
 }