aboutsummaryrefslogtreecommitdiff
path: root/src/topology
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-09-14 11:59:46 +0000
committerChristian Grothoff <christian@grothoff.org>2011-09-14 11:59:46 +0000
commit1fe79fd553e21a20206301c18568d30158c9dd46 (patch)
tree3db4e42adb872d1e8aa792643c341a14b2959736 /src/topology
parentf709218364f7d40e5a13938886514e866602715d (diff)
downloadgnunet-1fe79fd553e21a20206301c18568d30158c9dd46.tar.gz
gnunet-1fe79fd553e21a20206301c18568d30158c9dd46.zip
indentation
Diffstat (limited to 'src/topology')
-rw-r--r--src/topology/test_gnunet_daemon_topology.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/topology/test_gnunet_daemon_topology.c b/src/topology/test_gnunet_daemon_topology.c
index 6d3645f01..49990788a 100644
--- a/src/topology/test_gnunet_daemon_topology.c
+++ b/src/topology/test_gnunet_daemon_topology.c
@@ -81,14 +81,14 @@ clean_up_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
81{ 81{
82 unsigned int i; 82 unsigned int i;
83 83
84 for (i=0;i<NUM_PEERS;i++) 84 for (i = 0; i < NUM_PEERS; i++)
85 {
86 if (NULL != cc[i])
85 { 87 {
86 if (NULL != cc[i]) 88 GNUNET_TESTING_daemons_connect_cancel (cc[i]);
87 { 89 cc[i] = NULL;
88 GNUNET_TESTING_daemons_connect_cancel (cc[i]);
89 cc[i] = NULL;
90 }
91 } 90 }
91 }
92 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); 92 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
93 ok = 0; 93 ok = 0;
94} 94}
@@ -111,12 +111,12 @@ notify_connect_complete (void *cls, const struct GNUNET_PeerIdentity *first,
111 if (NULL != emsg) 111 if (NULL != emsg)
112 { 112 {
113 fprintf (stderr, "Failed to connect two peers: %s\n", emsg); 113 fprintf (stderr, "Failed to connect two peers: %s\n", emsg);
114 for (i=0;i<NUM_PEERS;i++) 114 for (i = 0; i < NUM_PEERS; i++)
115 if (NULL != cc[i]) 115 if (NULL != cc[i])
116 { 116 {
117 GNUNET_TESTING_daemons_connect_cancel (cc[i]); 117 GNUNET_TESTING_daemons_connect_cancel (cc[i]);
118 cc[i] = NULL; 118 cc[i] = NULL;
119 } 119 }
120 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); 120 GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL);
121 GNUNET_assert (0); 121 GNUNET_assert (0);
122 return; 122 return;
@@ -145,13 +145,17 @@ my_cb (void *cls, const struct GNUNET_PeerIdentity *id,
145 last = d; 145 last = d;
146 return; 146 return;
147 } 147 }
148 cc[peers_left] = GNUNET_TESTING_daemons_connect (last, d, TIMEOUT, CONNECT_ATTEMPTS, 148 cc[peers_left] =
149 GNUNET_YES, &notify_connect_complete, &cc[peers_left]); 149 GNUNET_TESTING_daemons_connect (last, d, TIMEOUT, CONNECT_ATTEMPTS,
150 GNUNET_YES, &notify_connect_complete,
151 &cc[peers_left]);
150 if (peers_left == 0) 152 if (peers_left == 0)
151 { 153 {
152 /* close circle */ 154 /* close circle */
153 cc[NUM_PEERS-1] = GNUNET_TESTING_daemons_connect (d, first, TIMEOUT, CONNECT_ATTEMPTS, 155 cc[NUM_PEERS - 1] =
154 GNUNET_YES, &notify_connect_complete, &cc[NUM_PEERS-1]); 156 GNUNET_TESTING_daemons_connect (d, first, TIMEOUT, CONNECT_ATTEMPTS,
157 GNUNET_YES, &notify_connect_complete,
158 &cc[NUM_PEERS - 1]);
155 } 159 }
156} 160}
157 161