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_p2p.c | |
parent | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff) | |
download | gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip |
indentation
Diffstat (limited to 'src/fs/test_gnunet_service_fs_p2p.c')
-rw-r--r-- | src/fs/test_gnunet_service_fs_p2p.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c index c48f98666..aece0e80a 100644 --- a/src/fs/test_gnunet_service_fs_p2p.c +++ b/src/fs/test_gnunet_service_fs_p2p.c | |||
@@ -65,8 +65,7 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
65 | 1000LL / del.rel_value); | 65 | 1000LL / del.rel_value); |
66 | fprintf (stdout, "Download speed was %s/s\n", fancy); | 66 | fprintf (stdout, "Download speed was %s/s\n", fancy); |
67 | GNUNET_free (fancy); | 67 | GNUNET_free (fancy); |
68 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 68 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", |
69 | "Finished download, shutting down\n", | ||
70 | (unsigned long long) FILESIZE); | 69 | (unsigned long long) FILESIZE); |
71 | } | 70 | } |
72 | else | 71 | else |
@@ -89,11 +88,11 @@ do_download (void *cls, const struct GNUNET_FS_Uri *uri) | |||
89 | ok = 1; | 88 | ok = 1; |
90 | return; | 89 | return; |
91 | } | 90 | } |
92 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 91 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Downloading %llu bytes\n", |
93 | "Downloading %llu bytes\n", (unsigned long long) FILESIZE); | 92 | (unsigned long long) FILESIZE); |
94 | start_time = GNUNET_TIME_absolute_get (); | 93 | start_time = GNUNET_TIME_absolute_get (); |
95 | GNUNET_FS_TEST_download (daemons[0], | 94 | GNUNET_FS_TEST_download (daemons[0], TIMEOUT, 1, SEED, uri, VERBOSE, &do_stop, |
96 | TIMEOUT, 1, SEED, uri, VERBOSE, &do_stop, NULL); | 95 | NULL); |
97 | } | 96 | } |
98 | 97 | ||
99 | 98 | ||
@@ -108,11 +107,9 @@ do_publish (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
108 | ok = 1; | 107 | ok = 1; |
109 | return; | 108 | return; |
110 | } | 109 | } |
111 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 110 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Publishing %llu bytes\n", |
112 | "Publishing %llu bytes\n", (unsigned long long) FILESIZE); | 111 | (unsigned long long) FILESIZE); |
113 | GNUNET_FS_TEST_publish (daemons[1], | 112 | GNUNET_FS_TEST_publish (daemons[1], TIMEOUT, 1, GNUNET_NO, FILESIZE, SEED, |
114 | TIMEOUT, | ||
115 | 1, GNUNET_NO, FILESIZE, SEED, | ||
116 | VERBOSE, &do_download, NULL); | 113 | VERBOSE, &do_download, NULL); |
117 | } | 114 | } |
118 | 115 | ||
@@ -123,19 +120,17 @@ do_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
123 | GNUNET_assert (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)); | 120 | GNUNET_assert (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)); |
124 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 121 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
125 | "Daemons started, will now try to connect them\n"); | 122 | "Daemons started, will now try to connect them\n"); |
126 | GNUNET_FS_TEST_daemons_connect (daemons[0], | 123 | GNUNET_FS_TEST_daemons_connect (daemons[0], daemons[1], TIMEOUT, &do_publish, |
127 | daemons[1], TIMEOUT, &do_publish, NULL); | 124 | NULL); |
128 | } | 125 | } |
129 | 126 | ||
130 | 127 | ||
131 | static void | 128 | static void |
132 | run (void *cls, | 129 | run (void *cls, char *const *args, const char *cfgfile, |
133 | char *const *args, | 130 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
134 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
135 | { | 131 | { |
136 | GNUNET_FS_TEST_daemons_start ("fs_test_lib_data.conf", | 132 | GNUNET_FS_TEST_daemons_start ("fs_test_lib_data.conf", TIMEOUT, NUM_DAEMONS, |
137 | TIMEOUT, | 133 | daemons, &do_connect, NULL); |
138 | NUM_DAEMONS, daemons, &do_connect, NULL); | ||
139 | } | 134 | } |
140 | 135 | ||
141 | 136 | ||
@@ -163,9 +158,9 @@ main (int argc, char *argv[]) | |||
163 | "WARNING", | 158 | "WARNING", |
164 | #endif | 159 | #endif |
165 | NULL); | 160 | NULL); |
166 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, | 161 | GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx, |
167 | argvx, "test-gnunet-service-fs-p2p", | 162 | "test-gnunet-service-fs-p2p", "nohelp", options, &run, |
168 | "nohelp", options, &run, NULL); | 163 | NULL); |
169 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); | 164 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); |
170 | return ok; | 165 | return ok; |
171 | } | 166 | } |