diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-11-04 21:01:22 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-11-04 21:01:22 +0000 |
commit | 0e4c7cdccfc4105f9c6e529cfa0e3722104b0ddf (patch) | |
tree | ac53b9088e75b7041e14e3455698a75da085b3d7 /src/dv/test_transport_api_dv.c | |
parent | b6d09b511fbd61d3b36fde4c28624bed321bf4a1 (diff) | |
download | gnunet-0e4c7cdccfc4105f9c6e529cfa0e3722104b0ddf.tar.gz gnunet-0e4c7cdccfc4105f9c6e529cfa0e3722104b0ddf.zip |
-misc bugfixes, travel hacking
Diffstat (limited to 'src/dv/test_transport_api_dv.c')
-rw-r--r-- | src/dv/test_transport_api_dv.c | 82 |
1 files changed, 1 insertions, 81 deletions
diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c index c78d5072d..da822ca8f 100644 --- a/src/dv/test_transport_api_dv.c +++ b/src/dv/test_transport_api_dv.c | |||
@@ -25,8 +25,6 @@ | |||
25 | #include "gnunet_testing_lib.h" | 25 | #include "gnunet_testing_lib.h" |
26 | #include "gnunet_core_service.h" | 26 | #include "gnunet_core_service.h" |
27 | 27 | ||
28 | #define VERBOSE 1 | ||
29 | |||
30 | #define TEST_ALL GNUNET_NO | 28 | #define TEST_ALL GNUNET_NO |
31 | 29 | ||
32 | /** | 30 | /** |
@@ -176,17 +174,13 @@ shutdown_callback (void *cls, const char *emsg) | |||
176 | { | 174 | { |
177 | if (emsg != NULL) | 175 | if (emsg != NULL) |
178 | { | 176 | { |
179 | #if VERBOSE | ||
180 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n"); | 177 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown of peers failed!\n"); |
181 | #endif | ||
182 | if (ok == 0) | 178 | if (ok == 0) |
183 | ok = 666; | 179 | ok = 666; |
184 | } | 180 | } |
185 | else | 181 | else |
186 | { | 182 | { |
187 | #if VERBOSE | ||
188 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers successfully shut down!\n"); | 183 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers successfully shut down!\n"); |
189 | #endif | ||
190 | } | 184 | } |
191 | } | 185 | } |
192 | 186 | ||
@@ -200,10 +194,8 @@ finish_testing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
200 | struct TestMessageContext *free_pos; | 194 | struct TestMessageContext *free_pos; |
201 | 195 | ||
202 | die_task = GNUNET_SCHEDULER_NO_TASK; | 196 | die_task = GNUNET_SCHEDULER_NO_TASK; |
203 | #if VERBOSE | ||
204 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 197 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
205 | "Called finish testing, stopping daemons.\n"); | 198 | "Called finish testing, stopping daemons.\n"); |
206 | #endif | ||
207 | peer_pos = all_peers; | 199 | peer_pos = all_peers; |
208 | while (peer_pos != NULL) | 200 | while (peer_pos != NULL) |
209 | { | 201 | { |
@@ -258,20 +250,11 @@ finish_testing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
258 | } | 250 | } |
259 | GNUNET_free (free_pos); | 251 | GNUNET_free (free_pos); |
260 | } | 252 | } |
261 | #if VERBOSE | ||
262 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 253 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
263 | "transmit_ready's scheduled %d, failed %d, transmit_ready's called %d\n", | 254 | "transmit_ready's scheduled %d, failed %d, transmit_ready's called %d\n", |
264 | transmit_ready_scheduled, transmit_ready_failed, | 255 | transmit_ready_scheduled, transmit_ready_failed, |
265 | transmit_ready_called); | 256 | transmit_ready_called); |
266 | #endif | ||
267 | |||
268 | #if VERBOSE | ||
269 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling daemons_stop\n"); | ||
270 | #endif | ||
271 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); | 257 | GNUNET_TESTING_daemons_stop (pg, TIMEOUT, &shutdown_callback, NULL); |
272 | #if VERBOSE | ||
273 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "daemons_stop finished\n"); | ||
274 | #endif | ||
275 | if (dotOutFile != NULL) | 258 | if (dotOutFile != NULL) |
276 | { | 259 | { |
277 | FPRINTF (dotOutFile, "%s", "}"); | 260 | FPRINTF (dotOutFile, "%s", "}"); |
@@ -288,16 +271,12 @@ disconnect_cores (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
288 | struct TestMessageContext *pos = cls; | 271 | struct TestMessageContext *pos = cls; |
289 | 272 | ||
290 | /* Disconnect from the respective cores */ | 273 | /* Disconnect from the respective cores */ |
291 | #if VERBOSE | ||
292 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from peer 1 `%4s'\n", | 274 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from peer 1 `%4s'\n", |
293 | GNUNET_i2s (&pos->peer1->id)); | 275 | GNUNET_i2s (&pos->peer1->id)); |
294 | #endif | ||
295 | if (pos->peer1handle != NULL) | 276 | if (pos->peer1handle != NULL) |
296 | GNUNET_CORE_disconnect (pos->peer1handle); | 277 | GNUNET_CORE_disconnect (pos->peer1handle); |
297 | #if VERBOSE | ||
298 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from peer 2 `%4s'\n", | 278 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from peer 2 `%4s'\n", |
299 | GNUNET_i2s (&pos->peer2->id)); | 279 | GNUNET_i2s (&pos->peer2->id)); |
300 | #endif | ||
301 | if (pos->peer2handle != NULL) | 280 | if (pos->peer2handle != NULL) |
302 | GNUNET_CORE_disconnect (pos->peer2handle); | 281 | GNUNET_CORE_disconnect (pos->peer2handle); |
303 | /* Set handles to NULL so test case can be ended properly */ | 282 | /* Set handles to NULL so test case can be ended properly */ |
@@ -422,23 +401,17 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
422 | { | 401 | { |
423 | struct TestMessageContext *pos = cls; | 402 | struct TestMessageContext *pos = cls; |
424 | struct GNUNET_TestMessage *msg = (struct GNUNET_TestMessage *) message; | 403 | struct GNUNET_TestMessage *msg = (struct GNUNET_TestMessage *) message; |
425 | |||
426 | #if VERBOSE | ||
427 | uint32_t distance; | 404 | uint32_t distance; |
428 | #endif | 405 | |
429 | if (pos->uid != ntohl (msg->uid)) | 406 | if (pos->uid != ntohl (msg->uid)) |
430 | return GNUNET_OK; | 407 | return GNUNET_OK; |
431 | |||
432 | #if VERBOSE | ||
433 | distance = get_atsi_distance (atsi, atsi_count); | 408 | distance = get_atsi_distance (atsi, atsi_count); |
434 | #endif | ||
435 | GNUNET_assert (0 == | 409 | GNUNET_assert (0 == |
436 | memcmp (peer, &pos->peer1->id, | 410 | memcmp (peer, &pos->peer1->id, |
437 | sizeof (struct GNUNET_PeerIdentity))); | 411 | sizeof (struct GNUNET_PeerIdentity))); |
438 | if (total_other_expected_messages == 0) | 412 | if (total_other_expected_messages == 0) |
439 | { | 413 | { |
440 | total_messages_received++; | 414 | total_messages_received++; |
441 | #if VERBOSE | ||
442 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 415 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
443 | "Received message from `%4s', type %d, uid %u, distance %u.\n", | 416 | "Received message from `%4s', type %d, uid %u, distance %u.\n", |
444 | GNUNET_i2s (peer), ntohs (message->type), ntohl (msg->uid), | 417 | GNUNET_i2s (peer), ntohs (message->type), ntohl (msg->uid), |
@@ -446,12 +419,10 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
446 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 419 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
447 | "Total messages received %d, expected %d.\n", | 420 | "Total messages received %d, expected %d.\n", |
448 | total_messages_received, expected_messages); | 421 | total_messages_received, expected_messages); |
449 | #endif | ||
450 | } | 422 | } |
451 | else | 423 | else |
452 | { | 424 | { |
453 | total_other_messages++; | 425 | total_other_messages++; |
454 | #if VERBOSE | ||
455 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 426 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
456 | "Received message from `%4s', type %d, uid %u, distance %u.\n", | 427 | "Received message from `%4s', type %d, uid %u, distance %u.\n", |
457 | GNUNET_i2s (peer), ntohs (message->type), ntohl (msg->uid), | 428 | GNUNET_i2s (peer), ntohs (message->type), ntohl (msg->uid), |
@@ -459,17 +430,14 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
459 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 430 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
460 | "Total OTHER messages received %d, expected %d.\n", | 431 | "Total OTHER messages received %d, expected %d.\n", |
461 | total_other_messages, total_other_expected_messages); | 432 | total_other_messages, total_other_expected_messages); |
462 | #endif | ||
463 | } | 433 | } |
464 | 434 | ||
465 | if ((total_messages_received == expected_messages) && | 435 | if ((total_messages_received == expected_messages) && |
466 | (total_other_messages == 0)) | 436 | (total_other_messages == 0)) |
467 | { | 437 | { |
468 | GNUNET_SCHEDULER_cancel (die_task); | 438 | GNUNET_SCHEDULER_cancel (die_task); |
469 | #if VERBOSE | ||
470 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 439 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
471 | "Scheduling timeout from DV connections.\n"); | 440 | "Scheduling timeout from DV connections.\n"); |
472 | #endif | ||
473 | die_task = | 441 | die_task = |
474 | GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT, &end_badly, | 442 | GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT, &end_badly, |
475 | "waiting for DV peers to connect!"); | 443 | "waiting for DV peers to connect!"); |
@@ -500,12 +468,10 @@ transmit_ready (void *cls, size_t size, void *buf) | |||
500 | m->header.size = htons (sizeof (struct GNUNET_TestMessage)); | 468 | m->header.size = htons (sizeof (struct GNUNET_TestMessage)); |
501 | m->uid = htonl (pos->uid); | 469 | m->uid = htonl (pos->uid); |
502 | transmit_ready_called++; | 470 | transmit_ready_called++; |
503 | #if VERBOSE | ||
504 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 471 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
505 | "transmit ready for peer %s\ntransmit_ready's scheduled %d, transmit_ready's called %d\n", | 472 | "transmit ready for peer %s\ntransmit_ready's scheduled %d, transmit_ready's called %d\n", |
506 | GNUNET_i2s (&pos->peer1->id), transmit_ready_scheduled, | 473 | GNUNET_i2s (&pos->peer1->id), transmit_ready_scheduled, |
507 | transmit_ready_called); | 474 | transmit_ready_called); |
508 | #endif | ||
509 | return sizeof (struct GNUNET_TestMessage); | 475 | return sizeof (struct GNUNET_TestMessage); |
510 | } | 476 | } |
511 | 477 | ||
@@ -537,11 +503,9 @@ connect_notify_peer2 (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
537 | 503 | ||
538 | if (0 == memcmp (&pos->peer1->id, peer, sizeof (struct GNUNET_PeerIdentity))) | 504 | if (0 == memcmp (&pos->peer1->id, peer, sizeof (struct GNUNET_PeerIdentity))) |
539 | { | 505 | { |
540 | #if VERBOSE | ||
541 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 506 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
542 | "Core connection from `%s' to `%4s' verfied, sending message!\n", | 507 | "Core connection from `%s' to `%4s' verfied, sending message!\n", |
543 | GNUNET_i2s (&pos->peer2->id), GNUNET_h2s (&peer->hashPubKey)); | 508 | GNUNET_i2s (&pos->peer2->id), GNUNET_h2s (&peer->hashPubKey)); |
544 | #endif | ||
545 | if (NULL == | 509 | if (NULL == |
546 | GNUNET_CORE_notify_transmit_ready (pos->peer1handle, GNUNET_YES, 0, | 510 | GNUNET_CORE_notify_transmit_ready (pos->peer1handle, GNUNET_YES, 0, |
547 | TIMEOUT, &pos->peer2->id, | 511 | TIMEOUT, &pos->peer2->id, |
@@ -566,11 +530,9 @@ static void | |||
566 | init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server, | 530 | init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server, |
567 | const struct GNUNET_PeerIdentity *my_identity) | 531 | const struct GNUNET_PeerIdentity *my_identity) |
568 | { | 532 | { |
569 | #if VERBOSE | ||
570 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 533 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
571 | "Core connection to `%4s' established, awaiting connections.\n", | 534 | "Core connection to `%4s' established, awaiting connections.\n", |
572 | GNUNET_i2s (my_identity)); | 535 | GNUNET_i2s (my_identity)); |
573 | #endif | ||
574 | total_server_connections++; | 536 | total_server_connections++; |
575 | } | 537 | } |
576 | 538 | ||
@@ -592,11 +554,9 @@ connect_notify_peer1 (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
592 | 554 | ||
593 | if (0 == memcmp (&pos->peer2->id, peer, sizeof (struct GNUNET_PeerIdentity))) | 555 | if (0 == memcmp (&pos->peer2->id, peer, sizeof (struct GNUNET_PeerIdentity))) |
594 | { | 556 | { |
595 | #if VERBOSE | ||
596 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 557 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
597 | "Core connection from `%s' to `%4s' verified.\n", | 558 | "Core connection from `%s' to `%4s' verified.\n", |
598 | GNUNET_i2s (&pos->peer1->id), GNUNET_h2s (&peer->hashPubKey)); | 559 | GNUNET_i2s (&pos->peer1->id), GNUNET_h2s (&peer->hashPubKey)); |
599 | #endif | ||
600 | /* | 560 | /* |
601 | * Connect to the receiving peer | 561 | * Connect to the receiving peer |
602 | */ | 562 | */ |
@@ -612,11 +572,9 @@ init_notify_peer1 (void *cls, struct GNUNET_CORE_Handle *server, | |||
612 | const struct GNUNET_PeerIdentity *my_identity) | 572 | const struct GNUNET_PeerIdentity *my_identity) |
613 | { | 573 | { |
614 | total_server_connections++; | 574 | total_server_connections++; |
615 | #if VERBOSE | ||
616 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 575 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
617 | "Core connection to `%4s' established, awaiting connections...\n", | 576 | "Core connection to `%4s' established, awaiting connections...\n", |
618 | GNUNET_i2s (my_identity)); | 577 | GNUNET_i2s (my_identity)); |
619 | #endif | ||
620 | } | 578 | } |
621 | 579 | ||
622 | 580 | ||
@@ -642,11 +600,9 @@ send_test_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
642 | &send_test_messages, pos); | 600 | &send_test_messages, pos); |
643 | return; /* Otherwise we'll double schedule messages here! */ | 601 | return; /* Otherwise we'll double schedule messages here! */ |
644 | } | 602 | } |
645 | #if VERBOSE | ||
646 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 603 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
647 | "Attempting to send test message from %s to %s\n", | 604 | "Attempting to send test message from %s to %s\n", |
648 | pos->peer1->shortname, pos->peer2->shortname); | 605 | pos->peer1->shortname, pos->peer2->shortname); |
649 | #endif | ||
650 | /* | 606 | /* |
651 | * Connect to the sending peer | 607 | * Connect to the sending peer |
652 | */ | 608 | */ |
@@ -739,12 +695,9 @@ send_other_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
739 | GNUNET_SCHEDULER_add_now (&end_badly, | 695 | GNUNET_SCHEDULER_add_now (&end_badly, |
740 | "send_other_messages had 0 messages to send, no DV connections made!"); | 696 | "send_other_messages had 0 messages to send, no DV connections made!"); |
741 | } | 697 | } |
742 | #if VERBOSE | ||
743 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 698 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
744 | "Preparing to send %d other test messages\n", | 699 | "Preparing to send %d other test messages\n", |
745 | total_other_expected_messages); | 700 | total_other_expected_messages); |
746 | #endif | ||
747 | |||
748 | GNUNET_SCHEDULER_add_now (&send_test_messages, other_test_messages); | 701 | GNUNET_SCHEDULER_add_now (&send_test_messages, other_test_messages); |
749 | if (GNUNET_SCHEDULER_NO_TASK != die_task) | 702 | if (GNUNET_SCHEDULER_NO_TASK != die_task) |
750 | GNUNET_SCHEDULER_cancel (die_task); | 703 | GNUNET_SCHEDULER_cancel (die_task); |
@@ -768,11 +721,9 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
768 | if (emsg == NULL) | 721 | if (emsg == NULL) |
769 | { | 722 | { |
770 | total_connections++; | 723 | total_connections++; |
771 | #if VERBOSE | ||
772 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 724 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
773 | "connected peer %s to peer %s, distance %u\n", | 725 | "connected peer %s to peer %s, distance %u\n", |
774 | first_daemon->shortname, second_daemon->shortname, distance); | 726 | first_daemon->shortname, second_daemon->shortname, distance); |
775 | #endif | ||
776 | temp_context = GNUNET_malloc (sizeof (struct TestMessageContext)); | 727 | temp_context = GNUNET_malloc (sizeof (struct TestMessageContext)); |
777 | temp_context->peer1 = first_daemon; | 728 | temp_context->peer1 = first_daemon; |
778 | temp_context->peer2 = second_daemon; | 729 | temp_context->peer2 = second_daemon; |
@@ -782,7 +733,6 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
782 | test_messages = temp_context; | 733 | test_messages = temp_context; |
783 | expected_messages++; | 734 | expected_messages++; |
784 | } | 735 | } |
785 | #if VERBOSE | ||
786 | else | 736 | else |
787 | { | 737 | { |
788 | failed_connections++; | 738 | failed_connections++; |
@@ -790,15 +740,12 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
790 | "Failed to connect peer %s to peer %s with error :\n%s\n", | 740 | "Failed to connect peer %s to peer %s with error :\n%s\n", |
791 | first_daemon->shortname, second_daemon->shortname, emsg); | 741 | first_daemon->shortname, second_daemon->shortname, emsg); |
792 | } | 742 | } |
793 | #endif | ||
794 | 743 | ||
795 | if (total_connections == expected_connections) | 744 | if (total_connections == expected_connections) |
796 | { | 745 | { |
797 | #if VERBOSE | ||
798 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 746 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
799 | "Created %u total connections, which is our target number! Calling send messages.\n", | 747 | "Created %u total connections, which is our target number! Calling send messages.\n", |
800 | total_connections); | 748 | total_connections); |
801 | #endif | ||
802 | if (GNUNET_SCHEDULER_NO_TASK != die_task) | 749 | if (GNUNET_SCHEDULER_NO_TASK != die_task) |
803 | GNUNET_SCHEDULER_cancel (die_task); | 750 | GNUNET_SCHEDULER_cancel (die_task); |
804 | die_task = GNUNET_SCHEDULER_NO_TASK; | 751 | die_task = GNUNET_SCHEDULER_NO_TASK; |
@@ -825,13 +772,11 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
825 | } | 772 | } |
826 | else | 773 | else |
827 | { | 774 | { |
828 | #if VERBOSE | ||
829 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 775 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
830 | "Have %d total connections, %d failed connections, Want %d (at least %d)\n", | 776 | "Have %d total connections, %d failed connections, Want %d (at least %d)\n", |
831 | total_connections, failed_connections, expected_connections, | 777 | total_connections, failed_connections, expected_connections, |
832 | expected_connections - | 778 | expected_connections - |
833 | (unsigned int) (fail_percentage * expected_connections)); | 779 | (unsigned int) (fail_percentage * expected_connections)); |
834 | #endif | ||
835 | } | 780 | } |
836 | } | 781 | } |
837 | 782 | ||
@@ -864,12 +809,9 @@ all_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
864 | second_shortname = GNUNET_strdup (GNUNET_i2s (peer)); | 809 | second_shortname = GNUNET_strdup (GNUNET_i2s (peer)); |
865 | distance = get_atsi_distance (atsi, atsi_count); | 810 | distance = get_atsi_distance (atsi, atsi_count); |
866 | 811 | ||
867 | #if VERBOSE | ||
868 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 812 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
869 | "connected peer %s to peer %s, distance %u\n", d->shortname, | 813 | "connected peer %s to peer %s, distance %u\n", d->shortname, |
870 | second_shortname, distance); | 814 | second_shortname, distance); |
871 | #endif | ||
872 | |||
873 | second_daemon = | 815 | second_daemon = |
874 | GNUNET_CONTAINER_multihashmap_get (peer_daemon_hash, &peer->hashPubKey); | 816 | GNUNET_CONTAINER_multihashmap_get (peer_daemon_hash, &peer->hashPubKey); |
875 | 817 | ||
@@ -933,10 +875,8 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
933 | return; | 875 | return; |
934 | } | 876 | } |
935 | GNUNET_assert (id != NULL); | 877 | GNUNET_assert (id != NULL); |
936 | #if VERBOSE | ||
937 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started daemon %llu out of %llu\n", | 878 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Started daemon %llu out of %llu\n", |
938 | (num_peers - peers_left) + 1, num_peers); | 879 | (num_peers - peers_left) + 1, num_peers); |
939 | #endif | ||
940 | GNUNET_assert (GNUNET_SYSERR != | 880 | GNUNET_assert (GNUNET_SYSERR != |
941 | GNUNET_CONTAINER_multihashmap_put (peer_daemon_hash, | 881 | GNUNET_CONTAINER_multihashmap_put (peer_daemon_hash, |
942 | &id->hashPubKey, d, | 882 | &id->hashPubKey, d, |
@@ -953,10 +893,8 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
953 | 893 | ||
954 | if (peers_left == 0) | 894 | if (peers_left == 0) |
955 | { | 895 | { |
956 | #if VERBOSE | ||
957 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 896 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
958 | "All %d daemons started, now creating topology!\n", num_peers); | 897 | "All %d daemons started, now creating topology!\n", num_peers); |
959 | #endif | ||
960 | GNUNET_SCHEDULER_cancel (die_task); | 898 | GNUNET_SCHEDULER_cancel (die_task); |
961 | die_task = GNUNET_SCHEDULER_NO_TASK; | 899 | die_task = GNUNET_SCHEDULER_NO_TASK; |
962 | expected_connections = -1; | 900 | expected_connections = -1; |
@@ -967,10 +905,8 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
967 | connect_topology_option, | 905 | connect_topology_option, |
968 | connect_topology_option_modifier, | 906 | connect_topology_option_modifier, |
969 | TIMEOUT, 12, NULL, NULL); | 907 | TIMEOUT, 12, NULL, NULL); |
970 | #if VERBOSE | ||
971 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Have %d expected connections\n", | 908 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Have %d expected connections\n", |
972 | expected_connections); | 909 | expected_connections); |
973 | #endif | ||
974 | } | 910 | } |
975 | 911 | ||
976 | if (expected_connections == GNUNET_SYSERR) | 912 | if (expected_connections == GNUNET_SYSERR) |
@@ -1009,17 +945,13 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
1009 | "Hostkey callback received error: %s\n", emsg); | 945 | "Hostkey callback received error: %s\n", emsg); |
1010 | } | 946 | } |
1011 | 947 | ||
1012 | #if VERBOSE | ||
1013 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostkey created for peer `%s'\n", | 948 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Hostkey created for peer `%s'\n", |
1014 | GNUNET_i2s (id)); | 949 | GNUNET_i2s (id)); |
1015 | #endif | ||
1016 | peers_left--; | 950 | peers_left--; |
1017 | if (peers_left == 0) | 951 | if (peers_left == 0) |
1018 | { | 952 | { |
1019 | #if VERBOSE | ||
1020 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 953 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1021 | "All %d hostkeys created, now creating topology!\n", num_peers); | 954 | "All %d hostkeys created, now creating topology!\n", num_peers); |
1022 | #endif | ||
1023 | if (GNUNET_SCHEDULER_NO_TASK != die_task) | 955 | if (GNUNET_SCHEDULER_NO_TASK != die_task) |
1024 | { | 956 | { |
1025 | GNUNET_SCHEDULER_cancel (die_task); | 957 | GNUNET_SCHEDULER_cancel (die_task); |
@@ -1031,10 +963,8 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
1031 | (pg, topology, blacklist_topology, | 963 | (pg, topology, blacklist_topology, |
1032 | blacklist_transports) != GNUNET_SYSERR) | 964 | blacklist_transports) != GNUNET_SYSERR) |
1033 | { | 965 | { |
1034 | #if VERBOSE | ||
1035 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 966 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1036 | "Topology set up, now starting peers!\n"); | 967 | "Topology set up, now starting peers!\n"); |
1037 | #endif | ||
1038 | GNUNET_TESTING_daemons_continue_startup (pg); | 968 | GNUNET_TESTING_daemons_continue_startup (pg); |
1039 | /* Set up task in case topology creation doesn't finish | 969 | /* Set up task in case topology creation doesn't finish |
1040 | * within a reasonable amount of time */ | 970 | * within a reasonable amount of time */ |
@@ -1070,11 +1000,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
1070 | FPRINTF (dotOutFile, "%s", "strict graph G {\n"); | 1000 | FPRINTF (dotOutFile, "%s", "strict graph G {\n"); |
1071 | } | 1001 | } |
1072 | 1002 | ||
1073 | #if VERBOSE | ||
1074 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1003 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1075 | "Starting daemons based on config file %s\n", cfgfile); | 1004 | "Starting daemons based on config file %s\n", cfgfile); |
1076 | #endif | ||
1077 | |||
1078 | if (GNUNET_YES != | 1005 | if (GNUNET_YES != |
1079 | GNUNET_CONFIGURATION_get_value_string (cfg, "paths", "servicehome", | 1006 | GNUNET_CONFIGURATION_get_value_string (cfg, "paths", "servicehome", |
1080 | &test_directory)) | 1007 | &test_directory)) |
@@ -1198,9 +1125,6 @@ check () | |||
1198 | char *const argv[] = { "test-transport-dv", | 1125 | char *const argv[] = { "test-transport-dv", |
1199 | "-c", | 1126 | "-c", |
1200 | "test_transport_dv_data.conf", | 1127 | "test_transport_dv_data.conf", |
1201 | #if VERBOSE | ||
1202 | "-L", "DEBUG", | ||
1203 | #endif | ||
1204 | NULL | 1128 | NULL |
1205 | }; | 1129 | }; |
1206 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 1130 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
@@ -1223,11 +1147,7 @@ main (int argc, char *argv[]) | |||
1223 | int ret; | 1147 | int ret; |
1224 | 1148 | ||
1225 | GNUNET_log_setup ("test-transport-dv", | 1149 | GNUNET_log_setup ("test-transport-dv", |
1226 | #if VERBOSE | ||
1227 | "DEBUG", | ||
1228 | #else | ||
1229 | "WARNING", | 1150 | "WARNING", |
1230 | #endif | ||
1231 | NULL); | 1151 | NULL); |
1232 | ret = check (); | 1152 | ret = check (); |
1233 | /** | 1153 | /** |