diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-10-23 13:35:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-10-23 13:35:03 +0000 |
commit | 458cb34da45e855162c96fc4735f168e36a323c9 (patch) | |
tree | 092435daf6fb14609d4f1441858c5f9eda714640 /src/mesh | |
parent | bcad355380c32637dd47feec84c23faed30e0eea (diff) | |
download | gnunet-458cb34da45e855162c96fc4735f168e36a323c9.tar.gz gnunet-458cb34da45e855162c96fc4735f168e36a323c9.zip |
make writing data_output optional and disable by default
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/test_mesh_small.c | 23 | ||||
-rw-r--r-- | src/mesh/test_mesh_small.conf | 2 | ||||
-rw-r--r-- | src/mesh/test_mesh_small_unicast_far.c | 24 |
3 files changed, 20 insertions, 29 deletions
diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c index f100a40e4..0888c1e00 100644 --- a/src/mesh/test_mesh_small.c +++ b/src/mesh/test_mesh_small.c | |||
@@ -140,8 +140,6 @@ static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle; | |||
140 | 140 | ||
141 | static char *topology_file; | 141 | static char *topology_file; |
142 | 142 | ||
143 | static char *data_filename; | ||
144 | |||
145 | static struct GNUNET_TESTING_Daemon *d1; | 143 | static struct GNUNET_TESTING_Daemon *d1; |
146 | 144 | ||
147 | static GNUNET_PEER_Id pid1; | 145 | static GNUNET_PEER_Id pid1; |
@@ -753,6 +751,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
753 | char *temp_str; | 751 | char *temp_str; |
754 | unsigned long long temp_wait; | 752 | unsigned long long temp_wait; |
755 | struct GNUNET_TESTING_Host *hosts; | 753 | struct GNUNET_TESTING_Host *hosts; |
754 | char *data_filename; | ||
756 | 755 | ||
757 | ok = 0; | 756 | ok = 0; |
758 | testing_cfg = GNUNET_CONFIGURATION_dup (cfg); | 757 | testing_cfg = GNUNET_CONFIGURATION_dup (cfg); |
@@ -801,27 +800,23 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
801 | return; | 800 | return; |
802 | } | 801 | } |
803 | 802 | ||
804 | if (GNUNET_OK != | 803 | if (GNUNET_OK == |
805 | GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_mesh_small", | 804 | GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_mesh_small", |
806 | "data_output_file", | 805 | "data_output_file", |
807 | &data_filename)) | 806 | &data_filename)) |
808 | { | 807 | { |
809 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 808 | data_file = |
810 | "Option test_mesh_small:data_output_file is required!\n"); | ||
811 | return; | ||
812 | } | ||
813 | |||
814 | data_file = | ||
815 | GNUNET_DISK_file_open (data_filename, | 809 | GNUNET_DISK_file_open (data_filename, |
816 | GNUNET_DISK_OPEN_READWRITE | | 810 | GNUNET_DISK_OPEN_READWRITE | |
817 | GNUNET_DISK_OPEN_CREATE, | 811 | GNUNET_DISK_OPEN_CREATE, |
818 | GNUNET_DISK_PERM_USER_READ | | 812 | GNUNET_DISK_PERM_USER_READ | |
819 | GNUNET_DISK_PERM_USER_WRITE); | 813 | GNUNET_DISK_PERM_USER_WRITE); |
820 | if (data_file == NULL) | 814 | if (data_file == NULL) |
821 | { | 815 | { |
822 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n", | 816 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n", |
823 | data_filename); | 817 | data_filename); |
824 | GNUNET_free (data_filename); | 818 | GNUNET_free (data_filename); |
819 | } | ||
825 | } | 820 | } |
826 | 821 | ||
827 | wait_time = | 822 | wait_time = |
diff --git a/src/mesh/test_mesh_small.conf b/src/mesh/test_mesh_small.conf index f98dca7dc..9e340aacb 100644 --- a/src/mesh/test_mesh_small.conf +++ b/src/mesh/test_mesh_small.conf | |||
@@ -87,4 +87,4 @@ DELETE_FILES = YES | |||
87 | [test_mesh_small] | 87 | [test_mesh_small] |
88 | WAIT_TIME = 300 | 88 | WAIT_TIME = 300 |
89 | CONNECTION_LIMIT = 16 | 89 | CONNECTION_LIMIT = 16 |
90 | DATA_OUTPUT_FILE=data_output | 90 | #DATA_OUTPUT_FILE=data_output |
diff --git a/src/mesh/test_mesh_small_unicast_far.c b/src/mesh/test_mesh_small_unicast_far.c index d5a768f98..f5bab6fb4 100644 --- a/src/mesh/test_mesh_small_unicast_far.c +++ b/src/mesh/test_mesh_small_unicast_far.c | |||
@@ -120,8 +120,6 @@ static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle; | |||
120 | 120 | ||
121 | static char *topology_file; | 121 | static char *topology_file; |
122 | 122 | ||
123 | static char *data_filename; | ||
124 | |||
125 | static struct GNUNET_TESTING_Daemon *d1; | 123 | static struct GNUNET_TESTING_Daemon *d1; |
126 | 124 | ||
127 | static struct GNUNET_TESTING_Daemon *d2; | 125 | static struct GNUNET_TESTING_Daemon *d2; |
@@ -460,6 +458,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
460 | char *temp_str; | 458 | char *temp_str; |
461 | unsigned long long temp_wait; | 459 | unsigned long long temp_wait; |
462 | struct GNUNET_TESTING_Host *hosts; | 460 | struct GNUNET_TESTING_Host *hosts; |
461 | char *data_filename; | ||
462 | |||
463 | 463 | ||
464 | ok = 1; | 464 | ok = 1; |
465 | testing_cfg = GNUNET_CONFIGURATION_dup (cfg); | 465 | testing_cfg = GNUNET_CONFIGURATION_dup (cfg); |
@@ -516,27 +516,23 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
516 | return; | 516 | return; |
517 | } | 517 | } |
518 | 518 | ||
519 | if (GNUNET_OK != | 519 | if (GNUNET_OK == |
520 | GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_mesh_small", | 520 | GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_mesh_small", |
521 | "data_output_file", | 521 | "data_output_file", |
522 | &data_filename)) | 522 | &data_filename)) |
523 | { | 523 | { |
524 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 524 | data_file = |
525 | "Option test_mesh_small:data_output_file is required!\n"); | ||
526 | return; | ||
527 | } | ||
528 | |||
529 | data_file = | ||
530 | GNUNET_DISK_file_open (data_filename, | 525 | GNUNET_DISK_file_open (data_filename, |
531 | GNUNET_DISK_OPEN_READWRITE | | 526 | GNUNET_DISK_OPEN_READWRITE | |
532 | GNUNET_DISK_OPEN_CREATE, | 527 | GNUNET_DISK_OPEN_CREATE, |
533 | GNUNET_DISK_PERM_USER_READ | | 528 | GNUNET_DISK_PERM_USER_READ | |
534 | GNUNET_DISK_PERM_USER_WRITE); | 529 | GNUNET_DISK_PERM_USER_WRITE); |
535 | if (data_file == NULL) | 530 | if (data_file == NULL) |
536 | { | 531 | { |
537 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n", | 532 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n", |
538 | data_filename); | 533 | data_filename); |
539 | GNUNET_free (data_filename); | 534 | GNUNET_free (data_filename); |
535 | } | ||
540 | } | 536 | } |
541 | 537 | ||
542 | wait_time = | 538 | wait_time = |