static void
abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
+ timeout_task = GNUNET_SCHEDULER_NO_TASK;
fprintf (stderr,
"Timeout\n");
- if (NULL != publish)
- {
- GNUNET_FS_publish_stop (publish);
- publish = NULL;
- }
if (NULL != search)
{
GNUNET_FS_search_stop (search);
search = NULL;
}
+ if (NULL != publish)
+ {
+ GNUNET_FS_publish_stop (publish);
+ publish = NULL;
+ }
err = 1;
}
static void
abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_FS_publish_stop (publish);
- publish = NULL;
+ if (NULL != publish)
+ {
+ GNUNET_FS_publish_stop (publish);
+ publish = NULL;
+ }
+ if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
+ {
+ GNUNET_SCHEDULER_cancel (timeout_task);
+ timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ }
}
size_t i;
fs = GNUNET_FS_start (cfg, "test-fs-search", &progress_cb, NULL,
- GNUNET_FS_FLAGS_DO_PROBES,
+ GNUNET_FS_FLAGS_DO_PROBES,
GNUNET_FS_OPTIONS_END);
GNUNET_assert (NULL != fs);
buf = GNUNET_malloc (FILESIZE);