From 5746309cb4be2073d550ad7a6885e918631dbc38 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 15 Aug 2011 21:54:06 +0000 Subject: indentation --- src/dht/test_dht_twopeer_path_tracking.c | 74 +++++++++++++------------------- 1 file changed, 31 insertions(+), 43 deletions(-) (limited to 'src/dht/test_dht_twopeer_path_tracking.c') diff --git a/src/dht/test_dht_twopeer_path_tracking.c b/src/dht/test_dht_twopeer_path_tracking.c index ab0b1edd2..9985939ae 100644 --- a/src/dht/test_dht_twopeer_path_tracking.c +++ b/src/dht/test_dht_twopeer_path_tracking.c @@ -188,8 +188,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) * @param data pointer to the result data */ void -get_result_iterator (void *cls, - struct GNUNET_TIME_Absolute exp, +get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, const GNUNET_HashCode * key, const struct GNUNET_PeerIdentity *const *get_path, const struct GNUNET_PeerIdentity *const *put_path, @@ -262,9 +261,9 @@ static void put_finished (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { GNUNET_SCHEDULER_cancel (die_task); - die_task = GNUNET_SCHEDULER_add_delayed (GET_TIMEOUT, - &end_badly, - "waiting for get response (data not found)"); + 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); } @@ -282,13 +281,9 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) memset (data, 43, sizeof (data)); /* Insert the data at the first peer */ - GNUNET_DHT_put (peer1dht, - &key, - DEFAULT_PUT_REPLICATION, - GNUNET_DHT_RO_RECORD_ROUTE, - GNUNET_BLOCK_TYPE_TEST, - sizeof (data), data, - GNUNET_TIME_UNIT_FOREVER_ABS, + GNUNET_DHT_put (peer1dht, &key, DEFAULT_PUT_REPLICATION, + GNUNET_DHT_RO_RECORD_ROUTE, GNUNET_BLOCK_TYPE_TEST, + sizeof (data), data, GNUNET_TIME_UNIT_FOREVER_ABS, GNUNET_TIME_UNIT_FOREVER_REL, &put_finished, NULL); } @@ -302,10 +297,8 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) * failure (peers failed to connect). */ void -topology_callback (void *cls, - const struct GNUNET_PeerIdentity *first, - const struct GNUNET_PeerIdentity *second, - uint32_t distance, +topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, + const struct GNUNET_PeerIdentity *second, uint32_t distance, const struct GNUNET_CONFIGURATION_Handle *first_cfg, const struct GNUNET_CONFIGURATION_Handle *second_cfg, struct GNUNET_TESTING_Daemon *first_daemon, @@ -339,8 +332,8 @@ topology_callback (void *cls, total_connections); #endif GNUNET_SCHEDULER_cancel (die_task); - die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, - &end_badly, "from test gets"); + die_task = + GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, "from test gets"); GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 2), &do_put, NULL); @@ -367,8 +360,7 @@ topology_callback (void *cls, * @param emsg NULL if peer started, non-NULL on error */ static void -peers_started_callback (void *cls, - const struct GNUNET_PeerIdentity *id, +peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TESTING_Daemon *d, const char *emsg) { @@ -415,12 +407,10 @@ peers_started_callback (void *cls, if ((pg != NULL)) /* Sanity check */ { /* Connect peers in a "straight line" topology, return the number of expected connections */ - expected_connections = GNUNET_TESTING_connect_topology (pg, - GNUNET_TESTING_TOPOLOGY_LINE, - GNUNET_TESTING_TOPOLOGY_OPTION_ALL, - 0.0, - TIMEOUT, - 2, NULL, NULL); + expected_connections = + GNUNET_TESTING_connect_topology (pg, GNUNET_TESTING_TOPOLOGY_LINE, + GNUNET_TESTING_TOPOLOGY_OPTION_ALL, + 0.0, TIMEOUT, 2, NULL, NULL); } /* Cancel current timeout fail task */ @@ -431,17 +421,16 @@ peers_started_callback (void *cls, "from connect topology (bad return)"); /* Schedule timeout on failure task */ - die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, - &end_badly, - "from connect topology (timeout)"); + die_task = + GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, + "from connect topology (timeout)"); ok = 0; } } static void -run (void *cls, - char *const *args, - const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) +run (void *cls, char *const *args, const char *cfgfile, + const struct GNUNET_CONFIGURATION_Handle *cfg) { /* Get path from configuration file */ @@ -463,20 +452,18 @@ run (void *cls, peers_left = num_peers; /* Set up a task to end testing if peer start fails */ - die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, - &end_badly, - "didn't start all daemons in reasonable amount of time!!!"); + die_task = + GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, + "didn't start all daemons in reasonable amount of time!!!"); /* Start num_peers peers, call peers_started_callback on peer start, topology_callback on peer connect */ /* Read the API documentation for other parameters! */ pg = GNUNET_TESTING_daemons_start (cfg, peers_left, /* Total number of peers */ peers_left, /* Number of outstanding connections */ peers_left, /* Number of parallel ssh connections, or peers being started at once */ - TIMEOUT, - NULL, - NULL, - &peers_started_callback, - NULL, &topology_callback, NULL, NULL); + TIMEOUT, NULL, NULL, + &peers_started_callback, NULL, + &topology_callback, NULL, NULL); } @@ -498,9 +485,10 @@ check () GNUNET_GETOPT_OPTION_END }; /* Run the run function as a new program */ - ret = GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, - argv, "test-dht-twopeer-put-get", "nohelp", - options, &run, &ok); + ret = + GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, + "test-dht-twopeer-put-get", "nohelp", options, &run, + &ok); if (ret != GNUNET_OK) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, -- cgit v1.2.3