diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-18 21:45:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-18 21:45:37 +0000 |
commit | 38c6188791c21c815d4260593116698fa6b1bf4d (patch) | |
tree | f2864e5fd9a9c75ee4dce48f171fc1bcc50aa74f | |
parent | 6aea4726cc1d63e40cda30e626973b89a9bf9980 (diff) | |
download | gnunet-38c6188791c21c815d4260593116698fa6b1bf4d.tar.gz gnunet-38c6188791c21c815d4260593116698fa6b1bf4d.zip |
-style fix
-rw-r--r-- | src/dv/test_transport_dv.c | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/src/dv/test_transport_dv.c b/src/dv/test_transport_dv.c index fd55750a4..6a2cbde94 100644 --- a/src/dv/test_transport_dv.c +++ b/src/dv/test_transport_dv.c | |||
@@ -34,7 +34,10 @@ struct GNUNET_TESTBED_Operation *topology_op; | |||
34 | 34 | ||
35 | static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; | 35 | static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; |
36 | 36 | ||
37 | static void do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 37 | |
38 | static void | ||
39 | do_shutdown (void *cls, | ||
40 | const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
38 | { | 41 | { |
39 | shutdown_task = GNUNET_SCHEDULER_NO_TASK; | 42 | shutdown_task = GNUNET_SCHEDULER_NO_TASK; |
40 | if (NULL != topology_op) | 43 | if (NULL != topology_op) |
@@ -44,17 +47,25 @@ static void do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *t | |||
44 | } | 47 | } |
45 | } | 48 | } |
46 | 49 | ||
47 | static void topology_completed (void *cls, | 50 | |
48 | unsigned int nsuccess, | 51 | static void |
49 | unsigned int nfailures) | 52 | topology_completed (void *cls, |
53 | unsigned int nsuccess, | ||
54 | unsigned int nfailures) | ||
50 | { | 55 | { |
51 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Links successful %u / %u failed\n", nsuccess, nfailures); | 56 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
57 | "Links successful %u / %u failed\n", | ||
58 | nsuccess, | ||
59 | nfailures); | ||
52 | GNUNET_TESTBED_operation_done (topology_op); | 60 | GNUNET_TESTBED_operation_done (topology_op); |
53 | topology_op = NULL; | 61 | topology_op = NULL; |
54 | 62 | ||
55 | if (nfailures > 0) | 63 | if (nfailures > 0) |
56 | { | 64 | { |
57 | fprintf (stderr, "Error: links successful %u but %u failed\n", nsuccess, nfailures); | 65 | fprintf (stderr, |
66 | "Error: links successful %u but %u failed\n", | ||
67 | nsuccess, | ||
68 | nfailures); | ||
58 | ok = 1; | 69 | ok = 1; |
59 | } | 70 | } |
60 | else | 71 | else |
@@ -72,28 +83,35 @@ test_connection (void *cls, | |||
72 | unsigned int links_succeeded, | 83 | unsigned int links_succeeded, |
73 | unsigned int links_failed) | 84 | unsigned int links_failed) |
74 | { | 85 | { |
75 | shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &do_shutdown, NULL); | 86 | shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
87 | &do_shutdown, NULL); | ||
76 | if (4 != num_peers) | 88 | if (4 != num_peers) |
77 | { | 89 | { |
78 | ok = 1; | 90 | ok = 1; |
79 | fprintf (stderr, "Only %u out of 4 peers were started ...\n", | 91 | fprintf (stderr, |
80 | num_peers); | 92 | "Only %u out of 4 peers were started ...\n", |
93 | num_peers); | ||
81 | } | 94 | } |
82 | 95 | ||
83 | if (0 != links_failed) | 96 | if (0 != links_failed) |
84 | { | 97 | { |
85 | /* All peers except DV peers are connected */ | 98 | /* All peers except DV peers are connected */ |
86 | fprintf (stderr, "Testbed failed to connect peers,\n"); | 99 | fprintf (stderr, |
87 | 100 | "Testbed failed to connect peers (%u links OK, %u links failed)\n", | |
88 | topology_op = GNUNET_TESTBED_overlay_configure_topology(NULL, num_peers, peers, NULL, | 101 | links_succeeded, |
89 | &topology_completed, NULL, | 102 | links_failed); |
90 | GNUNET_TESTBED_TOPOLOGY_CLIQUE, | 103 | |
91 | GNUNET_TESTBED_TOPOLOGY_OPTION_END); | 104 | topology_op = GNUNET_TESTBED_overlay_configure_topology |
105 | (NULL, num_peers, peers, NULL, | ||
106 | &topology_completed, NULL, | ||
107 | GNUNET_TESTBED_TOPOLOGY_CLIQUE, | ||
108 | GNUNET_TESTBED_TOPOLOGY_OPTION_END); | ||
92 | return; | 109 | return; |
93 | } | 110 | } |
94 | 111 | ||
95 | ok = 1; | 112 | ok = 1; |
96 | fprintf (stderr, "Testbed connected peers, should not happen...\n"); | 113 | fprintf (stderr, |
114 | "Testbed connected peers, should not happen...\n"); | ||
97 | GNUNET_SCHEDULER_shutdown (); | 115 | GNUNET_SCHEDULER_shutdown (); |
98 | } | 116 | } |
99 | 117 | ||