diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-11-29 20:47:18 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-11-29 20:47:18 +0000 |
commit | 71ea5bd2d05058008e604ffd42993be9c7250e04 (patch) | |
tree | a5074671ddfaa9d1621a4182fc95a91a98b3d536 /src/transport/test_transport_api_restart_1peer.c | |
parent | b335777fd435142c16eb05e86c8a64a4b1a45447 (diff) | |
download | gnunet-71ea5bd2d05058008e604ffd42993be9c7250e04.tar.gz gnunet-71ea5bd2d05058008e604ffd42993be9c7250e04.zip |
-fixing indentation
Diffstat (limited to 'src/transport/test_transport_api_restart_1peer.c')
-rw-r--r-- | src/transport/test_transport_api_restart_1peer.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/transport/test_transport_api_restart_1peer.c b/src/transport/test_transport_api_restart_1peer.c index 87383bbac..61423a7ee 100644 --- a/src/transport/test_transport_api_restart_1peer.c +++ b/src/transport/test_transport_api_restart_1peer.c | |||
@@ -155,10 +155,12 @@ static void | |||
155 | reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 155 | reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
156 | { | 156 | { |
157 | struct PeerContext *p = cls; | 157 | struct PeerContext *p = cls; |
158 | |||
158 | reconnect_task = GNUNET_SCHEDULER_NO_TASK; | 159 | reconnect_task = GNUNET_SCHEDULER_NO_TASK; |
159 | 160 | ||
160 | GNUNET_TRANSPORT_try_connect (p->th, &p2->id); | 161 | GNUNET_TRANSPORT_try_connect (p->th, &p2->id); |
161 | reconnect_task = GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_SECONDS, &reconnect, p); | 162 | reconnect_task = |
163 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &reconnect, p); | ||
162 | } | 164 | } |
163 | 165 | ||
164 | static void | 166 | static void |
@@ -166,20 +168,17 @@ restart_cb (struct PeerContext *p, void *cls) | |||
166 | { | 168 | { |
167 | 169 | ||
168 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 170 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
169 | "Restarted peer %u (`%4s'), issuing reconnect\n", | 171 | "Restarted peer %u (`%4s'), issuing reconnect\n", p->no, |
170 | p->no, | ||
171 | GNUNET_i2s (&p->id)); | 172 | GNUNET_i2s (&p->id)); |
172 | 173 | ||
173 | reconnect_task = GNUNET_SCHEDULER_add_now(&reconnect, p); | 174 | reconnect_task = GNUNET_SCHEDULER_add_now (&reconnect, p); |
174 | } | 175 | } |
175 | 176 | ||
176 | static | 177 | static void |
177 | void restart (struct PeerContext *p , char * cfg_file) | 178 | restart (struct PeerContext *p, char *cfg_file) |
178 | { | 179 | { |
179 | GNUNET_assert (p != NULL); | 180 | GNUNET_assert (p != NULL); |
180 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 181 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Restarting peer %u (`%4s')\n", p->no, |
181 | "Restarting peer %u (`%4s')\n", | ||
182 | p->no, | ||
183 | GNUNET_i2s (&p->id)); | 182 | GNUNET_i2s (&p->id)); |
184 | GNUNET_TRANSPORT_TESTING_restart_peer (tth, p, cfg_file, &restart_cb, p); | 183 | GNUNET_TRANSPORT_TESTING_restart_peer (tth, p, cfg_file, &restart_cb, p); |
185 | return; | 184 | return; |
@@ -200,6 +199,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
200 | GNUNET_assert (t != NULL); | 199 | GNUNET_assert (t != NULL); |
201 | 200 | ||
202 | char *ps = GNUNET_strdup (GNUNET_i2s (&p->id)); | 201 | char *ps = GNUNET_strdup (GNUNET_i2s (&p->id)); |
202 | |||
203 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 203 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
204 | "Peer %u (`%4s') received message of type %d and size %u size from peer %u (`%4s')!\n", | 204 | "Peer %u (`%4s') received message of type %d and size %u size from peer %u (`%4s')!\n", |
205 | p->no, ps, ntohs (message->type), ntohs (message->size), t->no, | 205 | p->no, ps, ntohs (message->type), ntohs (message->size), t->no, |
@@ -217,8 +217,8 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
217 | } | 217 | } |
218 | else | 218 | else |
219 | { | 219 | { |
220 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 220 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
221 | "Restarted peers connected, stopping test...\n"); | 221 | "Restarted peers connected, stopping test...\n"); |
222 | ok = 0; | 222 | ok = 0; |
223 | end (); | 223 | end (); |
224 | } | 224 | } |
@@ -329,6 +329,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
329 | 329 | ||
330 | 330 | ||
331 | char *ps = GNUNET_strdup (GNUNET_i2s (&p->id)); | 331 | char *ps = GNUNET_strdup (GNUNET_i2s (&p->id)); |
332 | |||
332 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 333 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
333 | "Peer %u (`%4s'): peer (`%s') disconnected from me!\n", p->no, ps, | 334 | "Peer %u (`%4s'): peer (`%s') disconnected from me!\n", p->no, ps, |
334 | GNUNET_i2s (peer)); | 335 | GNUNET_i2s (peer)); |
@@ -368,6 +369,7 @@ start_cb (struct PeerContext *p, void *cls) | |||
368 | return; | 369 | return; |
369 | 370 | ||
370 | char *sender_c = GNUNET_strdup (GNUNET_i2s (&p1->id)); | 371 | char *sender_c = GNUNET_strdup (GNUNET_i2s (&p1->id)); |
372 | |||
371 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 373 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
372 | "Test tries to connect peer %u (`%s') -> peer %u (`%s')\n", | 374 | "Test tries to connect peer %u (`%s') -> peer %u (`%s')\n", |
373 | p1->no, sender_c, p2->no, GNUNET_i2s (&p2->id)); | 375 | p1->no, sender_c, p2->no, GNUNET_i2s (&p2->id)); |
@@ -451,8 +453,8 @@ main (int argc, char *argv[]) | |||
451 | tth = GNUNET_TRANSPORT_TESTING_init (); | 453 | tth = GNUNET_TRANSPORT_TESTING_init (); |
452 | 454 | ||
453 | 455 | ||
454 | GNUNET_asprintf(&cfg_file_p1,"test_transport_api_tcp_peer1.conf"); | 456 | GNUNET_asprintf (&cfg_file_p1, "test_transport_api_tcp_peer1.conf"); |
455 | GNUNET_asprintf(&cfg_file_p2,"test_transport_api_tcp_peer2.conf"); | 457 | GNUNET_asprintf (&cfg_file_p2, "test_transport_api_tcp_peer2.conf"); |
456 | 458 | ||
457 | 459 | ||
458 | ret = check (); | 460 | ret = check (); |