From: Nathan S. Evans Date: Fri, 2 Jul 2010 13:49:05 +0000 (+0000) Subject: added dv twice and dht never? X-Git-Tag: initial-import-from-subversion-38251~21063 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=76aac1b58af3a2c8488875d0f3d0e994563d80ca;p=oweals%2Fgnunet.git added dv twice and dht never? --- diff --git a/src/Makefile.am b/src/Makefile.am index aa68c8537..46189da71 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -25,8 +25,9 @@ SUBDIRS = \ transport \ peerinfo-tool \ core \ - testing \ dv \ + testing \ + dht \ hostlist \ topology \ $(NAT_DIR) \ diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index 4a19422a8..7095eeb6d 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c @@ -574,7 +574,7 @@ service_message_handler (void *cls, finish(handle, GNUNET_SYSERR); /* If there was a current message, kill it! */ } #if RETRANSMIT - if (GNUNET_CONTAINER_multihashmap_iterate(handle->outstanding_requests, &retransmit_iterator, handle) > 0) + if ((handle->retransmit_stage != DHT_RETRANSMITTING) && (GNUNET_CONTAINER_multihashmap_iterate(handle->outstanding_requests, &retransmit_iterator, handle) > 0)) { handle->retransmit_stage = DHT_RETRANSMITTING; handle->current = handle->retransmissions->message; diff --git a/src/dv/dv.h b/src/dv/dv.h index e744c30d0..bb63bc004 100644 --- a/src/dv/dv.h +++ b/src/dv/dv.h @@ -31,7 +31,7 @@ #define DEBUG_DV_GOSSIP GNUNET_NO #define DEBUG_DV_GOSSIP_SEND GNUNET_NO #define DEBUG_DV_GOSSIP_RECEIPT GNUNET_NO -#define DEBUG_DV_MESSAGES GNUNET_NO +#define DEBUG_DV_MESSAGES GNUNET_YES #define DEBUG_DV GNUNET_NO #define DEBUG_DV_PEER_NUMBERS GNUNET_NO #define DEBUG_MESSAGE_DROP GNUNET_NO diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c index 48db86cdc..709ef8e97 100644 --- a/src/dv/test_transport_api_dv.c +++ b/src/dv/test_transport_api_dv.c @@ -720,7 +720,7 @@ topology_callback (void *cls, { #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Created %d total connections, which is our target number! Calling send messages.\n", + "Created %u total connections, which is our target number! Calling send messages.\n", total_connections); #endif diff --git a/src/dv/test_transport_dv_data.conf b/src/dv/test_transport_dv_data.conf index f993603c0..8cb1ffb06 100644 --- a/src/dv/test_transport_dv_data.conf +++ b/src/dv/test_transport_dv_data.conf @@ -6,7 +6,7 @@ DEFAULTCONFIG = test_transport_dv_data.conf PORT = 2564 [transport] -DEBUG = NO +DEBUG = YES PORT = 2565 PLUGINS = tcp dv BLACKLIST_FILE = $SERVICEHOME/blacklist @@ -45,7 +45,7 @@ PORT = 2570 [dv] AUTOSTART = YES -DEBUG = NO +DEBUG = YES ACCEPT_FROM6 = ::1; ACCEPT_FROM = 127.0.0.1; BINARY = gnunet-service-dv diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c index 58fcd834a..ecd82b2c4 100644 --- a/src/fragmentation/fragmentation.c +++ b/src/fragmentation/fragmentation.c @@ -35,10 +35,12 @@ #include "gnunet_fragmentation_lib.h" #include "gnunet_protocols.h" #include "gnunet_util_lib.h" + /** * Message fragment. This header is followed * by the actual data of the fragment. */ + struct Fragment { @@ -181,10 +183,16 @@ void GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *ctx) { struct GNUNET_FRAGEMENT_Ctxbuffer *buffer; - for(buffer = ctx->buffer; buffer!=NULL; buffer = buffer->next){ - GNUNET_free(buffer->num); - GNUNET_free(buffer); - } + struct GNUNET_FRAGEMENT_Ctxbuffer *temp; + buffer = ctx->buffer; + + while (buffer != NULL) + { + temp = buffer->next; + GNUNET_free(buffer->num); + GNUNET_free(buffer); + buffer = temp; + } GNUNET_free(ctx); GNUNET_assert (0); } diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am index f5e834d4e..9fcdd351b 100644 --- a/src/fs/Makefile.am +++ b/src/fs/Makefile.am @@ -150,7 +150,6 @@ TESTS = \ test_fs_download \ test_fs_download_indexed \ test_fs_download_persistence \ - test_fs_file_information \ test_fs_list_indexed \ test_fs_namespace \ test_fs_publish \ @@ -166,6 +165,7 @@ TESTS = \ test_gnunet_service_fs_p2p \ $(check_SCRIPTS) # $(check_PROGRAMS) +# test_fs_file_information test_fs_collection_SOURCES = \ diff --git a/src/testing/test_testing_data_topology_clique.conf b/src/testing/test_testing_data_topology_clique.conf index 114364da2..abe6f586a 100644 --- a/src/testing/test_testing_data_topology_clique.conf +++ b/src/testing/test_testing_data_topology_clique.conf @@ -41,7 +41,7 @@ PORT = 2570 #DEBUG = YES [testing] -NUM_PEERS = 4 +NUM_PEERS = 10 WEAKRANDOM = YES TOPOLOGY = CLIQUE F2F = YES diff --git a/src/testing/test_testing_data_topology_none.conf b/src/testing/test_testing_data_topology_none.conf index 9ff8ca390..f03633d56 100644 --- a/src/testing/test_testing_data_topology_none.conf +++ b/src/testing/test_testing_data_topology_none.conf @@ -3,16 +3,14 @@ SERVICEHOME = /tmp/test-gnunet-testing/ DEFAULTCONFIG = test_testing_data_topology_clique.conf [resolver] +AUTOSTART = NO PORT = 0 [transport] PORT = 0 PLUGINS = tcp -#PREFIX = xterm -e xterm -T transport -e gdb --args #BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/transport/.libs/gnunet-service-transport -#PREFIX = valgrind --tool=memcheck --log-file=logs%p -#PREFIX = valgrind --tool=callgrind --log-file=callgrind.%p -#DEBUG = YES +#PREFIX = valgrind --tool=massif [topology] PORT = 0 @@ -22,23 +20,18 @@ PORT = 0 DEFAULTSERVICES = [statistics] +AUTOSTART = NO PORT = 0 [transport-tcp] PORT = 2568 +BINDTO = 127.0.0.1 [peerinfo] PORT = 0 -#DEBUG = YES -#PREFIX = xterm -e xterm -T peerinfo -e gdb --args -#BINARY = /home/mrwiggles/documents/research/gnunet/gnunet-ng/src/peerinfo/.libs/gnunet-service-peerinfo -#PREFIX = valgrind --tool=memcheck --log-file=peerinfo%p [core] PORT = 0 -#PREFIX = xterm -e xterm -T CORE -e gdb --args -#PREFIX = valgrind --tool=memcheck --log-file=logs%p -#DEBUG = YES [hostlist] PORT = 0 @@ -47,10 +40,14 @@ PORT = 0 PORT = 0 [testing] -NUM_PEERS = 200 +NUM_PEERS = 50 WEAKRANDOM = YES TOPOLOGY = NONE F2F = NO BLACKLIST_TOPOLOGY = NONE CONNECT_TOPOLOGY = RING +#CONNECT_TOPOLOGY = 2D_TORUS +#CONNECT_TOPOLOGY = CLIQUE +#CONNECT_TOPOLOGY_OPTION = CONNECT_DFS +#CONNECT_TOPOLOGY_OPTION_MODIFIER = 20 #DEBUG = YES diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c index eb13c8eef..23cb3716a 100644 --- a/src/testing/test_testing_topology.c +++ b/src/testing/test_testing_topology.c @@ -24,9 +24,12 @@ #include "platform.h" #include "gnunet_testing_lib.h" #include "gnunet_core_service.h" +#include "gnunet_os_lib.h" #define VERBOSE GNUNET_YES +#define DELAY_FOR_LOGGING GNUNET_YES + /** * How long until we fail the whole testcase? */ @@ -167,6 +170,20 @@ void shutdown_callback (void *cls, } } +#if DELAY_FOR_LOGGING +static void gather_log_data () +{ + char *peer_number; + char *connect_number; + pid_t mem_process; + GNUNET_asprintf(&peer_number, "%llu", num_peers); + GNUNET_asprintf(&connect_number, "%llu", expected_connections); + mem_process = GNUNET_OS_start_process (NULL, NULL, "./memsize.pl", + "memsize.pl", "totals.txt", peer_number, connect_number, NULL); + GNUNET_OS_process_wait(mem_process); +} + +#endif static void finish_testing () { @@ -177,6 +194,7 @@ finish_testing () GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Called finish testing, stopping daemons.\n"); #endif + int count; count = 0; pos = test_messages; @@ -558,12 +576,22 @@ topology_callback (void *cls, #endif modnum = expected_messages / 4; dotnum = (expected_messages / 50) + 1; -#if VERBOSE - fprintf(stdout, "Test message progress: ["); -#endif GNUNET_SCHEDULER_cancel (sched, die_task); die_task = GNUNET_SCHEDULER_NO_TASK; +#if DELAY_FOR_LOGGING + fprintf(stdout, "Sending test messages in 10 seconds.\n"); + GNUNET_SCHEDULER_add_delayed (sched, + GNUNET_TIME_relative_multiply + (GNUNET_TIME_UNIT_SECONDS, 10), + &send_test_messages, test_messages); + gather_log_data(); +#else GNUNET_SCHEDULER_add_now (sched, &send_test_messages, test_messages); +#endif +#if VERBOSE + fprintf(stdout, "Test message progress: ["); +#endif + } else if (total_connections + failed_connections == expected_connections) { @@ -629,8 +657,8 @@ create_topology () #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Topology set up, now starting peers!\n"); -#endif fprintf(stdout, "Daemon start progress ["); +#endif GNUNET_TESTING_daemons_continue_startup(pg); } else @@ -696,10 +724,18 @@ peers_started_callback (void *cls, * within a reasonable amount of time */ die_task = GNUNET_SCHEDULER_add_delayed (sched, GNUNET_TIME_relative_multiply - (GNUNET_TIME_UNIT_MINUTES, 5), + (GNUNET_TIME_UNIT_MINUTES, 8), &end_badly, "from peers_started_callback"); - +#if DELAY_FOR_LOGGING + fprintf(stdout, "Connecting topology in 10 seconds\n"); + gather_log_data(); + GNUNET_SCHEDULER_add_delayed (sched, + GNUNET_TIME_relative_multiply + (GNUNET_TIME_UNIT_SECONDS, 10), + &connect_topology, NULL); +#else connect_topology (); +#endif ok = 0; } } @@ -861,7 +897,9 @@ run (void *cls, peers_left = num_peers; modnum = num_peers / 4; dotnum = (num_peers / 50) + 1; +#if VERBOSE fprintf (stdout, "Hostkey generation progress: \["); +#endif /* Set up a task to end testing if peer start fails */ die_task = GNUNET_SCHEDULER_add_delayed (sched, GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, SECONDS_PER_PEER_START * num_peers),