diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:54:06 +0000 |
commit | 5746309cb4be2073d550ad7a6885e918631dbc38 (patch) | |
tree | 89455bc4aadf977816b38df13f990372cd81d71a /src/testing/testing_peergroup.c | |
parent | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff) | |
download | gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip |
indentation
Diffstat (limited to 'src/testing/testing_peergroup.c')
-rw-r--r-- | src/testing/testing_peergroup.c | 221 |
1 files changed, 107 insertions, 114 deletions
diff --git a/src/testing/testing_peergroup.c b/src/testing/testing_peergroup.c index e81e9fad8..a76c7cc26 100644 --- a/src/testing/testing_peergroup.c +++ b/src/testing/testing_peergroup.c | |||
@@ -203,8 +203,8 @@ update_meter (struct ProgressMeter *meter) | |||
203 | fprintf (stdout, "%sProgress: [0%%", meter->startup_string); | 203 | fprintf (stdout, "%sProgress: [0%%", meter->startup_string); |
204 | } | 204 | } |
205 | else | 205 | else |
206 | fprintf (stdout, "%d%%", (int) (((float) meter->completed | 206 | fprintf (stdout, "%d%%", |
207 | / meter->total) * 100)); | 207 | (int) (((float) meter->completed / meter->total) * 100)); |
208 | } | 208 | } |
209 | else if (meter->completed % meter->dotnum == 0) | 209 | else if (meter->completed % meter->dotnum == 0) |
210 | fprintf (stdout, "."); | 210 | fprintf (stdout, "."); |
@@ -304,8 +304,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
304 | * failure (peers failed to connect). | 304 | * failure (peers failed to connect). |
305 | */ | 305 | */ |
306 | static void | 306 | static void |
307 | internal_topology_callback (void *cls, | 307 | internal_topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, |
308 | const struct GNUNET_PeerIdentity *first, | ||
309 | const struct GNUNET_PeerIdentity *second, | 308 | const struct GNUNET_PeerIdentity *second, |
310 | uint32_t distance, | 309 | uint32_t distance, |
311 | const struct GNUNET_CONFIGURATION_Handle *first_cfg, | 310 | const struct GNUNET_CONFIGURATION_Handle *first_cfg, |
@@ -332,9 +331,9 @@ internal_topology_callback (void *cls, | |||
332 | #endif | 331 | #endif |
333 | 332 | ||
334 | #if TIMING | 333 | #if TIMING |
335 | if (GNUNET_TIME_absolute_get_difference (connect_last_time, | 334 | if (GNUNET_TIME_absolute_get_difference |
336 | GNUNET_TIME_absolute_get | 335 | (connect_last_time, |
337 | ()).rel_value > | 336 | GNUNET_TIME_absolute_get ()).rel_value > |
338 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, | 337 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, |
339 | CONN_UPDATE_DURATION).rel_value) | 338 | CONN_UPDATE_DURATION).rel_value) |
340 | { | 339 | { |
@@ -345,14 +344,14 @@ internal_topology_callback (void *cls, | |||
345 | new_failed_connections = failed_connections - previous_failed_connections; | 344 | new_failed_connections = failed_connections - previous_failed_connections; |
346 | 345 | ||
347 | /* Get duration in seconds */ | 346 | /* Get duration in seconds */ |
348 | duration | 347 | duration = |
349 | = GNUNET_TIME_absolute_get_difference (connect_last_time, | 348 | GNUNET_TIME_absolute_get_difference (connect_last_time, |
350 | GNUNET_TIME_absolute_get | 349 | GNUNET_TIME_absolute_get ()). |
351 | ()).rel_value / 1000; | 350 | rel_value / 1000; |
352 | total_duration = | 351 | total_duration = |
353 | GNUNET_TIME_absolute_get_difference (connect_start_time, | 352 | GNUNET_TIME_absolute_get_difference (connect_start_time, |
354 | GNUNET_TIME_absolute_get | 353 | GNUNET_TIME_absolute_get ()). |
355 | ()).rel_value / 1000; | 354 | rel_value / 1000; |
356 | 355 | ||
357 | failed_conns_per_sec_recent = (double) new_failed_connections / duration; | 356 | failed_conns_per_sec_recent = (double) new_failed_connections / duration; |
358 | failed_conns_per_sec_total = (double) failed_connections / total_duration; | 357 | failed_conns_per_sec_total = (double) failed_connections / total_duration; |
@@ -360,9 +359,8 @@ internal_topology_callback (void *cls, | |||
360 | conns_per_sec_total = (double) total_connections / total_duration; | 359 | conns_per_sec_total = (double) total_connections / total_duration; |
361 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 360 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
362 | "Recent: %.2f/s, Total: %.2f/s, Recent failed: %.2f/s, total failed %.2f/s\n", | 361 | "Recent: %.2f/s, Total: %.2f/s, Recent failed: %.2f/s, total failed %.2f/s\n", |
363 | conns_per_sec_recent, CONN_UPDATE_DURATION, | 362 | conns_per_sec_recent, CONN_UPDATE_DURATION, conns_per_sec_total, |
364 | conns_per_sec_total, failed_conns_per_sec_recent, | 363 | failed_conns_per_sec_recent, failed_conns_per_sec_total); |
365 | failed_conns_per_sec_total); | ||
366 | connect_last_time = GNUNET_TIME_absolute_get (); | 364 | connect_last_time = GNUNET_TIME_absolute_get (); |
367 | previous_connections = total_connections; | 365 | previous_connections = total_connections; |
368 | previous_failed_connections = failed_connections; | 366 | previous_failed_connections = failed_connections; |
@@ -410,11 +408,9 @@ internal_topology_callback (void *cls, | |||
410 | 408 | ||
411 | GNUNET_assert (pg_start_ctx->connect_meter != NULL); | 409 | GNUNET_assert (pg_start_ctx->connect_meter != NULL); |
412 | if (pg_start_ctx->connect_cb != NULL) | 410 | if (pg_start_ctx->connect_cb != NULL) |
413 | pg_start_ctx->connect_cb (pg_start_ctx->cls, first, | 411 | pg_start_ctx->connect_cb (pg_start_ctx->cls, first, second, distance, |
414 | second, | 412 | first_cfg, second_cfg, first_daemon, |
415 | distance, | 413 | second_daemon, emsg); |
416 | first_cfg, | ||
417 | second_cfg, first_daemon, second_daemon, emsg); | ||
418 | if (GNUNET_YES == update_meter (pg_start_ctx->connect_meter)) | 414 | if (GNUNET_YES == update_meter (pg_start_ctx->connect_meter)) |
419 | { | 415 | { |
420 | #if VERBOSE | 416 | #if VERBOSE |
@@ -424,10 +420,10 @@ internal_topology_callback (void *cls, | |||
424 | #endif | 420 | #endif |
425 | 421 | ||
426 | #if TIMING | 422 | #if TIMING |
427 | total_duration | 423 | total_duration = |
428 | = GNUNET_TIME_absolute_get_difference (connect_start_time, | 424 | GNUNET_TIME_absolute_get_difference (connect_start_time, |
429 | GNUNET_TIME_absolute_get | 425 | GNUNET_TIME_absolute_get ()). |
430 | ()).rel_value / 1000; | 426 | rel_value / 1000; |
431 | failed_conns_per_sec_total = (double) failed_connections / total_duration; | 427 | failed_conns_per_sec_total = (double) failed_connections / total_duration; |
432 | conns_per_sec_total = (double) total_connections / total_duration; | 428 | conns_per_sec_total = (double) total_connections / total_duration; |
433 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 429 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -494,20 +490,21 @@ internal_peers_started_callback (void *cls, | |||
494 | if ((pg_start_ctx->pg != NULL) && (pg_start_ctx->peers_left == 0)) | 490 | if ((pg_start_ctx->pg != NULL) && (pg_start_ctx->peers_left == 0)) |
495 | { | 491 | { |
496 | pg_start_ctx->connect_start_time = GNUNET_TIME_absolute_get (); | 492 | pg_start_ctx->connect_start_time = GNUNET_TIME_absolute_get (); |
497 | pg_start_ctx->expected_connections | 493 | pg_start_ctx->expected_connections = |
498 | = GNUNET_TESTING_connect_topology (pg_start_ctx->pg, | 494 | GNUNET_TESTING_connect_topology (pg_start_ctx->pg, |
499 | pg_start_ctx->connect_topology, | 495 | pg_start_ctx->connect_topology, |
500 | pg_start_ctx->connect_topology_option, | 496 | pg_start_ctx-> |
501 | pg_start_ctx->connect_topology_option_modifier, | 497 | connect_topology_option, |
502 | DEFAULT_CONNECT_TIMEOUT, | 498 | pg_start_ctx-> |
503 | pg_start_ctx->connect_attempts, | 499 | connect_topology_option_modifier, |
504 | NULL, NULL); | 500 | DEFAULT_CONNECT_TIMEOUT, |
505 | 501 | pg_start_ctx->connect_attempts, NULL, | |
506 | pg_start_ctx->connect_meter | 502 | NULL); |
507 | = create_meter (pg_start_ctx->expected_connections, | 503 | |
508 | "Peer connection ", pg_start_ctx->verbose); | 504 | pg_start_ctx->connect_meter = |
509 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 505 | create_meter (pg_start_ctx->expected_connections, "Peer connection ", |
510 | "Have %d expected connections\n", | 506 | pg_start_ctx->verbose); |
507 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Have %d expected connections\n", | ||
511 | pg_start_ctx->expected_connections); | 508 | pg_start_ctx->expected_connections); |
512 | } | 509 | } |
513 | 510 | ||
@@ -553,8 +550,8 @@ internal_hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
553 | 550 | ||
554 | #if VERBOSE > 1 | 551 | #if VERBOSE > 1 |
555 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 552 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
556 | "Hostkey (%d/%d) created for peer `%s'\n", | 553 | "Hostkey (%d/%d) created for peer `%s'\n", num_peers - peers_left, |
557 | num_peers - peers_left, num_peers, GNUNET_i2s (id)); | 554 | num_peers, GNUNET_i2s (id)); |
558 | #endif | 555 | #endif |
559 | 556 | ||
560 | pg_start_ctx->peers_left--; | 557 | pg_start_ctx->peers_left--; |
@@ -583,13 +580,13 @@ internal_hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
583 | else | 580 | else |
584 | { | 581 | { |
585 | GNUNET_SCHEDULER_cancel (pg_start_ctx->die_task); | 582 | GNUNET_SCHEDULER_cancel (pg_start_ctx->die_task); |
586 | pg_start_ctx->die_task = GNUNET_SCHEDULER_add_now (&end_badly, | 583 | pg_start_ctx->die_task = |
587 | "from create topology (bad return)"); | 584 | GNUNET_SCHEDULER_add_now (&end_badly, |
585 | "from create topology (bad return)"); | ||
588 | } | 586 | } |
589 | 587 | ||
590 | GNUNET_SCHEDULER_cancel (pg_start_ctx->die_task); | 588 | GNUNET_SCHEDULER_cancel (pg_start_ctx->die_task); |
591 | pg_start_ctx->die_task | 589 | pg_start_ctx->die_task = |
592 | = | ||
593 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining | 590 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining |
594 | (pg_start_ctx->timeout), &end_badly, | 591 | (pg_start_ctx->timeout), &end_badly, |
595 | "from continue startup (timeout)"); | 592 | "from continue startup (timeout)"); |
@@ -608,8 +605,7 @@ internal_hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
608 | * @param emsg error message (NULL on success) | 605 | * @param emsg error message (NULL on success) |
609 | */ | 606 | */ |
610 | void | 607 | void |
611 | write_topology_cb (void *cls, | 608 | write_topology_cb (void *cls, const struct GNUNET_PeerIdentity *first, |
612 | const struct GNUNET_PeerIdentity *first, | ||
613 | const struct GNUNET_PeerIdentity *second, const char *emsg) | 609 | const struct GNUNET_PeerIdentity *second, const char *emsg) |
614 | { | 610 | { |
615 | struct TopologyOutputContext *topo_ctx; | 611 | struct TopologyOutputContext *topo_ctx; |
@@ -727,9 +723,9 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
727 | 723 | ||
728 | pg_start_ctx = GNUNET_malloc (sizeof (struct PeerGroupStartupContext)); | 724 | pg_start_ctx = GNUNET_malloc (sizeof (struct PeerGroupStartupContext)); |
729 | 725 | ||
730 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg, "testing", | 726 | if (GNUNET_OK != |
731 | "connect_attempts", | 727 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", "connect_attempts", |
732 | &pg_start_ctx->connect_attempts)) | 728 | &pg_start_ctx->connect_attempts)) |
733 | { | 729 | { |
734 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", | 730 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", |
735 | "testing", "connect_attempts"); | 731 | "testing", "connect_attempts"); |
@@ -737,10 +733,11 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
737 | return NULL; | 733 | return NULL; |
738 | } | 734 | } |
739 | 735 | ||
740 | if (GNUNET_OK | 736 | if (GNUNET_OK != |
741 | != GNUNET_CONFIGURATION_get_value_number (cfg, "testing", | 737 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", |
742 | "max_outstanding_connections", | 738 | "max_outstanding_connections", |
743 | &pg_start_ctx->max_concurrent_connections)) | 739 | &pg_start_ctx-> |
740 | max_concurrent_connections)) | ||
744 | { | 741 | { |
745 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", | 742 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", |
746 | "testing", "max_outstanding_connections"); | 743 | "testing", "max_outstanding_connections"); |
@@ -748,9 +745,10 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
748 | return NULL; | 745 | return NULL; |
749 | } | 746 | } |
750 | 747 | ||
751 | if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg, "testing", | 748 | if (GNUNET_OK != |
752 | "max_concurrent_ssh", | 749 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", |
753 | &pg_start_ctx->max_concurrent_ssh)) | 750 | "max_concurrent_ssh", |
751 | &pg_start_ctx->max_concurrent_ssh)) | ||
754 | { | 752 | { |
755 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", | 753 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", |
756 | "testing", "max_concurrent_ssh"); | 754 | "testing", "max_concurrent_ssh"); |
@@ -769,9 +767,10 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
769 | return NULL; | 767 | return NULL; |
770 | } | 768 | } |
771 | 769 | ||
772 | if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_number (cfg, "testing", | 770 | if (GNUNET_OK == |
773 | "peergroup_timeout", | 771 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", |
774 | &temp_config_number)) | 772 | "peergroup_timeout", |
773 | &temp_config_number)) | ||
775 | pg_start_ctx->timeout = | 774 | pg_start_ctx->timeout = |
776 | GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply | 775 | GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply |
777 | (GNUNET_TIME_UNIT_SECONDS, | 776 | (GNUNET_TIME_UNIT_SECONDS, |
@@ -787,11 +786,11 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
787 | 786 | ||
788 | /* Read topology related options from the configuration file */ | 787 | /* Read topology related options from the configuration file */ |
789 | temp_str = NULL; | 788 | temp_str = NULL; |
790 | if ((GNUNET_YES == GNUNET_CONFIGURATION_get_value_string (cfg, "testing", | 789 | if ((GNUNET_YES == |
791 | "topology", | 790 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "topology", |
792 | &temp_str)) | 791 | &temp_str)) && |
793 | && (GNUNET_NO == | 792 | (GNUNET_NO == |
794 | GNUNET_TESTING_topology_get (&pg_start_ctx->topology, temp_str))) | 793 | GNUNET_TESTING_topology_get (&pg_start_ctx->topology, temp_str))) |
795 | { | 794 | { |
796 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 795 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
797 | "Invalid topology `%s' given for section %s option %s\n", | 796 | "Invalid topology `%s' given for section %s option %s\n", |
@@ -821,9 +820,9 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
821 | GNUNET_free (temp_str); | 820 | GNUNET_free (temp_str); |
822 | } | 821 | } |
823 | 822 | ||
824 | if (GNUNET_OK | 823 | if (GNUNET_OK != |
825 | != GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "percentage", | 824 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "percentage", |
826 | &temp_str)) | 825 | &temp_str)) |
827 | pg_start_ctx->topology_percentage = 0.5; | 826 | pg_start_ctx->topology_percentage = 0.5; |
828 | else | 827 | else |
829 | { | 828 | { |
@@ -831,9 +830,9 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
831 | GNUNET_free (temp_str); | 830 | GNUNET_free (temp_str); |
832 | } | 831 | } |
833 | 832 | ||
834 | if (GNUNET_OK | 833 | if (GNUNET_OK != |
835 | != GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "probability", | 834 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", "probability", |
836 | &temp_str)) | 835 | &temp_str)) |
837 | pg_start_ctx->topology_probability = 0.5; | 836 | pg_start_ctx->topology_probability = 0.5; |
838 | else | 837 | else |
839 | { | 838 | { |
@@ -841,13 +840,11 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
841 | GNUNET_free (temp_str); | 840 | GNUNET_free (temp_str); |
842 | } | 841 | } |
843 | 842 | ||
844 | if ((GNUNET_YES | 843 | if ((GNUNET_YES == |
845 | == GNUNET_CONFIGURATION_get_value_string (cfg, "testing", | 844 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", |
846 | "connect_topology", | 845 | "connect_topology", &temp_str)) && |
847 | &temp_str)) | 846 | (GNUNET_NO == |
848 | && (GNUNET_NO == | 847 | GNUNET_TESTING_topology_get (&pg_start_ctx->connect_topology, temp_str))) |
849 | GNUNET_TESTING_topology_get (&pg_start_ctx->connect_topology, | ||
850 | temp_str))) | ||
851 | { | 848 | { |
852 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 849 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
853 | "Invalid connect topology `%s' given for section %s option %s\n", | 850 | "Invalid connect topology `%s' given for section %s option %s\n", |
@@ -855,14 +852,13 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
855 | } | 852 | } |
856 | GNUNET_free_non_null (temp_str); | 853 | GNUNET_free_non_null (temp_str); |
857 | 854 | ||
858 | if ((GNUNET_YES | 855 | if ((GNUNET_YES == |
859 | == GNUNET_CONFIGURATION_get_value_string (cfg, "testing", | 856 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", |
860 | "connect_topology_option", | 857 | "connect_topology_option", |
861 | &temp_str)) | 858 | &temp_str)) && |
862 | && (GNUNET_NO | 859 | (GNUNET_NO == |
863 | == | 860 | GNUNET_TESTING_topology_option_get (&pg_start_ctx-> |
864 | GNUNET_TESTING_topology_option_get | 861 | connect_topology_option, temp_str))) |
865 | (&pg_start_ctx->connect_topology_option, temp_str))) | ||
866 | { | 862 | { |
867 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 863 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
868 | "Invalid connect topology option `%s' given for section %s option %s\n", | 864 | "Invalid connect topology option `%s' given for section %s option %s\n", |
@@ -871,14 +867,13 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
871 | } | 867 | } |
872 | GNUNET_free_non_null (temp_str); | 868 | GNUNET_free_non_null (temp_str); |
873 | 869 | ||
874 | if (GNUNET_YES | 870 | if (GNUNET_YES == |
875 | == GNUNET_CONFIGURATION_get_value_string (cfg, | 871 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", |
876 | "testing", | 872 | "connect_topology_option_modifier", |
877 | "connect_topology_option_modifier", | 873 | &temp_str)) |
878 | &temp_str)) | ||
879 | { | 874 | { |
880 | if (sscanf (temp_str, "%lf", | 875 | if (sscanf |
881 | &pg_start_ctx->connect_topology_option_modifier) != 1) | 876 | (temp_str, "%lf", &pg_start_ctx->connect_topology_option_modifier) != 1) |
882 | { | 877 | { |
883 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 878 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
884 | _ | 879 | _ |
@@ -891,17 +886,17 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
891 | GNUNET_free (temp_str); | 886 | GNUNET_free (temp_str); |
892 | } | 887 | } |
893 | 888 | ||
894 | if (GNUNET_YES | 889 | if (GNUNET_YES != |
895 | != GNUNET_CONFIGURATION_get_value_string (cfg, "testing", | 890 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", |
896 | "blacklist_transports", | 891 | "blacklist_transports", |
897 | &pg_start_ctx->restrict_transports)) | 892 | &pg_start_ctx-> |
893 | restrict_transports)) | ||
898 | pg_start_ctx->restrict_transports = NULL; | 894 | pg_start_ctx->restrict_transports = NULL; |
899 | 895 | ||
900 | pg_start_ctx->restrict_topology = GNUNET_TESTING_TOPOLOGY_NONE; | 896 | pg_start_ctx->restrict_topology = GNUNET_TESTING_TOPOLOGY_NONE; |
901 | if ((GNUNET_YES | 897 | if ((GNUNET_YES == |
902 | == GNUNET_CONFIGURATION_get_value_string (cfg, "testing", | 898 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", |
903 | "blacklist_topology", | 899 | "blacklist_topology", &temp_str)) |
904 | &temp_str)) | ||
905 | && (GNUNET_NO == | 900 | && (GNUNET_NO == |
906 | GNUNET_TESTING_topology_get (&pg_start_ctx->restrict_topology, | 901 | GNUNET_TESTING_topology_get (&pg_start_ctx->restrict_topology, |
907 | temp_str))) | 902 | temp_str))) |
@@ -928,23 +923,21 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
928 | pg_start_ctx->verbose); | 923 | pg_start_ctx->verbose); |
929 | /* Make compilers happy */ | 924 | /* Make compilers happy */ |
930 | reset_meter (pg_start_ctx->peer_start_meter); | 925 | reset_meter (pg_start_ctx->peer_start_meter); |
931 | pg_start_ctx->die_task | 926 | pg_start_ctx->die_task = |
932 | = | ||
933 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining | 927 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining |
934 | (pg_start_ctx->timeout), &end_badly, | 928 | (pg_start_ctx->timeout), &end_badly, |
935 | "didn't generate all hostkeys within allowed startup time!"); | 929 | "didn't generate all hostkeys within allowed startup time!"); |
936 | 930 | ||
937 | pg_start_ctx->pg | 931 | pg_start_ctx->pg = |
938 | = GNUNET_TESTING_daemons_start (pg_start_ctx->cfg, | 932 | GNUNET_TESTING_daemons_start (pg_start_ctx->cfg, pg_start_ctx->peers_left, |
939 | pg_start_ctx->peers_left, | 933 | pg_start_ctx->max_concurrent_connections, |
940 | pg_start_ctx->max_concurrent_connections, | 934 | pg_start_ctx->max_concurrent_ssh, |
941 | pg_start_ctx->max_concurrent_ssh, | 935 | GNUNET_TIME_absolute_get_remaining |
942 | GNUNET_TIME_absolute_get_remaining | 936 | (pg_start_ctx->timeout), |
943 | (pg_start_ctx->timeout), | 937 | &internal_hostkey_callback, pg_start_ctx, |
944 | &internal_hostkey_callback, pg_start_ctx, | 938 | &internal_peers_started_callback, |
945 | &internal_peers_started_callback, | 939 | pg_start_ctx, &internal_topology_callback, |
946 | pg_start_ctx, &internal_topology_callback, | 940 | pg_start_ctx, pg_start_ctx->hostnames); |
947 | pg_start_ctx, pg_start_ctx->hostnames); | ||
948 | 941 | ||
949 | return pg_start_ctx->pg; | 942 | return pg_start_ctx->pg; |
950 | } | 943 | } |