aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/fs_api.c4
-rw-r--r--src/fs/fs_api.h8
-rw-r--r--src/fs/fs_dirmetascan.c4
-rw-r--r--src/fs/fs_download.c13
-rw-r--r--src/fs/fs_publish.c8
-rw-r--r--src/fs/fs_publish_ksk.c8
-rw-r--r--src/fs/fs_publish_ublock.c4
-rw-r--r--src/fs/fs_search.c17
-rw-r--r--src/fs/fs_test_lib.c13
-rw-r--r--src/fs/fs_tree.c4
-rw-r--r--src/fs/fs_unindex.c4
-rw-r--r--src/fs/gnunet-auto-share.c64
-rw-r--r--src/fs/gnunet-daemon-fsprofiler.c24
-rw-r--r--src/fs/gnunet-download.c4
-rw-r--r--src/fs/gnunet-fs-profiler.c4
-rw-r--r--src/fs/gnunet-publish.c4
-rw-r--r--src/fs/gnunet-search.c4
-rw-r--r--src/fs/gnunet-service-fs.c10
-rw-r--r--src/fs/gnunet-service-fs_cadet_client.c8
-rw-r--r--src/fs/gnunet-service-fs_cadet_server.c6
-rw-r--r--src/fs/gnunet-service-fs_cp.c35
-rw-r--r--src/fs/gnunet-service-fs_lc.c6
-rw-r--r--src/fs/gnunet-service-fs_pe.c8
-rw-r--r--src/fs/gnunet-service-fs_pr.c8
-rw-r--r--src/fs/gnunet-service-fs_push.c8
-rw-r--r--src/fs/gnunet-service-fs_put.c11
-rw-r--r--src/fs/gnunet-unindex.c4
-rw-r--r--src/fs/perf_gnunet_service_fs_p2p.c3
-rw-r--r--src/fs/perf_gnunet_service_fs_p2p_respect.c2
-rw-r--r--src/fs/test_fs_download.c8
-rw-r--r--src/fs/test_fs_download_persistence.c8
-rw-r--r--src/fs/test_fs_list_indexed.c5
-rw-r--r--src/fs/test_fs_namespace.c10
-rw-r--r--src/fs/test_fs_publish.c2
-rw-r--r--src/fs/test_fs_publish_persistence.c6
-rw-r--r--src/fs/test_fs_search.c6
-rw-r--r--src/fs/test_fs_search_persistence.c9
-rw-r--r--src/fs/test_fs_search_probes.c6
-rw-r--r--src/fs/test_fs_search_with_and.c6
-rw-r--r--src/fs/test_fs_test_lib.c3
-rw-r--r--src/fs/test_fs_unindex.c4
-rw-r--r--src/fs/test_fs_unindex_persistence.c6
-rw-r--r--src/fs/test_gnunet_service_fs_migration.c8
-rw-r--r--src/fs/test_gnunet_service_fs_p2p.c2
44 files changed, 152 insertions, 237 deletions
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index f85b8e739..2db475528 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -108,11 +108,9 @@ stop_job (struct GNUNET_FS_QueueEntry *qe)
108 * and stopping others. 108 * and stopping others.
109 * 109 *
110 * @param cls the `struct GNUNET_FS_Handle *` 110 * @param cls the `struct GNUNET_FS_Handle *`
111 * @param tc scheduler context
112 */ 111 */
113static void 112static void
114process_job_queue (void *cls, 113process_job_queue (void *cls)
115 const struct GNUNET_SCHEDULER_TaskContext *tc)
116{ 114{
117 struct GNUNET_FS_Handle *h = cls; 115 struct GNUNET_FS_Handle *h = cls;
118 struct GNUNET_FS_QueueEntry *qe; 116 struct GNUNET_FS_QueueEntry *qe;
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h
index e9f9ab2cb..0e1476f5c 100644
--- a/src/fs/fs_api.h
+++ b/src/fs/fs_api.h
@@ -757,11 +757,9 @@ GNUNET_FS_search_probe_progress_ (void *cls,
757 * Main function that performs the upload. 757 * Main function that performs the upload.
758 * 758 *
759 * @param cls `struct GNUNET_FS_PublishContext` identifies the upload 759 * @param cls `struct GNUNET_FS_PublishContext` identifies the upload
760 * @param tc task context
761 */ 760 */
762void 761void
763GNUNET_FS_publish_main_ (void *cls, 762GNUNET_FS_publish_main_ (void *cls);
764 const struct GNUNET_SCHEDULER_TaskContext *tc);
765 763
766 764
767/** 765/**
@@ -828,11 +826,9 @@ GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
828 * request for the file. 826 * request for the file.
829 * 827 *
830 * @param cls the 'struct GNUNET_FS_DownloadContext' 828 * @param cls the 'struct GNUNET_FS_DownloadContext'
831 * @param tc scheduler context
832 */ 829 */
833void 830void
834GNUNET_FS_download_start_task_ (void *cls, 831GNUNET_FS_download_start_task_ (void *cls);
835 const struct GNUNET_SCHEDULER_TaskContext *tc);
836 832
837 833
838 834
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c
index 72098957d..2f79c7c05 100644
--- a/src/fs/fs_dirmetascan.c
+++ b/src/fs/fs_dirmetascan.c
@@ -222,11 +222,9 @@ expand_tree (struct GNUNET_FS_ShareTreeItem *parent,
222 * Task run last to shut everything down. 222 * Task run last to shut everything down.
223 * 223 *
224 * @param cls the 'struct GNUNET_FS_DirScanner' 224 * @param cls the 'struct GNUNET_FS_DirScanner'
225 * @param tc unused
226 */ 225 */
227static void 226static void
228finish_scan (void *cls, 227finish_scan (void *cls)
229 const struct GNUNET_SCHEDULER_TaskContext *tc)
230{ 228{
231 struct GNUNET_FS_DirScanner *ds = cls; 229 struct GNUNET_FS_DirScanner *ds = cls;
232 230
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index f43524553..e8b632a3f 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -1372,10 +1372,9 @@ transmit_download_request (void *cls, size_t size, void *buf)
1372 * Reconnect to the FS service and transmit our queries NOW. 1372 * Reconnect to the FS service and transmit our queries NOW.
1373 * 1373 *
1374 * @param cls our download context 1374 * @param cls our download context
1375 * @param tc unused
1376 */ 1375 */
1377static void 1376static void
1378do_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1377do_reconnect (void *cls)
1379{ 1378{
1380 struct GNUNET_FS_DownloadContext *dc = cls; 1379 struct GNUNET_FS_DownloadContext *dc = cls;
1381 struct GNUNET_CLIENT_Connection *client; 1380 struct GNUNET_CLIENT_Connection *client;
@@ -1625,10 +1624,9 @@ create_download_request (struct DownloadRequest *parent,
1625 * the current IBlock from the existing file. 1624 * the current IBlock from the existing file.
1626 * 1625 *
1627 * @param cls the 'struct ReconstructContext' 1626 * @param cls the 'struct ReconstructContext'
1628 * @param tc scheduler context
1629 */ 1627 */
1630static void 1628static void
1631reconstruct_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1629reconstruct_cont (void *cls)
1632{ 1630{
1633 struct GNUNET_FS_DownloadContext *dc = cls; 1631 struct GNUNET_FS_DownloadContext *dc = cls;
1634 1632
@@ -1655,10 +1653,9 @@ reconstruct_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1655 * Task requesting the next block from the tree encoder. 1653 * Task requesting the next block from the tree encoder.
1656 * 1654 *
1657 * @param cls the 'struct GNUJNET_FS_DownloadContext' we're processing 1655 * @param cls the 'struct GNUJNET_FS_DownloadContext' we're processing
1658 * @param tc task context
1659 */ 1656 */
1660static void 1657static void
1661get_next_block (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1658get_next_block (void *cls)
1662{ 1659{
1663 struct GNUNET_FS_DownloadContext *dc = cls; 1660 struct GNUNET_FS_DownloadContext *dc = cls;
1664 1661
@@ -1855,11 +1852,9 @@ fh_reader (void *cls, uint64_t offset, size_t max, void *buf, char **emsg)
1855 * request for the file. 1852 * request for the file.
1856 * 1853 *
1857 * @param cls the 'struct GNUNET_FS_DownloadContext' 1854 * @param cls the 'struct GNUNET_FS_DownloadContext'
1858 * @param tc scheduler context
1859 */ 1855 */
1860void 1856void
1861GNUNET_FS_download_start_task_ (void *cls, 1857GNUNET_FS_download_start_task_ (void *cls)
1862 const struct GNUNET_SCHEDULER_TaskContext *tc)
1863{ 1858{
1864 struct GNUNET_FS_DownloadContext *dc = cls; 1859 struct GNUNET_FS_DownloadContext *dc = cls;
1865 struct GNUNET_FS_ProgressInfo pi; 1860 struct GNUNET_FS_ProgressInfo pi;
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 1e8e82c71..80843006e 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -413,11 +413,9 @@ block_reader (void *cls,
413 * the final result. 413 * the final result.
414 * 414 *
415 * @param cls our publishing context 415 * @param cls our publishing context
416 * @param tc scheduler's task context (not used)
417 */ 416 */
418static void 417static void
419encode_cont (void *cls, 418encode_cont (void *cls)
420 const struct GNUNET_SCHEDULER_TaskContext *tc)
421{ 419{
422 struct GNUNET_FS_PublishContext *pc = cls; 420 struct GNUNET_FS_PublishContext *pc = cls;
423 struct GNUNET_FS_FileInformation *p; 421 struct GNUNET_FS_FileInformation *p;
@@ -960,11 +958,9 @@ create_loc_uri (struct GNUNET_FS_PublishContext *pc)
960 * Main function that performs the upload. 958 * Main function that performs the upload.
961 * 959 *
962 * @param cls `struct GNUNET_FS_PublishContext *` identifies the upload 960 * @param cls `struct GNUNET_FS_PublishContext *` identifies the upload
963 * @param tc task context
964 */ 961 */
965void 962void
966GNUNET_FS_publish_main_ (void *cls, 963GNUNET_FS_publish_main_ (void *cls)
967 const struct GNUNET_SCHEDULER_TaskContext *tc)
968{ 964{
969 struct GNUNET_FS_PublishContext *pc = cls; 965 struct GNUNET_FS_PublishContext *pc = cls;
970 struct GNUNET_FS_ProgressInfo pi; 966 struct GNUNET_FS_ProgressInfo pi;
diff --git a/src/fs/fs_publish_ksk.c b/src/fs/fs_publish_ksk.c
index b3e9de728..a7ad3e91f 100644
--- a/src/fs/fs_publish_ksk.c
+++ b/src/fs/fs_publish_ksk.c
@@ -110,11 +110,9 @@ struct GNUNET_FS_PublishKskContext
110 * of the keywords). 110 * of the keywords).
111 * 111 *
112 * @param cls closure of type `struct PublishKskContext *` 112 * @param cls closure of type `struct PublishKskContext *`
113 * @param tc unused
114 */ 113 */
115static void 114static void
116publish_ksk_cont (void *cls, 115publish_ksk_cont (void *cls);
117 const struct GNUNET_SCHEDULER_TaskContext *tc);
118 116
119 117
120/** 118/**
@@ -148,11 +146,9 @@ kb_put_cont (void *cls,
148 * publishing operation (iterating over all of the keywords). 146 * publishing operation (iterating over all of the keywords).
149 * 147 *
150 * @param cls closure of type `struct GNUNET_FS_PublishKskContext *` 148 * @param cls closure of type `struct GNUNET_FS_PublishKskContext *`
151 * @param tc unused
152 */ 149 */
153static void 150static void
154publish_ksk_cont (void *cls, 151publish_ksk_cont (void *cls)
155 const struct GNUNET_SCHEDULER_TaskContext *tc)
156{ 152{
157 struct GNUNET_FS_PublishKskContext *pkc = cls; 153 struct GNUNET_FS_PublishKskContext *pkc = cls;
158 const char *keyword; 154 const char *keyword;
diff --git a/src/fs/fs_publish_ublock.c b/src/fs/fs_publish_ublock.c
index 7cdad396b..9ea7bf41b 100644
--- a/src/fs/fs_publish_ublock.c
+++ b/src/fs/fs_publish_ublock.c
@@ -147,11 +147,9 @@ ublock_put_cont (void *cls,
147 * Run the continuation. 147 * Run the continuation.
148 * 148 *
149 * @param cls the `struct GNUNET_FS_PublishUblockContext *` 149 * @param cls the `struct GNUNET_FS_PublishUblockContext *`
150 * @param tc scheduler context
151 */ 150 */
152static void 151static void
153run_cont (void *cls, 152run_cont (void *cls)
154 const struct GNUNET_SCHEDULER_TaskContext *tc)
155{ 153{
156 struct GNUNET_FS_PublishUblockContext *uc = cls; 154 struct GNUNET_FS_PublishUblockContext *uc = cls;
157 155
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index 626d23a72..eaabac746 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -215,11 +215,9 @@ signal_probe_result (struct GNUNET_FS_SearchResult *sr)
215 * Handle the case where we have failed to receive a response for our probe. 215 * Handle the case where we have failed to receive a response for our probe.
216 * 216 *
217 * @param cls our `struct GNUNET_FS_SearchResult *` 217 * @param cls our `struct GNUNET_FS_SearchResult *`
218 * @param tc scheduler context
219 */ 218 */
220static void 219static void
221probe_failure_handler (void *cls, 220probe_failure_handler (void *cls)
222 const struct GNUNET_SCHEDULER_TaskContext *tc)
223{ 221{
224 struct GNUNET_FS_SearchResult *sr = cls; 222 struct GNUNET_FS_SearchResult *sr = cls;
225 223
@@ -241,11 +239,9 @@ probe_failure_handler (void *cls,
241 * Handle the case where we have gotten a response for our probe. 239 * Handle the case where we have gotten a response for our probe.
242 * 240 *
243 * @param cls our `struct GNUNET_FS_SearchResult *` 241 * @param cls our `struct GNUNET_FS_SearchResult *`
244 * @param tc scheduler context
245 */ 242 */
246static void 243static void
247probe_success_handler (void *cls, 244probe_success_handler (void *cls)
248 const struct GNUNET_SCHEDULER_TaskContext *tc)
249{ 245{
250 struct GNUNET_FS_SearchResult *sr = cls; 246 struct GNUNET_FS_SearchResult *sr = cls;
251 247
@@ -364,11 +360,9 @@ GNUNET_FS_search_probe_progress_ (void *cls,
364 * Task run periodically to remind clients that a probe is active. 360 * Task run periodically to remind clients that a probe is active.
365 * 361 *
366 * @param cls the `struct GNUNET_FS_SearchResult` that we are probing for 362 * @param cls the `struct GNUNET_FS_SearchResult` that we are probing for
367 * @param tc scheduler context
368 */ 363 */
369static void 364static void
370probe_ping_task_cb (void *cls, 365probe_ping_task_cb (void *cls)
371 const struct GNUNET_SCHEDULER_TaskContext *tc)
372{ 366{
373 struct GNUNET_FS_Handle *h = cls; 367 struct GNUNET_FS_Handle *h = cls;
374 struct GNUNET_FS_SearchResult *sr; 368 struct GNUNET_FS_SearchResult *sr;
@@ -1245,10 +1239,9 @@ schedule_transmit_search_request (struct GNUNET_FS_SearchContext *sc)
1245 * our queries NOW. 1239 * our queries NOW.
1246 * 1240 *
1247 * @param cls our search context 1241 * @param cls our search context
1248 * @param tc unused
1249 */ 1242 */
1250static void 1243static void
1251do_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1244do_reconnect (void *cls)
1252{ 1245{
1253 struct GNUNET_FS_SearchContext *sc = cls; 1246 struct GNUNET_FS_SearchContext *sc = cls;
1254 struct GNUNET_CLIENT_Connection *client; 1247 struct GNUNET_CLIENT_Connection *client;
@@ -1637,7 +1630,7 @@ GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc)
1637 1630
1638 GNUNET_assert (NULL == sc->client); 1631 GNUNET_assert (NULL == sc->client);
1639 GNUNET_assert (NULL == sc->task); 1632 GNUNET_assert (NULL == sc->task);
1640 do_reconnect (sc, NULL); 1633 do_reconnect (sc);
1641 GNUNET_FS_search_sync_ (sc); 1634 GNUNET_FS_search_sync_ (sc);
1642 pi.status = GNUNET_FS_STATUS_SEARCH_CONTINUED; 1635 pi.status = GNUNET_FS_STATUS_SEARCH_CONTINUED;
1643 sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc); 1636 sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc);
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c
index 6bd156e8b..d03888021 100644
--- a/src/fs/fs_test_lib.c
+++ b/src/fs/fs_test_lib.c
@@ -183,8 +183,7 @@ struct TestDownloadOperation
183 * @param tc scheduler context (unused) 183 * @param tc scheduler context (unused)
184 */ 184 */
185static void 185static void
186report_uri (void *cls, 186report_uri (void *cls)
187 const struct GNUNET_SCHEDULER_TaskContext *tc)
188{ 187{
189 struct TestPublishOperation *po = cls; 188 struct TestPublishOperation *po = cls;
190 189
@@ -208,10 +207,9 @@ report_uri (void *cls,
208 * Task scheduled to run when publish operation times out. 207 * Task scheduled to run when publish operation times out.
209 * 208 *
210 * @param cls the publish operation context 209 * @param cls the publish operation context
211 * @param tc scheduler context (unused)
212 */ 210 */
213static void 211static void
214publish_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 212publish_timeout (void *cls)
215{ 213{
216 struct TestPublishOperation *po = cls; 214 struct TestPublishOperation *po = cls;
217 215
@@ -480,10 +478,9 @@ GNUNET_FS_TEST_publish (struct GNUNET_TESTBED_Peer *peer,
480 * Task scheduled to run when download operation times out. 478 * Task scheduled to run when download operation times out.
481 * 479 *
482 * @param cls the download operation context 480 * @param cls the download operation context
483 * @param tc scheduler context (unused)
484 */ 481 */
485static void 482static void
486download_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 483download_timeout (void *cls)
487{ 484{
488 struct TestDownloadOperation *dop = cls; 485 struct TestDownloadOperation *dop = cls;
489 486
@@ -504,11 +501,9 @@ download_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
504 * Task scheduled to report on the completion of our download operation. 501 * Task scheduled to report on the completion of our download operation.
505 * 502 *
506 * @param cls the download operation context 503 * @param cls the download operation context
507 * @param tc scheduler context (unused)
508 */ 504 */
509static void 505static void
510report_success (void *cls, 506report_success (void *cls)
511 const struct GNUNET_SCHEDULER_TaskContext *tc)
512{ 507{
513 struct TestDownloadOperation *dop = cls; 508 struct TestDownloadOperation *dop = cls;
514 509
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c
index 57c4c567f..b3c632203 100644
--- a/src/fs/fs_tree.c
+++ b/src/fs/fs_tree.c
@@ -352,7 +352,7 @@ GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te)
352 te->uri->data.chk.chk = te->chk_tree[off]; 352 te->uri->data.chk.chk = te->chk_tree[off];
353 te->uri->data.chk.file_length = GNUNET_htonll (te->size); 353 te->uri->data.chk.file_length = GNUNET_htonll (te->size);
354 te->in_next = GNUNET_NO; 354 te->in_next = GNUNET_NO;
355 te->cont (te->cls, NULL); 355 te->cont (te->cls);
356 return; 356 return;
357 } 357 }
358 if (0 == te->current_depth) 358 if (0 == te->current_depth)
@@ -363,7 +363,7 @@ GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te)
363 te->reader (te->cls, te->publish_offset, pt_size, iob, &te->emsg)) 363 te->reader (te->cls, te->publish_offset, pt_size, iob, &te->emsg))
364 { 364 {
365 te->in_next = GNUNET_NO; 365 te->in_next = GNUNET_NO;
366 te->cont (te->cls, NULL); 366 te->cont (te->cls);
367 return; 367 return;
368 } 368 }
369 pt_block = iob; 369 pt_block = iob;
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index 88d3dd0ea..2e9c17217 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.c
@@ -626,11 +626,9 @@ GNUNET_FS_unindex_do_remove_kblocks_ (struct GNUNET_FS_UnindexContext *uc)
626 * processed all blocks. Clean up. 626 * processed all blocks. Clean up.
627 * 627 *
628 * @param cls our unindexing context 628 * @param cls our unindexing context
629 * @param tc not used
630 */ 629 */
631static void 630static void
632unindex_extract_keywords (void *cls, 631unindex_extract_keywords (void *cls)
633 const struct GNUNET_SCHEDULER_TaskContext *tc)
634{ 632{
635 struct GNUNET_FS_UnindexContext *uc = cls; 633 struct GNUNET_FS_UnindexContext *uc = cls;
636 634
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c
index 3e5c8777c..aef66614c 100644
--- a/src/fs/gnunet-auto-share.c
+++ b/src/fs/gnunet-auto-share.c
@@ -317,17 +317,15 @@ save_state ()
317 * Task run on shutdown. Serializes our current state to disk. 317 * Task run on shutdown. Serializes our current state to disk.
318 * 318 *
319 * @param cls closure, unused 319 * @param cls closure, unused
320 * @param tc scheduler context, unused
321 */ 320 */
322static void 321static void
323do_stop_task (void *cls, 322do_stop_task (void *cls)
324 const struct GNUNET_SCHEDULER_TaskContext *tc)
325{ 323{
326 kill_task = NULL; 324 kill_task = NULL;
327 do_shutdown = GNUNET_YES; 325 do_shutdown = GNUNET_YES;
328 if (NULL != publish_proc) 326 if (NULL != publish_proc)
329 { 327 {
330 GNUNET_OS_process_kill (publish_proc, 328 GNUNET_OS_process_kill (publish_proc,
331 SIGKILL); 329 SIGKILL);
332 return; 330 return;
333 } 331 }
@@ -351,11 +349,9 @@ schedule_next_task (void);
351 * process died). 349 * process died).
352 * 350 *
353 * @param cls the `struct WorkItem` we were working on 351 * @param cls the `struct WorkItem` we were working on
354 * @param tc context
355 */ 352 */
356static void 353static void
357maint_child_death (void *cls, 354maint_child_death (void *cls)
358 const struct GNUNET_SCHEDULER_TaskContext *tc)
359{ 355{
360 struct WorkItem *wi = cls; 356 struct WorkItem *wi = cls;
361 struct GNUNET_HashCode key; 357 struct GNUNET_HashCode key;
@@ -364,10 +360,12 @@ maint_child_death (void *cls,
364 int ret; 360 int ret;
365 char c; 361 char c;
366 const struct GNUNET_DISK_FileHandle *pr; 362 const struct GNUNET_DISK_FileHandle *pr;
363 const struct GNUNET_SCHEDULER_TaskContext *tc;
367 364
368 run_task = NULL; 365 run_task = NULL;
369 pr = GNUNET_DISK_pipe_handle (sigpipe, 366 pr = GNUNET_DISK_pipe_handle (sigpipe,
370 GNUNET_DISK_PIPE_END_READ); 367 GNUNET_DISK_PIPE_END_READ);
368 tc = GNUNET_SCHEDULER_get_task_context ();
371 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 369 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
372 { 370 {
373 /* shutdown scheduled us, someone else will kill child, 371 /* shutdown scheduled us, someone else will kill child,
@@ -389,7 +387,7 @@ maint_child_death (void *cls,
389 { 387 {
390 /* process still running? Then where did the SIGCHLD come from? 388 /* process still running? Then where did the SIGCHLD come from?
391 Well, let's declare it spurious (kernel bug?) and keep rolling. 389 Well, let's declare it spurious (kernel bug?) and keep rolling.
392 */ 390 */
393 GNUNET_break (0); 391 GNUNET_break (0);
394 run_task = 392 run_task =
395 GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, 393 GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
@@ -398,7 +396,7 @@ maint_child_death (void *cls,
398 return; 396 return;
399 } 397 }
400 GNUNET_assert (GNUNET_OK == ret); 398 GNUNET_assert (GNUNET_OK == ret);
401 399
402 GNUNET_OS_process_destroy (publish_proc); 400 GNUNET_OS_process_destroy (publish_proc);
403 publish_proc = NULL; 401 publish_proc = NULL;
404 402
@@ -457,11 +455,9 @@ sighandler_child_death ()
457 * Function called to process work items. 455 * Function called to process work items.
458 * 456 *
459 * @param cls closure, NULL 457 * @param cls closure, NULL
460 * @param tc scheduler context (unused)
461 */ 458 */
462static void 459static void
463work (void *cls, 460work (void *cls)
464 const struct GNUNET_SCHEDULER_TaskContext *tc)
465{ 461{
466 static char *argv[14]; 462 static char *argv[14];
467 static char anon_level[20]; 463 static char anon_level[20];
@@ -521,7 +517,7 @@ work (void *cls,
521 NULL); 517 NULL);
522 return; 518 return;
523 } 519 }
524 pr = GNUNET_DISK_pipe_handle (sigpipe, 520 pr = GNUNET_DISK_pipe_handle (sigpipe,
525 GNUNET_DISK_PIPE_END_READ); 521 GNUNET_DISK_PIPE_END_READ);
526 run_task = 522 run_task =
527 GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, 523 GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL,
@@ -549,13 +545,13 @@ determine_id (void *cls,
549 545
550 if (0 != STAT (filename, &sbuf)) 546 if (0 != STAT (filename, &sbuf))
551 { 547 {
552 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, 548 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
553 "stat", 549 "stat",
554 filename); 550 filename);
555 return GNUNET_OK; 551 return GNUNET_OK;
556 } 552 }
557 GNUNET_CRYPTO_hash (filename, 553 GNUNET_CRYPTO_hash (filename,
558 strlen (filename), 554 strlen (filename),
559 &fx[0]); 555 &fx[0]);
560 if (!S_ISDIR (sbuf.st_mode)) 556 if (!S_ISDIR (sbuf.st_mode))
561 { 557 {
@@ -564,8 +560,8 @@ determine_id (void *cls,
564 fattr[0] = GNUNET_htonll (sbuf.st_size); 560 fattr[0] = GNUNET_htonll (sbuf.st_size);
565 fattr[0] = GNUNET_htonll (sbuf.st_mtime); 561 fattr[0] = GNUNET_htonll (sbuf.st_mtime);
566 562
567 GNUNET_CRYPTO_hash (fattr, 563 GNUNET_CRYPTO_hash (fattr,
568 sizeof (fattr), 564 sizeof (fattr),
569 &fx[1]); 565 &fx[1]);
570 } 566 }
571 else 567 else
@@ -579,7 +575,7 @@ determine_id (void *cls,
579 } 575 }
580 /* use hash here to make hierarchical structure distinct from 576 /* use hash here to make hierarchical structure distinct from
581 all files on the same level */ 577 all files on the same level */
582 GNUNET_CRYPTO_hash (fx, 578 GNUNET_CRYPTO_hash (fx,
583 sizeof (fx), 579 sizeof (fx),
584 &ft); 580 &ft);
585 /* use XOR here so that order of the files in the directory 581 /* use XOR here so that order of the files in the directory
@@ -653,11 +649,9 @@ add_file (void *cls,
653 * Periodically run task to update our view of the directory to share. 649 * Periodically run task to update our view of the directory to share.
654 * 650 *
655 * @param cls NULL 651 * @param cls NULL
656 * @param tc scheduler context, unused
657 */ 652 */
658static void 653static void
659scan (void *cls, 654scan (void *cls)
660 const struct GNUNET_SCHEDULER_TaskContext *tc)
661{ 655{
662 run_task = NULL; 656 run_task = NULL;
663 start_time = GNUNET_TIME_absolute_get (); 657 start_time = GNUNET_TIME_absolute_get ();
@@ -695,7 +689,7 @@ schedule_next_task ()
695 } 689 }
696 else 690 else
697 { 691 {
698 run_task = GNUNET_SCHEDULER_add_now (&work, 692 run_task = GNUNET_SCHEDULER_add_now (&work,
699 NULL); 693 NULL);
700 } 694 }
701} 695}
@@ -710,15 +704,15 @@ schedule_next_task ()
710 * @param c configuration 704 * @param c configuration
711 */ 705 */
712static void 706static void
713run (void *cls, 707run (void *cls,
714 char *const *args, 708 char *const *args,
715 const char *cfgfile, 709 const char *cfgfile,
716 const struct GNUNET_CONFIGURATION_Handle *c) 710 const struct GNUNET_CONFIGURATION_Handle *c)
717{ 711{
718 /* check arguments */ 712 /* check arguments */
719 if ( (NULL == args[0]) || 713 if ( (NULL == args[0]) ||
720 (NULL != args[1]) || 714 (NULL != args[1]) ||
721 (GNUNET_YES != 715 (GNUNET_YES !=
722 GNUNET_DISK_directory_test (args[0], 716 GNUNET_DISK_directory_test (args[0],
723 GNUNET_YES)) ) 717 GNUNET_YES)) )
724 { 718 {
@@ -729,14 +723,14 @@ run (void *cls,
729 cfg_filename = GNUNET_strdup (cfgfile); 723 cfg_filename = GNUNET_strdup (cfgfile);
730 cfg = c; 724 cfg = c;
731 dir_name = args[0]; 725 dir_name = args[0];
732 work_finished = GNUNET_CONTAINER_multihashmap_create (1024, 726 work_finished = GNUNET_CONTAINER_multihashmap_create (1024,
733 GNUNET_NO); 727 GNUNET_NO);
734 load_state (); 728 load_state ();
735 run_task = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, 729 run_task = GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE,
736 &scan, 730 &scan,
737 NULL); 731 NULL);
738 kill_task = 732 kill_task =
739 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 733 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
740 &do_stop_task, 734 &do_stop_task,
741 NULL); 735 NULL);
742} 736}
@@ -799,17 +793,17 @@ main (int argc, char *const *argv)
799 int ok; 793 int ok;
800 struct GNUNET_SIGNAL_Context *shc_chld; 794 struct GNUNET_SIGNAL_Context *shc_chld;
801 795
802 if (GNUNET_OK != 796 if (GNUNET_OK !=
803 GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) 797 GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv))
804 return 2; 798 return 2;
805 sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, 799 sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO,
806 GNUNET_NO, GNUNET_NO); 800 GNUNET_NO, GNUNET_NO);
807 GNUNET_assert (NULL != sigpipe); 801 GNUNET_assert (NULL != sigpipe);
808 shc_chld = 802 shc_chld =
809 GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD, 803 GNUNET_SIGNAL_handler_install (GNUNET_SIGCHLD,
810 &sighandler_child_death); 804 &sighandler_child_death);
811 ok = (GNUNET_OK == 805 ok = (GNUNET_OK ==
812 GNUNET_PROGRAM_run (argc, argv, 806 GNUNET_PROGRAM_run (argc, argv,
813 "gnunet-auto-share [OPTIONS] FILENAME", 807 "gnunet-auto-share [OPTIONS] FILENAME",
814 gettext_noop 808 gettext_noop
815 ("Automatically publish files from a directory on GNUnet"), 809 ("Automatically publish files from a directory on GNUnet"),
@@ -823,7 +817,7 @@ main (int argc, char *const *argv)
823 } 817 }
824 while (NULL != (wi = work_head)) 818 while (NULL != (wi = work_head))
825 { 819 {
826 GNUNET_CONTAINER_DLL_remove (work_head, 820 GNUNET_CONTAINER_DLL_remove (work_head,
827 work_tail, 821 work_tail,
828 wi); 822 wi);
829 GNUNET_free (wi->filename); 823 GNUNET_free (wi->filename);
diff --git a/src/fs/gnunet-daemon-fsprofiler.c b/src/fs/gnunet-daemon-fsprofiler.c
index 77a293a23..326178df9 100644
--- a/src/fs/gnunet-daemon-fsprofiler.c
+++ b/src/fs/gnunet-daemon-fsprofiler.c
@@ -267,10 +267,9 @@ make_file (uint64_t length,
267 * Task run during shutdown. 267 * Task run during shutdown.
268 * 268 *
269 * @param cls unused 269 * @param cls unused
270 * @param tc unused
271 */ 270 */
272static void 271static void
273shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 272shutdown_task (void *cls)
274{ 273{
275 struct Pattern *p; 274 struct Pattern *p;
276 275
@@ -313,10 +312,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
313 * Task run when a publish operation should be stopped. 312 * Task run when a publish operation should be stopped.
314 * 313 *
315 * @param cls the 'struct Pattern' of the publish operation to stop 314 * @param cls the 'struct Pattern' of the publish operation to stop
316 * @param tc unused
317 */ 315 */
318static void 316static void
319publish_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 317publish_stop_task (void *cls)
320{ 318{
321 struct Pattern *p = cls; 319 struct Pattern *p = cls;
322 320
@@ -329,10 +327,9 @@ publish_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
329 * Task run when a download operation should be stopped. 327 * Task run when a download operation should be stopped.
330 * 328 *
331 * @param cls the 'struct Pattern' of the download operation to stop 329 * @param cls the 'struct Pattern' of the download operation to stop
332 * @param tc unused
333 */ 330 */
334static void 331static void
335download_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 332download_stop_task (void *cls)
336{ 333{
337 struct Pattern *p = cls; 334 struct Pattern *p = cls;
338 335
@@ -345,10 +342,9 @@ download_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
345 * Task run when a download operation should be stopped. 342 * Task run when a download operation should be stopped.
346 * 343 *
347 * @param cls the 'struct Pattern' of the download operation to stop 344 * @param cls the 'struct Pattern' of the download operation to stop
348 * @param tc unused
349 */ 345 */
350static void 346static void
351search_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 347search_stop_task (void *cls)
352{ 348{
353 struct Pattern *p = cls; 349 struct Pattern *p = cls;
354 350
@@ -498,16 +494,16 @@ progress_cb (void *cls,
498 * Start publish operation. 494 * Start publish operation.
499 * 495 *
500 * @param cls the 'struct Pattern' specifying the operation to perform 496 * @param cls the 'struct Pattern' specifying the operation to perform
501 * @param tc scheduler context
502 */ 497 */
503static void 498static void
504start_publish (void *cls, 499start_publish (void *cls)
505 const struct GNUNET_SCHEDULER_TaskContext *tc)
506{ 500{
507 struct Pattern *p = cls; 501 struct Pattern *p = cls;
508 struct GNUNET_FS_FileInformation *fi; 502 struct GNUNET_FS_FileInformation *fi;
503 const struct GNUNET_SCHEDULER_TaskContext *tc;
509 504
510 p->task = NULL; 505 p->task = NULL;
506 tc = GNUNET_SCHEDULER_get_task_context ();
511 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 507 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
512 return; 508 return;
513 fi = make_file (p->x, p->y, p); 509 fi = make_file (p->x, p->y, p);
@@ -523,16 +519,16 @@ start_publish (void *cls,
523 * Start download operation. 519 * Start download operation.
524 * 520 *
525 * @param cls the 'struct Pattern' specifying the operation to perform 521 * @param cls the 'struct Pattern' specifying the operation to perform
526 * @param tc scheduler context
527 */ 522 */
528static void 523static void
529start_download (void *cls, 524start_download (void *cls)
530 const struct GNUNET_SCHEDULER_TaskContext *tc)
531{ 525{
532 struct Pattern *p = cls; 526 struct Pattern *p = cls;
533 struct GNUNET_FS_Uri *keywords; 527 struct GNUNET_FS_Uri *keywords;
528 const struct GNUNET_SCHEDULER_TaskContext *tc;
534 529
535 p->task = NULL; 530 p->task = NULL;
531 tc = GNUNET_SCHEDULER_get_task_context ();
536 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 532 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
537 return; 533 return;
538 keywords = make_keywords (p->x); 534 keywords = make_keywords (p->x);
diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c
index 85afbe606..a2b0aa5fc 100644
--- a/src/fs/gnunet-download.c
+++ b/src/fs/gnunet-download.c
@@ -54,7 +54,7 @@ static int local_only;
54 54
55 55
56static void 56static void
57cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 57cleanup_task (void *cls)
58{ 58{
59 GNUNET_FS_stop (ctx); 59 GNUNET_FS_stop (ctx);
60 ctx = NULL; 60 ctx = NULL;
@@ -62,7 +62,7 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
62 62
63 63
64static void 64static void
65shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 65shutdown_task (void *cls)
66{ 66{
67 if (NULL != dc) 67 if (NULL != dc)
68 { 68 {
diff --git a/src/fs/gnunet-fs-profiler.c b/src/fs/gnunet-fs-profiler.c
index cd4f9d851..69433346f 100644
--- a/src/fs/gnunet-fs-profiler.c
+++ b/src/fs/gnunet-fs-profiler.c
@@ -109,11 +109,9 @@ process_stats (void *cls,
109 * all statistics. 109 * all statistics.
110 * 110 *
111 * @param cls NULL 111 * @param cls NULL
112 * @param tc unused
113 */ 112 */
114static void 113static void
115terminate_task (void *cls, 114terminate_task (void *cls)
116 const struct GNUNET_SCHEDULER_TaskContext *tc)
117{ 115{
118 terminate_taskid = NULL; 116 terminate_taskid = NULL;
119 GNUNET_TESTBED_get_statistics (0, NULL, 117 GNUNET_TESTBED_get_statistics (0, NULL,
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index b5c8acc4c..f058c10b2 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -146,11 +146,9 @@ static struct GNUNET_IDENTITY_Handle *identity;
146 * FS state. 146 * FS state.
147 * 147 *
148 * @param cls NULL 148 * @param cls NULL
149 * @param tc scheduler context
150 */ 149 */
151static void 150static void
152do_stop_task (void *cls, 151do_stop_task (void *cls)
153 const struct GNUNET_SCHEDULER_TaskContext *tc)
154{ 152{
155 struct GNUNET_FS_PublishContext *p; 153 struct GNUNET_FS_PublishContext *p;
156 154
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c
index d9ce456a6..a15d0d883 100644
--- a/src/fs/gnunet-search.c
+++ b/src/fs/gnunet-search.c
@@ -96,7 +96,7 @@ item_printer (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type,
96 96
97 97
98static void 98static void
99clean_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 99clean_task (void *cls)
100{ 100{
101 size_t dsize; 101 size_t dsize;
102 void *ddata; 102 void *ddata;
@@ -210,7 +210,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
210 210
211 211
212static void 212static void
213shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 213shutdown_task (void *cls)
214{ 214{
215 if (sc != NULL) 215 if (sc != NULL)
216 { 216 {
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index aebbe5854..2ba96334c 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -184,11 +184,9 @@ static struct GNUNET_PeerIdentity my_id;
184 * Task that periodically ages our cover traffic statistics. 184 * Task that periodically ages our cover traffic statistics.
185 * 185 *
186 * @param cls unused closure 186 * @param cls unused closure
187 * @param tc task context
188 */ 187 */
189static void 188static void
190age_cover_counters (void *cls, 189age_cover_counters (void *cls)
191 const struct GNUNET_SCHEDULER_TaskContext *tc)
192{ 190{
193 GSF_cover_content_count = (GSF_cover_content_count * 15) / 16; 191 GSF_cover_content_count = (GSF_cover_content_count * 15) / 16;
194 GSF_cover_query_count = (GSF_cover_query_count * 15) / 16; 192 GSF_cover_query_count = (GSF_cover_query_count * 15) / 16;
@@ -531,11 +529,9 @@ handle_loc_sign (void *cls,
531 * Task run during shutdown. 529 * Task run during shutdown.
532 * 530 *
533 * @param cls unused 531 * @param cls unused
534 * @param tc unused
535 */ 532 */
536static void 533static void
537shutdown_task (void *cls, 534shutdown_task (void *cls)
538 const struct GNUNET_SCHEDULER_TaskContext *tc)
539{ 535{
540 GSF_cadet_stop_client (); 536 GSF_cadet_stop_client ();
541 GSF_cadet_stop_server (); 537 GSF_cadet_stop_server ();
@@ -821,7 +817,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
821 (GNUNET_OK != main_init (server, cfg))) 817 (GNUNET_OK != main_init (server, cfg)))
822 { 818 {
823 GNUNET_SCHEDULER_shutdown (); 819 GNUNET_SCHEDULER_shutdown ();
824 shutdown_task (NULL, NULL); 820 shutdown_task (NULL);
825 return; 821 return;
826 } 822 }
827} 823}
diff --git a/src/fs/gnunet-service-fs_cadet_client.c b/src/fs/gnunet-service-fs_cadet_client.c
index 417468970..3ea2efa67 100644
--- a/src/fs/gnunet-service-fs_cadet_client.c
+++ b/src/fs/gnunet-service-fs_cadet_client.c
@@ -246,11 +246,9 @@ reset_cadet (struct CadetHandle *mh)
246 * Task called when it is time to destroy an inactive cadet channel. 246 * Task called when it is time to destroy an inactive cadet channel.
247 * 247 *
248 * @param cls the `struct CadetHandle` to tear down 248 * @param cls the `struct CadetHandle` to tear down
249 * @param tc scheduler context, unused
250 */ 249 */
251static void 250static void
252cadet_timeout (void *cls, 251cadet_timeout (void *cls)
253 const struct GNUNET_SCHEDULER_TaskContext *tc)
254{ 252{
255 struct CadetHandle *mh = cls; 253 struct CadetHandle *mh = cls;
256 struct GNUNET_CADET_Channel *tun; 254 struct GNUNET_CADET_Channel *tun;
@@ -270,11 +268,9 @@ cadet_timeout (void *cls,
270 * Task called when it is time to reset an cadet. 268 * Task called when it is time to reset an cadet.
271 * 269 *
272 * @param cls the `struct CadetHandle` to tear down 270 * @param cls the `struct CadetHandle` to tear down
273 * @param tc scheduler context, unused
274 */ 271 */
275static void 272static void
276reset_cadet_task (void *cls, 273reset_cadet_task (void *cls)
277 const struct GNUNET_SCHEDULER_TaskContext *tc)
278{ 274{
279 struct CadetHandle *mh = cls; 275 struct CadetHandle *mh = cls;
280 276
diff --git a/src/fs/gnunet-service-fs_cadet_server.c b/src/fs/gnunet-service-fs_cadet_server.c
index 46086eec8..ccf6b3c5c 100644
--- a/src/fs/gnunet-service-fs_cadet_server.c
+++ b/src/fs/gnunet-service-fs_cadet_server.c
@@ -154,11 +154,9 @@ static unsigned long long sc_count_max;
154 * Task run to asynchronously terminate the cadet due to timeout. 154 * Task run to asynchronously terminate the cadet due to timeout.
155 * 155 *
156 * @param cls the 'struct CadetClient' 156 * @param cls the 'struct CadetClient'
157 * @param tc scheduler context
158 */ 157 */
159static void 158static void
160timeout_cadet_task (void *cls, 159timeout_cadet_task (void *cls)
161 const struct GNUNET_SCHEDULER_TaskContext *tc)
162{ 160{
163 struct CadetClient *sc = cls; 161 struct CadetClient *sc = cls;
164 struct GNUNET_CADET_Channel *tun; 162 struct GNUNET_CADET_Channel *tun;
@@ -324,7 +322,7 @@ continue_writing (struct CadetClient *sc)
324static void 322static void
325handle_datastore_reply (void *cls, 323handle_datastore_reply (void *cls,
326 const struct GNUNET_HashCode *key, 324 const struct GNUNET_HashCode *key,
327 size_t size, 325 size_t size,
328 const void *data, 326 const void *data,
329 enum GNUNET_BLOCK_Type type, 327 enum GNUNET_BLOCK_Type type,
330 uint32_t priority, 328 uint32_t priority,
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c
index 3cabfeaaf..e916a73a8 100644
--- a/src/fs/gnunet-service-fs_cp.c
+++ b/src/fs/gnunet-service-fs_cp.c
@@ -522,11 +522,9 @@ peer_transmit_ready_cb (void *cls,
522 * (re)try to reserve bandwidth from the given peer. 522 * (re)try to reserve bandwidth from the given peer.
523 * 523 *
524 * @param cls the `struct GSF_ConnectedPeer` to reserve from 524 * @param cls the `struct GSF_ConnectedPeer` to reserve from
525 * @param tc scheduler context
526 */ 525 */
527static void 526static void
528retry_reservation (void *cls, 527retry_reservation (void *cls)
529 const struct GNUNET_SCHEDULER_TaskContext *tc)
530{ 528{
531 struct GSF_ConnectedPeer *cp = cls; 529 struct GSF_ConnectedPeer *cp = cls;
532 struct GNUNET_PeerIdentity target; 530 struct GNUNET_PeerIdentity target;
@@ -675,11 +673,9 @@ GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer,
675 * peer. Check, and if so, restart migration. 673 * peer. Check, and if so, restart migration.
676 * 674 *
677 * @param cls the `struct GSF_ConnectedPeer` 675 * @param cls the `struct GSF_ConnectedPeer`
678 * @param tc scheduler context
679 */ 676 */
680static void 677static void
681revive_migration (void *cls, 678revive_migration (void *cls)
682 const struct GNUNET_SCHEDULER_TaskContext *tc)
683{ 679{
684 struct GSF_ConnectedPeer *cp = cls; 680 struct GSF_ConnectedPeer *cp = cls;
685 struct GNUNET_TIME_Relative bt; 681 struct GNUNET_TIME_Relative bt;
@@ -854,11 +850,9 @@ cancel_pending_request (void *cls,
854 * Free the given request. 850 * Free the given request.
855 * 851 *
856 * @param cls the request to free 852 * @param cls the request to free
857 * @param tc task context
858 */ 853 */
859static void 854static void
860peer_request_destroy (void *cls, 855peer_request_destroy (void *cls)
861 const struct GNUNET_SCHEDULER_TaskContext *tc)
862{ 856{
863 struct PeerRequest *peerreq = cls; 857 struct PeerRequest *peerreq = cls;
864 struct GSF_PendingRequest *pr = peerreq->pr; 858 struct GSF_PendingRequest *pr = peerreq->pr;
@@ -876,19 +870,19 @@ peer_request_destroy (void *cls,
876 * The artificial delay is over, transmit the message now. 870 * The artificial delay is over, transmit the message now.
877 * 871 *
878 * @param cls the `struct GSF_DelayedHandle` with the message 872 * @param cls the `struct GSF_DelayedHandle` with the message
879 * @param tc scheduler context
880 */ 873 */
881static void 874static void
882transmit_delayed_now (void *cls, 875transmit_delayed_now (void *cls)
883 const struct GNUNET_SCHEDULER_TaskContext *tc)
884{ 876{
885 struct GSF_DelayedHandle *dh = cls; 877 struct GSF_DelayedHandle *dh = cls;
886 struct GSF_ConnectedPeer *cp = dh->cp; 878 struct GSF_ConnectedPeer *cp = dh->cp;
879 const struct GNUNET_SCHEDULER_TaskContext *tc;
887 880
888 GNUNET_CONTAINER_DLL_remove (cp->delayed_head, 881 GNUNET_CONTAINER_DLL_remove (cp->delayed_head,
889 cp->delayed_tail, 882 cp->delayed_tail,
890 dh); 883 dh);
891 cp->delay_queue_size--; 884 cp->delay_queue_size--;
885 tc = GNUNET_SCHEDULER_get_task_context ();
892 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 886 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
893 { 887 {
894 GNUNET_free (dh->pm); 888 GNUNET_free (dh->pm);
@@ -1490,11 +1484,9 @@ GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other,
1490 * a transmission request. 1484 * a transmission request.
1491 * 1485 *
1492 * @param cls the `struct GSF_PeerTransmitHandle` of the request 1486 * @param cls the `struct GSF_PeerTransmitHandle` of the request
1493 * @param tc scheduler context
1494 */ 1487 */
1495static void 1488static void
1496peer_transmit_timeout (void *cls, 1489peer_transmit_timeout (void *cls)
1497 const struct GNUNET_SCHEDULER_TaskContext *tc)
1498{ 1490{
1499 struct GSF_PeerTransmitHandle *pth = cls; 1491 struct GSF_PeerTransmitHandle *pth = cls;
1500 struct GSF_ConnectedPeer *cp; 1492 struct GSF_ConnectedPeer *cp;
@@ -1981,18 +1973,17 @@ GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp,
1981 * Call this method periodically to flush respect information to disk. 1973 * Call this method periodically to flush respect information to disk.
1982 * 1974 *
1983 * @param cls closure, not used 1975 * @param cls closure, not used
1984 * @param tc task context, not used
1985 */ 1976 */
1986static void 1977static void
1987cron_flush_respect (void *cls, 1978cron_flush_respect (void *cls)
1988 const struct GNUNET_SCHEDULER_TaskContext *tc)
1989{ 1979{
1980 const struct GNUNET_SCHEDULER_TaskContext *tc;
1981
1990 if (NULL == cp_map) 1982 if (NULL == cp_map)
1991 return; 1983 return;
1992 GNUNET_CONTAINER_multipeermap_iterate (cp_map, 1984 GNUNET_CONTAINER_multipeermap_iterate (cp_map,
1993 &flush_respect, NULL); 1985 &flush_respect, NULL);
1994 if (NULL == tc) 1986 tc = GNUNET_SCHEDULER_get_task_context ();
1995 return;
1996 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1987 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1997 return; 1988 return;
1998 GNUNET_SCHEDULER_add_delayed_with_priority (RESPECT_FLUSH_FREQ, 1989 GNUNET_SCHEDULER_add_delayed_with_priority (RESPECT_FLUSH_FREQ,
@@ -2038,7 +2029,9 @@ clean_peer (void *cls,
2038void 2029void
2039GSF_connected_peer_done_ () 2030GSF_connected_peer_done_ ()
2040{ 2031{
2041 cron_flush_respect (NULL, NULL); 2032 GNUNET_CONTAINER_multipeermap_iterate (cp_map,
2033 &flush_respect,
2034 NULL);
2042 GNUNET_CONTAINER_multipeermap_iterate (cp_map, 2035 GNUNET_CONTAINER_multipeermap_iterate (cp_map,
2043 &clean_peer, NULL); 2036 &clean_peer, NULL);
2044 GNUNET_CONTAINER_multipeermap_destroy (cp_map); 2037 GNUNET_CONTAINER_multipeermap_destroy (cp_map);
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c
index f837ad320..2706aea30 100644
--- a/src/fs/gnunet-service-fs_lc.c
+++ b/src/fs/gnunet-service-fs_lc.c
@@ -184,11 +184,9 @@ GSF_local_client_lookup_ (struct GNUNET_SERVER_Client *client)
184 * Free the given client request. 184 * Free the given client request.
185 * 185 *
186 * @param cls the client request to free 186 * @param cls the client request to free
187 * @param tc task context
188 */ 187 */
189static void 188static void
190client_request_destroy (void *cls, 189client_request_destroy (void *cls)
191 const struct GNUNET_SCHEDULER_TaskContext *tc)
192{ 190{
193 struct ClientRequest *cr = cls; 191 struct ClientRequest *cr = cls;
194 struct GSF_LocalClient *lc; 192 struct GSF_LocalClient *lc;
@@ -510,7 +508,7 @@ GSF_client_disconnect_handler_ (void *cls,
510 { 508 {
511 if (NULL != cr->kill_task) 509 if (NULL != cr->kill_task)
512 GNUNET_SCHEDULER_cancel (cr->kill_task); 510 GNUNET_SCHEDULER_cancel (cr->kill_task);
513 client_request_destroy (cr, NULL); 511 client_request_destroy (cr);
514 } 512 }
515 while (NULL != (res = pos->res_head)) 513 while (NULL != (res = pos->res_head))
516 { 514 {
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c
index 8e414e74a..b338c1a13 100644
--- a/src/fs/gnunet-service-fs_pe.c
+++ b/src/fs/gnunet-service-fs_pe.c
@@ -244,11 +244,9 @@ get_rp_key (struct GSF_RequestPlan *rp)
244 * Figure out when and how to transmit to the given peer. 244 * Figure out when and how to transmit to the given peer.
245 * 245 *
246 * @param cls the `struct GSF_ConnectedPeer` for transmission 246 * @param cls the `struct GSF_ConnectedPeer` for transmission
247 * @param tc scheduler context
248 */ 247 */
249static void 248static void
250schedule_peer_transmission (void *cls, 249schedule_peer_transmission (void *cls);
251 const struct GNUNET_SCHEDULER_TaskContext *tc);
252 250
253 251
254/** 252/**
@@ -457,11 +455,9 @@ transmit_message_callback (void *cls,
457 * Figure out when and how to transmit to the given peer. 455 * Figure out when and how to transmit to the given peer.
458 * 456 *
459 * @param cls the `struct PeerPlan` 457 * @param cls the `struct PeerPlan`
460 * @param tc scheduler context
461 */ 458 */
462static void 459static void
463schedule_peer_transmission (void *cls, 460schedule_peer_transmission (void *cls)
464 const struct GNUNET_SCHEDULER_TaskContext *tc)
465{ 461{
466 struct PeerPlan *pp = cls; 462 struct PeerPlan *pp = cls;
467 struct GSF_RequestPlan *rp; 463 struct GSF_RequestPlan *rp;
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index 8c97e0898..a7a62a743 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -1300,11 +1300,9 @@ GSF_cadet_lookup_ (struct GSF_PendingRequest *pr)
1300 * Task that issues a warning if the datastore lookup takes too long. 1300 * Task that issues a warning if the datastore lookup takes too long.
1301 * 1301 *
1302 * @param cls the `struct GSF_PendingRequest` 1302 * @param cls the `struct GSF_PendingRequest`
1303 * @param tc task context
1304 */ 1303 */
1305static void 1304static void
1306warn_delay_task (void *cls, 1305warn_delay_task (void *cls)
1307 const struct GNUNET_SCHEDULER_TaskContext *tc)
1308{ 1306{
1309 struct GSF_PendingRequest *pr = cls; 1307 struct GSF_PendingRequest *pr = cls;
1310 1308
@@ -1323,11 +1321,9 @@ warn_delay_task (void *cls,
1323 * Task that issues a warning if the datastore lookup takes too long. 1321 * Task that issues a warning if the datastore lookup takes too long.
1324 * 1322 *
1325 * @param cls the `struct GSF_PendingRequest` 1323 * @param cls the `struct GSF_PendingRequest`
1326 * @param tc task context
1327 */ 1324 */
1328static void 1325static void
1329odc_warn_delay_task (void *cls, 1326odc_warn_delay_task (void *cls)
1330 const struct GNUNET_SCHEDULER_TaskContext *tc)
1331{ 1327{
1332 struct GSF_PendingRequest *pr = cls; 1328 struct GSF_PendingRequest *pr = cls;
1333 1329
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c
index a31a4f626..a76a3827c 100644
--- a/src/fs/gnunet-service-fs_push.c
+++ b/src/fs/gnunet-service-fs_push.c
@@ -432,11 +432,9 @@ find_content (struct MigrationReadyPeer *mrp)
432 * migration 432 * migration
433 * 433 *
434 * @param cls unused 434 * @param cls unused
435 * @param tc scheduler context (also unused)
436 */ 435 */
437static void 436static void
438gather_migration_blocks (void *cls, 437gather_migration_blocks (void *cls);
439 const struct GNUNET_SCHEDULER_TaskContext *tc);
440 438
441 439
442/** 440/**
@@ -569,11 +567,9 @@ process_migration_content (void *cls,
569 * migration 567 * migration
570 * 568 *
571 * @param cls unused 569 * @param cls unused
572 * @param tc scheduler context (also unused)
573 */ 570 */
574static void 571static void
575gather_migration_blocks (void *cls, 572gather_migration_blocks (void *cls)
576 const struct GNUNET_SCHEDULER_TaskContext *tc)
577{ 573{
578 mig_task = NULL; 574 mig_task = NULL;
579 if (mig_size >= MAX_MIGRATION_QUEUE) 575 if (mig_size >= MAX_MIGRATION_QUEUE)
diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c
index 3fb2d7abb..fa5aa461d 100644
--- a/src/fs/gnunet-service-fs_put.c
+++ b/src/fs/gnunet-service-fs_put.c
@@ -95,8 +95,7 @@ static struct PutOperator operators[] = {
95 * @param tc scheduler context (unused) 95 * @param tc scheduler context (unused)
96 */ 96 */
97static void 97static void
98gather_dht_put_blocks (void *cls, 98gather_dht_put_blocks (void *cls);
99 const struct GNUNET_SCHEDULER_TaskContext *tc);
100 99
101 100
102/** 101/**
@@ -151,10 +150,9 @@ delay_dht_put_blocks (void *cls, int success)
151 * Task that is run periodically to obtain blocks for DHT PUTs. 150 * Task that is run periodically to obtain blocks for DHT PUTs.
152 * 151 *
153 * @param cls type of blocks to gather 152 * @param cls type of blocks to gather
154 * @param tc scheduler context
155 */ 153 */
156static void 154static void
157delay_dht_put_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 155delay_dht_put_task (void *cls)
158{ 156{
159 struct PutOperator *po = cls; 157 struct PutOperator *po = cls;
160 158
@@ -212,14 +210,15 @@ process_dht_put_content (void *cls,
212 * Task that is run periodically to obtain blocks for DHT PUTs. 210 * Task that is run periodically to obtain blocks for DHT PUTs.
213 * 211 *
214 * @param cls type of blocks to gather 212 * @param cls type of blocks to gather
215 * @param tc scheduler context (unused)
216 */ 213 */
217static void 214static void
218gather_dht_put_blocks (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 215gather_dht_put_blocks (void *cls)
219{ 216{
220 struct PutOperator *po = cls; 217 struct PutOperator *po = cls;
218 const struct GNUNET_SCHEDULER_TaskContext *tc;
221 219
222 po->dht_task = NULL; 220 po->dht_task = NULL;
221 tc = GNUNET_SCHEDULER_get_task_context ();
223 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 222 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
224 return; 223 return;
225 po->dht_qe = 224 po->dht_qe =
diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c
index 8a059478c..cab963e0d 100644
--- a/src/fs/gnunet-unindex.c
+++ b/src/fs/gnunet-unindex.c
@@ -40,7 +40,7 @@ static struct GNUNET_FS_UnindexContext *uc;
40 40
41 41
42static void 42static void
43cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 43cleanup_task (void *cls)
44{ 44{
45 GNUNET_FS_stop (ctx); 45 GNUNET_FS_stop (ctx);
46 ctx = NULL; 46 ctx = NULL;
@@ -48,7 +48,7 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
48 48
49 49
50static void 50static void
51shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 51shutdown_task (void *cls)
52{ 52{
53 struct GNUNET_FS_UnindexContext *u; 53 struct GNUNET_FS_UnindexContext *u;
54 54
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c
index 08bfe1b30..40b2b977b 100644
--- a/src/fs/perf_gnunet_service_fs_p2p.c
+++ b/src/fs/perf_gnunet_service_fs_p2p.c
@@ -238,8 +238,7 @@ stat_run (void *cls,
238 238
239 239
240static void 240static void
241do_report (void *cls, 241do_report (void *cls)
242 const struct GNUNET_SCHEDULER_TaskContext *tc)
243{ 242{
244 char *fn = cls; 243 char *fn = cls;
245 struct GNUNET_TIME_Relative del; 244 struct GNUNET_TIME_Relative del;
diff --git a/src/fs/perf_gnunet_service_fs_p2p_respect.c b/src/fs/perf_gnunet_service_fs_p2p_respect.c
index d20d15aff..2527c8978 100644
--- a/src/fs/perf_gnunet_service_fs_p2p_respect.c
+++ b/src/fs/perf_gnunet_service_fs_p2p_respect.c
@@ -279,7 +279,7 @@ stat_run (void *cls,
279 279
280 280
281static void 281static void
282do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 282do_report (void *cls)
283{ 283{
284 static int download_counter; 284 static int download_counter;
285 const char *type = cls; 285 const char *type = cls;
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c
index e192e8f52..936f001df 100644
--- a/src/fs/test_fs_download.c
+++ b/src/fs/test_fs_download.c
@@ -67,7 +67,7 @@ static int err;
67 67
68 68
69static void 69static void
70timeout_kill_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 70timeout_kill_task (void *cls)
71{ 71{
72 if (NULL != download) 72 if (NULL != download)
73 { 73 {
@@ -86,7 +86,7 @@ timeout_kill_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
86 86
87 87
88static void 88static void
89abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 89abort_publish_task (void *cls)
90{ 90{
91 if (NULL != publish) 91 if (NULL != publish)
92 { 92 {
@@ -97,7 +97,7 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
97 97
98 98
99static void 99static void
100stop_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 100stop_fs_task (void *cls)
101{ 101{
102 GNUNET_FS_stop (fs); 102 GNUNET_FS_stop (fs);
103 fs = NULL; 103 fs = NULL;
@@ -105,7 +105,7 @@ stop_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
105 105
106 106
107static void 107static void
108abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 108abort_download_task (void *cls)
109{ 109{
110 uint64_t size; 110 uint64_t size;
111 111
diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c
index 6b78741e6..76a1ea911 100644
--- a/src/fs/test_fs_download_persistence.c
+++ b/src/fs/test_fs_download_persistence.c
@@ -62,7 +62,7 @@ static int err;
62 62
63 63
64static void 64static void
65timeout_kill_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 65timeout_kill_task (void *cls)
66{ 66{
67 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Timeout downloading file\n"); 67 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Timeout downloading file\n");
68 if (download != NULL) 68 if (download != NULL)
@@ -81,7 +81,7 @@ timeout_kill_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
81 81
82 82
83static void 83static void
84abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 84abort_publish_task (void *cls)
85{ 85{
86 if (publish != NULL) 86 if (publish != NULL)
87 { 87 {
@@ -92,7 +92,7 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
92 92
93 93
94static void 94static void
95abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 95abort_download_task (void *cls)
96{ 96{
97 uint64_t size; 97 uint64_t size;
98 98
@@ -116,7 +116,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event);
116 116
117 117
118static void 118static void
119restart_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 119restart_fs_task (void *cls)
120{ 120{
121 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Restarting FS.\n"); 121 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Restarting FS.\n");
122 GNUNET_FS_stop (fs); 122 GNUNET_FS_stop (fs);
diff --git a/src/fs/test_fs_list_indexed.c b/src/fs/test_fs_list_indexed.c
index b76e894a5..61e4df512 100644
--- a/src/fs/test_fs_list_indexed.c
+++ b/src/fs/test_fs_list_indexed.c
@@ -62,7 +62,7 @@ static int err;
62 62
63 63
64static void 64static void
65abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 65abort_publish_task (void *cls)
66{ 66{
67 GNUNET_FS_publish_stop (publish); 67 GNUNET_FS_publish_stop (publish);
68 publish = NULL; 68 publish = NULL;
@@ -76,8 +76,7 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
76 76
77 77
78static void 78static void
79list_indexed_task (void *cls, 79list_indexed_task (void *cls)
80 const struct GNUNET_SCHEDULER_TaskContext *tc)
81{ 80{
82 GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); 81 GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL);
83} 82}
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c
index 201acb8f5..b8325d8d8 100644
--- a/src/fs/test_fs_namespace.c
+++ b/src/fs/test_fs_namespace.c
@@ -49,7 +49,7 @@ static int err;
49 49
50 50
51static void 51static void
52abort_ksk_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 52abort_ksk_search_task (void *cls)
53{ 53{
54 if (ksk_search != NULL) 54 if (ksk_search != NULL)
55 { 55 {
@@ -66,7 +66,7 @@ abort_ksk_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
66 66
67 67
68static void 68static void
69abort_sks_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 69abort_sks_search_task (void *cls)
70{ 70{
71 if (sks_search == NULL) 71 if (sks_search == NULL)
72 return; 72 return;
@@ -82,13 +82,13 @@ abort_sks_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
82 82
83 83
84static void 84static void
85do_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 85do_timeout (void *cls)
86{ 86{
87 err = 1; 87 err = 1;
88 FPRINTF (stderr, "%s", "Operation timed out\n"); 88 FPRINTF (stderr, "%s", "Operation timed out\n");
89 kill_task = NULL; 89 kill_task = NULL;
90 abort_sks_search_task (NULL, tc); 90 abort_sks_search_task (NULL);
91 abort_ksk_search_task (NULL, tc); 91 abort_ksk_search_task (NULL);
92} 92}
93 93
94 94
diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c
index a391dbe0d..f4c56e015 100644
--- a/src/fs/test_fs_publish.c
+++ b/src/fs/test_fs_publish.c
@@ -58,7 +58,7 @@ static int err;
58 58
59 59
60static void 60static void
61abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 61abort_publish_task (void *cls)
62{ 62{
63 GNUNET_FS_publish_stop (publish); 63 GNUNET_FS_publish_stop (publish);
64 publish = NULL; 64 publish = NULL;
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c
index 9807520a2..be9006d42 100644
--- a/src/fs/test_fs_publish_persistence.c
+++ b/src/fs/test_fs_publish_persistence.c
@@ -60,11 +60,11 @@ static char *fn2;
60 60
61static int err; 61static int err;
62 62
63static struct GNUNET_SCHEDULER_Task * rtask; 63static struct GNUNET_SCHEDULER_Task *rtask;
64 64
65 65
66static void 66static void
67abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 67abort_publish_task (void *cls)
68{ 68{
69 GNUNET_FS_publish_stop (publish); 69 GNUNET_FS_publish_stop (publish);
70 publish = NULL; 70 publish = NULL;
@@ -89,7 +89,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event);
89 89
90 90
91static void 91static void
92restart_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 92restart_fs_task (void *cls)
93{ 93{
94 rtask = NULL; 94 rtask = NULL;
95 GNUNET_FS_stop (fs); 95 GNUNET_FS_stop (fs);
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c
index 29a98bbad..0918b4b6b 100644
--- a/src/fs/test_fs_search.c
+++ b/src/fs/test_fs_search.c
@@ -58,7 +58,7 @@ static int err;
58 58
59 59
60static void 60static void
61abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 61abort_publish_task (void *cls)
62{ 62{
63 if (NULL != publish) 63 if (NULL != publish)
64 { 64 {
@@ -74,7 +74,7 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
74 74
75 75
76static void 76static void
77abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 77abort_error (void *cls)
78{ 78{
79 fprintf (stderr, 79 fprintf (stderr,
80 "Timeout\n"); 80 "Timeout\n");
@@ -94,7 +94,7 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
94 94
95 95
96static void 96static void
97abort_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 97abort_search_task (void *cls)
98{ 98{
99 if (NULL != search) 99 if (NULL != search)
100 { 100 {
diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c
index 756c72557..db084446e 100644
--- a/src/fs/test_fs_search_persistence.c
+++ b/src/fs/test_fs_search_persistence.c
@@ -60,7 +60,7 @@ static int err;
60 60
61 61
62static void 62static void
63abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 63abort_error (void *cls)
64{ 64{
65 timeout_task = NULL; 65 timeout_task = NULL;
66 fprintf (stderr, 66 fprintf (stderr,
@@ -78,8 +78,9 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
78 err = 1; 78 err = 1;
79} 79}
80 80
81
81static void 82static void
82abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 83abort_publish_task (void *cls)
83{ 84{
84 if (NULL != publish) 85 if (NULL != publish)
85 { 86 {
@@ -95,7 +96,7 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
95 96
96 97
97static void 98static void
98abort_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 99abort_search_task (void *cls)
99{ 100{
100 if (NULL != search) 101 if (NULL != search)
101 { 102 {
@@ -110,7 +111,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event);
110 111
111 112
112static void 113static void
113restart_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 114restart_fs_task (void *cls)
114{ 115{
115 GNUNET_FS_stop (fs); 116 GNUNET_FS_stop (fs);
116 fs = GNUNET_FS_start (cfg, "test-fs-search-persistence", &progress_cb, NULL, 117 fs = GNUNET_FS_start (cfg, "test-fs-search-persistence", &progress_cb, NULL,
diff --git a/src/fs/test_fs_search_probes.c b/src/fs/test_fs_search_probes.c
index bcb914d79..eaf804a22 100644
--- a/src/fs/test_fs_search_probes.c
+++ b/src/fs/test_fs_search_probes.c
@@ -59,7 +59,7 @@ static int err;
59 59
60 60
61static void 61static void
62abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 62abort_error (void *cls)
63{ 63{
64 timeout_task = NULL; 64 timeout_task = NULL;
65 fprintf (stderr, 65 fprintf (stderr,
@@ -79,7 +79,7 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
79 79
80 80
81static void 81static void
82abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 82abort_publish_task (void *cls)
83{ 83{
84 if (NULL != publish) 84 if (NULL != publish)
85 { 85 {
@@ -95,7 +95,7 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
95 95
96 96
97static void 97static void
98abort_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 98abort_search_task (void *cls)
99{ 99{
100 if (search != NULL) 100 if (search != NULL)
101 GNUNET_FS_search_stop (search); 101 GNUNET_FS_search_stop (search);
diff --git a/src/fs/test_fs_search_with_and.c b/src/fs/test_fs_search_with_and.c
index e25d3786a..83edf2e6c 100644
--- a/src/fs/test_fs_search_with_and.c
+++ b/src/fs/test_fs_search_with_and.c
@@ -66,7 +66,7 @@ static int processed_files;
66 66
67 67
68static void 68static void
69abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 69abort_publish_task (void *cls)
70{ 70{
71 if (NULL != publish) 71 if (NULL != publish)
72 { 72 {
@@ -82,7 +82,7 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
82 82
83 83
84static void 84static void
85abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 85abort_error (void *cls)
86{ 86{
87 fprintf (stderr, 87 fprintf (stderr,
88 "Timeout\n"); 88 "Timeout\n");
@@ -102,7 +102,7 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
102 102
103 103
104static void 104static void
105abort_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 105abort_search_task (void *cls)
106{ 106{
107 if (NULL != search) 107 if (NULL != search)
108 { 108 {
diff --git a/src/fs/test_fs_test_lib.c b/src/fs/test_fs_test_lib.c
index dda990830..c3a03668c 100644
--- a/src/fs/test_fs_test_lib.c
+++ b/src/fs/test_fs_test_lib.c
@@ -50,8 +50,7 @@ static int ret;
50 50
51 51
52static void 52static void
53do_stop (void *cls, 53do_stop (void *cls)
54 const struct GNUNET_SCHEDULER_TaskContext *tc)
55{ 54{
56 char *fn = cls; 55 char *fn = cls;
57 56
diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c
index 77a70cb20..bd36fcd18 100644
--- a/src/fs/test_fs_unindex.c
+++ b/src/fs/test_fs_unindex.c
@@ -57,7 +57,7 @@ static char *fn;
57 57
58 58
59static void 59static void
60abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 60abort_publish_task (void *cls)
61{ 61{
62 GNUNET_FS_publish_stop (publish); 62 GNUNET_FS_publish_stop (publish);
63 publish = NULL; 63 publish = NULL;
@@ -65,7 +65,7 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
65 65
66 66
67static void 67static void
68abort_unindex_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 68abort_unindex_task (void *cls)
69{ 69{
70 GNUNET_FS_unindex_stop (unindex); 70 GNUNET_FS_unindex_stop (unindex);
71 unindex = NULL; 71 unindex = NULL;
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c
index cfb08629b..7c76ee227 100644
--- a/src/fs/test_fs_unindex_persistence.c
+++ b/src/fs/test_fs_unindex_persistence.c
@@ -58,7 +58,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
58 58
59 59
60static void 60static void
61abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 61abort_publish_task (void *cls)
62{ 62{
63 GNUNET_FS_publish_stop (publish); 63 GNUNET_FS_publish_stop (publish);
64 publish = NULL; 64 publish = NULL;
@@ -66,7 +66,7 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
66 66
67 67
68static void 68static void
69abort_unindex_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 69abort_unindex_task (void *cls)
70{ 70{
71 if (unindex != NULL) 71 if (unindex != NULL)
72 { 72 {
@@ -87,7 +87,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event);
87 87
88 88
89static void 89static void
90restart_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 90restart_fs_task (void *cls)
91{ 91{
92 GNUNET_FS_stop (fs); 92 GNUNET_FS_stop (fs);
93 fs = GNUNET_FS_start (cfg, "test-fs-unindex-persistence", &progress_cb, NULL, 93 fs = GNUNET_FS_start (cfg, "test-fs-unindex-persistence", &progress_cb, NULL,
diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c
index b698506b4..f00290b0d 100644
--- a/src/fs/test_gnunet_service_fs_migration.c
+++ b/src/fs/test_gnunet_service_fs_migration.c
@@ -64,8 +64,7 @@ struct DownloadContext
64 64
65 65
66static void 66static void
67do_stop (void *cls, 67do_stop (void *cls)
68 const struct GNUNET_SCHEDULER_TaskContext *tc)
69{ 68{
70 struct GNUNET_TIME_Relative del; 69 struct GNUNET_TIME_Relative del;
71 char *fancy; 70 char *fancy;
@@ -140,11 +139,12 @@ do_download (void *cls,
140 139
141 140
142static void 141static void
143stop_source_peer (void *cls, 142stop_source_peer (void *cls)
144 const struct GNUNET_SCHEDULER_TaskContext *tc)
145{ 143{
146 struct DownloadContext *dc = cls; 144 struct DownloadContext *dc = cls;
145 const struct GNUNET_SCHEDULER_TaskContext *tc;
147 146
147 tc = GNUNET_SCHEDULER_get_task_context ();
148 /* Do not interact with testbed when shutting down */ 148 /* Do not interact with testbed when shutting down */
149 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 149 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
150 return; 150 return;
diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c
index f2b3f7516..3f6ec2497 100644
--- a/src/fs/test_gnunet_service_fs_p2p.c
+++ b/src/fs/test_gnunet_service_fs_p2p.c
@@ -54,7 +54,7 @@ static struct GNUNET_TIME_Absolute start_time;
54 54
55 55
56static void 56static void
57do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 57do_stop (void *cls)
58{ 58{
59 char *fn = cls; 59 char *fn = cls;
60 struct GNUNET_TIME_Relative del; 60 struct GNUNET_TIME_Relative del;