/**
* File-size we use for testing.
*/
-#define FILESIZE (1024 * 1024 * 50)
+#define FILESIZE (1024 * 1024 * 1)
/**
* How long until we give up on transmitting the message?
*/
-#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 300)
+#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 30)
#define NUM_DAEMONS 2
static struct GNUNET_FS_TestDaemon *daemons[NUM_DAEMONS];
-static struct GNUNET_SCHEDULER_Handle *sched;
-
static int ok;
static struct GNUNET_TIME_Absolute start_time;
do_stop (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_FS_TEST_daemons_stop (sched,
- NUM_DAEMONS,
+ GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS,
daemons);
}
{ "fs", "cummulative artificial delay introduced (ms)"},
{ "core", "# bytes decrypted"},
{ "core", "# bytes encrypted"},
+ { "core", "# discarded CORE_SEND requests"},
+ { "core", "# discarded CORE_SEND request bytes"},
+ { "core", "# discarded lower priority CORE_SEND requests"},
+ { "core", "# discarded lower priority CORE_SEND request bytes"},
{ "transport", "# bytes received via TCP"},
{ "transport", "# bytes transmitted via TCP"},
{ "datacache", "# bytes stored"},
struct StatMaster *sm = cls;
GNUNET_break (GNUNET_OK == success);
sm->value++;
- GNUNET_SCHEDULER_add_now (sched, &stat_run, sm);
+ GNUNET_SCHEDULER_add_now (&stat_run, sm);
}
if (sm->daemon == NUM_DAEMONS)
{
GNUNET_free (sm);
- GNUNET_SCHEDULER_add_now (sched, &do_stop, NULL);
+ GNUNET_SCHEDULER_add_now (&do_stop, NULL);
return;
}
- sm->stat = GNUNET_STATISTICS_create (sched, "<driver>",
+ sm->stat = GNUNET_STATISTICS_create ("<driver>",
GNUNET_FS_TEST_get_configuration (daemons,
sm->daemon));
- GNUNET_SCHEDULER_add_now (sched, &stat_run, sm);
+ GNUNET_SCHEDULER_add_now (&stat_run, sm);
}
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE))
{
del = GNUNET_TIME_absolute_get_duration (start_time);
- if (del.value == 0)
- del.value = 1;
- fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.value);
+ if (del.rel_value == 0)
+ del.rel_value = 1;
+ fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long)FILESIZE) * 1000LL / del.rel_value);
fprintf (stdout,
"Download speed was %s/s\n",
fancy);
"Finished download, shutting down\n",
(unsigned long long) FILESIZE);
sm = GNUNET_malloc (sizeof (struct StatMaster));
- sm->stat = GNUNET_STATISTICS_create (sched, "<driver>",
+ sm->stat = GNUNET_STATISTICS_create ("<driver>",
GNUNET_FS_TEST_get_configuration (daemons,
sm->daemon));
- GNUNET_SCHEDULER_add_now (sched, &stat_run, sm);
+ GNUNET_SCHEDULER_add_now (&stat_run, sm);
}
else
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout during download, shutting down with error\n");
ok = 1;
- GNUNET_SCHEDULER_add_now (sched, &do_stop, NULL);
+ GNUNET_SCHEDULER_add_now (&do_stop, NULL);
}
}
if (NULL == uri)
{
- GNUNET_FS_TEST_daemons_stop (sched,
- NUM_DAEMONS,
+ GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS,
daemons);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout during upload attempt, shutting down with error\n");
anonymity = 0;
else
anonymity = 1;
- GNUNET_FS_TEST_download (sched,
- daemons[0],
+ GNUNET_FS_TEST_download (daemons[0],
TIMEOUT,
anonymity, SEED, uri,
VERBOSE,
if (NULL != emsg)
{
- GNUNET_FS_TEST_daemons_stop (sched,
- NUM_DAEMONS,
+ GNUNET_FS_TEST_daemons_stop (NUM_DAEMONS,
daemons);
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Error trying to connect: %s\n",
else
anonymity = 1;
- GNUNET_FS_TEST_publish (sched,
- daemons[NUM_DAEMONS-1],
+ GNUNET_FS_TEST_publish (daemons[NUM_DAEMONS-1],
TIMEOUT,
anonymity,
do_index, FILESIZE, SEED,
static void
run (void *cls,
- struct GNUNET_SCHEDULER_Handle *s,
char *const *args,
const char *cfgfile,
const struct GNUNET_CONFIGURATION_Handle *cfg)
{
- sched = s;
- GNUNET_FS_TEST_daemons_start (sched,
- "fs_test_lib_data.conf",
+ GNUNET_FS_TEST_daemons_start ("fs_test_lib_data.conf",
TIMEOUT,
NUM_DAEMONS,
daemons,