diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-09-30 11:20:44 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-09-30 11:20:44 +0000 |
commit | 4c3512dc834a6be9da4a8a656f596da536ca67f4 (patch) | |
tree | a1e3453b754954208dca9feefa080425d9df693d /src/transport | |
parent | f85e367ddecd6f43c880cb2e266af8139472cc2b (diff) | |
download | gnunet-4c3512dc834a6be9da4a8a656f596da536ca67f4.tar.gz gnunet-4c3512dc834a6be9da4a8a656f596da536ca67f4.zip |
some diagnoses
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/test_transport_api_disconnect.c | 3 | ||||
-rw-r--r-- | src/transport/test_transport_api_reliability.c | 9 | ||||
-rw-r--r-- | src/transport/test_transport_api_unreliability.c | 12 |
3 files changed, 20 insertions, 4 deletions
diff --git a/src/transport/test_transport_api_disconnect.c b/src/transport/test_transport_api_disconnect.c index 267c56af6..3cc30d91d 100644 --- a/src/transport/test_transport_api_disconnect.c +++ b/src/transport/test_transport_api_disconnect.c | |||
@@ -64,6 +64,7 @@ static struct PeerContext p2; | |||
64 | static int ok; | 64 | static int ok; |
65 | 65 | ||
66 | static int peers_connected = 0; | 66 | static int peers_connected = 0; |
67 | |||
67 | static int counter; | 68 | static int counter; |
68 | static int msgs_recv; | 69 | static int msgs_recv; |
69 | 70 | ||
@@ -313,8 +314,6 @@ peers_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
313 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) | 314 | if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) |
314 | return; | 315 | return; |
315 | 316 | ||
316 | //while (peers_connected > 0); | ||
317 | |||
318 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from Transport \n"); | 317 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from Transport \n"); |
319 | 318 | ||
320 | GNUNET_TRANSPORT_get_hello_cancel (p2.ghh); | 319 | GNUNET_TRANSPORT_get_hello_cancel (p2.ghh); |
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c index 1b6d89afe..7f8c9ad0f 100644 --- a/src/transport/test_transport_api_reliability.c +++ b/src/transport/test_transport_api_reliability.c | |||
@@ -100,6 +100,7 @@ static int msg_recv_expected; | |||
100 | static int msg_recv; | 100 | static int msg_recv; |
101 | 101 | ||
102 | static int test_failed; | 102 | static int test_failed; |
103 | static int test_connected; | ||
103 | 104 | ||
104 | static unsigned long long total_bytes; | 105 | static unsigned long long total_bytes; |
105 | 106 | ||
@@ -150,6 +151,11 @@ end_badly () | |||
150 | die_task = GNUNET_SCHEDULER_NO_TASK; | 151 | die_task = GNUNET_SCHEDULER_NO_TASK; |
151 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); | 152 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); |
152 | 153 | ||
154 | if (test_connected == GNUNET_NO) | ||
155 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers got connected\n"); | ||
156 | else | ||
157 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers got NOT connected\n"); | ||
158 | |||
153 | if (th != NULL) | 159 | if (th != NULL) |
154 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); | 160 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); |
155 | th = NULL; | 161 | th = NULL; |
@@ -261,7 +267,7 @@ notify_ready (void *cls, size_t size, void *buf) | |||
261 | if (buf == NULL) | 267 | if (buf == NULL) |
262 | { | 268 | { |
263 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 269 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
264 | "Timeout occurred while waiting for transmit_ready\n"); | 270 | "Timeout occurred while waiting for transmit_ready for message %u of %u\n", msg_scheduled, TOTAL_MSGS); |
265 | if (GNUNET_SCHEDULER_NO_TASK != die_task) | 271 | if (GNUNET_SCHEDULER_NO_TASK != die_task) |
266 | GNUNET_SCHEDULER_cancel (die_task); | 272 | GNUNET_SCHEDULER_cancel (die_task); |
267 | die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 273 | die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
@@ -401,6 +407,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
401 | die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 407 | die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
402 | return; | 408 | return; |
403 | } | 409 | } |
410 | test_connected = GNUNET_NO; | ||
404 | 411 | ||
405 | GNUNET_TRANSPORT_TESTING_connect_peers (p1, p2, &testing_connect_cb, NULL); | 412 | GNUNET_TRANSPORT_TESTING_connect_peers (p1, p2, &testing_connect_cb, NULL); |
406 | } | 413 | } |
diff --git a/src/transport/test_transport_api_unreliability.c b/src/transport/test_transport_api_unreliability.c index 7b7ec2d35..30862424c 100644 --- a/src/transport/test_transport_api_unreliability.c +++ b/src/transport/test_transport_api_unreliability.c | |||
@@ -104,6 +104,7 @@ static int msg_sent; | |||
104 | static int msg_recv_expected; | 104 | static int msg_recv_expected; |
105 | static int msg_recv; | 105 | static int msg_recv; |
106 | 106 | ||
107 | static int test_connected; | ||
107 | static int test_failed; | 108 | static int test_failed; |
108 | 109 | ||
109 | static unsigned long long total_bytes; | 110 | static unsigned long long total_bytes; |
@@ -172,6 +173,11 @@ end_badly () | |||
172 | die_task = GNUNET_SCHEDULER_NO_TASK; | 173 | die_task = GNUNET_SCHEDULER_NO_TASK; |
173 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); | 174 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); |
174 | 175 | ||
176 | if (test_connected == GNUNET_NO) | ||
177 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers got connected\n"); | ||
178 | else | ||
179 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peers got NOT connected\n"); | ||
180 | |||
175 | if (test_failed == GNUNET_NO) | 181 | if (test_failed == GNUNET_NO) |
176 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Testcase timeout\n"); | 182 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Testcase timeout\n"); |
177 | else | 183 | else |
@@ -324,7 +330,8 @@ notify_ready (void *cls, size_t size, void *buf) | |||
324 | if (buf == NULL) | 330 | if (buf == NULL) |
325 | { | 331 | { |
326 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 332 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
327 | "Timeout occurred while waiting for transmit_ready\n"); | 333 | "Timeout occurred while waiting for transmit_ready for msg %u of %u\n", |
334 | msg_scheduled, TOTAL_MSGS); | ||
328 | if (GNUNET_SCHEDULER_NO_TASK != die_task) | 335 | if (GNUNET_SCHEDULER_NO_TASK != die_task) |
329 | GNUNET_SCHEDULER_cancel (die_task); | 336 | GNUNET_SCHEDULER_cancel (die_task); |
330 | die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); | 337 | die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); |
@@ -439,6 +446,8 @@ testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls) | |||
439 | GNUNET_i2s (&p2->id)); | 446 | GNUNET_i2s (&p2->id)); |
440 | GNUNET_free (p1_c); | 447 | GNUNET_free (p1_c); |
441 | 448 | ||
449 | test_connected = GNUNET_YES; | ||
450 | |||
442 | // FIXME: THIS IS REQUIRED! SEEMS TO BE A BUG! | 451 | // FIXME: THIS IS REQUIRED! SEEMS TO BE A BUG! |
443 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &sendtask, NULL); | 452 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &sendtask, NULL); |
444 | } | 453 | } |
@@ -465,6 +474,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
465 | return; | 474 | return; |
466 | } | 475 | } |
467 | 476 | ||
477 | test_connected = GNUNET_NO; | ||
468 | GNUNET_TRANSPORT_TESTING_connect_peers (p1, p2, &testing_connect_cb, NULL); | 478 | GNUNET_TRANSPORT_TESTING_connect_peers (p1, p2, &testing_connect_cb, NULL); |
469 | } | 479 | } |
470 | 480 | ||