X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ffs%2Ftest_fs_download_indexed.c;h=d16aa97f15d5f0b07693a92762cc736133d8bb70;hb=6a3aa5797d49178e806fc5cc5713806647cbd040;hp=3f932f78316ea0d84ae4902d5b9288c669058239;hpb=a5d0694571db763efd0787a680168492f325b2e6;p=oweals%2Fgnunet.git diff --git a/src/fs/test_fs_download_indexed.c b/src/fs/test_fs_download_indexed.c index 3f932f783..d16aa97f1 100644 --- a/src/fs/test_fs_download_indexed.c +++ b/src/fs/test_fs_download_indexed.c @@ -30,7 +30,7 @@ #include "gnunet_fs_service.h" #include -#define VERBOSE GNUNET_EXTRA_LOGGING +#define VERBOSE GNUNET_NO #define START_ARM GNUNET_YES @@ -42,7 +42,7 @@ /** * How long until we give up on transmitting the message? */ -#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 60) +#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 120) /** * How long should our test-content live? @@ -75,9 +75,11 @@ static char *fn1; static int err; + static void timeout_kill_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { + fprintf (stderr, "Download not fast enough, timeout!\n"); if (download != NULL) { GNUNET_FS_download_stop (download, GNUNET_YES); @@ -102,6 +104,7 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } } + static void stop_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { @@ -109,6 +112,7 @@ stop_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) fs = NULL; } + static void abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { @@ -119,7 +123,7 @@ abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_FS_download_stop (download, GNUNET_YES); download = NULL; } - GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_size (fn, &size, GNUNET_YES)); + GNUNET_assert (GNUNET_OK == GNUNET_DISK_file_size (fn, &size, GNUNET_YES, GNUNET_NO)); GNUNET_assert (size == FILESIZE); GNUNET_DISK_directory_remove (fn); GNUNET_free (fn); @@ -191,14 +195,14 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: - fprintf (stderr, "Error publishing file: %s\n", + FPRINTF (stderr, "Error publishing file: %s\n", event->value.publish.specifics.error.message); GNUNET_break (0); GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; case GNUNET_FS_STATUS_DOWNLOAD_ERROR: - fprintf (stderr, "Error downloading file: %s\n", + FPRINTF (stderr, "Error downloading file: %s\n", event->value.download.specifics.error.message); GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); break; @@ -246,11 +250,8 @@ setup_peer (struct PeerContext *p, const char *cfgname) p->cfg = GNUNET_CONFIGURATION_create (); #if START_ARM p->arm_proc = - GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", + GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm", "gnunet-service-arm", -#if VERBOSE - "-L", "DEBUG", -#endif "-c", cfgname, NULL); #endif GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); @@ -269,7 +270,7 @@ stop_arm (struct PeerContext *p) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ARM process %u stopped\n", GNUNET_OS_process_get_pid (p->arm_proc)); - GNUNET_OS_process_close (p->arm_proc); + GNUNET_OS_process_destroy (p->arm_proc); p->arm_proc = NULL; } #endif @@ -335,9 +336,6 @@ main (int argc, char *argv[]) "test-fs-download-indexed", "-c", "test_fs_download_data.conf", -#if VERBOSE - "-L", "DEBUG", -#endif NULL }; struct GNUNET_GETOPT_CommandLineOption options[] = { @@ -345,11 +343,7 @@ main (int argc, char *argv[]) }; GNUNET_log_setup ("test_fs_download_indexed", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx, "test-fs-download-indexed", "nohelp", options, &run,