From: Christian Grothoff Date: Wed, 28 Sep 2011 07:52:34 +0000 (+0000) Subject: cleanup X-Git-Tag: initial-import-from-subversion-38251~16901 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=aa01c9decb353071619a1186004135bbea392f39;p=oweals%2Fgnunet.git cleanup --- diff --git a/src/dht/gnunet-service-dht.h b/src/dht/gnunet-service-dht.h index 7cacdba7a..2877a156b 100644 --- a/src/dht/gnunet-service-dht.h +++ b/src/dht/gnunet-service-dht.h @@ -35,7 +35,6 @@ */ extern const struct GNUNET_CONFIGURATION_Handle *GDS_cfg; - /** * Our handle to the BLOCK library. */ diff --git a/src/dht/test_dht_multipeer.c b/src/dht/test_dht_multipeer.c index acc9b1652..8133c7576 100644 --- a/src/dht/test_dht_multipeer.c +++ b/src/dht/test_dht_multipeer.c @@ -28,7 +28,7 @@ #include "gnunet_dht_service.h" /* DEFINES */ -#define VERBOSE GNUNET_NO +#define VERBOSE GNUNET_YES /* Timeout for entire testcase */ #define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_MINUTES, 5) @@ -549,8 +549,8 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_FOREVER_REL, &put_finished, test_put); test_put->disconnect_task = - GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_get_forever (), - &put_disconnect_task, test_put); + GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, + &put_disconnect_task, test_put); GNUNET_SCHEDULER_add_now (&do_put, test_put->next); } @@ -609,7 +609,7 @@ setup_puts_and_gets (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) * The emsg variable is NULL on success (peers connected), and non-NULL on * failure (peers failed to connect). */ -void +static void topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, const struct GNUNET_PeerIdentity *second, uint32_t distance, const struct GNUNET_CONFIGURATION_Handle *first_cfg, @@ -752,7 +752,7 @@ create_topology () * @param d the daemon handle (pretty useless at this point, remove?) * @param emsg non-null on failure */ -void +static void hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, struct GNUNET_TESTING_Daemon *d, const char *emsg) { diff --git a/src/dht/test_dht_twopeer_path_tracking.c b/src/dht/test_dht_twopeer_path_tracking.c index e88b7c8e9..5be36c4a1 100644 --- a/src/dht/test_dht_twopeer_path_tracking.c +++ b/src/dht/test_dht_twopeer_path_tracking.c @@ -187,7 +187,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) * @param size number of bytes in data * @param data pointer to the result data */ -void +static void get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, const GNUNET_HashCode * key, const struct GNUNET_PeerIdentity *get_path, @@ -239,21 +239,6 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, GNUNET_SCHEDULER_add_now (&finish_testing, NULL); } -/** - * Start the GET request for the same key/data that was inserted. - */ -static void -do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) -{ - GNUNET_HashCode key; /* Key for data lookup */ - - memset (&key, 42, sizeof (GNUNET_HashCode)); /* Set the key to the same thing as when data was inserted */ - global_get_handle = - GNUNET_DHT_get_start (peer2dht, GNUNET_TIME_relative_get_forever (), - GNUNET_BLOCK_TYPE_TEST, &key, - 1, GNUNET_DHT_RO_RECORD_ROUTE, - NULL, 0, &get_result_iterator, NULL); -} /** * Called when the PUT request has been transmitted to the DHT service. @@ -262,12 +247,18 @@ do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void put_finished (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { + GNUNET_HashCode key; /* Key for data lookup */ + GNUNET_SCHEDULER_cancel (die_task); die_task = GNUNET_SCHEDULER_add_delayed (GET_TIMEOUT, &end_badly, "waiting for get response (data not found)"); - GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply - (GNUNET_TIME_UNIT_SECONDS, 10), &do_get, NULL); + memset (&key, 42, sizeof (GNUNET_HashCode)); /* Set the key to the same thing as when data was inserted */ + global_get_handle = + GNUNET_DHT_get_start (peer2dht, GNUNET_TIME_relative_get_forever (), + GNUNET_BLOCK_TYPE_TEST, &key, + 1, GNUNET_DHT_RO_RECORD_ROUTE, + NULL, 0, &get_result_iterator, NULL); } /** @@ -298,7 +289,7 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) * The emsg variable is NULL on success (peers connected), and non-NULL on * failure (peers failed to connect). */ -void +static void topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, const struct GNUNET_PeerIdentity *second, uint32_t distance, const struct GNUNET_CONFIGURATION_Handle *first_cfg,