diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-11-24 23:09:36 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-11-24 23:09:36 +0000 |
commit | ffbcecfb3a225e8f592780c4a6eba56e6ae8a8f3 (patch) | |
tree | 1a5f0bf706cd5b4b39346853b19b1a89c86f28a5 /src/fs/perf_gnunet_service_fs_p2p.c | |
parent | eb402314191286004d4b5450508080b3ef7b4e5b (diff) | |
download | gnunet-ffbcecfb3a225e8f592780c4a6eba56e6ae8a8f3.tar.gz gnunet-ffbcecfb3a225e8f592780c4a6eba56e6ae8a8f3.zip |
-add multi-peer testcase for stream-based transfers (expected to fail right now), and option to disable anonymous transfers --- to force stream-based transfers
Diffstat (limited to 'src/fs/perf_gnunet_service_fs_p2p.c')
-rw-r--r-- | src/fs/perf_gnunet_service_fs_p2p.c | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index 9844006e5..dadeaba6f 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c | |||
@@ -294,21 +294,17 @@ do_download (void *cls, const struct GNUNET_FS_Uri *uri) | |||
294 | 294 | ||
295 | 295 | ||
296 | static void | 296 | static void |
297 | do_publish (void *cls, | 297 | do_publish (void *cls, |
298 | struct GNUNET_TESTBED_Operation *op, | 298 | unsigned int num_peers, |
299 | const char *emsg) | 299 | struct GNUNET_TESTBED_Peer **peers) |
300 | { | 300 | { |
301 | unsigned int i; | ||
301 | int do_index; | 302 | int do_index; |
302 | int anonymity; | 303 | int anonymity; |
303 | 304 | ||
304 | GNUNET_TESTBED_operation_done (op); | 305 | GNUNET_assert (NUM_DAEMONS == num_peers); |
305 | if (NULL != emsg) | 306 | for (i=0;i<num_peers;i++) |
306 | { | 307 | daemons[i] = peers[i]; |
307 | GNUNET_SCHEDULER_shutdown (); | ||
308 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Error trying to connect: %s\n", emsg); | ||
309 | ok = 1; | ||
310 | return; | ||
311 | } | ||
312 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Publishing %llu bytes\n", | 308 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Publishing %llu bytes\n", |
313 | (unsigned long long) FILESIZE); | 309 | (unsigned long long) FILESIZE); |
314 | if (NULL != strstr (progname, "index")) | 310 | if (NULL != strstr (progname, "index")) |
@@ -319,32 +315,12 @@ do_publish (void *cls, | |||
319 | anonymity = 0; | 315 | anonymity = 0; |
320 | else | 316 | else |
321 | anonymity = 1; | 317 | anonymity = 1; |
322 | |||
323 | GNUNET_FS_TEST_publish (daemons[NUM_DAEMONS - 1], TIMEOUT, anonymity, | 318 | GNUNET_FS_TEST_publish (daemons[NUM_DAEMONS - 1], TIMEOUT, anonymity, |
324 | do_index, FILESIZE, SEED, VERBOSE, &do_download, | 319 | do_index, FILESIZE, SEED, VERBOSE, &do_download, |
325 | NULL); | 320 | NULL); |
326 | } | 321 | } |
327 | 322 | ||
328 | 323 | ||
329 | static void | ||
330 | do_connect (void *cls, | ||
331 | unsigned int num_peers, | ||
332 | struct GNUNET_TESTBED_Peer **peers) | ||
333 | { | ||
334 | unsigned int i; | ||
335 | |||
336 | GNUNET_assert (NUM_DAEMONS == num_peers); | ||
337 | for (i=0;i<num_peers;i++) | ||
338 | daemons[i] = peers[i]; | ||
339 | GNUNET_TESTBED_overlay_connect (NULL, | ||
340 | &do_publish, | ||
341 | NULL, | ||
342 | peers[0], | ||
343 | peers[1]); | ||
344 | // FIXME: was supposed to connect in line... | ||
345 | } | ||
346 | |||
347 | |||
348 | int | 324 | int |
349 | main (int argc, char *argv[]) | 325 | main (int argc, char *argv[]) |
350 | { | 326 | { |
@@ -353,7 +329,7 @@ main (int argc, char *argv[]) | |||
353 | "perf_gnunet_service_fs_p2p.conf", | 329 | "perf_gnunet_service_fs_p2p.conf", |
354 | NUM_DAEMONS, | 330 | NUM_DAEMONS, |
355 | 0, NULL, NULL, | 331 | 0, NULL, NULL, |
356 | &do_connect, NULL); | 332 | &do_publish, NULL); |
357 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); | 333 | GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-lib/"); |
358 | return ok; | 334 | return ok; |
359 | } | 335 | } |