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/fs/test_gnunet_service_fs_migration.c | |
parent | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff) | |
download | gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip |
indentation
Diffstat (limited to 'src/fs/test_gnunet_service_fs_migration.c')
-rw-r--r-- | src/fs/test_gnunet_service_fs_migration.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c index 9a209521f..a5570e1d4 100644 --- a/src/fs/test_gnunet_service_fs_migration.c +++ b/src/fs/test_gnunet_service_fs_migration.c | |||
@@ -69,8 +69,7 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
69 | 1000LL / del.rel_value); | 69 | 1000LL / del.rel_value); |
70 | fprintf (stdout, "Download speed was %s/s\n", fancy); | 70 | fprintf (stdout, "Download speed was %s/s\n", fancy); |
71 | GNUNET_free (fancy); | 71 | GNUNET_free (fancy); |
72 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 72 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", |
73 | "Finished download, shutting down\n", | ||
74 | (unsigned long long) FILESIZE); | 73 | (unsigned long long) FILESIZE); |
75 | } | 74 | } |
76 | else | 75 | else |
@@ -90,17 +89,17 @@ do_download (void *cls, const char *emsg) | |||
90 | if (emsg != NULL) | 89 | if (emsg != NULL) |
91 | { | 90 | { |
92 | GNUNET_FS_TEST_daemons_stop (2, daemons); | 91 | GNUNET_FS_TEST_daemons_stop (2, daemons); |
93 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 92 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to stop source daemon: %s\n", |
94 | "Failed to stop source daemon: %s\n", emsg); | 93 | emsg); |
95 | GNUNET_FS_uri_destroy (uri); | 94 | GNUNET_FS_uri_destroy (uri); |
96 | ok = 1; | 95 | ok = 1; |
97 | return; | 96 | return; |
98 | } | 97 | } |
99 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 98 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Downloading %llu bytes\n", |
100 | "Downloading %llu bytes\n", (unsigned long long) FILESIZE); | 99 | (unsigned long long) FILESIZE); |
101 | start_time = GNUNET_TIME_absolute_get (); | 100 | start_time = GNUNET_TIME_absolute_get (); |
102 | GNUNET_FS_TEST_download (daemons[0], | 101 | GNUNET_FS_TEST_download (daemons[0], TIMEOUT, 1, SEED, uri, VERBOSE, &do_stop, |
103 | TIMEOUT, 1, SEED, uri, VERBOSE, &do_stop, NULL); | 102 | NULL); |
104 | GNUNET_FS_uri_destroy (uri); | 103 | GNUNET_FS_uri_destroy (uri); |
105 | } | 104 | } |
106 | 105 | ||
@@ -147,11 +146,9 @@ do_publish (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
147 | ok = 1; | 146 | ok = 1; |
148 | return; | 147 | return; |
149 | } | 148 | } |
150 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 149 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Publishing %llu bytes\n", |
151 | "Publishing %llu bytes\n", (unsigned long long) FILESIZE); | 150 | (unsigned long long) FILESIZE); |
152 | GNUNET_FS_TEST_publish (daemons[1], | 151 | GNUNET_FS_TEST_publish (daemons[1], TIMEOUT, 1, GNUNET_NO, FILESIZE, SEED, |
153 | TIMEOUT, | ||
154 | 1, GNUNET_NO, FILESIZE, SEED, | ||
155 | VERBOSE, &do_wait, NULL); | 152 | VERBOSE, &do_wait, NULL); |
156 | } | 153 | } |
157 | 154 | ||
@@ -168,15 +165,14 @@ do_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
168 | } | 165 | } |
169 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 166 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
170 | "Daemons started, will now try to connect them\n"); | 167 | "Daemons started, will now try to connect them\n"); |
171 | GNUNET_FS_TEST_daemons_connect (daemons[0], | 168 | GNUNET_FS_TEST_daemons_connect (daemons[0], daemons[1], TIMEOUT, &do_publish, |
172 | daemons[1], TIMEOUT, &do_publish, NULL); | 169 | NULL); |
173 | } | 170 | } |
174 | 171 | ||
175 | 172 | ||
176 | static void | 173 | static void |
177 | run (void *cls, | 174 | run (void *cls, char *const *args, const char *cfgfile, |
178 | char *const *args, | 175 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
179 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
180 | { | 176 | { |
181 | GNUNET_FS_TEST_daemons_start ("test_gnunet_service_fs_migration_data.conf", | 177 | GNUNET_FS_TEST_daemons_start ("test_gnunet_service_fs_migration_data.conf", |
182 | TIMEOUT, 2, daemons, &do_connect, NULL); | 178 | TIMEOUT, 2, daemons, &do_connect, NULL); |
@@ -207,9 +203,9 @@ main (int argc, char *argv[]) | |||
207 | "WARNING", | 203 | "WARNING", |
208 | #endif | 204 | #endif |
209 | NULL); | 205 | NULL); |
210 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, | 206 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx, |
211 | argvx, "test-gnunet-service-fs-migration", | 207 | "test-gnunet-service-fs-migration", "nohelp", options, |
212 | "nohelp", options, &run, NULL); | 208 | &run, NULL); |
213 | GNUNET_DISK_directory_remove ("/tmp/test-gnunet-service-fs-migration/"); | 209 | GNUNET_DISK_directory_remove ("/tmp/test-gnunet-service-fs-migration/"); |
214 | return ok; | 210 | return ok; |
215 | } | 211 | } |