aboutsummaryrefslogtreecommitdiff
path: root/doc/testbed_test.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-06 20:55:28 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-06 20:55:28 +0000
commit61c39c60565b386e0e12ea669556b030e8cd7180 (patch)
tree59109aeab8297bdc996faca8c4e38ec7426c36cf /doc/testbed_test.c
parent780eb09dd8040ecf8649d40ddf8314464e0fc48e (diff)
downloadgnunet-61c39c60565b386e0e12ea669556b030e8cd7180.tar.gz
gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.zip
-remove trailing whitespace
Diffstat (limited to 'doc/testbed_test.c')
-rw-r--r--doc/testbed_test.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/doc/testbed_test.c b/doc/testbed_test.c
index d6ab1aa1b..bdda338b0 100644
--- a/doc/testbed_test.c
+++ b/doc/testbed_test.c
@@ -36,12 +36,12 @@ static int result;
36 * Function run on CTRL-C or shutdown (i.e. success/timeout/etc.). 36 * Function run on CTRL-C or shutdown (i.e. success/timeout/etc.).
37 * Cleans up. 37 * Cleans up.
38 */ 38 */
39static void 39static void
40shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 40shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
41{ 41{
42 shutdown_tid = GNUNET_SCHEDULER_NO_TASK; 42 shutdown_tid = GNUNET_SCHEDULER_NO_TASK;
43 if (NULL != dht_op) 43 if (NULL != dht_op)
44 { 44 {
45 GNUNET_TESTBED_operation_done (dht_op); /* indirectly calls the dht_da() for closing 45 GNUNET_TESTBED_operation_done (dht_op); /* indirectly calls the dht_da() for closing
46 down the connection to the DHT */ 46 down the connection to the DHT */
47 dht_op = NULL; 47 dht_op = NULL;
@@ -68,15 +68,15 @@ service_connect_comp (void *cls,
68 struct GNUNET_TESTBED_Operation *op, 68 struct GNUNET_TESTBED_Operation *op,
69 void *ca_result, 69 void *ca_result,
70 const char *emsg) 70 const char *emsg)
71{ 71{
72 GNUNET_assert (op == dht_op); 72 GNUNET_assert (op == dht_op);
73 dht_handle = ca_result; 73 dht_handle = ca_result;
74 /* Service to DHT successful; here we'd usually do something 74 /* Service to DHT successful; here we'd usually do something
75 with the DHT (ok, if successful) */ 75 with the DHT (ok, if successful) */
76 76
77 /* for now, just indiscriminately terminate after 10s */ 77 /* for now, just indiscriminately terminate after 10s */
78 GNUNET_SCHEDULER_cancel (shutdown_tid); 78 GNUNET_SCHEDULER_cancel (shutdown_tid);
79 shutdown_tid = GNUNET_SCHEDULER_add_delayed 79 shutdown_tid = GNUNET_SCHEDULER_add_delayed
80 (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10), 80 (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10),
81 &shutdown_task, NULL); 81 &shutdown_task, NULL);
82} 82}
@@ -102,7 +102,7 @@ dht_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg)
102 struct MyContext *ctxt = cls; 102 struct MyContext *ctxt = cls;
103 103
104 /* Use the provided configuration to connect to service */ 104 /* Use the provided configuration to connect to service */
105 dht_handle = GNUNET_DHT_connect (cfg, ctxt->ht_len); 105 dht_handle = GNUNET_DHT_connect (cfg, ctxt->ht_len);
106 return dht_handle; 106 return dht_handle;
107} 107}
108 108
@@ -114,12 +114,12 @@ dht_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg)
114 * @param cls closure 114 * @param cls closure
115 * @param op_result whatever we returned from 'dht_ca' 115 * @param op_result whatever we returned from 'dht_ca'
116 */ 116 */
117static void 117static void
118dht_da (void *cls, void *op_result) 118dht_da (void *cls, void *op_result)
119{ 119{
120 struct MyContext *ctxt = cls; 120 struct MyContext *ctxt = cls;
121 121
122 /* Disconnect from DHT service */ 122 /* Disconnect from DHT service */
123 GNUNET_DHT_disconnect ((struct GNUNET_DHT_Handle *) op_result); 123 GNUNET_DHT_disconnect ((struct GNUNET_DHT_Handle *) op_result);
124 dht_handle = NULL; 124 dht_handle = NULL;
125} 125}
@@ -138,7 +138,7 @@ dht_da (void *cls, void *op_result)
138 * @param links_failed number of links testbed was unable to establish 138 * @param links_failed number of links testbed was unable to establish
139 */ 139 */
140static void 140static void
141test_master (void *cls, 141test_master (void *cls,
142 struct GNUNET_TESTBED_RunHandle *h, 142 struct GNUNET_TESTBED_RunHandle *h,
143 unsigned int num_peers, 143 unsigned int num_peers,
144 struct GNUNET_TESTBED_Peer **peers, 144 struct GNUNET_TESTBED_Peer **peers,
@@ -152,7 +152,7 @@ test_master (void *cls,
152 ctxt.ht_len = 10; 152 ctxt.ht_len = 10;
153 153
154 /* connect to a peers service */ 154 /* connect to a peers service */
155 dht_op = GNUNET_TESTBED_service_connect 155 dht_op = GNUNET_TESTBED_service_connect
156 (NULL, /* Closure for operation */ 156 (NULL, /* Closure for operation */
157 peers[0], /* The peer whose service to connect to */ 157 peers[0], /* The peer whose service to connect to */
158 "dht", /* The name of the service */ 158 "dht", /* The name of the service */
@@ -175,7 +175,7 @@ main (int argc, char **argv)
175 int ret; 175 int ret;
176 176
177 result = GNUNET_SYSERR; 177 result = GNUNET_SYSERR;
178 ret = GNUNET_TESTBED_test_run 178 ret = GNUNET_TESTBED_test_run
179 ("awesome-test", /* test case name */ 179 ("awesome-test", /* test case name */
180 "template.conf", /* template configuration */ 180 "template.conf", /* template configuration */
181 NUM_PEERS, /* number of peers to start */ 181 NUM_PEERS, /* number of peers to start */