aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-24 01:10:47 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-24 01:10:47 +0000
commitf1f603c7d0b3f03dca46a4f313472288eb080eb1 (patch)
tree3a29966b02dfb83e0a8a8d5c42b3116380209fb0 /src/fs
parent53cd5b8eda2fa8db86b0907a62a39598981d008a (diff)
making GNUNET_SCHEDULER_cancel() perform in O(1) instead of O(n) to help or even fully address #3247
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_api.c12
-rw-r--r--src/fs/fs_api.h16
-rw-r--r--src/fs/fs_dirmetascan.c8
-rw-r--r--src/fs/fs_download.c22
-rw-r--r--src/fs/fs_list_indexed.c2
-rw-r--r--src/fs/fs_publish.c26
-rw-r--r--src/fs/fs_publish_ksk.c8
-rw-r--r--src/fs/fs_publish_ublock.c6
-rw-r--r--src/fs/fs_search.c50
-rw-r--r--src/fs/fs_test_lib.c16
-rw-r--r--src/fs/fs_test_lib.h2
-rw-r--r--src/fs/fs_tree.c4
-rw-r--r--src/fs/fs_tree.h2
-rw-r--r--src/fs/gnunet-auto-share.c16
-rw-r--r--src/fs/gnunet-daemon-fsprofiler.c20
-rw-r--r--src/fs/gnunet-fs-profiler.c4
-rw-r--r--src/fs/gnunet-publish.c16
-rw-r--r--src/fs/gnunet-service-fs.c6
-rw-r--r--src/fs/gnunet-service-fs_cadet_client.c18
-rw-r--r--src/fs/gnunet-service-fs_cadet_server.c12
-rw-r--r--src/fs/gnunet-service-fs_cp.c46
-rw-r--r--src/fs/gnunet-service-fs_lc.c10
-rw-r--r--src/fs/gnunet-service-fs_pe.c16
-rw-r--r--src/fs/gnunet-service-fs_pr.c18
-rw-r--r--src/fs/gnunet-service-fs_push.c10
-rw-r--r--src/fs/gnunet-service-fs_put.c10
-rw-r--r--src/fs/test_fs_download.c6
-rw-r--r--src/fs/test_fs_download_persistence.c6
-rw-r--r--src/fs/test_fs_namespace.c8
-rw-r--r--src/fs/test_fs_publish_persistence.c8
-rw-r--r--src/fs/test_fs_search.c8
-rw-r--r--src/fs/test_fs_search_persistence.c8
-rw-r--r--src/fs/test_fs_search_probes.c8
-rw-r--r--src/fs/test_fs_search_with_and.c8
34 files changed, 218 insertions, 218 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index 302020d7d3..6c534ff322 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -131,7 +131,7 @@ process_job_queue (void *cls,
int num_downloads_change;
int block_limit_hit;
- h->queue_job = GNUNET_SCHEDULER_NO_TASK;
+ h->queue_job = NULL;
/* restart_at will be set to the time when it makes sense to
re-evaluate the job queue (unless, of course, jobs complete
or are added, then we'll be triggered immediately */
@@ -336,7 +336,7 @@ GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h,
qe->priority = priority;
GNUNET_CONTAINER_DLL_insert_after (h->pending_head, h->pending_tail,
h->pending_tail, qe);
- if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
+ if (h->queue_job != NULL)
GNUNET_SCHEDULER_cancel (h->queue_job);
h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -364,7 +364,7 @@ GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qe)
stop_job (qe);
GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, qe);
GNUNET_free (qe);
- if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
+ if (h->queue_job != NULL)
GNUNET_SCHEDULER_cancel (h->queue_job);
h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h);
}
@@ -1619,7 +1619,7 @@ deserialize_publish_file (void *cls,
/* re-start publishing (if needed)... */
if (GNUNET_YES != pc->all_done)
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority
(GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
@@ -2140,7 +2140,7 @@ GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc)
GNUNET_assert ((GNUNET_YES == GNUNET_FS_uri_test_ksk (sc->uri)) ||
(GNUNET_YES == GNUNET_FS_uri_test_sks (sc->uri)));
uris = GNUNET_FS_uri_to_string (sc->uri);
- in_pause = (sc->task != GNUNET_SCHEDULER_NO_TASK) ? 'r' : '\0';
+ in_pause = (sc->task != NULL) ? 'r' : '\0';
if ((GNUNET_OK != GNUNET_BIO_write_string (wh, uris)) ||
(GNUNET_OK != write_start_time (wh, sc->start_time)) ||
(GNUNET_OK != GNUNET_BIO_write_string (wh, sc->emsg)) ||
@@ -3130,7 +3130,7 @@ GNUNET_FS_stop (struct GNUNET_FS_Handle *h)
{
while (h->top_head != NULL)
h->top_head->ssf (h->top_head->ssf_cls);
- if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
+ if (h->queue_job != NULL)
GNUNET_SCHEDULER_cancel (h->queue_job);
GNUNET_free (h->client_name);
GNUNET_free (h);
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h
index 157662a65b..5fbdef6c24 100644
--- a/src/fs/fs_api.h
+++ b/src/fs/fs_api.h
@@ -601,7 +601,7 @@ struct GNUNET_FS_SearchResult
* complete on time (and that will need to be cancelled if we clean
* up the search result before then).
*/
- GNUNET_SCHEDULER_TaskIdentifier probe_cancel_task;
+ struct GNUNET_SCHEDULER_Task * probe_cancel_task;
/**
* When did the current probe become active?
@@ -1170,13 +1170,13 @@ struct GNUNET_FS_Handle
* Task that processes the jobs in the running and pending queues
* (and moves jobs around as needed).
*/
- GNUNET_SCHEDULER_TaskIdentifier queue_job;
+ struct GNUNET_SCHEDULER_Task * queue_job;
/**
* Task we use to report periodically to the application that
* certain search probes (from @e probes_head) are still running.
*/
- GNUNET_SCHEDULER_TaskIdentifier probe_ping_task;
+ struct GNUNET_SCHEDULER_Task * probe_ping_task;
/**
* Average time we take for a single request to be satisfied.
@@ -1300,7 +1300,7 @@ struct GNUNET_FS_PublishContext
* ID of the task performing the upload. NO_TASK if the upload has
* completed.
*/
- GNUNET_SCHEDULER_TaskIdentifier upload_task;
+ struct GNUNET_SCHEDULER_Task * upload_task;
/**
* Storage space to reserve for the operation.
@@ -1629,10 +1629,10 @@ struct GNUNET_FS_SearchContext
/**
* ID of a task that is using this struct and that must be cancelled
* when the search is being stopped (if not
- * #GNUNET_SCHEDULER_NO_TASK). Used for the task that adds some
+ * #NULL). Used for the task that adds some
* artificial delay when trying to reconnect to the FS service.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* How many of the entries in the search request
@@ -1961,12 +1961,12 @@ struct GNUNET_FS_DownloadContext
/**
* ID of a task that is using this struct and that must be cancelled
* when the download is being stopped (if not
- * #GNUNET_SCHEDULER_NO_TASK). Used for the task that adds some
+ * #NULL). Used for the task that adds some
* artificial delay when trying to reconnect to the FS service or
* the task processing incrementally the data on disk, or the
* task requesting blocks, etc.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* What is the first offset that we're interested
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c
index 83e436b168..2477aab4b9 100644
--- a/src/fs/fs_dirmetascan.c
+++ b/src/fs/fs_dirmetascan.c
@@ -80,7 +80,7 @@ struct GNUNET_FS_DirScanner
/**
* Task scheduled when we are done.
*/
- GNUNET_SCHEDULER_TaskIdentifier stop_task;
+ struct GNUNET_SCHEDULER_Task * stop_task;
/**
* Arguments for helper.
@@ -106,7 +106,7 @@ GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds)
/* free resources */
if (NULL != ds->toplevel)
GNUNET_FS_share_tree_free (ds->toplevel);
- if (GNUNET_SCHEDULER_NO_TASK != ds->stop_task)
+ if (NULL != ds->stop_task)
GNUNET_SCHEDULER_cancel (ds->stop_task);
GNUNET_free_non_null (ds->ex_arg);
GNUNET_free (ds->filename_expanded);
@@ -230,7 +230,7 @@ finish_scan (void *cls,
{
struct GNUNET_FS_DirScanner *ds = cls;
- ds->stop_task = GNUNET_SCHEDULER_NO_TASK;
+ ds->stop_task = NULL;
if (NULL != ds->helper)
{
GNUNET_HELPER_stop (ds->helper, GNUNET_NO);
@@ -427,7 +427,7 @@ helper_died_cb (void *cls)
struct GNUNET_FS_DirScanner *ds = cls;
ds->helper = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != ds->stop_task)
+ if (NULL != ds->stop_task)
return; /* normal death, was finished */
ds->progress_callback (ds->progress_callback_cls,
NULL, GNUNET_SYSERR,
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index 348a0bc173..3a6072d8ba 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -393,10 +393,10 @@ check_completed (struct GNUNET_FS_DownloadContext *dc)
GNUNET_FS_dequeue_ (dc->job_queue);
dc->job_queue = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != dc->task)
+ if (NULL != dc->task)
{
GNUNET_SCHEDULER_cancel (dc->task);
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
}
if (NULL != dc->rfh)
{
@@ -1380,7 +1380,7 @@ do_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_FS_DownloadContext *dc = cls;
struct GNUNET_CLIENT_Connection *client;
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
client = GNUNET_CLIENT_connect ("fs", dc->h->cfg);
if (NULL == client)
{
@@ -1633,10 +1633,10 @@ reconstruct_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_FS_DownloadContext *dc = cls;
/* clean up state from tree encoder */
- if (dc->task != GNUNET_SCHEDULER_NO_TASK)
+ if (dc->task != NULL)
{
GNUNET_SCHEDULER_cancel (dc->task);
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
}
if (NULL != dc->rfh)
{
@@ -1662,7 +1662,7 @@ get_next_block (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_FS_DownloadContext *dc = cls;
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
GNUNET_FS_tree_encoder_next (dc->te);
}
@@ -1866,7 +1866,7 @@ GNUNET_FS_download_start_task_ (void *cls,
struct GNUNET_DISK_FileHandle *fh;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start task running...\n");
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
if (0 == dc->length)
{
/* no bytes required! */
@@ -2028,10 +2028,10 @@ GNUNET_FS_download_signal_suspend_ (void *cls)
if (NULL != dc->parent)
GNUNET_CONTAINER_DLL_remove (dc->parent->child_head, dc->parent->child_tail,
dc);
- if (GNUNET_SCHEDULER_NO_TASK != dc->task)
+ if (NULL != dc->task)
{
GNUNET_SCHEDULER_cancel (dc->task);
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
}
pi.status = GNUNET_FS_STATUS_DOWNLOAD_SUSPEND;
GNUNET_FS_download_make_status_ (&pi, dc);
@@ -2336,10 +2336,10 @@ GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete)
if (NULL != dc->top)
GNUNET_FS_end_top (dc->h, dc->top);
- if (GNUNET_SCHEDULER_NO_TASK != dc->task)
+ if (NULL != dc->task)
{
GNUNET_SCHEDULER_cancel (dc->task);
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
}
search_was_null = (NULL == dc->search);
if (NULL != dc->search)
diff --git a/src/fs/fs_list_indexed.c b/src/fs/fs_list_indexed.c
index 7a891155e3..8c25587452 100644
--- a/src/fs/fs_list_indexed.c
+++ b/src/fs/fs_list_indexed.c
@@ -59,7 +59,7 @@ struct GNUNET_FS_GetIndexedContext
/**
* Continuation to trigger at the end.
*/
- GNUNET_SCHEDULER_Task cont;
+ GNUNET_SCHEDULER_TaskCallback cont;
/**
* Closure for cont.
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index a8a9a220f1..175e453c64 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -97,7 +97,7 @@ publish_cleanup (struct GNUNET_FS_PublishContext *pc)
GNUNET_CLIENT_disconnect (pc->client);
pc->client = NULL;
}
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
GNUNET_free (pc);
}
@@ -138,7 +138,7 @@ ds_put_cont (void *cls, int success,
GNUNET_FS_unindex_start (pc->h, pc->fi_pos->filename, NULL);
}
}
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
&GNUNET_FS_publish_main_, pc);
@@ -316,7 +316,7 @@ publish_kblocks_cont (void *cls,
signal_publish_error (p, pc, emsg);
GNUNET_FS_file_information_sync_ (p);
GNUNET_FS_publish_sync_ (pc);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority
(GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
@@ -334,7 +334,7 @@ publish_kblocks_cont (void *cls,
else
pc->fi_pos = p->dir;
GNUNET_FS_publish_sync_ (pc);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
&GNUNET_FS_publish_main_, pc);
@@ -449,7 +449,7 @@ encode_cont (void *cls,
p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, flen);
}
/* continue with main */ /* continue with main */
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
&GNUNET_FS_publish_main_, pc);
@@ -487,7 +487,7 @@ block_proc (void *cls,
if (NULL == pc->dsh)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Waiting for datastore connection\n");
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority
(GNUNET_SCHEDULER_PRIORITY_BACKGROUND, &GNUNET_FS_publish_main_, pc);
@@ -947,7 +947,7 @@ GNUNET_FS_publish_main_ (void *cls,
struct GNUNET_FS_FileInformation *p;
char *fn;
- pc->upload_task = GNUNET_SCHEDULER_NO_TASK;
+ pc->upload_task = NULL;
p = pc->fi_pos;
if (NULL == p)
{
@@ -1234,10 +1234,10 @@ GNUNET_FS_publish_signal_suspend_ (void *cls)
{
struct GNUNET_FS_PublishContext *pc = cls;
- if (GNUNET_SCHEDULER_NO_TASK != pc->upload_task)
+ if (NULL != pc->upload_task)
{
GNUNET_SCHEDULER_cancel (pc->upload_task);
- pc->upload_task = GNUNET_SCHEDULER_NO_TASK;
+ pc->upload_task = NULL;
}
pc->skip_next_fi_callback = GNUNET_YES;
GNUNET_FS_file_information_inspect (pc->fi, &fip_signal_suspend, pc);
@@ -1275,7 +1275,7 @@ finish_reserve (void *cls, int success,
return;
}
pc->rid = success;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
&GNUNET_FS_publish_main_, pc);
@@ -1373,7 +1373,7 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
}
else
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == ret->upload_task);
+ GNUNET_assert (NULL == ret->upload_task);
ret->upload_task =
GNUNET_SCHEDULER_add_with_priority
(GNUNET_SCHEDULER_PRIORITY_BACKGROUND, &GNUNET_FS_publish_main_, ret);
@@ -1462,10 +1462,10 @@ GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc)
GNUNET_FS_publish_sks_cancel (pc->sks_pc);
pc->sks_pc = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pc->upload_task)
+ if (NULL != pc->upload_task)
{
GNUNET_SCHEDULER_cancel (pc->upload_task);
- pc->upload_task = GNUNET_SCHEDULER_NO_TASK;
+ pc->upload_task = NULL;
}
pc->skip_next_fi_callback = GNUNET_YES;
GNUNET_FS_file_information_inspect (pc->fi, &fip_signal_stop, pc);
diff --git a/src/fs/fs_publish_ksk.c b/src/fs/fs_publish_ksk.c
index 67157f408b..436bac6334 100644
--- a/src/fs/fs_publish_ksk.c
+++ b/src/fs/fs_publish_ksk.c
@@ -74,7 +74,7 @@ struct GNUNET_FS_PublishKskContext
/**
* Current task.
*/
- GNUNET_SCHEDULER_TaskIdentifier ksk_task;
+ struct GNUNET_SCHEDULER_Task * ksk_task;
/**
* Function to call once we're done.
@@ -156,7 +156,7 @@ publish_ksk_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_FS_PublishKskContext *pkc = cls;
const char *keyword;
- pkc->ksk_task = GNUNET_SCHEDULER_NO_TASK;
+ pkc->ksk_task = NULL;
if ( (pkc->i == pkc->ksk_uri->data.ksk.keywordCount) ||
(NULL == pkc->dsh) )
{
@@ -236,10 +236,10 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
void
GNUNET_FS_publish_ksk_cancel (struct GNUNET_FS_PublishKskContext *pkc)
{
- if (GNUNET_SCHEDULER_NO_TASK != pkc->ksk_task)
+ if (NULL != pkc->ksk_task)
{
GNUNET_SCHEDULER_cancel (pkc->ksk_task);
- pkc->ksk_task = GNUNET_SCHEDULER_NO_TASK;
+ pkc->ksk_task = NULL;
}
if (NULL != pkc->uc)
{
diff --git a/src/fs/fs_publish_ublock.c b/src/fs/fs_publish_ublock.c
index 4399b8c8ec..1cba7a4fcc 100644
--- a/src/fs/fs_publish_ublock.c
+++ b/src/fs/fs_publish_ublock.c
@@ -112,7 +112,7 @@ struct GNUNET_FS_PublishUblockContext
/**
* Task to run continuation asynchronously.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
};
@@ -155,7 +155,7 @@ run_cont (void *cls,
{
struct GNUNET_FS_PublishUblockContext *uc = cls;
- uc->task = GNUNET_SCHEDULER_NO_TASK;
+ uc->task = NULL;
uc->cont (uc->cont_cls, NULL);
GNUNET_free (uc);
}
@@ -316,7 +316,7 @@ GNUNET_FS_publish_ublock_cancel_ (struct GNUNET_FS_PublishUblockContext *uc)
{
if (NULL != uc->qre)
GNUNET_DATASTORE_cancel (uc->qre);
- if (GNUNET_SCHEDULER_NO_TASK != uc->task)
+ if (NULL != uc->task)
GNUNET_SCHEDULER_cancel (uc->task);
GNUNET_free (uc);
}
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index c85d6d3df6..8f640009a6 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -223,7 +223,7 @@ probe_failure_handler (void *cls,
{
struct GNUNET_FS_SearchResult *sr = cls;
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
sr->availability_trials++;
GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES);
sr->probe_ctx = NULL;
@@ -249,7 +249,7 @@ probe_success_handler (void *cls,
{
struct GNUNET_FS_SearchResult *sr = cls;
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
sr->availability_trials++;
sr->availability_success++;
GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES);
@@ -303,34 +303,34 @@ GNUNET_FS_search_probe_progress_ (void *cls,
/* ignore */
break;
case GNUNET_FS_STATUS_DOWNLOAD_ERROR:
- if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
+ if (NULL != sr->probe_cancel_task)
{
GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
}
sr->probe_cancel_task =
GNUNET_SCHEDULER_add_delayed (sr->remaining_probe_time,
&probe_failure_handler, sr);
break;
case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
- if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
+ if (NULL != sr->probe_cancel_task)
{
GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
}
sr->probe_cancel_task =
GNUNET_SCHEDULER_add_now (&probe_success_handler, sr);
break;
case GNUNET_FS_STATUS_DOWNLOAD_STOPPED:
- if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
+ if (NULL != sr->probe_cancel_task)
{
GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
}
sr = NULL;
break;
case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE:
- if (GNUNET_SCHEDULER_NO_TASK == sr->probe_cancel_task)
+ if (NULL == sr->probe_cancel_task)
{
sr->probe_active_time = GNUNET_TIME_absolute_get ();
sr->probe_cancel_task =
@@ -339,10 +339,10 @@ GNUNET_FS_search_probe_progress_ (void *cls,
}
break;
case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE:
- if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
+ if (NULL != sr->probe_cancel_task)
{
GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
}
dur = GNUNET_TIME_absolute_get_duration (sr->probe_active_time);
sr->remaining_probe_time =
@@ -396,7 +396,7 @@ start_probe_ping_task (struct GNUNET_FS_SearchResult *sr)
GNUNET_CONTAINER_DLL_insert (h->probes_head,
h->probes_tail,
sr);
- if (GNUNET_SCHEDULER_NO_TASK == h->probe_ping_task)
+ if (NULL == h->probe_ping_task)
h->probe_ping_task
= GNUNET_SCHEDULER_add_now (&probe_ping_task_cb,
h);
@@ -419,7 +419,7 @@ GNUNET_FS_stop_probe_ping_task_ (struct GNUNET_FS_SearchResult *sr)
if (NULL == h->probes_head)
{
GNUNET_SCHEDULER_cancel (h->probe_ping_task);
- h->probe_ping_task = GNUNET_SCHEDULER_NO_TASK;
+ h->probe_ping_task = NULL;
}
}
@@ -520,10 +520,10 @@ GNUNET_FS_search_stop_probe_ (struct GNUNET_FS_SearchResult *sr)
sr->probe_ctx = NULL;
GNUNET_FS_stop_probe_ping_task_ (sr);
}
- if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
+ if (NULL != sr->probe_cancel_task)
{
GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
}
}
@@ -1253,7 +1253,7 @@ do_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_FS_SearchContext *sc = cls;
struct GNUNET_CLIENT_Connection *client;
- sc->task = GNUNET_SCHEDULER_NO_TASK;
+ sc->task = NULL;
client = GNUNET_CLIENT_connect ("fs", sc->h->cfg);
if (NULL == client)
{
@@ -1446,10 +1446,10 @@ search_result_freeze_probes (void *cls,
sr->probe_ctx = NULL;
GNUNET_FS_stop_probe_ping_task_ (sr);
}
- if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
+ if (NULL != sr->probe_cancel_task)
{
GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
}
if (NULL != sr->update_search)
GNUNET_FS_search_pause (sr->update_search);
@@ -1545,10 +1545,10 @@ GNUNET_FS_search_signal_suspend_ (void *cls)
pi.status = GNUNET_FS_STATUS_SEARCH_SUSPEND;
sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc);
GNUNET_break (NULL == sc->client_info);
- if (sc->task != GNUNET_SCHEDULER_NO_TASK)
+ if (sc->task != NULL)
{
GNUNET_SCHEDULER_cancel (sc->task);
- sc->task = GNUNET_SCHEDULER_NO_TASK;
+ sc->task = NULL;
}
if (NULL != sc->client)
{
@@ -1609,10 +1609,10 @@ GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc)
{
struct GNUNET_FS_ProgressInfo pi;
- if (GNUNET_SCHEDULER_NO_TASK != sc->task)
+ if (NULL != sc->task)
{
GNUNET_SCHEDULER_cancel (sc->task);
- sc->task = GNUNET_SCHEDULER_NO_TASK;
+ sc->task = NULL;
}
if (NULL != sc->client)
GNUNET_CLIENT_disconnect (sc->client);
@@ -1636,7 +1636,7 @@ GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc)
struct GNUNET_FS_ProgressInfo pi;
GNUNET_assert (NULL == sc->client);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sc->task);
+ GNUNET_assert (NULL == sc->task);
do_reconnect (sc, NULL);
GNUNET_FS_search_sync_ (sc);
pi.status = GNUNET_FS_STATUS_SEARCH_CONTINUED;
@@ -1721,7 +1721,7 @@ search_result_free (void *cls,
GNUNET_assert (NULL == sr->update_search);
}
GNUNET_break (NULL == sr->probe_ctx);
- GNUNET_break (GNUNET_SCHEDULER_NO_TASK == sr->probe_cancel_task);
+ GNUNET_break (NULL == sr->probe_cancel_task);
GNUNET_break (NULL == sr->client_info);
GNUNET_free_non_null (sr->serialization);
GNUNET_FS_uri_destroy (sr->uri);
@@ -1766,7 +1766,7 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc)
pi.status = GNUNET_FS_STATUS_SEARCH_STOPPED;
sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc);
GNUNET_break (NULL == sc->client_info);
- if (GNUNET_SCHEDULER_NO_TASK != sc->task)
+ if (NULL != sc->task)
GNUNET_SCHEDULER_cancel (sc->task);
if (NULL != sc->client)
GNUNET_CLIENT_disconnect (sc->client);
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c
index 1e098bd60e..589f979d63 100644
--- a/src/fs/fs_test_lib.c
+++ b/src/fs/fs_test_lib.c
@@ -63,7 +63,7 @@ struct TestPublishOperation
/**
* Task to abort publishing (timeout).
*/
- GNUNET_SCHEDULER_TaskIdentifier publish_timeout_task;
+ struct GNUNET_SCHEDULER_Task * publish_timeout_task;
/**
* Seed for file generation.
@@ -131,7 +131,7 @@ struct TestDownloadOperation
/**
* Function to call when download is done.
*/
- GNUNET_SCHEDULER_Task download_cont;
+ GNUNET_SCHEDULER_TaskCallback download_cont;
/**
* Closure for download_cont.
@@ -146,7 +146,7 @@ struct TestDownloadOperation
/**
* Task to abort downloading (timeout).
*/
- GNUNET_SCHEDULER_TaskIdentifier download_timeout_task;
+ struct GNUNET_SCHEDULER_Task * download_timeout_task;
/**
* Context for current download operation.
@@ -215,7 +215,7 @@ publish_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct TestPublishOperation *po = cls;
- po->publish_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ po->publish_timeout_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout while trying to publish data\n");
GNUNET_TESTBED_operation_done (po->fs_op);
@@ -242,7 +242,7 @@ publish_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
{
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
GNUNET_SCHEDULER_cancel (po->publish_timeout_task);
- po->publish_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ po->publish_timeout_task = NULL;
po->publish_uri =
GNUNET_FS_uri_dup (info->value.publish.specifics.completed.chk_uri);
GNUNET_SCHEDULER_add_continuation (&report_uri, po,
@@ -489,7 +489,7 @@ download_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout while trying to download file\n");
- dop->download_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ dop->download_timeout_task = NULL;
GNUNET_FS_download_stop (dop->download_context, GNUNET_YES);
GNUNET_SCHEDULER_add_continuation (dop->download_cont,
dop->download_cont_cls,
@@ -543,7 +543,7 @@ download_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
break;
case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
GNUNET_SCHEDULER_cancel (dop->download_timeout_task);
- dop->download_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ dop->download_timeout_task = NULL;
GNUNET_SCHEDULER_add_continuation (&report_success, dop,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
@@ -627,7 +627,7 @@ GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer,
struct GNUNET_TIME_Relative timeout,
uint32_t anonymity, uint32_t seed,
const struct GNUNET_FS_Uri *uri, unsigned int verbose,
- GNUNET_SCHEDULER_Task cont, void *cont_cls)
+ GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
{
struct TestDownloadOperation *dop;
diff --git a/src/fs/fs_test_lib.h b/src/fs/fs_test_lib.h
index 679e0745c2..112ff38930 100644
--- a/src/fs/fs_test_lib.h
+++ b/src/fs/fs_test_lib.h
@@ -89,7 +89,7 @@ GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer,
struct GNUNET_TIME_Relative timeout,
uint32_t anonymity, uint32_t seed,
const struct GNUNET_FS_Uri *uri, unsigned int verbose,
- GNUNET_SCHEDULER_Task cont, void *cont_cls);
+ GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls);
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c
index 5dc39e4e61..715ecddb15 100644
--- a/src/fs/fs_tree.c
+++ b/src/fs/fs_tree.c
@@ -63,7 +63,7 @@ struct GNUNET_FS_TreeEncoder
/**
* Function to call once we're done with processing.
*/
- GNUNET_SCHEDULER_Task cont;
+ GNUNET_SCHEDULER_TaskCallback cont;
/**
* Set to an error message (if we had an error).
@@ -272,7 +272,7 @@ GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size,
GNUNET_FS_DataReader reader,
GNUNET_FS_TreeBlockProcessor proc,
GNUNET_FS_TreeProgressCallback progress,
- GNUNET_SCHEDULER_Task cont)
+ GNUNET_SCHEDULER_TaskCallback cont)
{
struct GNUNET_FS_TreeEncoder *te;
diff --git a/src/fs/fs_tree.h b/src/fs/fs_tree.h
index cd25a6dd14..2aef80b858 100644
--- a/src/fs/fs_tree.h
+++ b/src/fs/fs_tree.h
@@ -142,7 +142,7 @@ GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size,
void *cls, GNUNET_FS_DataReader reader,
GNUNET_FS_TreeBlockProcessor proc,
GNUNET_FS_TreeProgressCallback progress,
- GNUNET_SCHEDULER_Task cont);
+ GNUNET_SCHEDULER_TaskCallback cont);
/**
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c
index 32725f66f0..c3b19b9edb 100644
--- a/src/fs/gnunet-auto-share.c
+++ b/src/fs/gnunet-auto-share.c
@@ -97,12 +97,12 @@ static int do_disable_creation_time;
/**
* Handle for the 'shutdown' task.
*/
-static GNUNET_SCHEDULER_TaskIdentifier kill_task;
+static struct GNUNET_SCHEDULER_Task * kill_task;
/**
* Handle for the main task that does scanning and working.
*/
-static GNUNET_SCHEDULER_TaskIdentifier run_task;
+static struct GNUNET_SCHEDULER_Task * run_task;
/**
* Anonymity level option to use for publishing.
@@ -322,17 +322,17 @@ save_state ()
static void
do_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- kill_task = GNUNET_SCHEDULER_NO_TASK;
+ kill_task = NULL;
do_shutdown = GNUNET_YES;
if (NULL != publish_proc)
{
GNUNET_OS_process_kill (publish_proc, SIGKILL);
return;
}
- if (GNUNET_SCHEDULER_NO_TASK != run_task)
+ if (NULL != run_task)
{
GNUNET_SCHEDULER_cancel (run_task);
- run_task = GNUNET_SCHEDULER_NO_TASK;
+ run_task = NULL;
}
}
@@ -363,7 +363,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
const struct GNUNET_DISK_FileHandle *pr;
- run_task = GNUNET_SCHEDULER_NO_TASK;
+ run_task = NULL;
pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
{
@@ -457,7 +457,7 @@ work (void *cls,
const struct GNUNET_DISK_FileHandle *pr;
int argc;
- run_task = GNUNET_SCHEDULER_NO_TASK;
+ run_task = NULL;
wi = work_head;
GNUNET_CONTAINER_DLL_remove (work_head,
work_tail,
@@ -629,7 +629,7 @@ add_file (void *cls,
static void
scan (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- run_task = GNUNET_SCHEDULER_NO_TASK;
+ run_task = NULL;
start_time = GNUNET_TIME_absolute_get ();
(void) GNUNET_DISK_directory_scan (dir_name,
&add_file,
diff --git a/src/fs/gnunet-daemon-fsprofiler.c b/src/fs/gnunet-daemon-fsprofiler.c
index 1549972a1c..9c4f28351c 100644
--- a/src/fs/gnunet-daemon-fsprofiler.c
+++ b/src/fs/gnunet-daemon-fsprofiler.c
@@ -69,12 +69,12 @@ struct Pattern
/**
* Task to run the operation.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* Secondary task to run the operation.
*/
- GNUNET_SCHEDULER_TaskIdentifier stask;
+ struct GNUNET_SCHEDULER_Task * stask;
/**
* X-value.
@@ -276,7 +276,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
while (NULL != (p = publish_head))
{
- if (GNUNET_SCHEDULER_NO_TASK != p->task)
+ if (NULL != p->task)
GNUNET_SCHEDULER_cancel (p->task);
if (NULL != p->ctx)
GNUNET_FS_publish_stop (p->ctx);
@@ -285,9 +285,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
}
while (NULL != (p = download_head))
{
- if (GNUNET_SCHEDULER_NO_TASK != p->task)
+ if (NULL != p->task)
GNUNET_SCHEDULER_cancel (p->task);
- if (GNUNET_SCHEDULER_NO_TASK != p->stask)
+ if (NULL != p->stask)
GNUNET_SCHEDULER_cancel (p->stask);
if (NULL != p->ctx)
GNUNET_FS_download_stop (p->ctx, GNUNET_YES);
@@ -320,7 +320,7 @@ publish_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct Pattern *p = cls;
- p->task = GNUNET_SCHEDULER_NO_TASK;
+ p->task = NULL;
GNUNET_FS_publish_stop (p->ctx);
}
@@ -336,7 +336,7 @@ download_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct Pattern *p = cls;
- p->task = GNUNET_SCHEDULER_NO_TASK;
+ p->task = NULL;
GNUNET_FS_download_stop (p->ctx, GNUNET_YES);
}
@@ -352,7 +352,7 @@ search_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct Pattern *p = cls;
- p->stask = GNUNET_SCHEDULER_NO_TASK;
+ p->stask = NULL;
GNUNET_FS_search_stop (p->sctx);
}
@@ -507,7 +507,7 @@ start_publish (void *cls,
struct Pattern *p = cls;
struct GNUNET_FS_FileInformation *fi;
- p->task = GNUNET_SCHEDULER_NO_TASK;
+ p->task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
fi = make_file (p->x, p->y, p);
@@ -532,7 +532,7 @@ start_download (void *cls,
struct Pattern *p = cls;
struct GNUNET_FS_Uri *keywords;
- p->task = GNUNET_SCHEDULER_NO_TASK;
+ p->task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
keywords = make_keywords (p->x);
diff --git a/src/fs/gnunet-fs-profiler.c b/src/fs/gnunet-fs-profiler.c
index 56a3084cc4..ba081f7cf6 100644
--- a/src/fs/gnunet-fs-profiler.c
+++ b/src/fs/gnunet-fs-profiler.c
@@ -50,7 +50,7 @@ static struct GNUNET_TIME_Relative timeout;
/**
* Handle to the task run during termination.
*/
-static GNUNET_SCHEDULER_TaskIdentifier terminate_taskid;
+static struct GNUNET_SCHEDULER_Task * terminate_taskid;
/**
@@ -115,7 +115,7 @@ static void
terminate_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- terminate_taskid = GNUNET_SCHEDULER_NO_TASK;
+ terminate_taskid = NULL;
GNUNET_TESTBED_get_statistics (0, NULL,
NULL, NULL,
&process_stats,
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index ceed3109fd..2ec50b14d3 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -127,7 +127,7 @@ static int do_disable_creation_time;
/**
* Task run on CTRL-C to kill everything nicely.
*/
-static GNUNET_SCHEDULER_TaskIdentifier kill_task;
+static struct GNUNET_SCHEDULER_Task * kill_task;
/**
* Handle to the directory scanner (for recursive insertions).
@@ -159,7 +159,7 @@ do_stop_task (void *cls,
{
struct GNUNET_FS_PublishContext *p;
- kill_task = GNUNET_SCHEDULER_NO_TASK;
+ kill_task = NULL;
if (NULL != identity)
{
GNUNET_IDENTITY_disconnect (identity);
@@ -188,7 +188,7 @@ do_stop_task (void *cls,
static void
stop_scanner_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- kill_task = GNUNET_SCHEDULER_NO_TASK;
+ kill_task = NULL;
if (NULL != ds)
{
GNUNET_FS_directory_scan_abort (ds);
@@ -256,10 +256,10 @@ progress_cb (void *cls,
case GNUNET_FS_STATUS_PUBLISH_ERROR:
FPRINTF (stderr, _("Error publishing: %s.\n"),
info->value.publish.specifics.error.message);
- if (kill_task != GNUNET_SCHEDULER_NO_TASK)
+ if (kill_task != NULL)
{
GNUNET_SCHEDULER_cancel (kill_task);
- kill_task = GNUNET_SCHEDULER_NO_TASK;
+ kill_task = NULL;
}
kill_task = GNUNET_SCHEDULER_add_now (&do_stop_task, NULL);
break;
@@ -284,7 +284,7 @@ progress_cb (void *cls,
}
if (NULL == info->value.publish.pctx)
{
- if (GNUNET_SCHEDULER_NO_TASK != kill_task)
+ if (NULL != kill_task)
GNUNET_SCHEDULER_cancel (kill_task);
kill_task = GNUNET_SCHEDULER_add_now (&do_stop_task, NULL);
}
@@ -669,10 +669,10 @@ directory_scan_cb (void *cls,
FPRINTF (stdout,
"%s",
_("Internal error scanning directory.\n"));
- if (kill_task != GNUNET_SCHEDULER_NO_TASK)
+ if (kill_task != NULL)
{
GNUNET_SCHEDULER_cancel (kill_task);
- kill_task = GNUNET_SCHEDULER_NO_TASK;
+ kill_task = NULL;
}
kill_task = GNUNET_SCHEDULER_add_now (&stop_scanner_task, NULL);
break;
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 7c8833ce82..4d33626c21 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -167,7 +167,7 @@ static struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
/**
* ID of our task that we use to age the cover counters.
*/
-static GNUNET_SCHEDULER_TaskIdentifier cover_age_task;
+static struct GNUNET_SCHEDULER_Task * cover_age_task;
/**
* Datastore 'GET' load tracking.
@@ -569,10 +569,10 @@ shutdown_task (void *cls,
block_cfg = NULL;
GNUNET_STATISTICS_destroy (GSF_stats, GNUNET_NO);
GSF_stats = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != cover_age_task)
+ if (NULL != cover_age_task)
{
GNUNET_SCHEDULER_cancel (cover_age_task);
- cover_age_task = GNUNET_SCHEDULER_NO_TASK;
+ cover_age_task = NULL;
}
GNUNET_FS_indexing_done ();
GNUNET_LOAD_value_free (datastore_get_load);
diff --git a/src/fs/gnunet-service-fs_cadet_client.c b/src/fs/gnunet-service-fs_cadet_client.c
index f0905e6c3f..88014f2042 100644
--- a/src/fs/gnunet-service-fs_cadet_client.c
+++ b/src/fs/gnunet-service-fs_cadet_client.c
@@ -140,14 +140,14 @@ struct CadetHandle
* a few seconds to give the application a chance to give
* us another query).
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Task to reset cadets that had errors (asynchronously,
* as we may not be able to do it immediately during a
* callback from the cadet API).
*/
- GNUNET_SCHEDULER_TaskIdentifier reset_task;
+ struct GNUNET_SCHEDULER_Task * reset_task;
};
@@ -258,7 +258,7 @@ cadet_timeout (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Timeout on cadet channel to %s\n",
GNUNET_i2s (&mh->target));
- mh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ mh->timeout_task = NULL;
tun = mh->channel;
mh->channel = NULL;
if(NULL != tun)
@@ -278,7 +278,7 @@ reset_cadet_task (void *cls,
{
struct CadetHandle *mh = cls;
- mh->reset_task = GNUNET_SCHEDULER_NO_TASK;
+ mh->reset_task = NULL;
reset_cadet (mh);
}
@@ -292,7 +292,7 @@ reset_cadet_task (void *cls,
static void
reset_cadet_async (struct CadetHandle *mh)
{
- if (GNUNET_SCHEDULER_NO_TASK != mh->reset_task)
+ if (NULL != mh->reset_task)
GNUNET_SCHEDULER_cancel (mh->reset_task);
mh->reset_task = GNUNET_SCHEDULER_add_now (&reset_cadet_task,
mh);
@@ -527,10 +527,10 @@ get_cadet (const struct GNUNET_PeerIdentity *target)
target);
if (NULL != mh)
{
- if (GNUNET_SCHEDULER_NO_TASK != mh->timeout_task)
+ if (NULL != mh->timeout_task)
{
GNUNET_SCHEDULER_cancel (mh->timeout_task);
- mh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ mh->timeout_task = NULL;
}
return mh;
}
@@ -698,9 +698,9 @@ cleaner_cb (void *cls,
mh);
if (NULL != mh->wh)
GNUNET_CADET_notify_transmit_ready_cancel (mh->wh);
- if (GNUNET_SCHEDULER_NO_TASK != mh->timeout_task)
+ if (NULL != mh->timeout_task)
GNUNET_SCHEDULER_cancel (mh->timeout_task);
- if (GNUNET_SCHEDULER_NO_TASK != mh->reset_task)
+ if (NULL != mh->reset_task)
GNUNET_SCHEDULER_cancel (mh->reset_task);
GNUNET_assert (0 ==
GNUNET_CONTAINER_multihashmap_size (mh->waiting_map));
diff --git a/src/fs/gnunet-service-fs_cadet_server.c b/src/fs/gnunet-service-fs_cadet_server.c
index 6ce18afb55..74251e4b79 100644
--- a/src/fs/gnunet-service-fs_cadet_server.c
+++ b/src/fs/gnunet-service-fs_cadet_server.c
@@ -108,12 +108,12 @@ struct CadetClient
/**
* Task that is scheduled to asynchronously terminate the connection.
*/
- GNUNET_SCHEDULER_TaskIdentifier terminate_task;
+ struct GNUNET_SCHEDULER_Task * terminate_task;
/**
* Task that is scheduled to terminate idle connections.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Size of the last write that was initiated.
@@ -163,7 +163,7 @@ timeout_cadet_task (void *cls,
struct CadetClient *sc = cls;
struct GNUNET_CADET_Channel *tun;
- sc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ sc->timeout_task = NULL;
tun = sc->channel;
sc->channel = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -181,7 +181,7 @@ timeout_cadet_task (void *cls,
static void
refresh_timeout_task (struct CadetClient *sc)
{
- if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task)
+ if (NULL != sc->timeout_task)
GNUNET_SCHEDULER_cancel (sc->timeout_task);
sc->timeout_task = GNUNET_SCHEDULER_add_delayed (IDLE_TIMEOUT,
&timeout_cadet_task,
@@ -530,9 +530,9 @@ cleaner_cb (void *cls,
GNUNET_STATISTICS_update (GSF_stats,
gettext_noop ("# cadet connections active"), -1,
GNUNET_NO);
- if (GNUNET_SCHEDULER_NO_TASK != sc->terminate_task)
+ if (NULL != sc->terminate_task)
GNUNET_SCHEDULER_cancel (sc->terminate_task);
- if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task)
+ if (NULL != sc->timeout_task)
GNUNET_SCHEDULER_cancel (sc->timeout_task);
if (NULL != sc->wh)
GNUNET_CADET_notify_transmit_ready_cancel (sc->wh);
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c
index 030d8b6432..8c956c2749 100644
--- a/src/fs/gnunet-service-fs_cp.c
+++ b/src/fs/gnunet-service-fs_cp.c
@@ -86,7 +86,7 @@ struct GSF_PeerTransmitHandle
/**
* Task called on timeout, or 0 for none.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Function to call to get the actual message.
@@ -155,7 +155,7 @@ struct GSF_DelayedHandle
/**
* Task for the delay.
*/
- GNUNET_SCHEDULER_TaskIdentifier delay_task;
+ struct GNUNET_SCHEDULER_Task * delay_task;
/**
* Size of the message.
@@ -184,7 +184,7 @@ struct PeerRequest
/**
* Task for asynchronous stopping of this request.
*/
- GNUNET_SCHEDULER_TaskIdentifier kill_task;
+ struct GNUNET_SCHEDULER_Task * kill_task;
};
@@ -209,7 +209,7 @@ struct GSF_ConnectedPeer
/**
* Task scheduled to revive migration to this peer.
*/
- GNUNET_SCHEDULER_TaskIdentifier mig_revive_task;
+ struct GNUNET_SCHEDULER_Task * mig_revive_task;
/**
* Messages (replies, queries, content migration) we would like to
@@ -248,7 +248,7 @@ struct GSF_ConnectedPeer
/**
* Task scheduled if we need to retry bandwidth reservation later.
*/
- GNUNET_SCHEDULER_TaskIdentifier rc_delay_task;
+ struct GNUNET_SCHEDULER_Task * rc_delay_task;
/**
* Active requests from this neighbour, map of query to 'struct PeerRequest'.
@@ -472,10 +472,10 @@ peer_transmit_ready_cb (void *cls, size_t size, void *buf)
schedule_transmission (pth);
return 0;
}
- if (GNUNET_SCHEDULER_NO_TASK != pth->timeout_task)
+ if (NULL != pth->timeout_task)
{
GNUNET_SCHEDULER_cancel (pth->timeout_task);
- pth->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ pth->timeout_task = NULL;
}
GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
if (GNUNET_YES == pth->is_query)
@@ -516,7 +516,7 @@ retry_reservation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_PeerIdentity target;
GNUNET_PEER_resolve (cp->ppd.pid, &target);
- cp->rc_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ cp->rc_delay_task = NULL;
cp->rc =
GNUNET_ATS_reserve_bandwidth (GSF_ats, &target, DBLOCK_SIZE,
&ats_reserve_callback, cp);
@@ -652,7 +652,7 @@ revive_migration (void *cls,
struct GSF_ConnectedPeer *cp = cls;
struct GNUNET_TIME_Relative bt;
- cp->mig_revive_task = GNUNET_SCHEDULER_NO_TASK;
+ cp->mig_revive_task = NULL;
bt = GNUNET_TIME_absolute_get_remaining (cp->ppd.migration_blocked_until);
if (0 != bt.rel_value_us)
{
@@ -715,7 +715,7 @@ GSF_handle_p2p_migration_stop_ (void *cls,
GNUNET_i2s (other),
GNUNET_STRINGS_relative_time_to_string (bt, GNUNET_YES));
cp->ppd.migration_blocked_until = GNUNET_TIME_relative_to_absolute (bt);
- if (GNUNET_SCHEDULER_NO_TASK == cp->mig_revive_task)
+ if (NULL == cp->mig_revive_task)
{
GSF_push_stop_ (cp);
cp->mig_revive_task =
@@ -773,10 +773,10 @@ free_pending_request (struct PeerRequest *peerreq,
{
struct GSF_ConnectedPeer *cp = peerreq->cp;
- if (GNUNET_SCHEDULER_NO_TASK != peerreq->kill_task)
+ if (NULL != peerreq->kill_task)
{
GNUNET_SCHEDULER_cancel (peerreq->kill_task);
- peerreq->kill_task = GNUNET_SCHEDULER_NO_TASK;
+ peerreq->kill_task = NULL;
}
GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# P2P searches active"),
-1, GNUNET_NO);
@@ -825,7 +825,7 @@ peer_request_destroy (void *cls,
struct GSF_PendingRequest *pr = peerreq->pr;
struct GSF_PendingRequestData *prd;
- peerreq->kill_task = GNUNET_SCHEDULER_NO_TASK;
+ peerreq->kill_task = NULL;
prd = GSF_pending_request_get_data_ (pr);
cancel_pending_request (NULL, &prd->query, peerreq);
}
@@ -987,7 +987,7 @@ handle_p2p_reply (void *cls,
}
if (GNUNET_BLOCK_EVALUATION_OK_LAST != eval)
return;
- if (GNUNET_SCHEDULER_NO_TASK == peerreq->kill_task)
+ if (NULL == peerreq->kill_task)
{
GNUNET_STATISTICS_update (GSF_stats,
gettext_noop
@@ -1356,7 +1356,7 @@ peer_transmit_timeout (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Timeout trying to transmit to other peer\n");
- pth->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ pth->timeout_task = NULL;
cp = pth->cp;
GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
if (GNUNET_YES == pth->is_query)
@@ -1440,10 +1440,10 @@ GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth)
{
struct GSF_ConnectedPeer *cp;
- if (GNUNET_SCHEDULER_NO_TASK != pth->timeout_task)
+ if (NULL != pth->timeout_task)
{
GNUNET_SCHEDULER_cancel (pth->timeout_task);
- pth->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ pth->timeout_task = NULL;
}
cp = pth->cp;
GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
@@ -1586,10 +1586,10 @@ GSF_peer_disconnect_handler_ (void *cls,
GNUNET_ATS_reserve_bandwidth_cancel (cp->rc);
cp->rc = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != cp->rc_delay_task)
+ if (NULL != cp->rc_delay_task)
{
GNUNET_SCHEDULER_cancel (cp->rc_delay_task);
- cp->rc_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ cp->rc_delay_task = NULL;
}
GNUNET_CONTAINER_multihashmap_iterate (cp->request_map,
&cancel_pending_request, cp);
@@ -1608,10 +1608,10 @@ GSF_peer_disconnect_handler_ (void *cls,
GNUNET_assert (0 == cp->cth_in_progress);
while (NULL != (pth = cp->pth_head))
{
- if (pth->timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (pth->timeout_task != NULL)
{
GNUNET_SCHEDULER_cancel (pth->timeout_task);
- pth->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ pth->timeout_task = NULL;
}
GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
pth->gmc (pth->gmc_cls, 0, NULL);
@@ -1625,10 +1625,10 @@ GSF_peer_disconnect_handler_ (void *cls,
GNUNET_free (dh);
}
GNUNET_PEER_change_rc (cp->ppd.pid, -1);
- if (GNUNET_SCHEDULER_NO_TASK != cp->mig_revive_task)
+ if (NULL != cp->mig_revive_task)
{
GNUNET_SCHEDULER_cancel (cp->mig_revive_task);
- cp->mig_revive_task = GNUNET_SCHEDULER_NO_TASK;
+ cp->mig_revive_task = NULL;
}
GNUNET_free (cp);
}
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c
index 6d3b761bed..0bb5e3f389 100644
--- a/src/fs/gnunet-service-fs_lc.c
+++ b/src/fs/gnunet-service-fs_lc.c
@@ -59,7 +59,7 @@ struct ClientRequest
/**
* Task scheduled to destroy the request.
*/
- GNUNET_SCHEDULER_TaskIdentifier kill_task;
+ struct GNUNET_SCHEDULER_Task * kill_task;
};
@@ -193,7 +193,7 @@ client_request_destroy (void *cls,
struct ClientRequest *cr = cls;
struct GSF_LocalClient *lc;
- cr->kill_task = GNUNET_SCHEDULER_NO_TASK;
+ cr->kill_task = NULL;
lc = cr->lc;
GNUNET_CONTAINER_DLL_remove (lc->cr_head, lc->cr_tail, cr);
GSF_pending_request_cancel_ (cr->pr, GNUNET_YES);
@@ -242,7 +242,7 @@ client_response_handler (void *cls,
if (NULL == data)
{
/* local-only request, with no result, clean up. */
- if (GNUNET_SCHEDULER_NO_TASK == cr->kill_task)
+ if (NULL == cr->kill_task)
cr->kill_task = GNUNET_SCHEDULER_add_now (&client_request_destroy,
cr);
return;
@@ -285,7 +285,7 @@ client_response_handler (void *cls,
(int) eval);
return;
}
- if (GNUNET_SCHEDULER_NO_TASK == cr->kill_task)
+ if (NULL == cr->kill_task)
cr->kill_task = GNUNET_SCHEDULER_add_now (&client_request_destroy, cr);
}
@@ -497,7 +497,7 @@ GSF_client_disconnect_handler_ (void *cls,
return;
while (NULL != (cr = pos->cr_head))
{
- if (GNUNET_SCHEDULER_NO_TASK != cr->kill_task)
+ if (NULL != cr->kill_task)
GNUNET_SCHEDULER_cancel (cr->kill_task);
client_request_destroy (cr, NULL);
}
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c
index 07b6b4d652..6b793a1e09 100644
--- a/src/fs/gnunet-service-fs_pe.c
+++ b/src/fs/gnunet-service-fs_pe.c
@@ -196,7 +196,7 @@ struct PeerPlan
/**
* Current task for executing the plan.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
};
@@ -337,7 +337,7 @@ plan (struct PeerPlan *pp, struct GSF_RequestPlan *rp)
GNUNET_CONTAINER_multihashmap_contains_value (pp->plan_map,
get_rp_key (rp),
rp));
- if (GNUNET_SCHEDULER_NO_TASK != pp->task)
+ if (NULL != pp->task)
GNUNET_SCHEDULER_cancel (pp->task);
pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
#undef N
@@ -391,7 +391,7 @@ transmit_message_callback (void *cls, size_t buf_size, void *buf)
if (NULL == buf)
{
/* failed, try again... */
- if (GNUNET_SCHEDULER_NO_TASK != pp->task)
+ if (NULL != pp->task)
GNUNET_SCHEDULER_cancel (pp->task);
pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
@@ -404,7 +404,7 @@ transmit_message_callback (void *cls, size_t buf_size, void *buf)
rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap);
if (NULL == rp)
{
- if (GNUNET_SCHEDULER_NO_TASK != pp->task)
+ if (NULL != pp->task)
GNUNET_SCHEDULER_cancel (pp->task);
pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
return 0;
@@ -412,7 +412,7 @@ transmit_message_callback (void *cls, size_t buf_size, void *buf)
msize = GSF_pending_request_get_message_ (get_latest (rp), buf_size, buf);
if (msize > buf_size)
{
- if (GNUNET_SCHEDULER_NO_TASK != pp->task)
+ if (NULL != pp->task)
GNUNET_SCHEDULER_cancel (pp->task);
/* buffer to small (message changed), try again */
pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
@@ -451,7 +451,7 @@ schedule_peer_transmission (void *cls,
size_t msize;
struct GNUNET_TIME_Relative delay;
- pp->task = GNUNET_SCHEDULER_NO_TASK;
+ pp->task = NULL;
if (NULL != pp->pth)
{
GSF_peer_transmit_cancel_ (pp->pth);
@@ -661,10 +661,10 @@ GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp)
GSF_peer_transmit_cancel_ (pp->pth);
pp->pth = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pp->task)
+ if (NULL != pp->task)
{
GNUNET_SCHEDULER_cancel (pp->task);
- pp->task = GNUNET_SCHEDULER_NO_TASK;
+ pp->task = NULL;
}
while (NULL != (rp = GNUNET_CONTAINER_heap_remove_root (pp->priority_heap)))
{
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index f809efd6ce..5dc03393a3 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -157,7 +157,7 @@ struct GSF_PendingRequest
/**
* Task that warns us if the local datastore lookup takes too long.
*/
- GNUNET_SCHEDULER_TaskIdentifier warn_task;
+ struct GNUNET_SCHEDULER_Task * warn_task;
/**
* Current offset for querying our local datastore for results.
@@ -632,10 +632,10 @@ clean_request (void *cls, const struct GNUNET_HashCode *key, void *value)
GNUNET_DHT_get_stop (pr->gh);
pr->gh = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pr->warn_task)
+ if (NULL != pr->warn_task)
{
GNUNET_SCHEDULER_cancel (pr->warn_task);
- pr->warn_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->warn_task = NULL;
}
GNUNET_assert (GNUNET_OK ==
GNUNET_CONTAINER_multihashmap_remove (pr_map,
@@ -690,10 +690,10 @@ GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, int full_cleanup)
GNUNET_DHT_get_stop (pr->gh);
pr->gh = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pr->warn_task)
+ if (NULL != pr->warn_task)
{
GNUNET_SCHEDULER_cancel (pr->warn_task);
- pr->warn_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->warn_task = NULL;
}
return;
}
@@ -1307,7 +1307,7 @@ process_local_reply (void *cls, const struct GNUNET_HashCode * key, size_t size,
unsigned int old_rf;
GNUNET_SCHEDULER_cancel (pr->warn_task);
- pr->warn_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->warn_task = NULL;
if (NULL != pr->qe)
{
pr->qe = NULL;
@@ -1514,10 +1514,10 @@ process_local_reply (void *cls, const struct GNUNET_HashCode * key, size_t size,
check_error_and_continue:
if (NULL != pr->qe)
return;
- if (GNUNET_SCHEDULER_NO_TASK != pr->warn_task)
+ if (NULL != pr->warn_task)
{
GNUNET_SCHEDULER_cancel (pr->warn_task);
- pr->warn_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->warn_task = NULL;
}
if (NULL == (cont = pr->llc_cont))
return; /* no continuation */
@@ -1620,7 +1620,7 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr,
("# Datastore lookups concluded (error queueing)"),
1, GNUNET_NO);
GNUNET_SCHEDULER_cancel (pr->warn_task);
- pr->warn_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->warn_task = NULL;
pr->llc_cont = NULL;
if (NULL != cont)
cont (cont_cls, pr, pr->local_result);
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c
index f099f7fdce..88c92828f5 100644
--- a/src/fs/gnunet-service-fs_push.c
+++ b/src/fs/gnunet-service-fs_push.c
@@ -163,7 +163,7 @@ static struct GNUNET_DATASTORE_QueueEntry *mig_qe;
/**
* ID of task that collects blocks for migration.
*/
-static GNUNET_SCHEDULER_TaskIdentifier mig_task;
+static struct GNUNET_SCHEDULER_Task * mig_task;
/**
* What is the maximum frequency at which we are allowed to
@@ -452,7 +452,7 @@ consider_gathering ()
return;
if (NULL != mig_qe)
return;
- if (GNUNET_SCHEDULER_NO_TASK != mig_task)
+ if (NULL != mig_task)
return;
if (mig_size >= MAX_MIGRATION_QUEUE)
return;
@@ -575,7 +575,7 @@ static void
gather_migration_blocks (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- mig_task = GNUNET_SCHEDULER_NO_TASK;
+ mig_task = NULL;
if (mig_size >= MAX_MIGRATION_QUEUE)
return;
if (NULL == GSF_dsh)
@@ -682,10 +682,10 @@ GSF_push_init_ ()
void
GSF_push_done_ ()
{
- if (GNUNET_SCHEDULER_NO_TASK != mig_task)
+ if (NULL != mig_task)
{
GNUNET_SCHEDULER_cancel (mig_task);
- mig_task = GNUNET_SCHEDULER_NO_TASK;
+ mig_task = NULL;
}
if (NULL != mig_qe)
{
diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c
index 8e9d70f72c..9eef491daa 100644
--- a/src/fs/gnunet-service-fs_put.c
+++ b/src/fs/gnunet-service-fs_put.c
@@ -63,7 +63,7 @@ struct PutOperator
/**
* ID of task that collects blocks for DHT PUTs.
*/
- GNUNET_SCHEDULER_TaskIdentifier dht_task;
+ struct GNUNET_SCHEDULER_Task * dht_task;
/**
* How many entires with zero anonymity of our type do we currently
@@ -158,7 +158,7 @@ delay_dht_put_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct PutOperator *po = cls;
- po->dht_task = GNUNET_SCHEDULER_NO_TASK;
+ po->dht_task = NULL;
schedule_next_put (po);
}
@@ -219,7 +219,7 @@ gather_dht_put_blocks (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct PutOperator *po = cls;
- po->dht_task = GNUNET_SCHEDULER_NO_TASK;
+ po->dht_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
po->dht_qe =
@@ -263,10 +263,10 @@ GSF_put_done_ ()
i = 0;
while ((po = &operators[i])->dht_put_type != GNUNET_BLOCK_TYPE_ANY)
{
- if (GNUNET_SCHEDULER_NO_TASK != po->dht_task)
+ if (NULL != po->dht_task)
{
GNUNET_SCHEDULER_cancel (po->dht_task);
- po->dht_task = GNUNET_SCHEDULER_NO_TASK;
+ po->dht_task = NULL;
}
if (NULL != po->dht_put)
{
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c
index 8dee249126..94e7e0733d 100644
--- a/src/fs/test_fs_download.c
+++ b/src/fs/test_fs_download.c
@@ -57,7 +57,7 @@ static struct GNUNET_FS_DownloadContext *download;
static struct GNUNET_FS_PublishContext *publish;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_kill;
+static struct GNUNET_SCHEDULER_Task * timeout_kill;
static char *fn;
@@ -80,7 +80,7 @@ timeout_kill_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
publish = NULL;
}
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Timeout downloading file\n");
- timeout_kill = GNUNET_SCHEDULER_NO_TASK;
+ timeout_kill = NULL;
err = 1;
}
@@ -120,7 +120,7 @@ abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_free (fn);
fn = NULL;
GNUNET_SCHEDULER_cancel (timeout_kill);
- timeout_kill = GNUNET_SCHEDULER_NO_TASK;
+ timeout_kill = NULL;
}
diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c
index a9b9980139..7e1f01ae71 100644
--- a/src/fs/test_fs_download_persistence.c
+++ b/src/fs/test_fs_download_persistence.c
@@ -54,7 +54,7 @@ static struct GNUNET_FS_DownloadContext *download;
static struct GNUNET_FS_PublishContext *publish;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_kill;
+static struct GNUNET_SCHEDULER_Task * timeout_kill;
static char *fn;
@@ -75,7 +75,7 @@ timeout_kill_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_FS_publish_stop (publish);
publish = NULL;
}
- timeout_kill = GNUNET_SCHEDULER_NO_TASK;
+ timeout_kill = NULL;
err = 1;
}
@@ -107,7 +107,7 @@ abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_free (fn);
fn = NULL;
GNUNET_SCHEDULER_cancel (timeout_kill);
- timeout_kill = GNUNET_SCHEDULER_NO_TASK;
+ timeout_kill = NULL;
}
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c
index c780081222..461bfdcdd6 100644
--- a/src/fs/test_fs_namespace.c
+++ b/src/fs/test_fs_namespace.c
@@ -41,7 +41,7 @@ static struct GNUNET_FS_SearchContext *sks_search;
static struct GNUNET_FS_SearchContext *ksk_search;
-static GNUNET_SCHEDULER_TaskIdentifier kill_task;
+static struct GNUNET_SCHEDULER_Task * kill_task;
static int update_started;
@@ -58,7 +58,7 @@ abort_ksk_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (sks_search == NULL)
{
GNUNET_FS_stop (fs);
- if (GNUNET_SCHEDULER_NO_TASK != kill_task)
+ if (NULL != kill_task)
GNUNET_SCHEDULER_cancel (kill_task);
}
}
@@ -75,7 +75,7 @@ abort_sks_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (ksk_search == NULL)
{
GNUNET_FS_stop (fs);
- if (GNUNET_SCHEDULER_NO_TASK != kill_task)
+ if (NULL != kill_task)
GNUNET_SCHEDULER_cancel (kill_task);
}
}
@@ -86,7 +86,7 @@ do_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
err = 1;
FPRINTF (stderr, "%s", "Operation timed out\n");
- kill_task = GNUNET_SCHEDULER_NO_TASK;
+ kill_task = NULL;
abort_sks_search_task (NULL, tc);
abort_ksk_search_task (NULL, tc);
}
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c
index 8e5e5f53bf..3c8b6e34e9 100644
--- a/src/fs/test_fs_publish_persistence.c
+++ b/src/fs/test_fs_publish_persistence.c
@@ -60,7 +60,7 @@ static char *fn2;
static int err;
-static GNUNET_SCHEDULER_TaskIdentifier rtask;
+static struct GNUNET_SCHEDULER_Task * rtask;
static void
@@ -76,10 +76,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
fn2 = NULL;
GNUNET_FS_stop (fs);
fs = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != rtask)
+ if (NULL != rtask)
{
GNUNET_SCHEDULER_cancel (rtask);
- rtask = GNUNET_SCHEDULER_NO_TASK;
+ rtask = NULL;
}
}
@@ -91,7 +91,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event);
static void
restart_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- rtask = GNUNET_SCHEDULER_NO_TASK;
+ rtask = NULL;
GNUNET_FS_stop (fs);
fs = GNUNET_FS_start (cfg, "test-fs-publish-persistence",
&progress_cb, NULL,
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c
index f525fb474a..caf2898b28 100644
--- a/src/fs/test_fs_search.c
+++ b/src/fs/test_fs_search.c
@@ -52,7 +52,7 @@ static struct GNUNET_FS_SearchContext *search;
static struct GNUNET_FS_PublishContext *publish;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
static int err;
@@ -65,10 +65,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_FS_publish_stop (publish);
publish = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
+ if (NULL != timeout_task)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
}
@@ -78,7 +78,7 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
fprintf (stderr,
"Timeout\n");
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
if (NULL != search)
{
GNUNET_FS_search_stop (search);
diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c
index 34ea04acad..780f21d994 100644
--- a/src/fs/test_fs_search_persistence.c
+++ b/src/fs/test_fs_search_persistence.c
@@ -54,7 +54,7 @@ static struct GNUNET_FS_PublishContext *publish;
static const struct GNUNET_CONFIGURATION_Handle *cfg;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
static int err;
@@ -62,7 +62,7 @@ static int err;
static void
abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
fprintf (stderr,
"Timeout\n");
if (NULL != search)
@@ -86,10 +86,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_FS_publish_stop (publish);
publish = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
+ if (NULL != timeout_task)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
}
diff --git a/src/fs/test_fs_search_probes.c b/src/fs/test_fs_search_probes.c
index beae34763c..c7abd073f1 100644
--- a/src/fs/test_fs_search_probes.c
+++ b/src/fs/test_fs_search_probes.c
@@ -53,7 +53,7 @@ static struct GNUNET_FS_SearchContext *search;
static struct GNUNET_FS_PublishContext *publish;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
static int err;
@@ -61,7 +61,7 @@ static int err;
static void
abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
fprintf (stderr,
"Timeout\n");
if (NULL != search)
@@ -86,10 +86,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_FS_publish_stop (publish);
publish = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
+ if (NULL != timeout_task)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
}
diff --git a/src/fs/test_fs_search_with_and.c b/src/fs/test_fs_search_with_and.c
index 80cd03213a..cca0e342e2 100644
--- a/src/fs/test_fs_search_with_and.c
+++ b/src/fs/test_fs_search_with_and.c
@@ -58,7 +58,7 @@ static struct GNUNET_FS_SearchContext *search;
static struct GNUNET_FS_PublishContext *publish;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
static int err;
@@ -73,10 +73,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_FS_publish_stop (publish);
publish = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
+ if (NULL != timeout_task)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
}
@@ -86,7 +86,7 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
fprintf (stderr,
"Timeout\n");
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
if (NULL != search)
{
GNUNET_FS_search_stop (search);