aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/testbed_test.c2
-rw-r--r--src/Makefile.am12
-rw-r--r--src/arm/arm_api.c6
-rw-r--r--src/arm/arm_monitor_api.c17
-rw-r--r--src/arm/gnunet-arm.c12
-rw-r--r--src/arm/gnunet-service-arm.c26
-rw-r--r--src/arm/test_arm_api.c2
-rw-r--r--src/arm/test_exponential_backoff.c10
-rw-r--r--src/arm/test_gnunet_service_arm.c3
-rw-r--r--src/ats-tests/ats-testing-experiment.c9
-rw-r--r--src/ats-tests/ats-testing-log.c14
-rw-r--r--src/ats-tests/ats-testing-preferences.c3
-rw-r--r--src/ats-tests/ats-testing-traffic.c4
-rw-r--r--src/ats-tests/ats-testing.c10
-rw-r--r--src/ats-tests/gnunet-solver-eval.c8
-rw-r--r--src/ats-tests/perf_ats.c6
-rw-r--r--src/ats-tests/perf_ats_logging.c14
-rw-r--r--src/ats-tool/gnunet-ats.c4
-rw-r--r--src/ats/ats_api_connectivity.c4
-rw-r--r--src/ats/ats_api_performance.c4
-rw-r--r--src/ats/ats_api_scanner.c4
-rw-r--r--src/ats/ats_api_scheduling.c4
-rw-r--r--src/ats/gnunet-ats-solver-eval.c19
-rw-r--r--src/ats/gnunet-service-ats.c4
-rw-r--r--src/ats/gnunet-service-ats_preferences.c4
-rw-r--r--src/ats/plugin_ats_ril.c3
-rw-r--r--src/ats/test_ats_lib.c12
-rw-r--r--src/cadet/cadet_api.c16
-rw-r--r--src/cadet/cadet_path.c5
-rw-r--r--src/cadet/gnunet-cadet-profiler.c41
-rw-r--r--src/cadet/gnunet-cadet.c54
-rw-r--r--src/cadet/gnunet-service-cadet.c3
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c11
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c40
-rw-r--r--src/cadet/gnunet-service-cadet_dht.c5
-rw-r--r--src/cadet/gnunet-service-cadet_peer.c9
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c39
-rw-r--r--src/cadet/test_cadet.c28
-rw-r--r--src/cadet/test_cadet_local.c25
-rw-r--r--src/cadet/test_cadet_single.c11
-rw-r--r--src/consensus/gnunet-consensus-profiler.c7
-rw-r--r--src/consensus/gnunet-service-consensus.c4
-rw-r--r--src/consensus/test_consensus_api.c5
-rw-r--r--src/conversation/gnunet-conversation-test.c8
-rw-r--r--src/conversation/gnunet-conversation.c8
-rw-r--r--src/conversation/gnunet-service-conversation.c4
-rw-r--r--src/conversation/test_conversation_api.c9
-rw-r--r--src/conversation/test_conversation_api_reject.c3
-rw-r--r--src/conversation/test_conversation_api_twocalls.c9
-rw-r--r--src/core/core_api.c7
-rw-r--r--src/core/gnunet-core.c4
-rw-r--r--src/core/gnunet-service-core.c6
-rw-r--r--src/core/gnunet-service-core_kx.c12
-rw-r--r--src/core/gnunet-service-core_sessions.c8
-rw-r--r--src/core/test_core_api.c6
-rw-r--r--src/core/test_core_api_mq.c3
-rw-r--r--src/core/test_core_api_reliability.c6
-rw-r--r--src/core/test_core_api_send_to_self.c2
-rw-r--r--src/core/test_core_api_start_only.c4
-rw-r--r--src/core/test_core_quota_compliance.c13
-rw-r--r--src/datastore/datastore_api.c10
-rw-r--r--src/datastore/gnunet-datastore.c3
-rw-r--r--src/datastore/gnunet-service-datastore.c10
-rw-r--r--src/datastore/perf_datastore_api.c10
-rw-r--r--src/datastore/perf_plugin_datastore.c13
-rw-r--r--src/datastore/test_datastore_api.c8
-rw-r--r--src/datastore/test_datastore_api_management.c4
-rw-r--r--src/datastore/test_plugin_datastore.c27
-rw-r--r--src/dht/dht_api.c30
-rw-r--r--src/dht/gnunet-dht-get.c3
-rw-r--r--src/dht/gnunet-dht-monitor.c3
-rw-r--r--src/dht/gnunet-dht-put.c9
-rw-r--r--src/dht/gnunet-service-dht.c8
-rw-r--r--src/dht/gnunet-service-dht_clients.c6
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c10
-rw-r--r--src/dht/gnunet-service-wdht.c5
-rw-r--r--src/dht/gnunet-service-wdht_clients.c6
-rw-r--r--src/dht/gnunet-service-wdht_neighbours.c8
-rw-r--r--src/dht/gnunet-service-xdht.c5
-rw-r--r--src/dht/gnunet-service-xdht_clients.c6
-rw-r--r--src/dht/gnunet-service-xdht_neighbours.c21
-rw-r--r--src/dht/gnunet_dht_profiler.c37
-rw-r--r--src/dht/test_dht_api.c6
-rw-r--r--src/dht/test_dht_monitor.c8
-rw-r--r--src/dht/test_dht_topo.c7
-rw-r--r--src/dns/dns_api.c5
-rw-r--r--src/dns/dnsstub.c10
-rw-r--r--src/dns/gnunet-dns-monitor.c2
-rw-r--r--src/dns/gnunet-dns-redirector.c2
-rw-r--r--src/dns/gnunet-service-dns.c4
-rw-r--r--src/dv/gnunet-dv.c4
-rw-r--r--src/dv/gnunet-service-dv.c16
-rw-r--r--src/dv/test_transport_dv.c3
-rw-r--r--src/exit/gnunet-daemon-exit.c14
-rw-r--r--src/fragmentation/defragmentation.c4
-rw-r--r--src/fragmentation/fragmentation.c4
-rw-r--r--src/fragmentation/test_fragmentation.c2
-rw-r--r--src/fragmentation/test_fragmentation_parallel.c5
-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
-rw-r--r--src/gns/gns_api.c3
-rw-r--r--src/gns/gnunet-bcd.c7
-rw-r--r--src/gns/gnunet-dns2gns.c22
-rw-r--r--src/gns/gnunet-gns-helper-service-w32.c4
-rw-r--r--src/gns/gnunet-gns-import.c4
-rw-r--r--src/gns/gnunet-gns-proxy.c42
-rw-r--r--src/gns/gnunet-gns.c4
-rw-r--r--src/gns/gnunet-service-gns.c15
-rw-r--r--src/gns/gnunet-service-gns_resolver.c11
-rw-r--r--src/gns/plugin_rest_gns.c9
-rw-r--r--src/gns/test_gns_proxy.c12
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c4
-rw-r--r--src/hostlist/gnunet-daemon-hostlist_client.c32
-rw-r--r--src/hostlist/gnunet-daemon-hostlist_server.c7
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist.c10
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_learning.c9
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_reconnect.c10
-rw-r--r--src/identity-provider/gnunet-service-identity-provider.c67
-rw-r--r--src/identity-provider/identity_provider_api.c11
-rw-r--r--src/identity-provider/plugin_rest_identity_provider.c38
-rw-r--r--src/identity/gnunet-identity.c4
-rw-r--r--src/identity/gnunet-service-identity.c3
-rw-r--r--src/identity/identity_api.c7
-rw-r--r--src/identity/plugin_rest_identity.c24
-rw-r--r--src/identity/test_identity.c6
-rw-r--r--src/identity/test_identity_defaults.c6
-rw-r--r--src/include/gnunet_os_lib.h5
-rw-r--r--src/include/gnunet_scheduler_lib.h16
-rw-r--r--src/include/gnunet_server_lib.h30
-rw-r--r--src/multicast/gnunet-service-multicast.c3
-rw-r--r--src/multicast/test_multicast.c14
-rw-r--r--src/namecache/gnunet-namecache.c4
-rw-r--r--src/namecache/gnunet-service-namecache.c4
-rw-r--r--src/namecache/namecache_api.c4
-rw-r--r--src/namecache/test_namecache_api_cache_block.c5
-rw-r--r--src/namestore/gnunet-namestore-fcfsd.c12
-rw-r--r--src/namestore/gnunet-namestore.c4
-rw-r--r--src/namestore/gnunet-service-namestore.c11
-rw-r--r--src/namestore/namestore_api.c4
-rw-r--r--src/namestore/plugin_rest_namestore.c34
-rw-r--r--src/namestore/test_namestore_api_lookup_nick.c16
-rw-r--r--src/namestore/test_namestore_api_lookup_private.c16
-rw-r--r--src/namestore/test_namestore_api_lookup_public.c5
-rw-r--r--src/namestore/test_namestore_api_lookup_shadow.c5
-rw-r--r--src/namestore/test_namestore_api_lookup_shadow_filter.c8
-rw-r--r--src/namestore/test_namestore_api_monitoring.c5
-rw-r--r--src/namestore/test_namestore_api_monitoring_existing.c10
-rw-r--r--src/namestore/test_namestore_api_remove.c5
-rw-r--r--src/namestore/test_namestore_api_remove_not_existing_record.c6
-rw-r--r--src/namestore/test_namestore_api_store.c5
-rw-r--r--src/namestore/test_namestore_api_store_update.c7
-rw-r--r--src/namestore/test_namestore_api_zone_iteration.c4
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_nick.c4
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_specific_zone.c25
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_stop.c23
-rw-r--r--src/namestore/test_namestore_api_zone_to_name.c5
-rw-r--r--src/nat/gnunet-nat-server.c8
-rw-r--r--src/nat/nat.c38
-rw-r--r--src/nat/nat_auto.c11
-rw-r--r--src/nat/nat_mini.c16
-rw-r--r--src/nat/nat_test.c26
-rw-r--r--src/nat/test_nat.c2
-rw-r--r--src/nat/test_nat_mini.c2
-rw-r--r--src/nat/test_nat_test.c7
-rw-r--r--src/nat/test_stun.c6
-rw-r--r--src/nse/gnunet-nse-profiler.c21
-rw-r--r--src/nse/gnunet-nse.c7
-rw-r--r--src/nse/gnunet-service-nse.c22
-rw-r--r--src/nse/nse_api.c7
-rw-r--r--src/nse/test_nse_api.c3
-rw-r--r--src/nse/test_nse_multipeer.c2
-rw-r--r--src/peerinfo-tool/gnunet-peerinfo.c12
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c16
-rw-r--r--src/peerinfo/peerinfo_api.c8
-rw-r--r--src/peerinfo/peerinfo_api_notify.c7
-rw-r--r--src/peerinfo/test_peerinfo_api_notify_friend_only.c7
-rw-r--r--src/peerstore/gnunet-peerstore.c6
-rw-r--r--src/peerstore/gnunet-service-peerstore.c8
-rw-r--r--src/peerstore/peerstore_api.c3
-rw-r--r--src/peerstore/test_peerstore_api_sync.c28
-rw-r--r--src/pq/test_pq.c9
-rw-r--r--src/psyc/gnunet-service-psyc.c7
-rw-r--r--src/psyc/test_psyc.c23
-rw-r--r--src/psycstore/gnunet-service-psycstore.c5
-rw-r--r--src/psycstore/psycstore_api.c6
-rw-r--r--src/psycstore/test_psycstore.c6
-rw-r--r--src/pt/gnunet-daemon-pt.c8
-rw-r--r--src/pt/test_gns_vpn.c13
-rw-r--r--src/pt/test_gnunet_vpn.c7
-rw-r--r--src/regex/gnunet-daemon-regexprofiler.c10
-rw-r--r--src/regex/gnunet-regex-profiler.c36
-rw-r--r--src/regex/gnunet-regex-simulation-profiler.c9
-rw-r--r--src/regex/gnunet-service-regex.c10
-rw-r--r--src/regex/test_regex_api.c5
-rw-r--r--src/regex/test_regex_integration.c5
-rw-r--r--src/rest/gnunet-rest-server.c41
-rw-r--r--src/revocation/gnunet-revocation.c10
-rw-r--r--src/revocation/gnunet-service-revocation.c8
-rw-r--r--src/revocation/test_revocation.c11
-rw-r--r--src/rps/gnunet-rps.c4
-rw-r--r--src/rps/gnunet-service-rps.c12
-rw-r--r--src/rps/gnunet-service-rps_sampler.c20
-rw-r--r--src/rps/test_rps.c32
-rw-r--r--src/scalarproduct/gnunet-scalarproduct.c3
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c3
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c4
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct_alice.c4
-rw-r--r--src/scalarproduct/gnunet-service-scalarproduct_bob.c4
-rw-r--r--src/secretsharing/gnunet-secretsharing-profiler.c5
-rw-r--r--src/secretsharing/gnunet-service-secretsharing.c3
-rw-r--r--src/secretsharing/test_secretsharing_api.c8
-rw-r--r--src/set/gnunet-service-set.c8
-rw-r--r--src/set/gnunet-set-profiler.c4
-rw-r--r--src/set/set_api.c19
-rw-r--r--src/set/test_set_api.c8
-rw-r--r--src/set/test_set_union_copy.c7
-rw-r--r--src/set/test_set_union_result_symmetric.c7
-rw-r--r--src/social/gnunet-service-social.c11
-rw-r--r--src/social/test_social.c17
-rw-r--r--src/statistics/gnunet-service-statistics.c4
-rw-r--r--src/statistics/gnunet-statistics.c7
-rw-r--r--src/statistics/statistics_api.c16
-rw-r--r--src/statistics/test_statistics_api_watch.c6
-rw-r--r--src/statistics/test_statistics_api_watch_zero_value.c6
-rw-r--r--src/template/gnunet-service-template.c3
-rw-r--r--src/testbed/gnunet-daemon-latency-logger.c3
-rw-r--r--src/testbed/gnunet-daemon-testbed-blacklist.c3
-rw-r--r--src/testbed/gnunet-daemon-testbed-underlay.c3
-rw-r--r--src/testbed/gnunet-helper-testbed.c18
-rw-r--r--src/testbed/gnunet-service-test-barriers.c9
-rw-r--r--src/testbed/gnunet-service-testbed-logger.c5
-rw-r--r--src/testbed/gnunet-service-testbed.c7
-rw-r--r--src/testbed/gnunet-service-testbed.h3
-rw-r--r--src/testbed/gnunet-service-testbed_barriers.c3
-rw-r--r--src/testbed/gnunet-service-testbed_connectionpool.c7
-rw-r--r--src/testbed/gnunet-service-testbed_cpustatus.c4
-rw-r--r--src/testbed/gnunet-service-testbed_links.c21
-rw-r--r--src/testbed/gnunet-service-testbed_oc.c61
-rw-r--r--src/testbed/gnunet-service-testbed_peers.c6
-rw-r--r--src/testbed/gnunet-testbed-profiler.c6
-rw-r--r--src/testbed/gnunet_testbed_mpi_spawn.c13
-rw-r--r--src/testbed/test_gnunet_helper_testbed.c14
-rw-r--r--src/testbed/test_testbed_api.c6
-rw-r--r--src/testbed/test_testbed_api_2peers_1controller.c11
-rw-r--r--src/testbed/test_testbed_api_3peers_3controllers.c11
-rw-r--r--src/testbed/test_testbed_api_barriers.c3
-rw-r--r--src/testbed/test_testbed_api_controllerlink.c16
-rw-r--r--src/testbed/test_testbed_api_hosts.c3
-rw-r--r--src/testbed/test_testbed_api_operations.c3
-rw-r--r--src/testbed/test_testbed_api_peer_reconfiguration.c3
-rw-r--r--src/testbed/test_testbed_api_peers_manage_services.c3
-rw-r--r--src/testbed/test_testbed_api_statistics.c3
-rw-r--r--src/testbed/test_testbed_api_test.c10
-rw-r--r--src/testbed/test_testbed_api_testbed_run.c6
-rw-r--r--src/testbed/test_testbed_api_topology.c3
-rw-r--r--src/testbed/test_testbed_api_topology_clique.c3
-rw-r--r--src/testbed/test_testbed_logger_api.c4
-rw-r--r--src/testbed/test_testbed_underlay.c2
-rw-r--r--src/testbed/testbed_api_hosts.c3
-rw-r--r--src/testbed/testbed_api_operations.c3
-rw-r--r--src/testbed/testbed_api_statistics.c6
-rw-r--r--src/testbed/testbed_api_testbed.c18
-rw-r--r--src/testbed/testbed_logger_api.c6
-rw-r--r--src/testing/gnunet-testing.c8
-rw-r--r--src/testing/test_testing_peerstartup.c3
-rw-r--r--src/testing/test_testing_peerstartup2.c10
-rw-r--r--src/testing/test_testing_sharedservices.c3
-rw-r--r--src/testing/testing.c4
-rw-r--r--src/topology/gnunet-daemon-topology.c14
-rw-r--r--src/transport/gnunet-service-transport.c8
-rw-r--r--src/transport/gnunet-service-transport_ats.c4
-rw-r--r--src/transport/gnunet-service-transport_blacklist.c36
-rw-r--r--src/transport/gnunet-service-transport_hello.c6
-rw-r--r--src/transport/gnunet-service-transport_manipulation.c4
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c16
-rw-r--r--src/transport/gnunet-service-transport_validation.c8
-rw-r--r--src/transport/gnunet-transport-profiler.c4
-rw-r--r--src/transport/gnunet-transport.c7
-rw-r--r--src/transport/plugin_transport_http_client.c23
-rw-r--r--src/transport/plugin_transport_http_server.c28
-rw-r--r--src/transport/plugin_transport_tcp.c12
-rw-r--r--src/transport/plugin_transport_udp.c24
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c6
-rw-r--r--src/transport/plugin_transport_unix.c20
-rw-r--r--src/transport/plugin_transport_wlan.c16
-rw-r--r--src/transport/test_plugin_transport.c7
-rw-r--r--src/transport/test_quota_compliance.c2
-rw-r--r--src/transport/test_transport_address_switch.c3
-rw-r--r--src/transport/test_transport_api.c9
-rw-r--r--src/transport/test_transport_api_bidirectional_connect.c8
-rw-r--r--src/transport/test_transport_api_blacklisting.c11
-rw-r--r--src/transport/test_transport_api_disconnect.c14
-rw-r--r--src/transport/test_transport_api_limited_sockets.c10
-rw-r--r--src/transport/test_transport_api_manipulation_cfg.c16
-rw-r--r--src/transport/test_transport_api_manipulation_recv_tcp.c13
-rw-r--r--src/transport/test_transport_api_manipulation_send_tcp.c9
-rw-r--r--src/transport/test_transport_api_monitor_peers.c9
-rw-r--r--src/transport/test_transport_api_monitor_validation.c8
-rw-r--r--src/transport/test_transport_api_reliability.c3
-rw-r--r--src/transport/test_transport_api_restart_1peer.c9
-rw-r--r--src/transport/test_transport_api_restart_2peers.c10
-rw-r--r--src/transport/test_transport_api_timeout.c8
-rw-r--r--src/transport/test_transport_blacklisting.c21
-rw-r--r--src/transport/test_transport_startonly.c6
-rw-r--r--src/transport/transport-testing.c13
-rw-r--r--src/transport/transport_api.c33
-rw-r--r--src/transport/transport_api_monitor_peers.c4
-rw-r--r--src/transport/transport_api_monitor_plugins.c4
-rw-r--r--src/transport/transport_api_monitor_validation.c8
-rw-r--r--src/util/bandwidth.c4
-rw-r--r--src/util/client.c19
-rw-r--r--src/util/client_manager.c6
-rw-r--r--src/util/connection.c34
-rw-r--r--src/util/crypto_hash_file.c3
-rw-r--r--src/util/disk_iterator.c3
-rw-r--r--src/util/gnunet-scrypt.c5
-rw-r--r--src/util/gnunet-uri.c3
-rw-r--r--src/util/helper.c24
-rw-r--r--src/util/mq.c6
-rw-r--r--src/util/os_priority.c21
-rw-r--r--src/util/program.c4
-rw-r--r--src/util/resolver_api.c26
-rw-r--r--src/util/scheduler.c21
-rw-r--r--src/util/server.c26
-rw-r--r--src/util/service.c9
-rw-r--r--src/util/socks.c53
-rw-r--r--src/util/speedup.c7
-rw-r--r--src/util/test_client.c2
-rw-r--r--src/util/test_common_logging_runtime_loglevels.c6
-rw-r--r--src/util/test_connection.c4
-rw-r--r--src/util/test_connection_addressing.c4
-rw-r--r--src/util/test_connection_receive_cancel.c6
-rw-r--r--src/util/test_connection_timeout.c2
-rw-r--r--src/util/test_connection_timeout_no_connect.c2
-rw-r--r--src/util/test_connection_transmit_cancel.c2
-rw-r--r--src/util/test_crypto_hash.c2
-rw-r--r--src/util/test_disk.c3
-rw-r--r--src/util/test_mq_client.c5
-rw-r--r--src/util/test_os_start_process.c6
-rw-r--r--src/util/test_scheduler.c26
-rw-r--r--src/util/test_scheduler_delay.c4
-rw-r--r--src/util/test_server.c8
-rw-r--r--src/util/test_server_disconnect.c11
-rw-r--r--src/util/test_server_with_client.c6
-rw-r--r--src/util/test_server_with_client_unix.c6
-rw-r--r--src/util/test_service.c2
-rw-r--r--src/util/test_socks.c2
-rw-r--r--src/util/test_speedup.c2
-rw-r--r--src/vpn/gnunet-service-vpn.c4
-rw-r--r--src/vpn/gnunet-vpn.c2
-rw-r--r--src/vpn/vpn_api.c6
393 files changed, 1699 insertions, 2271 deletions
diff --git a/doc/testbed_test.c b/doc/testbed_test.c
index e48bb28d8..0ef0980af 100644
--- a/doc/testbed_test.c
+++ b/doc/testbed_test.c
@@ -37,7 +37,7 @@ static int result;
37 * Cleans up. 37 * Cleans up.
38 */ 38 */
39static void 39static void
40shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 40shutdown_task (void *cls)
41{ 41{
42 shutdown_tid = NULL; 42 shutdown_tid = NULL;
43 if (NULL != dht_op) 43 if (NULL != dht_op)
diff --git a/src/Makefile.am b/src/Makefile.am
index 38fa42356..f38dd19d3 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,14 +13,9 @@ endif
13if HAVE_EXPERIMENTAL 13if HAVE_EXPERIMENTAL
14 EXP_DIR = \ 14 EXP_DIR = \
15 dv \ 15 dv \
16 multicast \
17 psycutil \
18 psycstore \
19 psyc \
20 rps \ 16 rps \
21 social \
22 $(CONSENSUS) \ 17 $(CONSENSUS) \
23 $(SECRETSHARING) 18 $(SECRETSHARING)
24endif 19endif
25 20
26if HAVE_REST 21if HAVE_REST
@@ -105,6 +100,11 @@ SUBDIRS = \
105 exit \ 100 exit \
106 pt \ 101 pt \
107 integration-tests \ 102 integration-tests \
103 multicast \
104 psycutil \
105 psycstore \
106 psyc \
107 social \
108 $(EXP_DIR) \ 108 $(EXP_DIR) \
109 $(PROVIDER_DIR) 109 $(PROVIDER_DIR)
110 110
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index 69569511f..c708f9150 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -205,10 +205,9 @@ trigger_next_request (struct GNUNET_ARM_Handle *h, int ignore_currently_down);
205 * Task scheduled to try to re-connect to arm. 205 * Task scheduled to try to re-connect to arm.
206 * 206 *
207 * @param cls the 'struct GNUNET_ARM_Handle' 207 * @param cls the 'struct GNUNET_ARM_Handle'
208 * @param tc task context
209 */ 208 */
210static void 209static void
211reconnect_arm_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 210reconnect_arm_task (void *cls)
212{ 211{
213 struct GNUNET_ARM_Handle *h = cls; 212 struct GNUNET_ARM_Handle *h = cls;
214 213
@@ -711,10 +710,9 @@ GNUNET_ARM_disconnect_and_free (struct GNUNET_ARM_Handle *h)
711 * Message timed out. Remove it from the queue. 710 * Message timed out. Remove it from the queue.
712 * 711 *
713 * @param cls the message (struct ARMControlMessage *) 712 * @param cls the message (struct ARMControlMessage *)
714 * @param tc task context
715 */ 713 */
716static void 714static void
717control_message_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 715control_message_timeout (void *cls)
718{ 716{
719 struct ARMControlMessage *cm = cls; 717 struct ARMControlMessage *cm = cls;
720 struct GNUNET_ARM_Message *arm_msg; 718 struct GNUNET_ARM_Message *arm_msg;
diff --git a/src/arm/arm_monitor_api.c b/src/arm/arm_monitor_api.c
index ea4caa866..19a2f4eb9 100644
--- a/src/arm/arm_monitor_api.c
+++ b/src/arm/arm_monitor_api.c
@@ -85,25 +85,29 @@ struct GNUNET_ARM_MonitorHandle
85 struct GNUNET_SCHEDULER_Task * init_timeout_task_id; 85 struct GNUNET_SCHEDULER_Task * init_timeout_task_id;
86}; 86};
87 87
88
88static void 89static void
89monitor_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg); 90monitor_notify_handler (void *cls,
91 const struct GNUNET_MessageHeader *msg);
92
90 93
91static int 94static int
92reconnect_arm_monitor (struct GNUNET_ARM_MonitorHandle *h); 95reconnect_arm_monitor (struct GNUNET_ARM_MonitorHandle *h);
93 96
97
94/** 98/**
95 * Task scheduled to try to re-connect to arm. 99 * Task scheduled to try to re-connect to arm.
96 * 100 *
97 * @param cls the 'struct GNUNET_ARM_MonitorHandle' 101 * @param cls the 'struct GNUNET_ARM_MonitorHandle'
98 * @param tc task context
99 */ 102 */
100static void 103static void
101reconnect_arm_monitor_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 104reconnect_arm_monitor_task (void *cls)
102{ 105{
103 struct GNUNET_ARM_MonitorHandle *h = cls; 106 struct GNUNET_ARM_MonitorHandle *h = cls;
104 107
105 h->reconnect_task = NULL; 108 h->reconnect_task = NULL;
106 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to ARM service for monitoring after delay\n"); 109 LOG (GNUNET_ERROR_TYPE_DEBUG,
110 "Connecting to ARM service for monitoring after delay\n");
107 reconnect_arm_monitor (h); 111 reconnect_arm_monitor (h);
108} 112}
109 113
@@ -147,15 +151,14 @@ reconnect_arm_monitor_later (struct GNUNET_ARM_MonitorHandle *h)
147 * Init message timed out. Disconnect and try again. 151 * Init message timed out. Disconnect and try again.
148 * 152 *
149 * @param cls arm monitor handle 153 * @param cls arm monitor handle
150 * @param tc task context
151 */ 154 */
152static void 155static void
153init_timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 156init_timeout_task (void *cls)
154{ 157{
155 struct GNUNET_ARM_MonitorHandle *h = cls; 158 struct GNUNET_ARM_MonitorHandle *h = cls;
159
156 LOG (GNUNET_ERROR_TYPE_DEBUG, 160 LOG (GNUNET_ERROR_TYPE_DEBUG,
157 "Init message timed out\n"); 161 "Init message timed out\n");
158
159 h->init_timeout_task_id = NULL; 162 h->init_timeout_task_id = NULL;
160 reconnect_arm_monitor_later (h); 163 reconnect_arm_monitor_later (h);
161} 164}
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c
index 726365ede..af85372d8 100644
--- a/src/arm/gnunet-arm.c
+++ b/src/arm/gnunet-arm.c
@@ -179,10 +179,9 @@ delete_files ()
179 * jobs that we've been asked to do in order. 179 * jobs that we've been asked to do in order.
180 * 180 *
181 * @param cls closure, unused 181 * @param cls closure, unused
182 * @param tc context, unused
183 */ 182 */
184static void 183static void
185shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 184shutdown_task (void *cls)
186{ 185{
187 if (NULL != h) 186 if (NULL != h)
188 { 187 {
@@ -269,10 +268,9 @@ ret_string (enum GNUNET_ARM_Result result)
269 * Main task that runs our various operations in order. 268 * Main task that runs our various operations in order.
270 * 269 *
271 * @param cls closure 270 * @param cls closure
272 * @param tc scheudler context
273 */ 271 */
274static void 272static void
275action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 273action_loop (void *cls);
276 274
277 275
278/** 276/**
@@ -539,11 +537,13 @@ list_callback (void *cls,
539 * do, in order. 537 * do, in order.
540 * 538 *
541 * @param cls closure, unused 539 * @param cls closure, unused
542 * @param tc context, unused
543 */ 540 */
544static void 541static void
545action_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 542action_loop (void *cls)
546{ 543{
544 const struct GNUNET_SCHEDULER_TaskContext *tc;
545
546 tc = GNUNET_SCHEDULER_get_task_context ();
547 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 547 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
548 return; 548 return;
549 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Running requested actions\n"); 549 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Running requested actions\n");
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index ea89b2989..28d448f75 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -630,16 +630,17 @@ find_service (const char *name)
630 * create the service in order to relay the incoming connection to it 630 * create the service in order to relay the incoming connection to it
631 * 631 *
632 * @param cls callback data, `struct ServiceListeningInfo` describing a listen socket 632 * @param cls callback data, `struct ServiceListeningInfo` describing a listen socket
633 * @param tc context
634 */ 633 */
635static void 634static void
636accept_connection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 635accept_connection (void *cls)
637{ 636{
638 struct ServiceListeningInfo *sli = cls; 637 struct ServiceListeningInfo *sli = cls;
639 struct ServiceList *sl = sli->sl; 638 struct ServiceList *sl = sli->sl;
639 const struct GNUNET_SCHEDULER_TaskContext *tc;
640 640
641 sli->accept_task = NULL; 641 sli->accept_task = NULL;
642 GNUNET_assert (GNUNET_NO == in_shutdown); 642 GNUNET_assert (GNUNET_NO == in_shutdown);
643 tc = GNUNET_SCHEDULER_get_task_context ();
643 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 644 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
644 return; 645 return;
645 start_process (sl, NULL, 0); 646 start_process (sl, NULL, 0);
@@ -845,11 +846,9 @@ handle_start (void *cls,
845 * Start a shutdown sequence. 846 * Start a shutdown sequence.
846 * 847 *
847 * @param cls closure (refers to service) 848 * @param cls closure (refers to service)
848 * @param tc task context
849 */ 849 */
850static void 850static void
851trigger_shutdown (void *cls, 851trigger_shutdown (void *cls)
852 const struct GNUNET_SCHEDULER_TaskContext *tc)
853{ 852{
854 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 853 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
855 "Triggering shutdown\n"); 854 "Triggering shutdown\n");
@@ -1060,11 +1059,9 @@ list_count (struct ServiceList *running_head)
1060 * Task run for shutdown. 1059 * Task run for shutdown.
1061 * 1060 *
1062 * @param cls closure, NULL if we need to self-restart 1061 * @param cls closure, NULL if we need to self-restart
1063 * @param tc context
1064 */ 1062 */
1065static void 1063static void
1066shutdown_task (void *cls, 1064shutdown_task (void *cls)
1067 const struct GNUNET_SCHEDULER_TaskContext *tc)
1068{ 1065{
1069 struct ServiceList *pos; 1066 struct ServiceList *pos;
1070 struct ServiceList *nxt; 1067 struct ServiceList *nxt;
@@ -1129,17 +1126,18 @@ shutdown_task (void *cls,
1129 * Task run whenever it is time to restart a child that died. 1126 * Task run whenever it is time to restart a child that died.
1130 * 1127 *
1131 * @param cls closure, always NULL 1128 * @param cls closure, always NULL
1132 * @param tc context
1133 */ 1129 */
1134static void 1130static void
1135delayed_restart_task (void *cls, 1131delayed_restart_task (void *cls)
1136 const struct GNUNET_SCHEDULER_TaskContext *tc) 1132
1137{ 1133{
1134 const struct GNUNET_SCHEDULER_TaskContext *tc;
1138 struct ServiceList *sl; 1135 struct ServiceList *sl;
1139 struct GNUNET_TIME_Relative lowestRestartDelay; 1136 struct GNUNET_TIME_Relative lowestRestartDelay;
1140 struct ServiceListeningInfo *sli; 1137 struct ServiceListeningInfo *sli;
1141 1138
1142 child_restart_task = NULL; 1139 child_restart_task = NULL;
1140 tc = GNUNET_SCHEDULER_get_task_context ();
1143 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1141 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1144 return; 1142 return;
1145 GNUNET_assert (GNUNET_NO == in_shutdown); 1143 GNUNET_assert (GNUNET_NO == in_shutdown);
@@ -1204,12 +1202,11 @@ delayed_restart_task (void *cls,
1204 * process died). 1202 * process died).
1205 * 1203 *
1206 * @param cls closure, NULL if we need to self-restart 1204 * @param cls closure, NULL if we need to self-restart
1207 * @param tc context
1208 */ 1205 */
1209static void 1206static void
1210maint_child_death (void *cls, 1207maint_child_death (void *cls)
1211 const struct GNUNET_SCHEDULER_TaskContext *tc)
1212{ 1208{
1209 const struct GNUNET_SCHEDULER_TaskContext *tc;
1213 struct ServiceList *pos; 1210 struct ServiceList *pos;
1214 struct ServiceList *next; 1211 struct ServiceList *next;
1215 struct ServiceListeningInfo *sli; 1212 struct ServiceListeningInfo *sli;
@@ -1223,6 +1220,7 @@ maint_child_death (void *cls,
1223 1220
1224 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ); 1221 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
1225 child_death_task = NULL; 1222 child_death_task = NULL;
1223 tc = GNUNET_SCHEDULER_get_task_context ();
1226 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 1224 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
1227 { 1225 {
1228 /* shutdown scheduled us, ignore! */ 1226 /* shutdown scheduled us, ignore! */
diff --git a/src/arm/test_arm_api.c b/src/arm/test_arm_api.c
index 2bdc0e941..149ec46c4 100644
--- a/src/arm/test_arm_api.c
+++ b/src/arm/test_arm_api.c
@@ -122,7 +122,7 @@ resolver_start_cb (void *cls,
122 122
123 123
124static void 124static void
125trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 125trigger_disconnect (void *cls)
126{ 126{
127 GNUNET_ARM_disconnect_and_free ((struct GNUNET_ARM_Handle *) cls); 127 GNUNET_ARM_disconnect_and_free ((struct GNUNET_ARM_Handle *) cls);
128} 128}
diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c
index 44493c6de..1032a9010 100644
--- a/src/arm/test_exponential_backoff.c
+++ b/src/arm/test_exponential_backoff.c
@@ -141,11 +141,9 @@ service_shutdown_handler (void *cls, const struct GNUNET_MessageHeader *msg)
141 * Shutting down took too long, cancel receive and return error. 141 * Shutting down took too long, cancel receive and return error.
142 * 142 *
143 * @param cls closure 143 * @param cls closure
144 * @param tc context information (why was this task triggered now)
145 */ 144 */
146static void 145static void
147service_shutdown_cancel (void *cls, 146service_shutdown_cancel (void *cls)
148 const struct GNUNET_SCHEDULER_TaskContext *tc)
149{ 147{
150 struct ShutdownContext *shutdown_ctx = cls; 148 struct ShutdownContext *shutdown_ctx = cls;
151 149
@@ -227,7 +225,7 @@ do_nothing_service_shutdown (struct GNUNET_CLIENT_Connection *sock,
227 225
228 226
229static void 227static void
230kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc); 228kill_task (void *cbData);
231 229
232 230
233static void 231static void
@@ -246,7 +244,7 @@ shutdown_cont (void *cls, int reason)
246 244
247 245
248static void 246static void
249kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc) 247kill_task (void *cbData)
250{ 248{
251 static struct GNUNET_CLIENT_Connection *doNothingConnection = NULL; 249 static struct GNUNET_CLIENT_Connection *doNothingConnection = NULL;
252 250
@@ -284,7 +282,7 @@ kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc)
284 282
285 283
286static void 284static void
287trigger_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 285trigger_disconnect (void *cls)
288{ 286{
289 GNUNET_ARM_disconnect_and_free (arm); 287 GNUNET_ARM_disconnect_and_free (arm);
290 GNUNET_ARM_monitor_disconnect_and_free (mon); 288 GNUNET_ARM_monitor_disconnect_and_free (mon);
diff --git a/src/arm/test_gnunet_service_arm.c b/src/arm/test_gnunet_service_arm.c
index 7003271fa..33662e579 100644
--- a/src/arm/test_gnunet_service_arm.c
+++ b/src/arm/test_gnunet_service_arm.c
@@ -49,8 +49,7 @@ static struct GNUNET_ARM_Handle *arm;
49 49
50 50
51static void 51static void
52trigger_disconnect (void *cls, 52trigger_disconnect (void *cls)
53 const struct GNUNET_SCHEDULER_TaskContext *tc)
54{ 53{
55 GNUNET_ARM_disconnect_and_free (arm); 54 GNUNET_ARM_disconnect_and_free (arm);
56 arm = NULL; 55 arm = NULL;
diff --git a/src/ats-tests/ats-testing-experiment.c b/src/ats-tests/ats-testing-experiment.c
index a4a925847..b8da23df9 100644
--- a/src/ats-tests/ats-testing-experiment.c
+++ b/src/ats-tests/ats-testing-experiment.c
@@ -415,8 +415,9 @@ load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg)
415 return e_counter; 415 return e_counter;
416} 416}
417 417
418
418static void 419static void
419timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 420timeout_experiment (void *cls)
420{ 421{
421 struct Experiment *e = cls; 422 struct Experiment *e = cls;
422 e->experiment_timeout_task = NULL; 423 e->experiment_timeout_task = NULL;
@@ -432,6 +433,7 @@ timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
432 GNUNET_SYSERR); 433 GNUNET_SYSERR);
433} 434}
434 435
436
435static void 437static void
436enforce_start_send (struct GNUNET_ATS_TEST_Operation *op) 438enforce_start_send (struct GNUNET_ATS_TEST_Operation *op)
437{ 439{
@@ -573,10 +575,12 @@ static void enforce_episode (struct Episode *ep)
573 } 575 }
574} 576}
575 577
578
576static void 579static void
577timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 580timeout_episode (void *cls)
578{ 581{
579 struct Experiment *e = cls; 582 struct Experiment *e = cls;
583
580 e->episode_timeout_task = NULL; 584 e->episode_timeout_task = NULL;
581 if (NULL != e->ep_done_cb) 585 if (NULL != e->ep_done_cb)
582 e->ep_done_cb (e->cur); 586 e->ep_done_cb (e->cur);
@@ -741,4 +745,3 @@ GNUNET_ATS_TEST_experimentation_stop (struct Experiment *e)
741} 745}
742 746
743/* end of file ats-testing-experiment.c*/ 747/* end of file ats-testing-experiment.c*/
744
diff --git a/src/ats-tests/ats-testing-log.c b/src/ats-tests/ats-testing-log.c
index fff70052d..650be29f3 100644
--- a/src/ats-tests/ats-testing-log.c
+++ b/src/ats-tests/ats-testing-log.c
@@ -799,21 +799,24 @@ GNUNET_ATS_TEST_logging_now (struct LoggingHandle *l)
799 } 799 }
800} 800}
801 801
802
802static void 803static void
803collect_log_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 804collect_log_task (void *cls)
804{ 805{
805 struct LoggingHandle *l = cls; 806 struct LoggingHandle *l = cls;
806 l->log_task = NULL; 807 const struct GNUNET_SCHEDULER_TaskContext *tc;
807 808
809 l->log_task = NULL;
808 GNUNET_ATS_TEST_logging_now (l); 810 GNUNET_ATS_TEST_logging_now (l);
809 811 tc = GNUNET_SCHEDULER_get_task_context ();
810 if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN) 812 if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN)
811 return; 813 return;
812
813 l->log_task = GNUNET_SCHEDULER_add_delayed (l->frequency, 814 l->log_task = GNUNET_SCHEDULER_add_delayed (l->frequency,
814 &collect_log_task, l); 815 &collect_log_task,
816 l);
815} 817}
816 818
819
817/** 820/**
818 * Stop logging 821 * Stop logging
819 * 822 *
@@ -905,4 +908,3 @@ GNUNET_ATS_TEST_logging_start(struct GNUNET_TIME_Relative log_frequency,
905 return l; 908 return l;
906} 909}
907/* end of file ats-testing-log.c */ 910/* end of file ats-testing-log.c */
908
diff --git a/src/ats-tests/ats-testing-preferences.c b/src/ats-tests/ats-testing-preferences.c
index b8cf205ec..856c8de4b 100644
--- a/src/ats-tests/ats-testing-preferences.c
+++ b/src/ats-tests/ats-testing-preferences.c
@@ -91,8 +91,7 @@ get_preference (struct PreferenceGenerator *pg)
91 91
92 92
93static void 93static void
94set_pref_task (void *cls, 94set_pref_task (void *cls)
95 const struct GNUNET_SCHEDULER_TaskContext *tc)
96{ 95{
97 struct BenchmarkPartner *p = cls; 96 struct BenchmarkPartner *p = cls;
98 double pref_value; 97 double pref_value;
diff --git a/src/ats-tests/ats-testing-traffic.c b/src/ats-tests/ats-testing-traffic.c
index 4446be171..5eb01bd55 100644
--- a/src/ats-tests/ats-testing-traffic.c
+++ b/src/ats-tests/ats-testing-traffic.c
@@ -166,8 +166,7 @@ send_ping_ready_cb (void *cls, size_t size, void *buf)
166 166
167 167
168static void 168static void
169comm_schedule_send (void *cls, 169comm_schedule_send (void *cls)
170 const struct GNUNET_SCHEDULER_TaskContext *tc)
171{ 170{
172 struct BenchmarkPartner *p = cls; 171 struct BenchmarkPartner *p = cls;
173 172
@@ -431,4 +430,3 @@ GNUNET_ATS_TEST_generate_traffic_stop_all ()
431} 430}
432 431
433/* end of file ats-testing-traffic.c */ 432/* end of file ats-testing-traffic.c */
434
diff --git a/src/ats-tests/ats-testing.c b/src/ats-tests/ats-testing.c
index a3a6b9623..49aa5a052 100644
--- a/src/ats-tests/ats-testing.c
+++ b/src/ats-tests/ats-testing.c
@@ -52,14 +52,14 @@ struct GNUNET_CONFIGURATION_Handle *cfg;
52 52
53struct GNUNET_ATS_TEST_Topology *top; 53struct GNUNET_ATS_TEST_Topology *top;
54 54
55
55/** 56/**
56 * Shutdown nicely 57 * Shutdown nicely
57 * 58 *
58 * @param cls NULL 59 * @param cls NULL
59 * @param tc the task context
60 */ 60 */
61static void 61static void
62do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 62do_shutdown (void *cls)
63{ 63{
64 int c_m; 64 int c_m;
65 int c_s; 65 int c_s;
@@ -437,7 +437,7 @@ connect_completion_callback (void *cls, struct GNUNET_TESTBED_Operation *op,
437} 437}
438 438
439static void 439static void
440do_connect_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 440do_connect_peers (void *cls)
441{ 441{
442 int c_m; 442 int c_m;
443 int c_s; 443 int c_s;
@@ -506,7 +506,7 @@ comm_connect_completion_cb (void *cls, struct GNUNET_TESTBED_Operation *op,
506} 506}
507 507
508static void 508static void
509do_comm_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 509do_comm_connect (void *cls)
510{ 510{
511 int c_s; 511 int c_s;
512 int c_m; 512 int c_m;
@@ -649,7 +649,7 @@ ats_connect_completion_cb (void *cls, struct GNUNET_TESTBED_Operation *op,
649 649
650 650
651static void 651static void
652do_connect_ats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 652do_connect_ats (void *cls)
653{ 653{
654 int c_m; 654 int c_m;
655 int c_s; 655 int c_s;
diff --git a/src/ats-tests/gnunet-solver-eval.c b/src/ats-tests/gnunet-solver-eval.c
index e0d85094c..0d2460b7f 100644
--- a/src/ats-tests/gnunet-solver-eval.c
+++ b/src/ats-tests/gnunet-solver-eval.c
@@ -418,8 +418,9 @@ load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg)
418 return e_counter; 418 return e_counter;
419} 419}
420 420
421
421static void 422static void
422timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 423timeout_experiment (void *cls)
423{ 424{
424 struct Experiment *e = cls; 425 struct Experiment *e = cls;
425 e->experiment_timeout_task = NULL; 426 e->experiment_timeout_task = NULL;
@@ -435,6 +436,7 @@ timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
435 GNUNET_SYSERR); 436 GNUNET_SYSERR);
436} 437}
437 438
439
438static void 440static void
439enforce_start_send (struct GNUNET_ATS_TEST_Operation *op) 441enforce_start_send (struct GNUNET_ATS_TEST_Operation *op)
440{ 442{
@@ -584,8 +586,9 @@ static void enforce_episode (struct Episode *ep)
584 } 586 }
585} 587}
586 588
589
587static void 590static void
588timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 591timeout_episode (void *cls)
589{ 592{
590 struct Experiment *e = cls; 593 struct Experiment *e = cls;
591 e->episode_timeout_task = NULL; 594 e->episode_timeout_task = NULL;
@@ -931,4 +934,3 @@ main (int argc, char *argv[])
931 return 0; 934 return 0;
932} 935}
933/* end of file ats-testing-experiment.c*/ 936/* end of file ats-testing-experiment.c*/
934
diff --git a/src/ats-tests/perf_ats.c b/src/ats-tests/perf_ats.c
index c49d5f03d..4c22043e5 100644
--- a/src/ats-tests/perf_ats.c
+++ b/src/ats-tests/perf_ats.c
@@ -185,10 +185,9 @@ evaluate ()
185 * Shutdown nicely 185 * Shutdown nicely
186 * 186 *
187 * @param cls NULL 187 * @param cls NULL
188 * @param tc the task context
189 */ 188 */
190static void 189static void
191do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 190do_shutdown (void *cls)
192{ 191{
193 192
194 if (GNUNET_YES == logging) 193 if (GNUNET_YES == logging)
@@ -223,8 +222,9 @@ print_progress ()
223 &print_progress, NULL ); 222 &print_progress, NULL );
224} 223}
225 224
225
226static void 226static void
227ats_pref_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 227ats_pref_task (void *cls)
228{ 228{
229 struct BenchmarkPeer *me = cls; 229 struct BenchmarkPeer *me = cls;
230 230
diff --git a/src/ats-tests/perf_ats_logging.c b/src/ats-tests/perf_ats_logging.c
index d3c6ed9c5..1e4b15432 100644
--- a/src/ats-tests/perf_ats_logging.c
+++ b/src/ats-tests/perf_ats_logging.c
@@ -637,17 +637,19 @@ collect_log_now (void)
637} 637}
638 638
639static void 639static void
640collect_log_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 640collect_log_task (void *cls)
641{ 641{
642 const struct GNUNET_SCHEDULER_TaskContext *tc;
643
642 log_task = NULL; 644 log_task = NULL;
643 645
644 collect_log_now(); 646 collect_log_now();
645 647 tc = GNUNET_SCHEDULER_get_task_context ();
646 if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN) 648 if (tc->reason == GNUNET_SCHEDULER_REASON_SHUTDOWN)
647 return; 649 return;
648 650
649 log_task = GNUNET_SCHEDULER_add_delayed (frequency, 651 log_task = GNUNET_SCHEDULER_add_delayed (frequency,
650 &collect_log_task, NULL); 652 &collect_log_task, NULL);
651} 653}
652 654
653 655
@@ -655,7 +657,6 @@ void
655perf_logging_stop () 657perf_logging_stop ()
656{ 658{
657 int c_m; 659 int c_m;
658 struct GNUNET_SCHEDULER_TaskContext tc;
659 struct PeerLoggingTimestep *cur; 660 struct PeerLoggingTimestep *cur;
660 661
661 if (GNUNET_YES!= running) 662 if (GNUNET_YES!= running)
@@ -664,8 +665,7 @@ perf_logging_stop ()
664 if (NULL != log_task) 665 if (NULL != log_task)
665 GNUNET_SCHEDULER_cancel (log_task); 666 GNUNET_SCHEDULER_cancel (log_task);
666 log_task = NULL; 667 log_task = NULL;
667 tc.reason = GNUNET_SCHEDULER_REASON_SHUTDOWN; 668 collect_log_task (NULL);
668 collect_log_task (NULL, &tc);
669 669
670 GNUNET_log(GNUNET_ERROR_TYPE_INFO, 670 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
671 _("Stop logging\n")); 671 _("Stop logging\n"));
@@ -685,6 +685,7 @@ perf_logging_stop ()
685 GNUNET_free (lp); 685 GNUNET_free (lp);
686} 686}
687 687
688
688void 689void
689perf_logging_start (struct GNUNET_TIME_Relative log_frequency, 690perf_logging_start (struct GNUNET_TIME_Relative log_frequency,
690 char * testname, struct BenchmarkPeer *masters, int num_masters) 691 char * testname, struct BenchmarkPeer *masters, int num_masters)
@@ -710,4 +711,3 @@ perf_logging_start (struct GNUNET_TIME_Relative log_frequency,
710 running = GNUNET_YES; 711 running = GNUNET_YES;
711} 712}
712/* end of file perf_ats_logging.c */ 713/* end of file perf_ats_logging.c */
713
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c
index 458db04c8..a2ef80cef 100644
--- a/src/ats-tool/gnunet-ats.c
+++ b/src/ats-tool/gnunet-ats.c
@@ -265,11 +265,9 @@ free_addr_it (void *cls,
265 * Task run on shutdown. 265 * Task run on shutdown.
266 * 266 *
267 * @param cls NULL 267 * @param cls NULL
268 * @param tc scheduler context
269 */ 268 */
270static void 269static void
271end (void *cls, 270end (void *cls)
272 const struct GNUNET_SCHEDULER_TaskContext *tc)
273{ 271{
274 struct PendingResolutions * pr; 272 struct PendingResolutions * pr;
275 struct PendingResolutions * next; 273 struct PendingResolutions * next;
diff --git a/src/ats/ats_api_connectivity.c b/src/ats/ats_api_connectivity.c
index f1898af3f..1897e2783 100644
--- a/src/ats/ats_api_connectivity.c
+++ b/src/ats/ats_api_connectivity.c
@@ -106,11 +106,9 @@ reconnect (struct GNUNET_ATS_ConnectivityHandle *ch);
106 * Re-establish the connection to the ATS service. 106 * Re-establish the connection to the ATS service.
107 * 107 *
108 * @param cls handle to use to re-connect. 108 * @param cls handle to use to re-connect.
109 * @param tc scheduler context
110 */ 109 */
111static void 110static void
112reconnect_task (void *cls, 111reconnect_task (void *cls)
113 const struct GNUNET_SCHEDULER_TaskContext *tc)
114{ 112{
115 struct GNUNET_ATS_ConnectivityHandle *ch = cls; 113 struct GNUNET_ATS_ConnectivityHandle *ch = cls;
116 114
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c
index 490c74cfa..48bb2ebf4 100644
--- a/src/ats/ats_api_performance.c
+++ b/src/ats/ats_api_performance.c
@@ -261,11 +261,9 @@ reconnect (struct GNUNET_ATS_PerformanceHandle *ph);
261 * Re-establish the connection to the ATS service. 261 * Re-establish the connection to the ATS service.
262 * 262 *
263 * @param cls handle to use to re-connect. 263 * @param cls handle to use to re-connect.
264 * @param tc scheduler context
265 */ 264 */
266static void 265static void
267reconnect_task (void *cls, 266reconnect_task (void *cls)
268 const struct GNUNET_SCHEDULER_TaskContext *tc)
269{ 267{
270 struct GNUNET_ATS_PerformanceHandle *ph = cls; 268 struct GNUNET_ATS_PerformanceHandle *ph = cls;
271 269
diff --git a/src/ats/ats_api_scanner.c b/src/ats/ats_api_scanner.c
index 3ed0924fe..d9002a076 100644
--- a/src/ats/ats_api_scanner.c
+++ b/src/ats/ats_api_scanner.c
@@ -297,11 +297,9 @@ interface_proc (void *cls,
297 * Periodically get list of network addresses from our interfaces. 297 * Periodically get list of network addresses from our interfaces.
298 * 298 *
299 * @param cls closure 299 * @param cls closure
300 * @param tc Task context
301 */ 300 */
302static void 301static void
303get_addresses (void *cls, 302get_addresses (void *cls)
304 const struct GNUNET_SCHEDULER_TaskContext *tc)
305{ 303{
306 struct GNUNET_ATS_InterfaceScanner *is = cls; 304 struct GNUNET_ATS_InterfaceScanner *is = cls;
307 305
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index d26841878..0d0d102db 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -166,11 +166,9 @@ reconnect (struct GNUNET_ATS_SchedulingHandle *sh);
166 * Re-establish the connection to the ATS service. 166 * Re-establish the connection to the ATS service.
167 * 167 *
168 * @param cls handle to use to re-connect. 168 * @param cls handle to use to re-connect.
169 * @param tc scheduler context
170 */ 169 */
171static void 170static void
172reconnect_task (void *cls, 171reconnect_task (void *cls)
173 const struct GNUNET_SCHEDULER_TaskContext *tc)
174{ 172{
175 struct GNUNET_ATS_SchedulingHandle *sh = cls; 173 struct GNUNET_ATS_SchedulingHandle *sh = cls;
176 174
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c
index 3cadb2ef7..613df52ad 100644
--- a/src/ats/gnunet-ats-solver-eval.c
+++ b/src/ats/gnunet-ats-solver-eval.c
@@ -216,7 +216,7 @@ GNUNET_ATS_solver_logging_now (struct LoggingHandle *l)
216 216
217 217
218static void 218static void
219logging_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 219logging_task (void *cls)
220{ 220{
221 struct LoggingHandle *l = cls; 221 struct LoggingHandle *l = cls;
222 222
@@ -590,7 +590,7 @@ get_property (struct PropertyGenerator *pg)
590 590
591 591
592static void 592static void
593set_prop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 593set_prop_task (void *cls)
594{ 594{
595 struct PropertyGenerator *pg = cls; 595 struct PropertyGenerator *pg = cls;
596 struct TestPeer *p; 596 struct TestPeer *p;
@@ -858,9 +858,9 @@ get_preference (struct PreferenceGenerator *pg)
858 return pref_value; 858 return pref_value;
859} 859}
860 860
861
861static void 862static void
862set_feedback_task (void *cls, 863set_feedback_task (void *cls)
863 const struct GNUNET_SCHEDULER_TaskContext *tc)
864{ 864{
865 struct PreferenceGenerator *pg = cls; 865 struct PreferenceGenerator *pg = cls;
866 struct TestPeer *p; 866 struct TestPeer *p;
@@ -934,8 +934,7 @@ set_feedback_task (void *cls,
934 934
935 935
936static void 936static void
937set_pref_task (void *cls, 937set_pref_task (void *cls)
938 const struct GNUNET_SCHEDULER_TaskContext *tc)
939{ 938{
940 struct PreferenceGenerator *pg = cls; 939 struct PreferenceGenerator *pg = cls;
941 struct TestPeer *p; 940 struct TestPeer *p;
@@ -2124,10 +2123,12 @@ load_episodes (struct Experiment *e, struct GNUNET_CONFIGURATION_Handle *cfg)
2124 return e_counter; 2123 return e_counter;
2125} 2124}
2126 2125
2126
2127static void 2127static void
2128timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 2128timeout_experiment (void *cls)
2129{ 2129{
2130 struct Experiment *e = cls; 2130 struct Experiment *e = cls;
2131
2131 e->experiment_timeout_task = NULL; 2132 e->experiment_timeout_task = NULL;
2132 fprintf (stderr, "Experiment timeout!\n"); 2133 fprintf (stderr, "Experiment timeout!\n");
2133 2134
@@ -2487,10 +2488,12 @@ static void enforce_episode (struct Episode *ep)
2487 } 2488 }
2488} 2489}
2489 2490
2491
2490static void 2492static void
2491timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 2493timeout_episode (void *cls)
2492{ 2494{
2493 struct Experiment *e = cls; 2495 struct Experiment *e = cls;
2496
2494 e->episode_timeout_task = NULL; 2497 e->episode_timeout_task = NULL;
2495 if (NULL != e->ep_done_cb) 2498 if (NULL != e->ep_done_cb)
2496 e->ep_done_cb (e->cur); 2499 e->ep_done_cb (e->cur);
diff --git a/src/ats/gnunet-service-ats.c b/src/ats/gnunet-service-ats.c
index 11db62e2d..7b8dfe222 100644
--- a/src/ats/gnunet-service-ats.c
+++ b/src/ats/gnunet-service-ats.c
@@ -124,11 +124,9 @@ client_disconnect_handler (void *cls,
124 * Task run during shutdown. 124 * Task run during shutdown.
125 * 125 *
126 * @param cls unused 126 * @param cls unused
127 * @param tc unused
128 */ 127 */
129static void 128static void
130cleanup_task (void *cls, 129cleanup_task (void *cls)
131 const struct GNUNET_SCHEDULER_TaskContext *tc)
132{ 130{
133 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 131 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
134 "ATS shutdown initiated\n"); 132 "ATS shutdown initiated\n");
diff --git a/src/ats/gnunet-service-ats_preferences.c b/src/ats/gnunet-service-ats_preferences.c
index b56a8fd7f..c835b026b 100644
--- a/src/ats/gnunet-service-ats_preferences.c
+++ b/src/ats/gnunet-service-ats_preferences.c
@@ -388,11 +388,9 @@ age_values (void *cls,
388 * Reduce absolute preferences since they got old. 388 * Reduce absolute preferences since they got old.
389 * 389 *
390 * @param cls unused 390 * @param cls unused
391 * @param tc context
392 */ 391 */
393static void 392static void
394preference_aging (void *cls, 393preference_aging (void *cls)
395 const struct GNUNET_SCHEDULER_TaskContext *tc)
396{ 394{
397 struct AgeContext ac; 395 struct AgeContext ac;
398 396
diff --git a/src/ats/plugin_ats_ril.c b/src/ats/plugin_ats_ril.c
index 0f02fe34a..766a9936d 100644
--- a/src/ats/plugin_ats_ril.c
+++ b/src/ats/plugin_ats_ril.c
@@ -1513,10 +1513,9 @@ ril_step (struct GAS_RIL_Handle *solver);
1513 * no further step is scheduled. 1513 * no further step is scheduled.
1514 * 1514 *
1515 * @param cls the solver handle 1515 * @param cls the solver handle
1516 * @param tc the task context for the scheduler
1517 */ 1516 */
1518static void 1517static void
1519ril_step_scheduler_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1518ril_step_scheduler_task (void *cls)
1520{ 1519{
1521 struct GAS_RIL_Handle *solver = cls; 1520 struct GAS_RIL_Handle *solver = cls;
1522 1521
diff --git a/src/ats/test_ats_lib.c b/src/ats/test_ats_lib.c
index 6592cded1..b0c42ac3d 100644
--- a/src/ats/test_ats_lib.c
+++ b/src/ats/test_ats_lib.c
@@ -279,11 +279,9 @@ find_address_information (const struct GNUNET_HELLO_Address *addr)
279 * Task run to terminate the testcase. 279 * Task run to terminate the testcase.
280 * 280 *
281 * @param cls NULL 281 * @param cls NULL
282 * @param tc unused
283 */ 282 */
284static void 283static void
285end (void *cls, 284end (void *cls)
286 const struct GNUNET_SCHEDULER_TaskContext *tc)
287{ 285{
288 if (0 != ret) 286 if (0 != ret)
289 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 287 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -335,11 +333,9 @@ end (void *cls,
335 * Main interpreter loop. Runs the steps of the test. 333 * Main interpreter loop. Runs the steps of the test.
336 * 334 *
337 * @param cls NULL 335 * @param cls NULL
338 * @param tc unused
339 */ 336 */
340static void 337static void
341interpreter (void *cls, 338interpreter (void *cls);
342 const struct GNUNET_SCHEDULER_TaskContext *tc);
343 339
344 340
345/** 341/**
@@ -591,11 +587,9 @@ reservation_cb (void *cls,
591 * Main interpreter loop. Runs the steps of the test. 587 * Main interpreter loop. Runs the steps of the test.
592 * 588 *
593 * @param cls NULL 589 * @param cls NULL
594 * @param tc unused
595 */ 590 */
596static void 591static void
597interpreter (void *cls, 592interpreter (void *cls)
598 const struct GNUNET_SCHEDULER_TaskContext *tc)
599 593
600{ 594{
601 struct Command *cmd; 595 struct Command *cmd;
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index a1fe90cc5..6894d2482 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -513,10 +513,9 @@ destroy_channel (struct GNUNET_CADET_Channel *ch, int call_cleaner)
513 * Notify client that the transmission has timed out 513 * Notify client that the transmission has timed out
514 * 514 *
515 * @param cls closure 515 * @param cls closure
516 * @param tc task context
517 */ 516 */
518static void 517static void
519timeout_transmission (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 518timeout_transmission (void *cls)
520{ 519{
521 struct GNUNET_CADET_TransmitHandle *th = cls; 520 struct GNUNET_CADET_TransmitHandle *th = cls;
522 struct GNUNET_CADET_Handle *cadet = th->channel->cadet; 521 struct GNUNET_CADET_Handle *cadet = th->channel->cadet;
@@ -594,12 +593,12 @@ send_ack (struct GNUNET_CADET_Channel *ch)
594 593
595/** 594/**
596 * Reconnect callback: tries to reconnect again after a failer previous 595 * Reconnect callback: tries to reconnect again after a failer previous
597 * reconnecttion 596 * reconnection.
597 *
598 * @param cls closure (cadet handle) 598 * @param cls closure (cadet handle)
599 * @param tc task context
600 */ 599 */
601static void 600static void
602reconnect_cbk (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 601reconnect_cbk (void *cls);
603 602
604 603
605/** 604/**
@@ -696,15 +695,17 @@ do_reconnect (struct GNUNET_CADET_Handle *h)
696/** 695/**
697 * Reconnect callback: tries to reconnect again after a failer previous 696 * Reconnect callback: tries to reconnect again after a failer previous
698 * reconnecttion 697 * reconnecttion
698 *
699 * @param cls closure (cadet handle) 699 * @param cls closure (cadet handle)
700 * @param tc task context
701 */ 700 */
702static void 701static void
703reconnect_cbk (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 702reconnect_cbk (void *cls)
704{ 703{
705 struct GNUNET_CADET_Handle *h = cls; 704 struct GNUNET_CADET_Handle *h = cls;
705 const struct GNUNET_SCHEDULER_TaskContext *tc;
706 706
707 h->reconnect_task = NULL; 707 h->reconnect_task = NULL;
708 tc = GNUNET_SCHEDULER_get_task_context ();
708 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 709 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
709 return; 710 return;
710 do_reconnect (h); 711 do_reconnect (h);
@@ -2171,4 +2172,3 @@ GNUNET_CADET_mq_create (struct GNUNET_CADET_Channel *channel)
2171 NULL); /* no handler cls */ 2172 NULL); /* no handler cls */
2172 return mq; 2173 return mq;
2173} 2174}
2174
diff --git a/src/cadet/cadet_path.c b/src/cadet/cadet_path.c
index 1ea2b185f..47241292b 100644
--- a/src/cadet/cadet_path.c
+++ b/src/cadet/cadet_path.c
@@ -39,18 +39,19 @@
39 * Removes the path from the peer (except for direct paths). 39 * Removes the path from the peer (except for direct paths).
40 * 40 *
41 * @param cls Closure (path to destroy). 41 * @param cls Closure (path to destroy).
42 * @param tc Task context.
43 */ 42 */
44static void 43static void
45path_destroy_delayed (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 44path_destroy_delayed (void *cls)
46{ 45{
47 struct CadetPeerPath *path = cls; 46 struct CadetPeerPath *path = cls;
48 struct CadetPeer *peer; 47 struct CadetPeer *peer;
48 const struct GNUNET_SCHEDULER_TaskContext *tc;
49 49
50 LOG (GNUNET_ERROR_TYPE_INFO, "Destroy delayed %p (%u)\n", path, path->length); 50 LOG (GNUNET_ERROR_TYPE_INFO, "Destroy delayed %p (%u)\n", path, path->length);
51 path->path_delete = NULL; 51 path->path_delete = NULL;
52 52
53 /* During shutdown, the peers peermap might not exist anymore. */ 53 /* During shutdown, the peers peermap might not exist anymore. */
54 tc = GNUNET_SCHEDULER_get_task_context ();
54 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) == 0) 55 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) == 0)
55 { 56 {
56 if (2 >= path->length) 57 if (2 >= path->length)
diff --git a/src/cadet/gnunet-cadet-profiler.c b/src/cadet/gnunet-cadet-profiler.c
index bda844b13..ffa993f8e 100644
--- a/src/cadet/gnunet-cadet-profiler.c
+++ b/src/cadet/gnunet-cadet-profiler.c
@@ -249,10 +249,9 @@ static int test_finished;
249 * on callback funtion ch. 249 * on callback funtion ch.
250 * 250 *
251 * @param cls Closure (unsued). 251 * @param cls Closure (unsued).
252 * @param tc Task Context.
253 */ 252 */
254static void 253static void
255start_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 254start_test (void *cls);
256 255
257 256
258/** 257/**
@@ -314,10 +313,9 @@ show_end_data (void)
314 * Shut down peergroup, clean up. 313 * Shut down peergroup, clean up.
315 * 314 *
316 * @param cls Closure (unused). 315 * @param cls Closure (unused).
317 * @param tc Task Context.
318 */ 316 */
319static void 317static void
320shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 318shutdown_task (void *cls)
321{ 319{
322 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Ending test.\n"); 320 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Ending test.\n");
323 shutdown_handle = NULL; 321 shutdown_handle = NULL;
@@ -328,10 +326,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
328 * Disconnect from cadet services af all peers, call shutdown. 326 * Disconnect from cadet services af all peers, call shutdown.
329 * 327 *
330 * @param cls Closure (unused). 328 * @param cls Closure (unused).
331 * @param tc Task Context.
332 */ 329 */
333static void 330static void
334disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 331disconnect_cadet_peers (void *cls)
335{ 332{
336 long line = (long) cls; 333 long line = (long) cls;
337 unsigned int i; 334 unsigned int i;
@@ -443,11 +440,13 @@ stats_iterator (void *cls, const struct GNUNET_TESTBED_Peer *peer,
443 * Task check that keepalives were sent and received. 440 * Task check that keepalives were sent and received.
444 * 441 *
445 * @param cls Closure (NULL). 442 * @param cls Closure (NULL).
446 * @param tc Task Context.
447 */ 443 */
448static void 444static void
449collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 445collect_stats (void *cls)
450{ 446{
447 const struct GNUNET_SCHEDULER_TaskContext *tc;
448
449 tc = GNUNET_SCHEDULER_get_task_context ();
451 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 450 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
452 return; 451 return;
453 452
@@ -462,11 +461,13 @@ collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
462 * @brief Finish profiler normally. Signal finish and start collecting stats. 461 * @brief Finish profiler normally. Signal finish and start collecting stats.
463 * 462 *
464 * @param cls Closure (unused). 463 * @param cls Closure (unused).
465 * @param tc Task context.
466 */ 464 */
467static void 465static void
468finish_profiler (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 466finish_profiler (void *cls)
469{ 467{
468 const struct GNUNET_SCHEDULER_TaskContext *tc;
469
470 tc = GNUNET_SCHEDULER_get_task_context ();
470 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 471 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
471 return; 472 return;
472 473
@@ -542,11 +543,13 @@ adjust_running_peers (unsigned int target)
542 * @brief Move to next round. 543 * @brief Move to next round.
543 * 544 *
544 * @param cls Closure (round #). 545 * @param cls Closure (round #).
545 * @param tc Task context.
546 */ 546 */
547static void 547static void
548next_rnd (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 548next_rnd (void *cls)
549{ 549{
550 const struct GNUNET_SCHEDULER_TaskContext *tc;
551
552 tc = GNUNET_SCHEDULER_get_task_context ();
550 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 553 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
551 return; 554 return;
552 555
@@ -608,15 +611,15 @@ tmt_rdy_pong (void *cls, size_t size, void *buf)
608 * @brief Send a ping to destination 611 * @brief Send a ping to destination
609 * 612 *
610 * @param cls Closure (peer). 613 * @param cls Closure (peer).
611 * @param tc Task context.
612 */ 614 */
613static void 615static void
614ping (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 616ping (void *cls)
615{ 617{
616 struct CadetPeer *peer = (struct CadetPeer *) cls; 618 struct CadetPeer *peer = cls;
619 const struct GNUNET_SCHEDULER_TaskContext *tc;
617 620
618 peer->ping_task = NULL; 621 peer->ping_task = NULL;
619 622 tc = GNUNET_SCHEDULER_get_task_context ();
620 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) 623 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)
621 || GNUNET_YES == test_finished) 624 || GNUNET_YES == test_finished)
622 return; 625 return;
@@ -865,15 +868,16 @@ select_random_peer (struct CadetPeer *peer)
865 * on callback funtion ch. 868 * on callback funtion ch.
866 * 869 *
867 * @param cls Closure (unsued). 870 * @param cls Closure (unsued).
868 * @param tc Task Context.
869 */ 871 */
870static void 872static void
871start_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 873start_test (void *cls)
872{ 874{
873 enum GNUNET_CADET_ChannelOption flags; 875 enum GNUNET_CADET_ChannelOption flags;
874 unsigned long i; 876 unsigned long i;
877 const struct GNUNET_SCHEDULER_TaskContext *tc;
875 878
876 test_task = NULL; 879 test_task = NULL;
880 tc = GNUNET_SCHEDULER_get_task_context ();
877 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 881 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
878 return; 882 return;
879 883
@@ -1089,4 +1093,3 @@ main (int argc, char *argv[])
1089} 1093}
1090 1094
1091/* end of gnunet-cadet-profiler.c */ 1095/* end of gnunet-cadet-profiler.c */
1092
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c
index 5c5ec54b9..14b499aae 100644
--- a/src/cadet/gnunet-cadet.c
+++ b/src/cadet/gnunet-cadet.c
@@ -191,11 +191,9 @@ conn_2s (uint16_t status)
191 * Stops monitoring activity. 191 * Stops monitoring activity.
192 * 192 *
193 * @param cls Closure (unused). 193 * @param cls Closure (unused).
194 * @param tc scheduler context
195 */ 194 */
196static void 195static void
197shutdown_task (void *cls, 196shutdown_task (void *cls)
198 const struct GNUNET_SCHEDULER_TaskContext *tc)
199{ 197{
200 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n"); 198 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n");
201 if (NULL != th) 199 if (NULL != th)
@@ -268,14 +266,14 @@ data_ready (void *cls, size_t size, void *buf)
268 * Task run in stdio mode, after some data is available at stdin. 266 * Task run in stdio mode, after some data is available at stdin.
269 * 267 *
270 * @param cls Closure (unused). 268 * @param cls Closure (unused).
271 * @param tc scheduler context
272 */ 269 */
273static void 270static void
274read_stdio (void *cls, 271read_stdio (void *cls)
275 const struct GNUNET_SCHEDULER_TaskContext *tc)
276{ 272{
277 static char buf[60000]; 273 static char buf[60000];
274 const struct GNUNET_SCHEDULER_TaskContext *tc;
278 275
276 tc = GNUNET_SCHEDULER_get_task_context ();
279 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 277 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
280 { 278 {
281 return; 279 return;
@@ -406,11 +404,13 @@ channel_incoming (void *cls,
406 * @brief Send an echo request to the remote peer. 404 * @brief Send an echo request to the remote peer.
407 * 405 *
408 * @param cls Closure (NULL). 406 * @param cls Closure (NULL).
409 * @param tc Task context.
410 */ 407 */
411static void 408static void
412send_echo (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 409send_echo (void *cls)
413{ 410{
411 const struct GNUNET_SCHEDULER_TaskContext *tc;
412
413 tc = GNUNET_SCHEDULER_get_task_context ();
414 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) || NULL == ch) 414 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) || NULL == ch)
415 return; 415 return;
416 416
@@ -426,10 +426,9 @@ send_echo (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
426 * Call CADET's monitor API, request debug dump on the service. 426 * Call CADET's monitor API, request debug dump on the service.
427 * 427 *
428 * @param cls Closure (unused). 428 * @param cls Closure (unused).
429 * @param tc TaskContext
430 */ 429 */
431static void 430static void
432request_dump (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 431request_dump (void *cls)
433{ 432{
434 GNUNET_CADET_request_dump (mh); 433 GNUNET_CADET_request_dump (mh);
435 GNUNET_SCHEDULER_cancel (sd); 434 GNUNET_SCHEDULER_cancel (sd);
@@ -441,10 +440,9 @@ request_dump (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
441 * Call CADET's monitor API, get info of one connection. 440 * Call CADET's monitor API, get info of one connection.
442 * 441 *
443 * @param cls Closure (unused). 442 * @param cls Closure (unused).
444 * @param tc TaskContext
445 */ 443 */
446static void 444static void
447create_channel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 445create_channel (void *cls)
448{ 446{
449 struct GNUNET_PeerIdentity pid; 447 struct GNUNET_PeerIdentity pid;
450 enum GNUNET_CADET_ChannelOption opt; 448 enum GNUNET_CADET_ChannelOption opt;
@@ -703,11 +701,13 @@ tunnel_callback (void *cls,
703 * Call CADET's meta API, get all peers known to a peer. 701 * Call CADET's meta API, get all peers known to a peer.
704 * 702 *
705 * @param cls Closure (unused). 703 * @param cls Closure (unused).
706 * @param tc TaskContext
707 */ 704 */
708static void 705static void
709get_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 706get_peers (void *cls)
710{ 707{
708 const struct GNUNET_SCHEDULER_TaskContext *tc;
709
710 tc = GNUNET_SCHEDULER_get_task_context ();
711 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 711 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
712 { 712 {
713 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n"); 713 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n");
@@ -721,18 +721,17 @@ get_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
721 * Call CADET's monitor API, get info of one peer. 721 * Call CADET's monitor API, get info of one peer.
722 * 722 *
723 * @param cls Closure (unused). 723 * @param cls Closure (unused).
724 * @param tc TaskContext
725 */ 724 */
726static void 725static void
727show_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 726show_peer (void *cls)
728{ 727{
729 struct GNUNET_PeerIdentity pid; 728 struct GNUNET_PeerIdentity pid;
730 729
731 if (GNUNET_OK != 730 if (GNUNET_OK !=
732 GNUNET_CRYPTO_eddsa_public_key_from_string (peer_id, 731 GNUNET_CRYPTO_eddsa_public_key_from_string (peer_id,
733 strlen (peer_id), 732 strlen (peer_id),
734 &pid.public_key)) 733 &pid.public_key))
735 { 734 {
736 fprintf (stderr, 735 fprintf (stderr,
737 _("Invalid peer ID `%s'\n"), 736 _("Invalid peer ID `%s'\n"),
738 peer_id); 737 peer_id);
@@ -746,11 +745,13 @@ show_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
746 * Call CADET's meta API, get all tunnels known to a peer. 745 * Call CADET's meta API, get all tunnels known to a peer.
747 * 746 *
748 * @param cls Closure (unused). 747 * @param cls Closure (unused).
749 * @param tc TaskContext
750 */ 748 */
751static void 749static void
752get_tunnels (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 750get_tunnels (void *cls)
753{ 751{
752 const struct GNUNET_SCHEDULER_TaskContext *tc;
753
754 tc = GNUNET_SCHEDULER_get_task_context ();
754 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 755 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
755 { 756 {
756 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n"); 757 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown\n");
@@ -764,10 +765,9 @@ get_tunnels (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
764 * Call CADET's monitor API, get info of one tunnel. 765 * Call CADET's monitor API, get info of one tunnel.
765 * 766 *
766 * @param cls Closure (unused). 767 * @param cls Closure (unused).
767 * @param tc TaskContext
768 */ 768 */
769static void 769static void
770show_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 770show_tunnel (void *cls)
771{ 771{
772 struct GNUNET_PeerIdentity pid; 772 struct GNUNET_PeerIdentity pid;
773 773
@@ -790,10 +790,9 @@ show_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
790 * Call CADET's monitor API, get info of one channel. 790 * Call CADET's monitor API, get info of one channel.
791 * 791 *
792 * @param cls Closure (unused). 792 * @param cls Closure (unused).
793 * @param tc TaskContext
794 */ 793 */
795static void 794static void
796show_channel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 795show_channel (void *cls)
797{ 796{
798 797
799} 798}
@@ -803,10 +802,9 @@ show_channel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
803 * Call CADET's monitor API, get info of one connection. 802 * Call CADET's monitor API, get info of one connection.
804 * 803 *
805 * @param cls Closure (unused). 804 * @param cls Closure (unused).
806 * @param tc TaskContext
807 */ 805 */
808static void 806static void
809show_connection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 807show_connection (void *cls)
810{ 808{
811 809
812} 810}
diff --git a/src/cadet/gnunet-service-cadet.c b/src/cadet/gnunet-service-cadet.c
index 86f1692e1..a2e00300b 100644
--- a/src/cadet/gnunet-service-cadet.c
+++ b/src/cadet/gnunet-service-cadet.c
@@ -98,10 +98,9 @@ static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
98 * Task run during shutdown. 98 * Task run during shutdown.
99 * 99 *
100 * @param cls unused 100 * @param cls unused
101 * @param tc unused
102 */ 101 */
103static void 102static void
104shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 103shutdown_task (void *cls)
105{ 104{
106 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutting down\n"); 105 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutting down\n");
107 106
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index a2e01d28f..debae7d77 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -721,19 +721,19 @@ send_client_nack (struct CadetChannel *ch)
721 * We haven't received an ACK after a certain time: restransmit the message. 721 * We haven't received an ACK after a certain time: restransmit the message.
722 * 722 *
723 * @param cls Closure (CadetChannelReliability with the message to restransmit) 723 * @param cls Closure (CadetChannelReliability with the message to restransmit)
724 * @param tc TaskContext.
725 */ 724 */
726static void 725static void
727channel_retransmit_message (void *cls, 726channel_retransmit_message (void *cls)
728 const struct GNUNET_SCHEDULER_TaskContext *tc)
729{ 727{
730 struct CadetChannelReliability *rel = cls; 728 struct CadetChannelReliability *rel = cls;
731 struct CadetReliableMessage *copy; 729 struct CadetReliableMessage *copy;
732 struct CadetChannel *ch; 730 struct CadetChannel *ch;
733 struct GNUNET_CADET_Data *payload; 731 struct GNUNET_CADET_Data *payload;
734 int fwd; 732 int fwd;
733 const struct GNUNET_SCHEDULER_TaskContext *tc;
735 734
736 rel->retry_task = NULL; 735 rel->retry_task = NULL;
736 tc = GNUNET_SCHEDULER_get_task_context ();
737 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 737 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
738 return; 738 return;
739 739
@@ -760,14 +760,15 @@ channel_retransmit_message (void *cls,
760 * We haven't received an Channel ACK after a certain time: resend the CREATE. 760 * We haven't received an Channel ACK after a certain time: resend the CREATE.
761 * 761 *
762 * @param cls Closure (CadetChannelReliability of the channel to recreate) 762 * @param cls Closure (CadetChannelReliability of the channel to recreate)
763 * @param tc TaskContext.
764 */ 763 */
765static void 764static void
766channel_recreate (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 765channel_recreate (void *cls)
767{ 766{
768 struct CadetChannelReliability *rel = cls; 767 struct CadetChannelReliability *rel = cls;
768 const struct GNUNET_SCHEDULER_TaskContext *tc;
769 769
770 rel->retry_task = NULL; 770 rel->retry_task = NULL;
771 tc = GNUNET_SCHEDULER_get_task_context ();
771 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 772 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
772 return; 773 return;
773 774
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 186204f1e..d11368a79 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -1221,13 +1221,14 @@ connection_keepalive (struct CadetConnection *c, int fwd, int shutdown)
1221 * Keep the connection alive in the FWD direction. 1221 * Keep the connection alive in the FWD direction.
1222 * 1222 *
1223 * @param cls Closure (connection to keepalive). 1223 * @param cls Closure (connection to keepalive).
1224 * @param tc TaskContext.
1225 */ 1224 */
1226static void 1225static void
1227connection_fwd_keepalive (void *cls, 1226connection_fwd_keepalive (void *cls)
1228 const struct GNUNET_SCHEDULER_TaskContext *tc)
1229{ 1227{
1228 const struct GNUNET_SCHEDULER_TaskContext *tc;
1229
1230 GCC_check_connections (); 1230 GCC_check_connections ();
1231 tc = GNUNET_SCHEDULER_get_task_context ();
1231 connection_keepalive ((struct CadetConnection *) cls, 1232 connection_keepalive ((struct CadetConnection *) cls,
1232 GNUNET_YES, 1233 GNUNET_YES,
1233 tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN); 1234 tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN);
@@ -1239,13 +1240,14 @@ connection_fwd_keepalive (void *cls,
1239 * Keep the connection alive in the BCK direction. 1240 * Keep the connection alive in the BCK direction.
1240 * 1241 *
1241 * @param cls Closure (connection to keepalive). 1242 * @param cls Closure (connection to keepalive).
1242 * @param tc TaskContext.
1243 */ 1243 */
1244static void 1244static void
1245connection_bck_keepalive (void *cls, 1245connection_bck_keepalive (void *cls)
1246 const struct GNUNET_SCHEDULER_TaskContext *tc)
1247{ 1246{
1247 const struct GNUNET_SCHEDULER_TaskContext *tc;
1248
1248 GCC_check_connections (); 1249 GCC_check_connections ();
1250 tc = GNUNET_SCHEDULER_get_task_context ();
1249 connection_keepalive ((struct CadetConnection *) cls, 1251 connection_keepalive ((struct CadetConnection *) cls,
1250 GNUNET_NO, 1252 GNUNET_NO,
1251 tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN); 1253 tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN);
@@ -1400,11 +1402,9 @@ connection_cancel_queues (struct CadetConnection *c,
1400 * possibly due to a missed ACK. Poll the neighbor about its ACK status. 1402 * possibly due to a missed ACK. Poll the neighbor about its ACK status.
1401 * 1403 *
1402 * @param cls Closure (poll ctx). 1404 * @param cls Closure (poll ctx).
1403 * @param tc TaskContext.
1404 */ 1405 */
1405static void 1406static void
1406connection_poll (void *cls, 1407connection_poll (void *cls);
1407 const struct GNUNET_SCHEDULER_TaskContext *tc);
1408 1408
1409 1409
1410/** 1410/**
@@ -1453,18 +1453,19 @@ poll_sent (void *cls,
1453 * possibly due to a missed ACK. Poll the neighbor about its ACK status. 1453 * possibly due to a missed ACK. Poll the neighbor about its ACK status.
1454 * 1454 *
1455 * @param cls Closure (poll ctx). 1455 * @param cls Closure (poll ctx).
1456 * @param tc TaskContext.
1457 */ 1456 */
1458static void 1457static void
1459connection_poll (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1458connection_poll (void *cls)
1460{ 1459{
1461 struct CadetFlowControl *fc = cls; 1460 struct CadetFlowControl *fc = cls;
1462 struct GNUNET_CADET_Poll msg; 1461 struct GNUNET_CADET_Poll msg;
1463 struct CadetConnection *c; 1462 struct CadetConnection *c;
1464 int fwd; 1463 int fwd;
1464 const struct GNUNET_SCHEDULER_TaskContext *tc;
1465 1465
1466 fc->poll_task = NULL; 1466 fc->poll_task = NULL;
1467 GCC_check_connections (); 1467 GCC_check_connections ();
1468 tc = GNUNET_SCHEDULER_get_task_context ();
1468 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1469 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1469 { 1470 {
1470 return; 1471 return;
@@ -1586,15 +1587,15 @@ connection_timeout (struct CadetConnection *c, int fwd)
1586 * Destroys connection if called. 1587 * Destroys connection if called.
1587 * 1588 *
1588 * @param cls Closure (connection to destroy). 1589 * @param cls Closure (connection to destroy).
1589 * @param tc TaskContext.
1590 */ 1590 */
1591static void 1591static void
1592connection_fwd_timeout (void *cls, 1592connection_fwd_timeout (void *cls)
1593 const struct GNUNET_SCHEDULER_TaskContext *tc)
1594{ 1593{
1595 struct CadetConnection *c = cls; 1594 struct CadetConnection *c = cls;
1595 const struct GNUNET_SCHEDULER_TaskContext *tc;
1596 1596
1597 c->fwd_maintenance_task = NULL; 1597 c->fwd_maintenance_task = NULL;
1598 tc = GNUNET_SCHEDULER_get_task_context ();
1598 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1599 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1599 return; 1600 return;
1600 GCC_check_connections (); 1601 GCC_check_connections ();
@@ -1608,15 +1609,15 @@ connection_fwd_timeout (void *cls,
1608 * Destroys connection if called. 1609 * Destroys connection if called.
1609 * 1610 *
1610 * @param cls Closure (connection to destroy). 1611 * @param cls Closure (connection to destroy).
1611 * @param tc TaskContext
1612 */ 1612 */
1613static void 1613static void
1614connection_bck_timeout (void *cls, 1614connection_bck_timeout (void *cls)
1615 const struct GNUNET_SCHEDULER_TaskContext *tc)
1616{ 1615{
1617 struct CadetConnection *c = cls; 1616 struct CadetConnection *c = cls;
1617 const struct GNUNET_SCHEDULER_TaskContext *tc;
1618 1618
1619 c->bck_maintenance_task = NULL; 1619 c->bck_maintenance_task = NULL;
1620 tc = GNUNET_SCHEDULER_get_task_context ();
1620 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1621 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1621 return; 1622 return;
1622 GCC_check_connections (); 1623 GCC_check_connections ();
@@ -1761,14 +1762,15 @@ does_connection_exist (struct CadetConnection *conn)
1761 * connection with the same path, and destroy one if so. 1762 * connection with the same path, and destroy one if so.
1762 * 1763 *
1763 * @param cls Closure (connection to check). 1764 * @param cls Closure (connection to check).
1764 * @param tc Task context.
1765 */ 1765 */
1766static void 1766static void
1767check_duplicates (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1767check_duplicates (void *cls)
1768{ 1768{
1769 struct CadetConnection *c = cls; 1769 struct CadetConnection *c = cls;
1770 const struct GNUNET_SCHEDULER_TaskContext *tc;
1770 1771
1771 c->check_duplicates_task = NULL; 1772 c->check_duplicates_task = NULL;
1773 tc = GNUNET_SCHEDULER_get_task_context ();
1772 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1774 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1773 return; 1775 return;
1774 1776
diff --git a/src/cadet/gnunet-service-cadet_dht.c b/src/cadet/gnunet-service-cadet_dht.c
index 2e8e53a9d..088d40eac 100644
--- a/src/cadet/gnunet-service-cadet_dht.c
+++ b/src/cadet/gnunet-service-cadet_dht.c
@@ -206,17 +206,18 @@ dht_get_id_handler (void *cls, struct GNUNET_TIME_Absolute exp,
206 * Periodically announce self id in the DHT 206 * Periodically announce self id in the DHT
207 * 207 *
208 * @param cls closure 208 * @param cls closure
209 * @param tc task context
210 */ 209 */
211static void 210static void
212announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 211announce_id (void *cls)
213{ 212{
214 struct GNUNET_HashCode phash; 213 struct GNUNET_HashCode phash;
215 const struct GNUNET_HELLO_Message *hello; 214 const struct GNUNET_HELLO_Message *hello;
216 size_t size; 215 size_t size;
217 struct GNUNET_TIME_Absolute expiration; 216 struct GNUNET_TIME_Absolute expiration;
218 struct GNUNET_TIME_Relative retry_time; 217 struct GNUNET_TIME_Relative retry_time;
218 const struct GNUNET_SCHEDULER_TaskContext *tc;
219 219
220 tc = GNUNET_SCHEDULER_get_task_context ();
220 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 221 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
221 { 222 {
222 announce_id_task = NULL; 223 announce_id_task = NULL;
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c
index 594c35701..51af04527 100644
--- a/src/cadet/gnunet-service-cadet_peer.c
+++ b/src/cadet/gnunet-service-cadet_peer.c
@@ -841,14 +841,15 @@ is_searching (const struct CadetPeer *peer)
841 * @brief Start a search for a peer. 841 * @brief Start a search for a peer.
842 * 842 *
843 * @param cls Closure (Peer to search for). 843 * @param cls Closure (Peer to search for).
844 * @param tc Task context.
845 */ 844 */
846static void 845static void
847delayed_search (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 846delayed_search (void *cls)
848{ 847{
849 struct CadetPeer *peer = cls; 848 struct CadetPeer *peer = cls;
849 const struct GNUNET_SCHEDULER_TaskContext *tc;
850 850
851 peer->search_delayed = NULL; 851 peer->search_delayed = NULL;
852 tc = GNUNET_SCHEDULER_get_task_context ();
852 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 853 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
853 return; 854 return;
854 GCC_check_connections (); 855 GCC_check_connections ();
@@ -1955,11 +1956,9 @@ GCP_get_short (const GNUNET_PEER_Id peer, int create)
1955 * Marks the operation as finished. 1956 * Marks the operation as finished.
1956 * 1957 *
1957 * @param cls Closure (our `struct CadetPeer`). 1958 * @param cls Closure (our `struct CadetPeer`).
1958 * @param tc TaskContext.
1959 */ 1959 */
1960static void 1960static void
1961hello_offer_done (void *cls, 1961hello_offer_done (void *cls)
1962 const struct GNUNET_SCHEDULER_TaskContext *tc)
1963{ 1962{
1964 struct CadetPeer *peer = cls; 1963 struct CadetPeer *peer = cls;
1965 1964
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index 67c2ad5fa..73bd28643 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -1730,15 +1730,15 @@ create_kx_ctx (struct CadetTunnel *t)
1730 * @brief Finish the Key eXchange and destroy the old keys. 1730 * @brief Finish the Key eXchange and destroy the old keys.
1731 * 1731 *
1732 * @param cls Closure (Tunnel for which to finish the KX). 1732 * @param cls Closure (Tunnel for which to finish the KX).
1733 * @param tc Task context.
1734 */ 1733 */
1735static void 1734static void
1736finish_kx (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1735finish_kx (void *cls)
1737{ 1736{
1738 struct CadetTunnel *t = cls; 1737 struct CadetTunnel *t = cls;
1738 const struct GNUNET_SCHEDULER_TaskContext *tc;
1739 1739
1740 LOG (GNUNET_ERROR_TYPE_INFO, "finish KX for %s\n", GCT_2s (t)); 1740 LOG (GNUNET_ERROR_TYPE_INFO, "finish KX for %s\n", GCT_2s (t));
1741 1741 tc = GNUNET_SCHEDULER_get_task_context ();
1742 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1742 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1743 { 1743 {
1744 LOG (GNUNET_ERROR_TYPE_INFO, " shutdown\n"); 1744 LOG (GNUNET_ERROR_TYPE_INFO, " shutdown\n");
@@ -2098,15 +2098,15 @@ send_queued_data (struct CadetTunnel *t)
2098 * @brief Resend the AX KX until we complete the handshake. 2098 * @brief Resend the AX KX until we complete the handshake.
2099 * 2099 *
2100 * @param cls Closure (tunnel). 2100 * @param cls Closure (tunnel).
2101 * @param tc Task context.
2102 */ 2101 */
2103static void 2102static void
2104ax_kx_resend (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 2103ax_kx_resend (void *cls)
2105{ 2104{
2106 struct CadetTunnel *t = cls; 2105 struct CadetTunnel *t = cls;
2106 const struct GNUNET_SCHEDULER_TaskContext *tc;
2107 2107
2108 t->rekey_task = NULL; 2108 t->rekey_task = NULL;
2109 2109 tc = GNUNET_SCHEDULER_get_task_context ();
2110 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 2110 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
2111 return; 2111 return;
2112 2112
@@ -2328,16 +2328,16 @@ send_pong (struct CadetTunnel *t, uint32_t challenge)
2328 * Initiate a rekey with the remote peer. 2328 * Initiate a rekey with the remote peer.
2329 * 2329 *
2330 * @param cls Closure (tunnel). 2330 * @param cls Closure (tunnel).
2331 * @param tc TaskContext.
2332 */ 2331 */
2333static void 2332static void
2334rekey_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 2333rekey_tunnel (void *cls)
2335{ 2334{
2336 struct CadetTunnel *t = cls; 2335 struct CadetTunnel *t = cls;
2336 const struct GNUNET_SCHEDULER_TaskContext *tc;
2337 2337
2338 t->rekey_task = NULL; 2338 t->rekey_task = NULL;
2339
2340 LOG (GNUNET_ERROR_TYPE_INFO, "Re-key Tunnel %s\n", GCT_2s (t)); 2339 LOG (GNUNET_ERROR_TYPE_INFO, "Re-key Tunnel %s\n", GCT_2s (t));
2340 tc = GNUNET_SCHEDULER_get_task_context ();
2341 if (NULL != tc && 0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 2341 if (NULL != tc && 0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
2342 return; 2342 return;
2343 2343
@@ -2447,16 +2447,16 @@ rekey_iterator (void *cls,
2447 * Create a new ephemeral key and key message, schedule next rekeying. 2447 * Create a new ephemeral key and key message, schedule next rekeying.
2448 * 2448 *
2449 * @param cls Closure (unused). 2449 * @param cls Closure (unused).
2450 * @param tc TaskContext.
2451 */ 2450 */
2452static void 2451static void
2453global_otr_rekey (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 2452global_otr_rekey (void *cls)
2454{ 2453{
2455 struct GNUNET_TIME_Absolute time; 2454 struct GNUNET_TIME_Absolute time;
2456 long n; 2455 long n;
2456 const struct GNUNET_SCHEDULER_TaskContext *tc;
2457 2457
2458 rekey_task = NULL; 2458 rekey_task = NULL;
2459 2459 tc = GNUNET_SCHEDULER_get_task_context ();
2460 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 2460 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
2461 return; 2461 return;
2462 2462
@@ -2833,7 +2833,7 @@ handle_ephemeral (struct CadetTunnel *t,
2833 GNUNET_break (0); 2833 GNUNET_break (0);
2834 return; 2834 return;
2835 } 2835 }
2836 rekey_tunnel (t, NULL); 2836 rekey_tunnel (t);
2837 GNUNET_STATISTICS_update (stats, "# otr-downgrades", -1, GNUNET_NO); 2837 GNUNET_STATISTICS_update (stats, "# otr-downgrades", -1, GNUNET_NO);
2838 } 2838 }
2839 2839
@@ -2865,7 +2865,7 @@ handle_ephemeral (struct CadetTunnel *t,
2865 } 2865 }
2866 if (NULL != t->rekey_task) 2866 if (NULL != t->rekey_task)
2867 GNUNET_SCHEDULER_cancel (t->rekey_task); 2867 GNUNET_SCHEDULER_cancel (t->rekey_task);
2868 t->rekey_task = GNUNET_SCHEDULER_add_now (rekey_tunnel, t); 2868 t->rekey_task = GNUNET_SCHEDULER_add_now (&rekey_tunnel, t);
2869 } 2869 }
2870 if (CADET_TUNNEL_KEY_SENT == t->estate) 2870 if (CADET_TUNNEL_KEY_SENT == t->estate)
2871 { 2871 {
@@ -3467,15 +3467,15 @@ GCT_change_estate (struct CadetTunnel* t, enum CadetTunnelEState state)
3467 * of being created/processed. 3467 * of being created/processed.
3468 * 3468 *
3469 * @param cls Closure (Tunnel to check). 3469 * @param cls Closure (Tunnel to check).
3470 * @param tc Task context.
3471 */ 3470 */
3472static void 3471static void
3473trim_connections (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 3472trim_connections (void *cls)
3474{ 3473{
3475 struct CadetTunnel *t = cls; 3474 struct CadetTunnel *t = cls;
3475 const struct GNUNET_SCHEDULER_TaskContext *tc;
3476 3476
3477 t->trim_connections_task = NULL; 3477 t->trim_connections_task = NULL;
3478 3478 tc = GNUNET_SCHEDULER_get_task_context ();
3479 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 3479 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
3480 return; 3480 return;
3481 3481
@@ -3695,15 +3695,16 @@ GCT_get_channel (struct CadetTunnel *t, CADET_ChannelNumber chid)
3695 * the tunnel. This way we avoid a new public key handshake. 3695 * the tunnel. This way we avoid a new public key handshake.
3696 * 3696 *
3697 * @param cls Closure (tunnel to destroy). 3697 * @param cls Closure (tunnel to destroy).
3698 * @param tc Task context.
3699 */ 3698 */
3700static void 3699static void
3701delayed_destroy (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 3700delayed_destroy (void *cls)
3702{ 3701{
3703 struct CadetTunnel *t = cls; 3702 struct CadetTunnel *t = cls;
3704 struct CadetTConnection *iter; 3703 struct CadetTConnection *iter;
3704 const struct GNUNET_SCHEDULER_TaskContext *tc;
3705 3705
3706 LOG (GNUNET_ERROR_TYPE_DEBUG, "delayed destroying tunnel %p\n", t); 3706 LOG (GNUNET_ERROR_TYPE_DEBUG, "delayed destroying tunnel %p\n", t);
3707 tc = GNUNET_SCHEDULER_get_task_context ();
3707 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 3708 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
3708 { 3709 {
3709 LOG (GNUNET_ERROR_TYPE_WARNING, 3710 LOG (GNUNET_ERROR_TYPE_WARNING,
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c
index d1b1b8212..39bfc5fed 100644
--- a/src/cadet/test_cadet.c
+++ b/src/cadet/test_cadet.c
@@ -262,7 +262,7 @@ show_end_data (void)
262 * @param tc Task Context. 262 * @param tc Task Context.
263 */ 263 */
264static void 264static void
265shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 265shutdown_task (void *cls)
266{ 266{
267 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending test.\n"); 267 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending test.\n");
268 shutdown_handle = NULL; 268 shutdown_handle = NULL;
@@ -276,12 +276,13 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
276 * @param tc Task Context. 276 * @param tc Task Context.
277 */ 277 */
278static void 278static void
279disconnect_cadet_peers (void *cls, 279disconnect_cadet_peers (void *cls)
280 const struct GNUNET_SCHEDULER_TaskContext *tc)
281{ 280{
282 long line = (long) cls; 281 long line = (long) cls;
283 unsigned int i; 282 unsigned int i;
283 const struct GNUNET_SCHEDULER_TaskContext *tc;
284 284
285 tc = GNUNET_SCHEDULER_get_task_context ();
285 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 286 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
286 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 287 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
287 "disconnecting cadet peers due to SHUTDOWN! called from %ld\n", 288 "disconnecting cadet peers due to SHUTDOWN! called from %ld\n",
@@ -387,16 +388,16 @@ stats_iterator (void *cls, const struct GNUNET_TESTBED_Peer *peer,
387 * Task to gather all statistics. 388 * Task to gather all statistics.
388 * 389 *
389 * @param cls Closure (NULL). 390 * @param cls Closure (NULL).
390 * @param tc Task Context.
391 */ 391 */
392static void 392static void
393gather_stats_and_exit (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 393gather_stats_and_exit (void *cls)
394{ 394{
395 disconnect_task = NULL;
396 long l = (long) cls; 395 long l = (long) cls;
396 const struct GNUNET_SCHEDULER_TaskContext *tc;
397 397
398 disconnect_task = NULL;
398 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "gathering statistics from line %d\n", l); 399 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "gathering statistics from line %d\n", l);
399 400 tc = GNUNET_SCHEDULER_get_task_context ();
400 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 401 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
401 { 402 {
402 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers, 403 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
@@ -456,18 +457,17 @@ tmt_rdy (void *cls, size_t size, void *buf);
456 * Task to request a new data transmission. 457 * Task to request a new data transmission.
457 * 458 *
458 * @param cls Closure (peer #). 459 * @param cls Closure (peer #).
459 * @param tc Task Context.
460 */ 460 */
461static void 461static void
462data_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 462data_task (void *cls)
463{ 463{
464 struct GNUNET_CADET_Channel *channel; 464 struct GNUNET_CADET_Channel *channel;
465 static struct GNUNET_CADET_TransmitHandle **pth; 465 static struct GNUNET_CADET_TransmitHandle **pth;
466 466 const struct GNUNET_SCHEDULER_TaskContext *tc;
467 long src; 467 long src;
468 468
469 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Data task\n"); 469 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Data task\n");
470 470 tc = GNUNET_SCHEDULER_get_task_context ();
471 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 471 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
472 return; 472 return;
473 473
@@ -837,13 +837,14 @@ channel_cleaner (void *cls, const struct GNUNET_CADET_Channel *channel,
837 * on callback function ch. 837 * on callback function ch.
838 * 838 *
839 * @param cls Closure (unused). 839 * @param cls Closure (unused).
840 * @param tc Task Context.
841 */ 840 */
842static void 841static void
843do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 842do_test (void *cls)
844{ 843{
845 enum GNUNET_CADET_ChannelOption flags; 844 enum GNUNET_CADET_ChannelOption flags;
845 const struct GNUNET_SCHEDULER_TaskContext *tc;
846 846
847 tc = GNUNET_SCHEDULER_get_task_context ();
847 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 848 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
848 return; 849 return;
849 850
@@ -1084,4 +1085,3 @@ main (int argc, char *argv[])
1084} 1085}
1085 1086
1086/* end of test_cadet.c */ 1087/* end of test_cadet.c */
1087
diff --git a/src/cadet/test_cadet_local.c b/src/cadet/test_cadet_local.c
index ef6882961..42663b146 100644
--- a/src/cadet/test_cadet_local.c
+++ b/src/cadet/test_cadet_local.c
@@ -53,17 +53,16 @@ static struct GNUNET_CADET_TransmitHandle *mth;
53 * Connect to other client and send data 53 * Connect to other client and send data
54 * 54 *
55 * @param cls Closue (unused). 55 * @param cls Closue (unused).
56 * @param tc TaskContext.
57 */ 56 */
58static void 57static void
59do_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 58do_connect (void *cls);
60 59
61 60
62/** 61/**
63 * Shutdown nicely 62 * Shutdown nicely
64 */ 63 */
65static void 64static void
66do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 65do_shutdown (void *cls)
67{ 66{
68 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n"); 67 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n");
69 if (NULL != abort_task) 68 if (NULL != abort_task)
@@ -91,7 +90,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
91 * Something went wrong and timed out. Kill everything and set error flag 90 * Something went wrong and timed out. Kill everything and set error flag
92 */ 91 */
93static void 92static void
94do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 93do_abort (void *cls)
95{ 94{
96 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ABORT\n"); 95 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ABORT\n");
97 result = GNUNET_SYSERR; 96 result = GNUNET_SYSERR;
@@ -101,7 +100,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
101 GNUNET_SCHEDULER_cancel (shutdown_task); 100 GNUNET_SCHEDULER_cancel (shutdown_task);
102 shutdown_task = NULL; 101 shutdown_task = NULL;
103 } 102 }
104 do_shutdown (cls, tc); 103 do_shutdown (cls);
105} 104}
106 105
107 106
@@ -126,7 +125,8 @@ data_callback (void *cls, struct GNUNET_CADET_Channel *channel,
126 if (NULL != shutdown_task) 125 if (NULL != shutdown_task)
127 GNUNET_SCHEDULER_cancel (shutdown_task); 126 GNUNET_SCHEDULER_cancel (shutdown_task);
128 shutdown_task = 127 shutdown_task =
129 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_shutdown, 128 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
129 &do_shutdown,
130 NULL); 130 NULL);
131 GNUNET_CADET_receive_done (channel); 131 GNUNET_CADET_receive_done (channel);
132 return GNUNET_OK; 132 return GNUNET_OK;
@@ -146,9 +146,11 @@ data_callback (void *cls, struct GNUNET_CADET_Channel *channel,
146 * (can be NULL -- that's not an error) 146 * (can be NULL -- that's not an error)
147 */ 147 */
148static void * 148static void *
149inbound_channel (void *cls, struct GNUNET_CADET_Channel *channel, 149inbound_channel (void *cls,
150 const struct GNUNET_PeerIdentity *initiator, 150 struct GNUNET_CADET_Channel *channel,
151 uint32_t port, enum GNUNET_CADET_ChannelOption options) 151 const struct GNUNET_PeerIdentity *initiator,
152 uint32_t port,
153 enum GNUNET_CADET_ChannelOption options)
152{ 154{
153 long id = (long) cls; 155 long id = (long) cls;
154 156
@@ -247,13 +249,14 @@ do_send (void *cls, size_t size, void *buf)
247 * Connect to other client and send data 249 * Connect to other client and send data
248 * 250 *
249 * @param cls Closue (unused). 251 * @param cls Closue (unused).
250 * @param tc TaskContext.
251 */ 252 */
252static void 253static void
253do_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 254do_connect (void *cls)
254{ 255{
255 struct GNUNET_PeerIdentity id; 256 struct GNUNET_PeerIdentity id;
257 const struct GNUNET_SCHEDULER_TaskContext *tc;
256 258
259 tc = GNUNET_SCHEDULER_get_task_context ();
257 if (NULL != tc && 0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 260 if (NULL != tc && 0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
258 return; 261 return;
259 262
diff --git a/src/cadet/test_cadet_single.c b/src/cadet/test_cadet_single.c
index d5c19ac01..93a50c02c 100644
--- a/src/cadet/test_cadet_single.c
+++ b/src/cadet/test_cadet_single.c
@@ -59,7 +59,7 @@ do_send (void *cls, size_t size, void *buf);
59 * Shutdown nicely 59 * Shutdown nicely
60 */ 60 */
61static void 61static void
62do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 62do_shutdown (void *cls)
63{ 63{
64 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n"); 64 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n");
65 if (NULL != abort_task) 65 if (NULL != abort_task)
@@ -88,7 +88,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
88 * Something went wrong and timed out. Kill everything and set error flag 88 * Something went wrong and timed out. Kill everything and set error flag
89 */ 89 */
90static void 90static void
91do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 91do_abort (void *cls)
92{ 92{
93 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ABORT\n"); 93 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ABORT\n");
94 result = GNUNET_SYSERR; 94 result = GNUNET_SYSERR;
@@ -98,7 +98,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
98 GNUNET_SCHEDULER_cancel (shutdown_task); 98 GNUNET_SCHEDULER_cancel (shutdown_task);
99 shutdown_task = NULL; 99 shutdown_task = NULL;
100 } 100 }
101 do_shutdown (cls, tc); 101 do_shutdown (cls);
102} 102}
103 103
104 104
@@ -247,14 +247,15 @@ do_send (void *cls, size_t size, void *buf)
247 * Connect to other client and send data 247 * Connect to other client and send data
248 * 248 *
249 * @param cls Closue (unused). 249 * @param cls Closue (unused).
250 * @param tc TaskContext.
251 */ 250 */
252static void 251static void
253do_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 252do_connect (void *cls)
254{ 253{
255 struct GNUNET_PeerIdentity id; 254 struct GNUNET_PeerIdentity id;
256 size_t size = sizeof (struct GNUNET_MessageHeader) + DATA_SIZE; 255 size_t size = sizeof (struct GNUNET_MessageHeader) + DATA_SIZE;
256 const struct GNUNET_SCHEDULER_TaskContext *tc;
257 257
258 tc = GNUNET_SCHEDULER_get_task_context ();
258 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 259 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
259 return; 260 return;
260 261
diff --git a/src/consensus/gnunet-consensus-profiler.c b/src/consensus/gnunet-consensus-profiler.c
index 355ae60a3..4af7740e7 100644
--- a/src/consensus/gnunet-consensus-profiler.c
+++ b/src/consensus/gnunet-consensus-profiler.c
@@ -120,8 +120,8 @@ statistics_done_db (void *cls,
120 * @param subsystem name of subsystem that created the statistic 120 * @param subsystem name of subsystem that created the statistic
121 * @param name the name of the datum 121 * @param name the name of the datum
122 * @param value the current value 122 * @param value the current value
123 * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not 123 * @param is_persistent #GNUNET_YES if the value is persistent, #GNUNET_NO if not
124 * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration 124 * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration
125 */ 125 */
126static int 126static int
127statistics_cb (void *cls, 127statistics_cb (void *cls,
@@ -140,7 +140,7 @@ statistics_cb (void *cls,
140 140
141 141
142static void 142static void
143destroy (void *cls, const struct GNUNET_SCHEDULER_TaskContext *ctx) 143destroy (void *cls)
144{ 144{
145 struct GNUNET_CONSENSUS_Handle *consensus = cls; 145 struct GNUNET_CONSENSUS_Handle *consensus = cls;
146 146
@@ -521,4 +521,3 @@ main (int argc, char **argv)
521 options, &run, NULL, GNUNET_YES); 521 options, &run, NULL, GNUNET_YES);
522 return 0; 522 return 0;
523} 523}
524
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c
index e8385a6bb..82b05d136 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -3169,11 +3169,9 @@ client_conclude (void *cls,
3169 * Called to clean up, after a shutdown has been requested. 3169 * Called to clean up, after a shutdown has been requested.
3170 * 3170 *
3171 * @param cls closure 3171 * @param cls closure
3172 * @param tc context information (why was this task triggered now)
3173 */ 3172 */
3174static void 3173static void
3175shutdown_task (void *cls, 3174shutdown_task (void *cls)
3176 const struct GNUNET_SCHEDULER_TaskContext *tc)
3177{ 3175{
3178 while (NULL != sessions_head) 3176 while (NULL != sessions_head)
3179 destroy_session (sessions_head); 3177 destroy_session (sessions_head);
diff --git a/src/consensus/test_consensus_api.c b/src/consensus/test_consensus_api.c
index 18c5b3b31..0073267f8 100644
--- a/src/consensus/test_consensus_api.c
+++ b/src/consensus/test_consensus_api.c
@@ -67,11 +67,9 @@ insert_done (void *cls, int success)
67 * Signature of the main function of a task. 67 * Signature of the main function of a task.
68 * 68 *
69 * @param cls closure 69 * @param cls closure
70 * @param tc context information (why was this task triggered now)
71 */ 70 */
72static void 71static void
73on_shutdown (void *cls, 72on_shutdown (void *cls)
74 const struct GNUNET_SCHEDULER_TaskContext *tc)
75{ 73{
76 if (NULL != consensus) 74 if (NULL != consensus)
77 { 75 {
@@ -121,4 +119,3 @@ main (int argc, char **argv)
121 &run, NULL); 119 &run, NULL);
122 return ret; 120 return ret;
123} 121}
124
diff --git a/src/conversation/gnunet-conversation-test.c b/src/conversation/gnunet-conversation-test.c
index 1c8fe74e6..fe6eae925 100644
--- a/src/conversation/gnunet-conversation-test.c
+++ b/src/conversation/gnunet-conversation-test.c
@@ -96,11 +96,9 @@ static struct Recording *rec_tail;
96 * Terminate test. 96 * Terminate test.
97 * 97 *
98 * @param cls NULL 98 * @param cls NULL
99 * @param tc unused
100 */ 99 */
101static void 100static void
102do_shutdown (void *cls, 101do_shutdown (void *cls)
103 const struct GNUNET_SCHEDULER_TaskContext *tc)
104{ 102{
105 struct Recording *rec; 103 struct Recording *rec;
106 104
@@ -126,11 +124,9 @@ do_shutdown (void *cls,
126 * Terminate recording process and switch to playback. 124 * Terminate recording process and switch to playback.
127 * 125 *
128 * @param cls NULL 126 * @param cls NULL
129 * @param tc unused
130 */ 127 */
131static void 128static void
132switch_to_speaker (void *cls, 129switch_to_speaker (void *cls)
133 const struct GNUNET_SCHEDULER_TaskContext *tc)
134{ 130{
135 struct Recording *rec; 131 struct Recording *rec;
136 132
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c
index 3b50c8043..9000bcf3f 100644
--- a/src/conversation/gnunet-conversation.c
+++ b/src/conversation/gnunet-conversation.c
@@ -1020,11 +1020,9 @@ do_help (const char *args)
1020 * Task run during shutdown. 1020 * Task run during shutdown.
1021 * 1021 *
1022 * @param cls NULL 1022 * @param cls NULL
1023 * @param tc unused
1024 */ 1023 */
1025static void 1024static void
1026do_stop_task (void *cls, 1025do_stop_task (void *cls)
1027 const struct GNUNET_SCHEDULER_TaskContext *tc)
1028{ 1026{
1029#ifdef WINDOWS 1027#ifdef WINDOWS
1030 if (NULL != stdin_hlp) 1028 if (NULL != stdin_hlp)
@@ -1132,11 +1130,9 @@ console_reader_chars (void *cls,
1132 * Task to handle commands from the terminal. 1130 * Task to handle commands from the terminal.
1133 * 1131 *
1134 * @param cls NULL 1132 * @param cls NULL
1135 * @param tc scheduler context
1136 */ 1133 */
1137static void 1134static void
1138handle_command (void *cls, 1135handle_command (void *cls)
1139 const struct GNUNET_SCHEDULER_TaskContext *tc)
1140{ 1136{
1141 char message[MAX_MESSAGE_LENGTH + 1]; 1137 char message[MAX_MESSAGE_LENGTH + 1];
1142 1138
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c
index 8761ed5e1..fdaa2999c 100644
--- a/src/conversation/gnunet-service-conversation.c
+++ b/src/conversation/gnunet-service-conversation.c
@@ -1463,11 +1463,9 @@ handle_client_disconnect (void *cls,
1463 * Shutdown nicely 1463 * Shutdown nicely
1464 * 1464 *
1465 * @param cls closure, NULL 1465 * @param cls closure, NULL
1466 * @param tc the task context
1467 */ 1466 */
1468static void 1467static void
1469do_shutdown (void *cls, 1468do_shutdown (void *cls)
1470 const struct GNUNET_SCHEDULER_TaskContext *tc)
1471{ 1469{
1472 struct Line *line; 1470 struct Line *line;
1473 struct Channel *ch; 1471 struct Channel *ch;
diff --git a/src/conversation/test_conversation_api.c b/src/conversation/test_conversation_api.c
index 317818c8e..f8159115b 100644
--- a/src/conversation/test_conversation_api.c
+++ b/src/conversation/test_conversation_api.c
@@ -73,8 +73,7 @@ static struct GNUNET_SCHEDULER_Task * call_task;
73 73
74 74
75static void 75static void
76phone_send (void *cls, 76phone_send (void *cls)
77 const struct GNUNET_SCHEDULER_TaskContext *tc)
78{ 77{
79 static unsigned int i; 78 static unsigned int i;
80 char buf[32]; 79 char buf[32];
@@ -88,8 +87,7 @@ phone_send (void *cls,
88 87
89 88
90static void 89static void
91call_send (void *cls, 90call_send (void *cls)
92 const struct GNUNET_SCHEDULER_TaskContext *tc)
93{ 91{
94 static unsigned int i; 92 static unsigned int i;
95 char buf[32]; 93 char buf[32];
@@ -272,10 +270,9 @@ static struct GNUNET_MICROPHONE_Handle phone_mic = {
272 * Signature of the main function of a task. 270 * Signature of the main function of a task.
273 * 271 *
274 * @param cls closure 272 * @param cls closure
275 * @param tc context information (why was this task triggered now)
276 */ 273 */
277static void 274static void
278end_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 275end_test (void *cls)
279{ 276{
280 GNUNET_SCHEDULER_shutdown (); 277 GNUNET_SCHEDULER_shutdown ();
281 if (NULL != op) 278 if (NULL != op)
diff --git a/src/conversation/test_conversation_api_reject.c b/src/conversation/test_conversation_api_reject.c
index 13dfcd3d5..5f1f836f7 100644
--- a/src/conversation/test_conversation_api_reject.c
+++ b/src/conversation/test_conversation_api_reject.c
@@ -130,10 +130,9 @@ static struct GNUNET_MICROPHONE_Handle call_mic = {
130 * Signature of the main function of a task. 130 * Signature of the main function of a task.
131 * 131 *
132 * @param cls closure 132 * @param cls closure
133 * @param tc context information (why was this task triggered now)
134 */ 133 */
135static void 134static void
136end_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 135end_test (void *cls)
137{ 136{
138 GNUNET_SCHEDULER_shutdown (); 137 GNUNET_SCHEDULER_shutdown ();
139 if (NULL != op) 138 if (NULL != op)
diff --git a/src/conversation/test_conversation_api_twocalls.c b/src/conversation/test_conversation_api_twocalls.c
index 5d7e56d95..17a12eb4f 100644
--- a/src/conversation/test_conversation_api_twocalls.c
+++ b/src/conversation/test_conversation_api_twocalls.c
@@ -124,8 +124,7 @@ static struct MicContext call2_mic_ctx;
124 124
125 125
126static void 126static void
127phone_send (void *cls, 127phone_send (void *cls)
128 const struct GNUNET_SCHEDULER_TaskContext *tc)
129{ 128{
130 char buf[32]; 129 char buf[32];
131 130
@@ -138,8 +137,7 @@ phone_send (void *cls,
138 137
139 138
140static void 139static void
141call_send (void *cls, 140call_send (void *cls)
142 const struct GNUNET_SCHEDULER_TaskContext *tc)
143{ 141{
144 struct MicContext *mc = cls; 142 struct MicContext *mc = cls;
145 char buf[32]; 143 char buf[32];
@@ -343,10 +341,9 @@ static struct GNUNET_MICROPHONE_Handle phone_mic = {
343 * Signature of the main function of a task. 341 * Signature of the main function of a task.
344 * 342 *
345 * @param cls closure 343 * @param cls closure
346 * @param tc context information (why was this task triggered now)
347 */ 344 */
348static void 345static void
349end_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 346end_test (void *cls)
350{ 347{
351 GNUNET_SCHEDULER_shutdown (); 348 GNUNET_SCHEDULER_shutdown ();
352 if (NULL != op) 349 if (NULL != op)
diff --git a/src/core/core_api.c b/src/core/core_api.c
index 20f0acc09..7b423b6a0 100644
--- a/src/core/core_api.c
+++ b/src/core/core_api.c
@@ -339,8 +339,7 @@ reconnect (struct GNUNET_CORE_Handle *h);
339 * @param tc task context 339 * @param tc task context
340 */ 340 */
341static void 341static void
342reconnect_task (void *cls, 342reconnect_task (void *cls)
343 const struct GNUNET_SCHEDULER_TaskContext *tc)
344{ 343{
345 struct GNUNET_CORE_Handle *h = cls; 344 struct GNUNET_CORE_Handle *h = cls;
346 345
@@ -1214,11 +1213,9 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle)
1214 * Task that calls #request_next_transmission(). 1213 * Task that calls #request_next_transmission().
1215 * 1214 *
1216 * @param cls the `struct PeerRecord *` 1215 * @param cls the `struct PeerRecord *`
1217 * @param tc scheduler context
1218 */ 1216 */
1219static void 1217static void
1220run_request_next_transmission (void *cls, 1218run_request_next_transmission (void *cls)
1221 const struct GNUNET_SCHEDULER_TaskContext *tc)
1222{ 1219{
1223 struct PeerRecord *pr = cls; 1220 struct PeerRecord *pr = cls;
1224 1221
diff --git a/src/core/gnunet-core.c b/src/core/gnunet-core.c
index c70d49bb7..968072e22 100644
--- a/src/core/gnunet-core.c
+++ b/src/core/gnunet-core.c
@@ -44,11 +44,9 @@ static struct GNUNET_CORE_MonitorHandle *mh;
44 * Stops monitoring activity. 44 * Stops monitoring activity.
45 * 45 *
46 * @param cls NULL 46 * @param cls NULL
47 * @param tc scheduler context
48 */ 47 */
49static void 48static void
50shutdown_task (void *cls, 49shutdown_task (void *cls)
51 const struct GNUNET_SCHEDULER_TaskContext *tc)
52{ 50{
53 if (NULL != mh) 51 if (NULL != mh)
54 { 52 {
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c
index 83942d9ab..1d9de8666 100644
--- a/src/core/gnunet-service-core.c
+++ b/src/core/gnunet-service-core.c
@@ -60,12 +60,12 @@ static struct GNUNET_SERVER_Handle *GSC_server;
60 * the transport. 60 * the transport.
61 * 61 *
62 * @param cls NULL, unused 62 * @param cls NULL, unused
63 * @param tc scheduler context, unused
64 */ 63 */
65static void 64static void
66shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 65shutdown_task (void *cls)
67{ 66{
68 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core service shutting down.\n"); 67 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
68 "Core service shutting down.\n");
69 GSC_CLIENTS_done (); 69 GSC_CLIENTS_done ();
70 GSC_NEIGHBOURS_done (); 70 GSC_NEIGHBOURS_done ();
71 GSC_SESSIONS_done (); 71 GSC_SESSIONS_done ();
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c
index 988c5790a..8250bcc6f 100644
--- a/src/core/gnunet-service-core_kx.c
+++ b/src/core/gnunet-service-core_kx.c
@@ -659,11 +659,9 @@ send_key (struct GSC_KeyExchangeInfo *kx);
659 * Task that will retry #send_key() if our previous attempt failed. 659 * Task that will retry #send_key() if our previous attempt failed.
660 * 660 *
661 * @param cls our `struct GSC_KeyExchangeInfo` 661 * @param cls our `struct GSC_KeyExchangeInfo`
662 * @param tc scheduler context
663 */ 662 */
664static void 663static void
665set_key_retry_task (void *cls, 664set_key_retry_task (void *cls)
666 const struct GNUNET_SCHEDULER_TaskContext *tc)
667{ 665{
668 struct GSC_KeyExchangeInfo *kx = cls; 666 struct GSC_KeyExchangeInfo *kx = cls;
669 667
@@ -1104,11 +1102,9 @@ GSC_KX_handle_ping (struct GSC_KeyExchangeInfo *kx,
1104 * (and we should prevent this by sending a PING). 1102 * (and we should prevent this by sending a PING).
1105 * 1103 *
1106 * @param cls the `struct GSC_KeyExchangeInfo` 1104 * @param cls the `struct GSC_KeyExchangeInfo`
1107 * @param tc scheduler context (not used)
1108 */ 1105 */
1109static void 1106static void
1110send_keep_alive (void *cls, 1107send_keep_alive (void *cls)
1111 const struct GNUNET_SCHEDULER_TaskContext *tc)
1112{ 1108{
1113 struct GSC_KeyExchangeInfo *kx = cls; 1109 struct GSC_KeyExchangeInfo *kx = cls;
1114 struct GNUNET_TIME_Relative retry; 1110 struct GNUNET_TIME_Relative retry;
@@ -1698,11 +1694,9 @@ sign_ephemeral_key ()
1698 * Task run to trigger rekeying. 1694 * Task run to trigger rekeying.
1699 * 1695 *
1700 * @param cls closure, NULL 1696 * @param cls closure, NULL
1701 * @param tc scheduler context
1702 */ 1697 */
1703static void 1698static void
1704do_rekey (void *cls, 1699do_rekey (void *cls)
1705 const struct GNUNET_SCHEDULER_TaskContext *tc)
1706{ 1700{
1707 struct GSC_KeyExchangeInfo *pos; 1701 struct GSC_KeyExchangeInfo *pos;
1708 1702
diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c
index 78ab8027e..890499394 100644
--- a/src/core/gnunet-service-core_sessions.c
+++ b/src/core/gnunet-service-core_sessions.c
@@ -264,11 +264,9 @@ GSC_SESSIONS_end (const struct GNUNET_PeerIdentity *pid)
264 * (Done periodically until the typemap is confirmed). 264 * (Done periodically until the typemap is confirmed).
265 * 265 *
266 * @param cls the `struct Session *` 266 * @param cls the `struct Session *`
267 * @param tc unused
268 */ 267 */
269static void 268static void
270transmit_typemap_task (void *cls, 269transmit_typemap_task (void *cls)
271 const struct GNUNET_SCHEDULER_TaskContext *tc)
272{ 270{
273 struct Session *session = cls; 271 struct Session *session = cls;
274 struct GNUNET_MessageHeader *hdr; 272 struct GNUNET_MessageHeader *hdr;
@@ -589,11 +587,9 @@ solicit_messages (struct Session *session,
589 * Send them now. 587 * Send them now.
590 * 588 *
591 * @param cls `struct Session` with the messages to transmit now 589 * @param cls `struct Session` with the messages to transmit now
592 * @param tc scheduler context (unused)
593 */ 590 */
594static void 591static void
595pop_cork_task (void *cls, 592pop_cork_task (void *cls)
596 const struct GNUNET_SCHEDULER_TaskContext *tc)
597{ 593{
598 struct Session *session = cls; 594 struct Session *session = cls;
599 595
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c
index 973b97bff..92ee038da 100644
--- a/src/core/test_core_api.c
+++ b/src/core/test_core_api.c
@@ -99,8 +99,7 @@ terminate_peer (struct PeerContext *p)
99 99
100 100
101static void 101static void
102terminate_task (void *cls, 102terminate_task (void *cls)
103 const struct GNUNET_SCHEDULER_TaskContext *tc)
104{ 103{
105 GNUNET_assert (ok == 6); 104 GNUNET_assert (ok == 6);
106 terminate_peer (&p1); 105 terminate_peer (&p1);
@@ -110,8 +109,7 @@ terminate_task (void *cls,
110 109
111 110
112static void 111static void
113terminate_task_error (void *cls, 112terminate_task_error (void *cls)
114 const struct GNUNET_SCHEDULER_TaskContext *tc)
115{ 113{
116 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 114 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
117 "ENDING ANGRILY %u\n", 115 "ENDING ANGRILY %u\n",
diff --git a/src/core/test_core_api_mq.c b/src/core/test_core_api_mq.c
index 3b063afca..a82465e74 100644
--- a/src/core/test_core_api_mq.c
+++ b/src/core/test_core_api_mq.c
@@ -96,8 +96,7 @@ handle_test (void *cls,
96 96
97 97
98static void 98static void
99shutdown_task (void *cls, 99shutdown_task (void *cls)
100 const struct GNUNET_SCHEDULER_TaskContext *tc)
101{ 100{
102 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 101 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
103 GNUNET_MQ_destroy (mq); 102 GNUNET_MQ_destroy (mq);
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c
index 5951e6c84..49affdff3 100644
--- a/src/core/test_core_api_reliability.c
+++ b/src/core/test_core_api_reliability.c
@@ -128,8 +128,7 @@ terminate_peer (struct PeerContext *p)
128 128
129 129
130static void 130static void
131terminate_task (void *cls, 131terminate_task (void *cls)
132 const struct GNUNET_SCHEDULER_TaskContext *tc)
133{ 132{
134 unsigned long long delta; 133 unsigned long long delta;
135 134
@@ -146,8 +145,7 @@ terminate_task (void *cls,
146 145
147 146
148static void 147static void
149terminate_task_error (void *cls, 148terminate_task_error (void *cls)
150 const struct GNUNET_SCHEDULER_TaskContext *tc)
151{ 149{
152 GNUNET_break (0); 150 GNUNET_break (0);
153 terminate_peer (&p1); 151 terminate_peer (&p1);
diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c
index 4b1a94cea..54dd29ca8 100644
--- a/src/core/test_core_api_send_to_self.c
+++ b/src/core/test_core_api_send_to_self.c
@@ -55,7 +55,7 @@ struct GNUNET_CORE_Handle *core;
55 * Function scheduled as very last function, cleans up after us 55 * Function scheduled as very last function, cleans up after us
56 */ 56 */
57static void 57static void
58cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tskctx) 58cleanup (void *cls)
59{ 59{
60 die_task = NULL; 60 die_task = NULL;
61 61
diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c
index 3cd777936..42bf4e452 100644
--- a/src/core/test_core_api_start_only.c
+++ b/src/core/test_core_api_start_only.c
@@ -92,7 +92,7 @@ static struct GNUNET_CORE_MessageHandler handlers[] = {
92 92
93 93
94static void 94static void
95shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 95shutdown_task (void *cls)
96{ 96{
97 GNUNET_CORE_disconnect (p1.ch); 97 GNUNET_CORE_disconnect (p1.ch);
98 p1.ch = NULL; 98 p1.ch = NULL;
@@ -144,7 +144,7 @@ setup_peer (struct PeerContext *p, const char *cfgname)
144 144
145 145
146static void 146static void
147timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 147timeout_task (void *cls)
148{ 148{
149 FPRINTF (stderr, "%s", "Timeout.\n"); 149 FPRINTF (stderr, "%s", "Timeout.\n");
150 if (p1.ch != NULL) 150 if (p1.ch != NULL)
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c
index 02b9b3f3e..ed895df42 100644
--- a/src/core/test_core_quota_compliance.c
+++ b/src/core/test_core_quota_compliance.c
@@ -152,8 +152,7 @@ terminate_peer (struct PeerContext *p)
152 152
153 153
154static void 154static void
155terminate_task (void *cls, 155terminate_task (void *cls)
156 const struct GNUNET_SCHEDULER_TaskContext *tc)
157{ 156{
158 err_task = NULL; 157 err_task = NULL;
159 terminate_peer (&p1); 158 terminate_peer (&p1);
@@ -162,11 +161,12 @@ terminate_task (void *cls,
162 161
163 162
164static void 163static void
165terminate_task_error (void *cls, 164terminate_task_error (void *cls)
166 const struct GNUNET_SCHEDULER_TaskContext *tc)
167{ 165{
168 err_task = NULL; 166 const struct GNUNET_SCHEDULER_TaskContext *tc;
169 167
168 err_task = NULL;
169 tc = GNUNET_SCHEDULER_get_task_context ();
170 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 170 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
171 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 171 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
172 "Testcase failed!\n"); 172 "Testcase failed!\n");
@@ -214,8 +214,7 @@ print_stat (void *cls,
214 214
215 215
216static void 216static void
217measurement_stop (void *cls, 217measurement_stop (void *cls)
218 const struct GNUNET_SCHEDULER_TaskContext *tc)
219{ 218{
220 unsigned long long delta; 219 unsigned long long delta;
221 unsigned long long throughput_out; 220 unsigned long long throughput_out;
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index cca67f6bc..832829e24 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -278,11 +278,9 @@ GNUNET_DATASTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
278 * Task used by 'transmit_drop' to disconnect the datastore. 278 * Task used by 'transmit_drop' to disconnect the datastore.
279 * 279 *
280 * @param cls the datastore handle 280 * @param cls the datastore handle
281 * @param tc scheduler context
282 */ 281 */
283static void 282static void
284disconnect_after_drop (void *cls, 283disconnect_after_drop (void *cls)
285 const struct GNUNET_SCHEDULER_TaskContext *tc)
286{ 284{
287 struct GNUNET_DATASTORE_Handle *h = cls; 285 struct GNUNET_DATASTORE_Handle *h = cls;
288 286
@@ -383,10 +381,9 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h,
383 * A request has timed out (before being transmitted to the service). 381 * A request has timed out (before being transmitted to the service).
384 * 382 *
385 * @param cls the `struct GNUNET_DATASTORE_QueueEntry` 383 * @param cls the `struct GNUNET_DATASTORE_QueueEntry`
386 * @param tc scheduler context
387 */ 384 */
388static void 385static void
389timeout_queue_entry (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 386timeout_queue_entry (void *cls)
390{ 387{
391 struct GNUNET_DATASTORE_QueueEntry *qe = cls; 388 struct GNUNET_DATASTORE_QueueEntry *qe = cls;
392 struct GNUNET_DATASTORE_Handle *h = qe->h; 389 struct GNUNET_DATASTORE_Handle *h = qe->h;
@@ -520,10 +517,9 @@ process_queue (struct GNUNET_DATASTORE_Handle *h);
520 * Try reconnecting to the datastore service. 517 * Try reconnecting to the datastore service.
521 * 518 *
522 * @param cls the `struct GNUNET_DATASTORE_Handle` 519 * @param cls the `struct GNUNET_DATASTORE_Handle`
523 * @param tc scheduler context
524 */ 520 */
525static void 521static void
526try_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 522try_reconnect (void *cls)
527{ 523{
528 struct GNUNET_DATASTORE_Handle *h = cls; 524 struct GNUNET_DATASTORE_Handle *h = cls;
529 525
diff --git a/src/datastore/gnunet-datastore.c b/src/datastore/gnunet-datastore.c
index 93c23c3fc..186889e4c 100644
--- a/src/datastore/gnunet-datastore.c
+++ b/src/datastore/gnunet-datastore.c
@@ -70,8 +70,7 @@ static struct GNUNET_DATASTORE_QueueEntry *qe;
70 70
71 71
72static void 72static void
73do_shutdown (void *cls, 73do_shutdown (void *cls)
74 const struct GNUNET_SCHEDULER_TaskContext *tc)
75{ 74{
76 if (NULL != qe) 75 if (NULL != qe)
77 GNUNET_DATASTORE_cancel (qe); 76 GNUNET_DATASTORE_cancel (qe);
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index 4979f4482..fdccd925e 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -303,11 +303,9 @@ static struct GNUNET_SERVER_Handle *server;
303 * content quickly. 303 * content quickly.
304 * 304 *
305 * @param cls not used 305 * @param cls not used
306 * @param tc task context
307 */ 306 */
308static void 307static void
309delete_expired (void *cls, 308delete_expired (void *cls);
310 const struct GNUNET_SCHEDULER_TaskContext *tc);
311 309
312 310
313/** 311/**
@@ -388,10 +386,9 @@ expired_processor (void *cls,
388 * content quickly. 386 * content quickly.
389 * 387 *
390 * @param cls not used 388 * @param cls not used
391 * @param tc task context
392 */ 389 */
393static void 390static void
394delete_expired (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 391delete_expired (void *cls)
395{ 392{
396 expired_kill_task = NULL; 393 expired_kill_task = NULL;
397 plugin->api->get_expiration (plugin->api->cls, &expired_processor, NULL); 394 plugin->api->get_expiration (plugin->api->cls, &expired_processor, NULL);
@@ -1579,8 +1576,7 @@ process_stat_done (void *cls,
1579 * Task run during shutdown. 1576 * Task run during shutdown.
1580 */ 1577 */
1581static void 1578static void
1582cleaning_task (void *cls, 1579cleaning_task (void *cls)
1583 const struct GNUNET_SCHEDULER_TaskContext *tc)
1584{ 1580{
1585 struct TransmitCallbackContext *tcc; 1581 struct TransmitCallbackContext *tcc;
1586 1582
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c
index e430bfe93..41cac1283 100644
--- a/src/datastore/perf_datastore_api.c
+++ b/src/datastore/perf_datastore_api.c
@@ -186,11 +186,9 @@ struct CpsRunContext
186 * depending on the current state. 186 * depending on the current state.
187 * 187 *
188 * @param cls the `struct CpsRunContext` 188 * @param cls the `struct CpsRunContext`
189 * @param tc scheduler context (unused)
190 */ 189 */
191static void 190static void
192run_continuation (void *cls, 191run_continuation (void *cls);
193 const struct GNUNET_SCHEDULER_TaskContext *tc);
194 192
195 193
196/** 194/**
@@ -344,18 +342,18 @@ delete_value (void *cls,
344 * depending on the current state. 342 * depending on the current state.
345 * 343 *
346 * @param cls the `struct CpsRunContext` 344 * @param cls the `struct CpsRunContext`
347 * @param tc scheduler context (unused)
348 */ 345 */
349static void 346static void
350run_continuation (void *cls, 347run_continuation (void *cls)
351 const struct GNUNET_SCHEDULER_TaskContext *tc)
352{ 348{
353 struct CpsRunContext *crc = cls; 349 struct CpsRunContext *crc = cls;
354 size_t size; 350 size_t size;
355 static struct GNUNET_HashCode key; 351 static struct GNUNET_HashCode key;
356 static char data[65536]; 352 static char data[65536];
357 char gstr[128]; 353 char gstr[128];
354 const struct GNUNET_SCHEDULER_TaskContext *tc;
358 355
356 tc = GNUNET_SCHEDULER_get_task_context ();
359 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 357 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
360 crc->phase = RP_ERROR; 358 crc->phase = RP_ERROR;
361 ok = (int) crc->phase; 359 ok = (int) crc->phase;
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c
index 4365fbd25..0aeb426ab 100644
--- a/src/datastore/perf_plugin_datastore.c
+++ b/src/datastore/perf_plugin_datastore.c
@@ -99,8 +99,7 @@ disk_utilization_change_cb (void *cls, int delta)
99 99
100 100
101static void 101static void
102test (void *cls, 102test (void *cls);
103 const struct GNUNET_SCHEDULER_TaskContext *tc);
104 103
105 104
106/** 105/**
@@ -115,8 +114,8 @@ test (void *cls,
115static void 114static void
116put_continuation (void *cls, 115put_continuation (void *cls,
117 const struct GNUNET_HashCode *key, 116 const struct GNUNET_HashCode *key,
118 uint32_t size, 117 uint32_t size,
119 int status, 118 int status,
120 const char *msg) 119 const char *msg)
121{ 120{
122 struct CpsRunContext *crc = cls; 121 struct CpsRunContext *crc = cls;
@@ -376,7 +375,7 @@ unload_plugin (struct GNUNET_DATASTORE_PluginFunctions *api,
376 * the transport and core. 375 * the transport and core.
377 */ 376 */
378static void 377static void
379cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 378cleaning_task (void *cls)
380{ 379{
381 struct CpsRunContext *crc = cls; 380 struct CpsRunContext *crc = cls;
382 381
@@ -386,10 +385,12 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
386 385
387 386
388static void 387static void
389test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 388test (void *cls)
390{ 389{
391 struct CpsRunContext *crc = cls; 390 struct CpsRunContext *crc = cls;
391 const struct GNUNET_SCHEDULER_TaskContext *tc;
392 392
393 tc = GNUNET_SCHEDULER_get_task_context ();
393 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 394 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
394 { 395 {
395 GNUNET_break (0); 396 GNUNET_break (0);
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c
index 12f2ef762..7d4565de6 100644
--- a/src/datastore/test_datastore_api.c
+++ b/src/datastore/test_datastore_api.c
@@ -168,11 +168,9 @@ struct CpsRunContext
168 * depending on the current state. 168 * depending on the current state.
169 * 169 *
170 * @param cls the `struct CpsRunContext` 170 * @param cls the `struct CpsRunContext`
171 * @param tc scheduler context (unused)
172 */ 171 */
173static void 172static void
174run_continuation (void *cls, 173run_continuation (void *cls);
175 const struct GNUNET_SCHEDULER_TaskContext *tc);
176 174
177 175
178/** 176/**
@@ -394,11 +392,9 @@ check_update (void *cls,
394 * depending on the current state. 392 * depending on the current state.
395 * 393 *
396 * @param cls the `struct CpsRunContext` 394 * @param cls the `struct CpsRunContext`
397 * @param tc scheduler context (unused)
398 */ 395 */
399static void 396static void
400run_continuation (void *cls, 397run_continuation (void *cls)
401 const struct GNUNET_SCHEDULER_TaskContext *tc)
402{ 398{
403 struct CpsRunContext *crc = cls; 399 struct CpsRunContext *crc = cls;
404 400
diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c
index 9ef83c55c..c9fec79e3 100644
--- a/src/datastore/test_datastore_api_management.c
+++ b/src/datastore/test_datastore_api_management.c
@@ -119,7 +119,7 @@ get_expiration (int i)
119 119
120 120
121static void 121static void
122run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 122run_continuation (void *cls);
123 123
124 124
125static void 125static void
@@ -182,7 +182,7 @@ check_nothing (void *cls, const struct GNUNET_HashCode * key, size_t size,
182 182
183 183
184static void 184static void
185run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 185run_continuation (void *cls)
186{ 186{
187 struct CpsRunContext *crc = cls; 187 struct CpsRunContext *crc = cls;
188 188
diff --git a/src/datastore/test_plugin_datastore.c b/src/datastore/test_plugin_datastore.c
index 4efad74be..d7dff1041 100644
--- a/src/datastore/test_plugin_datastore.c
+++ b/src/datastore/test_plugin_datastore.c
@@ -84,8 +84,7 @@ disk_utilization_change_cb (void *cls, int delta)
84 84
85 85
86static void 86static void
87test (void *cls, 87test (void *cls);
88 const struct GNUNET_SCHEDULER_TaskContext *tc);
89 88
90 89
91/** 90/**
@@ -98,10 +97,10 @@ test (void *cls,
98 * @param msg error message on error 97 * @param msg error message on error
99 */ 98 */
100static void 99static void
101put_continuation (void *cls, 100put_continuation (void *cls,
102 const struct GNUNET_HashCode *key, 101 const struct GNUNET_HashCode *key,
103 uint32_t size, 102 uint32_t size,
104 int status, 103 int status,
105 const char *msg) 104 const char *msg)
106{ 105{
107 struct CpsRunContext *crc = cls; 106 struct CpsRunContext *crc = cls;
@@ -241,7 +240,7 @@ unload_plugin (struct GNUNET_DATASTORE_PluginFunctions *api,
241 * the transport and core. 240 * the transport and core.
242 */ 241 */
243static void 242static void
244cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 243cleaning_task (void *cls)
245{ 244{
246 struct CpsRunContext *crc = cls; 245 struct CpsRunContext *crc = cls;
247 246
@@ -251,7 +250,7 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
251 250
252 251
253static void 252static void
254update_continuation (void *cls, 253update_continuation (void *cls,
255 int status, 254 int status,
256 const char *msg) 255 const char *msg)
257{ 256{
@@ -264,11 +263,13 @@ update_continuation (void *cls,
264 263
265 264
266static void 265static void
267test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 266test (void *cls)
268{ 267{
269 struct CpsRunContext *crc = cls; 268 struct CpsRunContext *crc = cls;
270 struct GNUNET_HashCode key; 269 struct GNUNET_HashCode key;
270 const struct GNUNET_SCHEDULER_TaskContext *tc;
271 271
272 tc = GNUNET_SCHEDULER_get_task_context ();
272 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 273 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
273 { 274 {
274 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Test aborted.\n"); 275 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Test aborted.\n");
@@ -302,9 +303,9 @@ test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
302 case RP_UPDATE: 303 case RP_UPDATE:
303 crc->api->update (crc->api->cls, 304 crc->api->update (crc->api->cls,
304 guid, 305 guid,
305 1, 306 1,
306 GNUNET_TIME_UNIT_ZERO_ABS, 307 GNUNET_TIME_UNIT_ZERO_ABS,
307 &update_continuation, 308 &update_continuation,
308 crc); 309 crc);
309 break; 310 break;
310 311
@@ -344,8 +345,8 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg)
344 char *libname; 345 char *libname;
345 346
346 if (GNUNET_OK != 347 if (GNUNET_OK !=
347 GNUNET_CONFIGURATION_get_value_string (cfg, 348 GNUNET_CONFIGURATION_get_value_string (cfg,
348 "DATASTORE", 349 "DATASTORE",
349 "DATABASE", 350 "DATABASE",
350 &name)) 351 &name))
351 { 352 {
@@ -366,7 +367,7 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg)
366 FPRINTF (stderr, "Failed to load plugin `%s'!\n", name); 367 FPRINTF (stderr, "Failed to load plugin `%s'!\n", name);
367 GNUNET_free (libname); 368 GNUNET_free (libname);
368 GNUNET_free (name); 369 GNUNET_free (name);
369 ok = 77; /* mark test as skipped */ 370 ok = 77; /* mark test as skipped */
370 return NULL; 371 return NULL;
371 } 372 }
372 GNUNET_free (libname); 373 GNUNET_free (libname);
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c
index 35d9580e9..b5ae2f8ce 100644
--- a/src/dht/dht_api.c
+++ b/src/dht/dht_api.c
@@ -362,7 +362,7 @@ struct GNUNET_DHT_Handle
362 * Did we start our receive loop yet? 362 * Did we start our receive loop yet?
363 */ 363 */
364 int in_receive; 364 int in_receive;
365 365
366#if ENABLE_MALICIOUS 366#if ENABLE_MALICIOUS
367 /** 367 /**
368 * Handle of act malicious request. 368 * Handle of act malicious request.
@@ -496,11 +496,9 @@ process_pending_messages (struct GNUNET_DHT_Handle *handle);
496 * Try reconnecting to the dht service. 496 * Try reconnecting to the dht service.
497 * 497 *
498 * @param cls a `struct GNUNET_DHT_Handle` 498 * @param cls a `struct GNUNET_DHT_Handle`
499 * @param tc scheduler context
500 */ 499 */
501static void 500static void
502try_reconnect (void *cls, 501try_reconnect (void *cls)
503 const struct GNUNET_SCHEDULER_TaskContext *tc)
504{ 502{
505 struct GNUNET_DHT_Handle *handle = cls; 503 struct GNUNET_DHT_Handle *handle = cls;
506 504
@@ -650,7 +648,7 @@ transmit_pending (void *cls,
650 head->in_pending_queue = GNUNET_NO; 648 head->in_pending_queue = GNUNET_NO;
651 if (NULL != head->cont) 649 if (NULL != head->cont)
652 { 650 {
653 head->cont (head->cont_cls, NULL); 651 head->cont (head->cont_cls);
654 head->cont = NULL; 652 head->cont = NULL;
655 head->cont_cls = NULL; 653 head->cont_cls = NULL;
656 } 654 }
@@ -663,7 +661,7 @@ transmit_pending (void *cls,
663 { 661 {
664 LOG (GNUNET_ERROR_TYPE_DEBUG, "Starting to process replies from DHT\n"); 662 LOG (GNUNET_ERROR_TYPE_DEBUG, "Starting to process replies from DHT\n");
665 handle->in_receive = GNUNET_YES; 663 handle->in_receive = GNUNET_YES;
666 664
667 GNUNET_CLIENT_receive (handle->client, &service_message_handler, handle, 665 GNUNET_CLIENT_receive (handle->client, &service_message_handler, handle,
668 GNUNET_TIME_UNIT_FOREVER_REL); 666 GNUNET_TIME_UNIT_FOREVER_REL);
669 } 667 }
@@ -899,7 +897,7 @@ process_act_malicious_confirmation_message (struct GNUNET_DHT_Handle *handle,
899 struct GNUNET_DHT_ActMaliciousHandle *mh; 897 struct GNUNET_DHT_ActMaliciousHandle *mh;
900 GNUNET_DHT_PutContinuation cont; 898 GNUNET_DHT_PutContinuation cont;
901 void *cont_cls; 899 void *cont_cls;
902 900
903 mh = handle->mh; 901 mh = handle->mh;
904 if (NULL == mh) 902 if (NULL == mh)
905 return GNUNET_OK; 903 return GNUNET_OK;
@@ -907,7 +905,7 @@ process_act_malicious_confirmation_message (struct GNUNET_DHT_Handle *handle,
907 cont_cls = mh->cont_cls; 905 cont_cls = mh->cont_cls;
908 if (NULL != cont) 906 if (NULL != cont)
909 cont (cont_cls, GNUNET_OK); 907 cont (cont_cls, GNUNET_OK);
910 908
911 return GNUNET_OK; 909 return GNUNET_OK;
912} 910}
913#endif 911#endif
@@ -1110,7 +1108,7 @@ GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle)
1110 pm->in_pending_queue = GNUNET_NO; 1108 pm->in_pending_queue = GNUNET_NO;
1111 GNUNET_assert (GNUNET_YES == pm->free_on_send); 1109 GNUNET_assert (GNUNET_YES == pm->free_on_send);
1112 if (NULL != pm->cont) 1110 if (NULL != pm->cont)
1113 pm->cont (pm->cont_cls, NULL); 1111 pm->cont (pm->cont_cls);
1114 GNUNET_free (pm); 1112 GNUNET_free (pm);
1115 } 1113 }
1116 while (NULL != (ph = handle->put_head)) 1114 while (NULL != (ph = handle->put_head))
@@ -1137,11 +1135,9 @@ GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle)
1137 * Timeout for the transmission of a fire&forget-request. Clean it up. 1135 * Timeout for the transmission of a fire&forget-request. Clean it up.
1138 * 1136 *
1139 * @param cls the `struct GNUNET_DHT_PutHandle *` 1137 * @param cls the `struct GNUNET_DHT_PutHandle *`
1140 * @param tc scheduler context
1141 */ 1138 */
1142static void 1139static void
1143timeout_put_request (void *cls, 1140timeout_put_request (void *cls)
1144 const struct GNUNET_SCHEDULER_TaskContext *tc)
1145{ 1141{
1146 struct GNUNET_DHT_PutHandle *ph = cls; 1142 struct GNUNET_DHT_PutHandle *ph = cls;
1147 struct GNUNET_DHT_Handle *handle = ph->dht_handle; 1143 struct GNUNET_DHT_Handle *handle = ph->dht_handle;
@@ -1168,11 +1164,9 @@ timeout_put_request (void *cls,
1168 * the message pointer in the put handle to NULL. 1164 * the message pointer in the put handle to NULL.
1169 * 1165 *
1170 * @param cls the `struct GNUNET_DHT_PutHandle` 1166 * @param cls the `struct GNUNET_DHT_PutHandle`
1171 * @param tc unused
1172 */ 1167 */
1173static void 1168static void
1174mark_put_message_gone (void *cls, 1169mark_put_message_gone (void *cls)
1175 const struct GNUNET_SCHEDULER_TaskContext *tc)
1176{ 1170{
1177 struct GNUNET_DHT_PutHandle *ph = cls; 1171 struct GNUNET_DHT_PutHandle *ph = cls;
1178 1172
@@ -1570,10 +1564,10 @@ GNUNET_DHT_monitor_stop (struct GNUNET_DHT_MonitorHandle *handle)
1570 * @param handle the DHT handle 1564 * @param handle the DHT handle
1571 * @param action 1 to make the service malicious; 0 to make it benign 1565 * @param action 1 to make the service malicious; 0 to make it benign
1572 * @param cont continuation to call when done (transmitting request to service) 1566 * @param cont continuation to call when done (transmitting request to service)
1573 * @param cont_cls closure for @a cont 1567 * @param cont_cls closure for @a cont
1574 */ 1568 */
1575struct GNUNET_DHT_ActMaliciousHandle * 1569struct GNUNET_DHT_ActMaliciousHandle *
1576GNUNET_DHT_act_malicious (struct GNUNET_DHT_Handle *handle, 1570GNUNET_DHT_act_malicious (struct GNUNET_DHT_Handle *handle,
1577 unsigned int action, 1571 unsigned int action,
1578 GNUNET_DHT_PutContinuation cont, 1572 GNUNET_DHT_PutContinuation cont,
1579 void *cont_cls) 1573 void *cont_cls)
@@ -1582,7 +1576,7 @@ GNUNET_DHT_act_malicious (struct GNUNET_DHT_Handle *handle,
1582 struct GNUNET_DHT_ActMaliciousHandle *mh; 1576 struct GNUNET_DHT_ActMaliciousHandle *mh;
1583 struct PendingMessage *pending; 1577 struct PendingMessage *pending;
1584 size_t msize; 1578 size_t msize;
1585 1579
1586 msize = sizeof(struct GNUNET_DHT_ActMaliciousMessage); 1580 msize = sizeof(struct GNUNET_DHT_ActMaliciousMessage);
1587 if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE) 1581 if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
1588 { 1582 {
diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c
index 7349d0c82..6846b3af7 100644
--- a/src/dht/gnunet-dht-get.c
+++ b/src/dht/gnunet-dht-get.c
@@ -87,10 +87,9 @@ static int ret;
87 * Task run to clean up on timeout. 87 * Task run to clean up on timeout.
88 * 88 *
89 * @param cls unused 89 * @param cls unused
90 * @param tc unused
91 */ 90 */
92static void 91static void
93cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 92cleanup_task (void *cls)
94{ 93{
95 if (NULL != get_handle) 94 if (NULL != get_handle)
96 { 95 {
diff --git a/src/dht/gnunet-dht-monitor.c b/src/dht/gnunet-dht-monitor.c
index 9047ba685..0502496d7 100644
--- a/src/dht/gnunet-dht-monitor.c
+++ b/src/dht/gnunet-dht-monitor.c
@@ -76,10 +76,9 @@ static int ret;
76 * Stop monitoring request and start shutdown 76 * Stop monitoring request and start shutdown
77 * 77 *
78 * @param cls closure (unused) 78 * @param cls closure (unused)
79 * @param tc Task Context
80 */ 79 */
81static void 80static void
82cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 81cleanup_task (void *cls)
83{ 82{
84 if (verbose) 83 if (verbose)
85 FPRINTF (stderr, "%s", "Cleaning up!\n"); 84 FPRINTF (stderr, "%s", "Cleaning up!\n");
diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c
index c58311876..19e385be1 100644
--- a/src/dht/gnunet-dht-put.c
+++ b/src/dht/gnunet-dht-put.c
@@ -87,8 +87,9 @@ static int ret;
87 */ 87 */
88static char *data; 88static char *data;
89 89
90
90static void 91static void
91shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 92shutdown_task (void *cls)
92{ 93{
93 if (NULL != dht_handle) 94 if (NULL != dht_handle)
94 { 95 {
@@ -101,9 +102,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
101 * Signature of the main function of a task. 102 * Signature of the main function of a task.
102 * 103 *
103 * @param cls closure 104 * @param cls closure
104 * @param success GNUNET_OK if the PUT was transmitted, 105 * @param success #GNUNET_OK if the PUT was transmitted,
105 * GNUNET_NO on timeout, 106 * #GNUNET_NO on timeout,
106 * GNUNET_SYSERR on disconnect from service 107 * #GNUNET_SYSERR on disconnect from service
107 * after the PUT message was transmitted 108 * after the PUT message was transmitted
108 * (so we don't know if it was received or not) 109 * (so we don't know if it was received or not)
109 */ 110 */
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c
index 006364664..1aeca9b85 100644
--- a/src/dht/gnunet-service-dht.c
+++ b/src/dht/gnunet-service-dht.c
@@ -98,10 +98,9 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message)
98 * Task run during shutdown. 98 * Task run during shutdown.
99 * 99 *
100 * @param cls unused 100 * @param cls unused
101 * @param tc unused
102 */ 101 */
103static void 102static void
104shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 103shutdown_task (void *cls)
105{ 104{
106 if (NULL != ghh) 105 if (NULL != ghh)
107 { 106 {
@@ -159,10 +158,11 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
159 GDS_CLIENTS_init (server); 158 GDS_CLIENTS_init (server);
160 if (GNUNET_OK != GDS_NEIGHBOURS_init ()) 159 if (GNUNET_OK != GDS_NEIGHBOURS_init ())
161 { 160 {
162 shutdown_task (NULL, NULL); 161 shutdown_task (NULL);
163 return; 162 return;
164 } 163 }
165 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, 164 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
165 &shutdown_task,
166 NULL); 166 NULL);
167 GDS_transport_handle = 167 GDS_transport_handle =
168 GNUNET_TRANSPORT_connect (GDS_cfg, NULL, NULL, NULL, NULL, NULL); 168 GNUNET_TRANSPORT_connect (GDS_cfg, NULL, NULL, NULL, NULL, NULL);
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index 30eb6afa6..e42069fe0 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -450,16 +450,16 @@ transmit_request (struct ClientQueryRecord *cqr)
450 * itself (unless the heap is empty). 450 * itself (unless the heap is empty).
451 * 451 *
452 * @param cls unused 452 * @param cls unused
453 * @param tc scheduler context
454 */ 453 */
455static void 454static void
456transmit_next_request_task (void *cls, 455transmit_next_request_task (void *cls)
457 const struct GNUNET_SCHEDULER_TaskContext *tc)
458{ 456{
459 struct ClientQueryRecord *cqr; 457 struct ClientQueryRecord *cqr;
460 struct GNUNET_TIME_Relative delay; 458 struct GNUNET_TIME_Relative delay;
459 const struct GNUNET_SCHEDULER_TaskContext *tc;
461 460
462 retry_task = NULL; 461 retry_task = NULL;
462 tc = GNUNET_SCHEDULER_get_task_context ();
463 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 463 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
464 return; 464 return;
465 while (NULL != (cqr = GNUNET_CONTAINER_heap_remove_root (retry_heap))) 465 while (NULL != (cqr = GNUNET_CONTAINER_heap_remove_root (retry_heap)))
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index cedafbd6c..d82effb34 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -492,11 +492,9 @@ find_bucket (const struct GNUNET_HashCode *hc)
492 * Clean up the "oh" field in the @a cls 492 * Clean up the "oh" field in the @a cls
493 * 493 *
494 * @param cls a `struct ConnectInfo` 494 * @param cls a `struct ConnectInfo`
495 * @param tc unused
496 */ 495 */
497static void 496static void
498offer_hello_done (void *cls, 497offer_hello_done (void *cls)
499 const struct GNUNET_SCHEDULER_TaskContext *tc)
500{ 498{
501 struct ConnectInfo *ci = cls; 499 struct ConnectInfo *ci = cls;
502 500
@@ -707,17 +705,17 @@ add_known_to_bloom (void *cls,
707 * and attempt to connect to them. 705 * and attempt to connect to them.
708 * 706 *
709 * @param cls closure for this task 707 * @param cls closure for this task
710 * @param tc the context under which the task is running
711 */ 708 */
712static void 709static void
713send_find_peer_message (void *cls, 710send_find_peer_message (void *cls)
714 const struct GNUNET_SCHEDULER_TaskContext *tc)
715{ 711{
716 struct GNUNET_TIME_Relative next_send_time; 712 struct GNUNET_TIME_Relative next_send_time;
717 struct BloomConstructorContext bcc; 713 struct BloomConstructorContext bcc;
718 struct GNUNET_CONTAINER_BloomFilter *peer_bf; 714 struct GNUNET_CONTAINER_BloomFilter *peer_bf;
715 const struct GNUNET_SCHEDULER_TaskContext *tc;
719 716
720 find_peer_task = NULL; 717 find_peer_task = NULL;
718 tc = GNUNET_SCHEDULER_get_task_context ();
721 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 719 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
722 return; 720 return;
723 if (newly_found_peers > bucket_size) 721 if (newly_found_peers > bucket_size)
diff --git a/src/dht/gnunet-service-wdht.c b/src/dht/gnunet-service-wdht.c
index 339b38aa4..0668c9078 100644
--- a/src/dht/gnunet-service-wdht.c
+++ b/src/dht/gnunet-service-wdht.c
@@ -60,10 +60,9 @@ const struct GNUNET_CONFIGURATION_Handle *GDS_cfg;
60 * Task run during shutdown. 60 * Task run during shutdown.
61 * 61 *
62 * @param cls unused 62 * @param cls unused
63 * @param tc unused
64 */ 63 */
65static void 64static void
66shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 65shutdown_task (void *cls)
67{ 66{
68 GDS_NEIGHBOURS_done (); 67 GDS_NEIGHBOURS_done ();
69 GDS_DATACACHE_done (); 68 GDS_DATACACHE_done ();
@@ -100,7 +99,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
100 GDS_CLIENTS_init (server); 99 GDS_CLIENTS_init (server);
101 if (GNUNET_OK != GDS_NEIGHBOURS_init ()) 100 if (GNUNET_OK != GDS_NEIGHBOURS_init ())
102 { 101 {
103 shutdown_task (NULL, NULL); 102 shutdown_task (NULL);
104 return; 103 return;
105 } 104 }
106 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 105 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
diff --git a/src/dht/gnunet-service-wdht_clients.c b/src/dht/gnunet-service-wdht_clients.c
index 0662472a8..c3aff03aa 100644
--- a/src/dht/gnunet-service-wdht_clients.c
+++ b/src/dht/gnunet-service-wdht_clients.c
@@ -874,16 +874,16 @@ transmit_request (struct ClientQueryRecord *cqr)
874 * itself (unless the heap is empty). 874 * itself (unless the heap is empty).
875 * 875 *
876 * @param cls unused 876 * @param cls unused
877 * @param tc scheduler context
878 */ 877 */
879static void 878static void
880transmit_next_request_task (void *cls, 879transmit_next_request_task (void *cls)
881 const struct GNUNET_SCHEDULER_TaskContext *tc)
882{ 880{
883 struct ClientQueryRecord *cqr; 881 struct ClientQueryRecord *cqr;
884 struct GNUNET_TIME_Relative delay; 882 struct GNUNET_TIME_Relative delay;
883 const struct GNUNET_SCHEDULER_TaskContext *tc;
885 884
886 retry_task = NULL; 885 retry_task = NULL;
886 tc = GNUNET_SCHEDULER_get_task_context ();
887 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 887 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
888 return; 888 return;
889 while (NULL != (cqr = GNUNET_CONTAINER_heap_remove_root (retry_heap))) 889 while (NULL != (cqr = GNUNET_CONTAINER_heap_remove_root (retry_heap)))
diff --git a/src/dht/gnunet-service-wdht_neighbours.c b/src/dht/gnunet-service-wdht_neighbours.c
index ef73c80a9..54c52507e 100644
--- a/src/dht/gnunet-service-wdht_neighbours.c
+++ b/src/dht/gnunet-service-wdht_neighbours.c
@@ -931,11 +931,9 @@ pick_random_friend ()
931 * possibly initiate cleanup. 931 * possibly initiate cleanup.
932 * 932 *
933 * @param cls NULL 933 * @param cls NULL
934 * @param tc unused
935 */ 934 */
936static void 935static void
937trail_timeout_callback (void *cls, 936trail_timeout_callback (void *cls)
938 const struct GNUNET_SCHEDULER_TaskContext *tc)
939{ 937{
940 struct Trail *trail; 938 struct Trail *trail;
941 struct GNUNET_TIME_Relative left; 939 struct GNUNET_TIME_Relative left;
@@ -974,11 +972,9 @@ get_desired_finger_array_size ()
974 * Initiate a random walk. 972 * Initiate a random walk.
975 * 973 *
976 * @param cls NULL 974 * @param cls NULL
977 * @param tc unused
978 */ 975 */
979static void 976static void
980do_random_walk (void *cls, 977do_random_walk (void *cls)
981 const struct GNUNET_SCHEDULER_TaskContext *tc)
982{ 978{
983 static unsigned int walk_layer; 979 static unsigned int walk_layer;
984 struct FriendInfo *friend; 980 struct FriendInfo *friend;
diff --git a/src/dht/gnunet-service-xdht.c b/src/dht/gnunet-service-xdht.c
index 3bab7e946..f6c7c5167 100644
--- a/src/dht/gnunet-service-xdht.c
+++ b/src/dht/gnunet-service-xdht.c
@@ -73,10 +73,9 @@ unsigned int malicious;
73 * Task run during shutdown. 73 * Task run during shutdown.
74 * 74 *
75 * @param cls unused 75 * @param cls unused
76 * @param tc unused
77 */ 76 */
78static void 77static void
79shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 78shutdown_task (void *cls)
80{ 79{
81 GDS_NEIGHBOURS_done (); 80 GDS_NEIGHBOURS_done ();
82 GDS_DATACACHE_done (); 81 GDS_DATACACHE_done ();
@@ -123,7 +122,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
123 } 122 }
124 if (GNUNET_OK != GDS_NEIGHBOURS_init ()) 123 if (GNUNET_OK != GDS_NEIGHBOURS_init ())
125 { 124 {
126 shutdown_task (NULL, NULL); 125 shutdown_task (NULL);
127 return; 126 return;
128 } 127 }
129 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 128 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
diff --git a/src/dht/gnunet-service-xdht_clients.c b/src/dht/gnunet-service-xdht_clients.c
index 1a1ee9e82..e08ccf792 100644
--- a/src/dht/gnunet-service-xdht_clients.c
+++ b/src/dht/gnunet-service-xdht_clients.c
@@ -871,16 +871,16 @@ transmit_request (struct ClientQueryRecord *cqr)
871 * itself (unless the heap is empty). 871 * itself (unless the heap is empty).
872 * 872 *
873 * @param cls unused 873 * @param cls unused
874 * @param tc scheduler context
875 */ 874 */
876static void 875static void
877transmit_next_request_task (void *cls, 876transmit_next_request_task (void *cls)
878 const struct GNUNET_SCHEDULER_TaskContext *tc)
879{ 877{
880 struct ClientQueryRecord *cqr; 878 struct ClientQueryRecord *cqr;
881 struct GNUNET_TIME_Relative delay; 879 struct GNUNET_TIME_Relative delay;
880 const struct GNUNET_SCHEDULER_TaskContext *tc;
882 881
883 retry_task = NULL; 882 retry_task = NULL;
883 tc = GNUNET_SCHEDULER_get_task_context ();
884 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 884 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
885 return; 885 return;
886 while (NULL != (cqr = GNUNET_CONTAINER_heap_remove_root (retry_heap))) 886 while (NULL != (cqr = GNUNET_CONTAINER_heap_remove_root (retry_heap)))
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c
index 96fdaa9d7..c6de94a5a 100644
--- a/src/dht/gnunet-service-xdht_neighbours.c
+++ b/src/dht/gnunet-service-xdht_neighbours.c
@@ -2674,11 +2674,9 @@ compute_finger_identity_value (unsigned int finger_index)
2674 * finger identity through this random friend. 2674 * finger identity through this random friend.
2675 * 2675 *
2676 * @param cls closure for this task 2676 * @param cls closure for this task
2677 * @param tc the context under which the task is running
2678 */ 2677 */
2679static void 2678static void
2680send_find_finger_trail_message (void *cls, 2679send_find_finger_trail_message (void *cls)
2681 const struct GNUNET_SCHEDULER_TaskContext *tc)
2682{ 2680{
2683 struct FriendInfo *target_friend; 2681 struct FriendInfo *target_friend;
2684 struct GNUNET_HashCode trail_id; 2682 struct GNUNET_HashCode trail_id;
@@ -3219,12 +3217,11 @@ add_new_finger (struct GNUNET_PeerIdentity finger_identity,
3219 * Periodic task to verify current successor. There can be multiple trails to reach 3217 * Periodic task to verify current successor. There can be multiple trails to reach
3220 * to successor, choose the shortest one and send verify successor message 3218 * to successor, choose the shortest one and send verify successor message
3221 * across that trail. 3219 * across that trail.
3220 *
3222 * @param cls closure for this task 3221 * @param cls closure for this task
3223 * @param tc the context under which the task is running
3224 */ 3222 */
3225static void 3223static void
3226send_verify_successor_message (void *cls, 3224send_verify_successor_message (void *cls)
3227 const struct GNUNET_SCHEDULER_TaskContext *tc)
3228{ 3225{
3229 struct FriendInfo *target_friend; 3226 struct FriendInfo *target_friend;
3230 struct GNUNET_HashCode trail_id; 3227 struct GNUNET_HashCode trail_id;
@@ -5077,10 +5074,10 @@ struct SendNotifyContext
5077 unsigned int num_retries_scheduled; 5074 unsigned int num_retries_scheduled;
5078}; 5075};
5079 5076
5077
5080void 5078void
5081send_notify_new_successor (void *cls, 5079send_notify_new_successor (void *cls);
5082 const struct GNUNET_SCHEDULER_TaskContext 5080
5083 * tc);
5084 5081
5085/** 5082/**
5086 * Check if the peer which sent us verify successor result message is still ours 5083 * Check if the peer which sent us verify successor result message is still ours
@@ -5250,11 +5247,9 @@ compare_and_update_successor (struct GNUNET_PeerIdentity curr_succ,
5250 5247
5251 5248
5252void 5249void
5253send_notify_new_successor (void *cls, 5250send_notify_new_successor (void *cls)
5254 const struct GNUNET_SCHEDULER_TaskContext
5255 * tc)
5256{ 5251{
5257 struct SendNotifyContext *ctx = (struct SendNotifyContext *) cls; 5252 struct SendNotifyContext *ctx = cls;
5258 5253
5259 GDS_NEIGHBOURS_send_notify_new_successor (ctx->source_peer, 5254 GDS_NEIGHBOURS_send_notify_new_successor (ctx->source_peer,
5260 ctx->successor, 5255 ctx->successor,
diff --git a/src/dht/gnunet_dht_profiler.c b/src/dht/gnunet_dht_profiler.c
index 7d6ac685a..f0c4ec7be 100644
--- a/src/dht/gnunet_dht_profiler.c
+++ b/src/dht/gnunet_dht_profiler.c
@@ -406,28 +406,30 @@ static int in_shutdown = 0;
406 */ 406 */
407static unsigned int tries; 407static unsigned int tries;
408 408
409
409/** 410/**
410 * Task that collects successor statistics from all the peers. 411 * Task that collects successor statistics from all the peers.
412 *
411 * @param cls 413 * @param cls
412 * @param tc
413 */ 414 */
414static void 415static void
415collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 416collect_stats (void *cls);
417
416 418
417/** 419/**
418 * Connect to DHT services of active peers 420 * Connect to DHT services of active peers
419 */ 421 */
420static void 422static void
421start_profiling(); 423start_profiling (void);
424
422 425
423/** 426/**
424 * Shutdown task. Cleanup all resources and operations. 427 * Shutdown task. Cleanup all resources and operations.
425 * 428 *
426 * @param cls NULL 429 * @param cls NULL
427 * @param tc scheduler task context
428 */ 430 */
429static void 431static void
430do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 432do_shutdown (void *cls)
431{ 433{
432 struct ActiveContext *ac; 434 struct ActiveContext *ac;
433 unsigned int cnt; 435 unsigned int cnt;
@@ -546,10 +548,9 @@ summarize ()
546 * Task to cancel DHT GET. 548 * Task to cancel DHT GET.
547 * 549 *
548 * @param cls NULL 550 * @param cls NULL
549 * @param tc scheduler task context
550 */ 551 */
551static void 552static void
552cancel_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 553cancel_get (void *cls)
553{ 554{
554 struct ActiveContext *ac = cls; 555 struct ActiveContext *ac = cls;
555 struct Context *ctx = ac->ctx; 556 struct Context *ctx = ac->ctx;
@@ -637,10 +638,9 @@ get_iter (void *cls,
637 * Task to do DHT GETs 638 * Task to do DHT GETs
638 * 639 *
639 * @param cls the active context 640 * @param cls the active context
640 * @param tc the scheduler task context
641 */ 641 */
642static void 642static void
643delayed_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 643delayed_get (void *cls)
644{ 644{
645 struct ActiveContext *ac = cls; 645 struct ActiveContext *ac = cls;
646 struct ActiveContext *get_ac; 646 struct ActiveContext *get_ac;
@@ -681,14 +681,15 @@ delayed_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
681 * clear the operation during shutdown. 681 * clear the operation during shutdown.
682 * 682 *
683 * @param cls the context 683 * @param cls the context
684 * @return tc scheduler task context.
685 */ 684 */
686static void 685static void
687teardown_dht_connection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 686teardown_dht_connection (void *cls)
688{ 687{
689 struct Context *ctx = cls; 688 struct Context *ctx = cls;
690 struct GNUNET_TESTBED_Operation *op; 689 struct GNUNET_TESTBED_Operation *op;
690 const struct GNUNET_SCHEDULER_TaskContext *tc;
691 691
692 tc = GNUNET_SCHEDULER_get_task_context ();
692 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 693 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
693 return; 694 return;
694 GNUNET_assert (NULL != ctx); 695 GNUNET_assert (NULL != ctx);
@@ -725,13 +726,12 @@ put_cont (void *cls, int success)
725 726
726 727
727/** 728/**
728 * Task to do DHT PUTS 729 * Task to do DHT PUTs
729 * 730 *
730 * @param cls the active context 731 * @param cls the active context
731 * @param tc the scheduler task context
732 */ 732 */
733static void 733static void
734delayed_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 734delayed_put (void *cls)
735{ 735{
736 struct ActiveContext *ac = cls; 736 struct ActiveContext *ac = cls;
737 737
@@ -1210,15 +1210,18 @@ successor_stats_iterator (void *cls,
1210 * Task that collects peer and its corresponding successors. 1210 * Task that collects peer and its corresponding successors.
1211 * 1211 *
1212 * @param cls Closure (NULL). 1212 * @param cls Closure (NULL).
1213 * @param tc Task Context.
1214 */ 1213 */
1215static void 1214static void
1216collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1215collect_stats (void *cls)
1217{ 1216{
1217 const struct GNUNET_SCHEDULER_TaskContext *tc;
1218
1219 tc = GNUNET_SCHEDULER_get_task_context ();
1218 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 1220 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
1219 return; 1221 return;
1220 1222
1221 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Start collecting statistics...\n"); 1223 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1224 "Start collecting statistics...\n");
1222 GNUNET_assert(NULL != testbed_handles); 1225 GNUNET_assert(NULL != testbed_handles);
1223 1226
1224 if (0 != max_searches) 1227 if (0 != max_searches)
diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c
index b2d31d02f..2507ff080 100644
--- a/src/dht/test_dht_api.c
+++ b/src/dht/test_dht_api.c
@@ -82,7 +82,7 @@ static struct GNUNET_SCHEDULER_Task * die_task;
82 82
83 83
84static void 84static void
85end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 85end (void *cls)
86{ 86{
87 GNUNET_SCHEDULER_cancel (die_task); 87 GNUNET_SCHEDULER_cancel (die_task);
88 die_task = NULL; 88 die_task = NULL;
@@ -116,11 +116,9 @@ end_badly ()
116 * Signature of the main function of a task. 116 * Signature of the main function of a task.
117 * 117 *
118 * @param cls closure 118 * @param cls closure
119 * @param tc context information (why was this task triggered now)
120 */ 119 */
121static void 120static void
122test_get_stop (void *cls, 121test_get_stop (void *cls)
123 const struct GNUNET_SCHEDULER_TaskContext *tc)
124{ 122{
125 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 123 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
126 "Called test_get_stop!\n"); 124 "Called test_get_stop!\n");
diff --git a/src/dht/test_dht_monitor.c b/src/dht/test_dht_monitor.c
index fc4b45a45..6b639e341 100644
--- a/src/dht/test_dht_monitor.c
+++ b/src/dht/test_dht_monitor.c
@@ -108,11 +108,9 @@ static unsigned int monitor_counter;
108 * the testbed. 108 * the testbed.
109 * 109 *
110 * @param cls the 'struct GNUNET_DHT_TestContext' 110 * @param cls the 'struct GNUNET_DHT_TestContext'
111 * @param tc scheduler context
112 */ 111 */
113static void 112static void
114shutdown_task (void *cls, 113shutdown_task (void *cls)
115 const struct GNUNET_SCHEDULER_TaskContext *tc)
116{ 114{
117 struct GNUNET_DHT_TEST_Context *ctx = cls; 115 struct GNUNET_DHT_TEST_Context *ctx = cls;
118 unsigned int i; 116 unsigned int i;
@@ -197,11 +195,9 @@ dht_get_handler (void *cls, struct GNUNET_TIME_Absolute exp,
197 * Task to put the id of each peer into the DHT. 195 * Task to put the id of each peer into the DHT.
198 * 196 *
199 * @param cls array with NUM_PEERS DHT handles 197 * @param cls array with NUM_PEERS DHT handles
200 * @param tc Task context
201 */ 198 */
202static void 199static void
203do_puts (void *cls, 200do_puts (void *cls)
204 const struct GNUNET_SCHEDULER_TaskContext *tc)
205{ 201{
206 struct GNUNET_DHT_Handle **hs = cls; 202 struct GNUNET_DHT_Handle **hs = cls;
207 struct GNUNET_HashCode key; 203 struct GNUNET_HashCode key;
diff --git a/src/dht/test_dht_topo.c b/src/dht/test_dht_topo.c
index fe6007a21..23ed21717 100644
--- a/src/dht/test_dht_topo.c
+++ b/src/dht/test_dht_topo.c
@@ -220,11 +220,9 @@ handle_stats (void *cls,
220 * the testbed. 220 * the testbed.
221 * 221 *
222 * @param cls the 'struct GNUNET_DHT_TestContext' 222 * @param cls the 'struct GNUNET_DHT_TestContext'
223 * @param tc scheduler context
224 */ 223 */
225static void 224static void
226shutdown_task (void *cls, 225shutdown_task (void *cls)
227 const struct GNUNET_SCHEDULER_TaskContext *tc)
228{ 226{
229 struct GNUNET_DHT_TEST_Context *ctx = cls; 227 struct GNUNET_DHT_TEST_Context *ctx = cls;
230 struct GetOperation *get_op; 228 struct GetOperation *get_op;
@@ -323,8 +321,7 @@ dht_get_handler (void *cls, struct GNUNET_TIME_Absolute exp,
323 * @param tc Task context 321 * @param tc Task context
324 */ 322 */
325static void 323static void
326do_puts (void *cls, 324do_puts (void *cls)
327 const struct GNUNET_SCHEDULER_TaskContext *tc)
328{ 325{
329 struct GNUNET_DHT_Handle **hs = cls; 326 struct GNUNET_DHT_Handle **hs = cls;
330 struct GNUNET_HashCode key; 327 struct GNUNET_HashCode key;
diff --git a/src/dns/dns_api.c b/src/dns/dns_api.c
index 984aa1a4c..f96ac3142 100644
--- a/src/dns/dns_api.c
+++ b/src/dns/dns_api.c
@@ -162,8 +162,7 @@ queue_reply (struct GNUNET_DNS_Handle *dh,
162 * @param tc scheduler context (unused) 162 * @param tc scheduler context (unused)
163 */ 163 */
164static void 164static void
165reconnect (void *cls, 165reconnect (void *cls)
166 const struct GNUNET_SCHEDULER_TaskContext *tc)
167{ 166{
168 struct GNUNET_DNS_Handle *dh = cls; 167 struct GNUNET_DNS_Handle *dh = cls;
169 struct ReplyQueueEntry *qe; 168 struct ReplyQueueEntry *qe;
@@ -440,7 +439,7 @@ GNUNET_DNS_request_drop (struct GNUNET_DNS_RequestHandle *rh)
440 * @param reply reply data 439 * @param reply reply data
441 */ 440 */
442void 441void
443GNUNET_DNS_request_answer (struct GNUNET_DNS_RequestHandle *rh, 442GNUNET_DNS_request_answer (struct GNUNET_DNS_RequestHandle *rh,
444 uint16_t reply_length, 443 uint16_t reply_length,
445 const char *reply) 444 const char *reply)
446{ 445{
diff --git a/src/dns/dnsstub.c b/src/dns/dnsstub.c
index 32049f66b..957777cba 100644
--- a/src/dns/dnsstub.c
+++ b/src/dns/dnsstub.c
@@ -185,11 +185,9 @@ open_socket (int af)
185 * Read a DNS response from the (unhindered) UDP-Socket 185 * Read a DNS response from the (unhindered) UDP-Socket
186 * 186 *
187 * @param cls socket to read from 187 * @param cls socket to read from
188 * @param tc scheduler context (must be shutdown or read ready)
189 */ 188 */
190static void 189static void
191read_response (void *cls, 190read_response (void *cls);
192 const struct GNUNET_SCHEDULER_TaskContext *tc);
193 191
194 192
195/** 193/**
@@ -466,16 +464,16 @@ do_dns_read (struct GNUNET_DNSSTUB_RequestSocket *rs,
466 * Read a DNS response from the (unhindered) UDP-Socket 464 * Read a DNS response from the (unhindered) UDP-Socket
467 * 465 *
468 * @param cls socket to read from 466 * @param cls socket to read from
469 * @param tc scheduler context (must be shutdown or read ready)
470 */ 467 */
471static void 468static void
472read_response (void *cls, 469read_response (void *cls)
473 const struct GNUNET_SCHEDULER_TaskContext *tc)
474{ 470{
475 struct GNUNET_DNSSTUB_RequestSocket *rs = cls; 471 struct GNUNET_DNSSTUB_RequestSocket *rs = cls;
476 struct GNUNET_NETWORK_FDSet *rset; 472 struct GNUNET_NETWORK_FDSet *rset;
473 const struct GNUNET_SCHEDULER_TaskContext *tc;
477 474
478 rs->read_task = NULL; 475 rs->read_task = NULL;
476 tc = GNUNET_SCHEDULER_get_task_context ();
479 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 477 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
480 { 478 {
481 /* timeout or shutdown */ 479 /* timeout or shutdown */
diff --git a/src/dns/gnunet-dns-monitor.c b/src/dns/gnunet-dns-monitor.c
index a7bc953ee..c9d840325 100644
--- a/src/dns/gnunet-dns-monitor.c
+++ b/src/dns/gnunet-dns-monitor.c
@@ -303,7 +303,7 @@ display_request (void *cls,
303 * Shutdown. 303 * Shutdown.
304 */ 304 */
305static void 305static void
306do_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 306do_disconnect (void *cls)
307{ 307{
308 if (NULL != handle) 308 if (NULL != handle)
309 { 309 {
diff --git a/src/dns/gnunet-dns-redirector.c b/src/dns/gnunet-dns-redirector.c
index daf74bf18..8ef69eb91 100644
--- a/src/dns/gnunet-dns-redirector.c
+++ b/src/dns/gnunet-dns-redirector.c
@@ -177,7 +177,7 @@ modify_request (void *cls,
177 * Shutdown. 177 * Shutdown.
178 */ 178 */
179static void 179static void
180do_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 180do_disconnect (void *cls)
181{ 181{
182 if (NULL != handle) 182 if (NULL != handle)
183 { 183 {
diff --git a/src/dns/gnunet-service-dns.c b/src/dns/gnunet-service-dns.c
index a8fd7b5e2..0f975e82f 100644
--- a/src/dns/gnunet-service-dns.c
+++ b/src/dns/gnunet-service-dns.c
@@ -273,11 +273,9 @@ cleanup_rr (struct RequestRecord *rr)
273 * Task run during shutdown. 273 * Task run during shutdown.
274 * 274 *
275 * @param cls unused 275 * @param cls unused
276 * @param tc unused
277 */ 276 */
278static void 277static void
279cleanup_task (void *cls GNUNET_UNUSED, 278cleanup_task (void *cls GNUNET_UNUSED)
280 const struct GNUNET_SCHEDULER_TaskContext *tc)
281{ 279{
282 unsigned int i; 280 unsigned int i;
283 281
diff --git a/src/dv/gnunet-dv.c b/src/dv/gnunet-dv.c
index 42234ad21..d5d95acca 100644
--- a/src/dv/gnunet-dv.c
+++ b/src/dv/gnunet-dv.c
@@ -119,11 +119,9 @@ message_cb (void *cls,
119 * Task run on shutdown. 119 * Task run on shutdown.
120 * 120 *
121 * @param cls NULL 121 * @param cls NULL
122 * @param tc unused
123 */ 122 */
124static void 123static void
125shutdown_task (void *cls, 124shutdown_task (void *cls)
126 const struct GNUNET_SCHEDULER_TaskContext *tc)
127{ 125{
128 GNUNET_DV_service_disconnect (sh); 126 GNUNET_DV_service_disconnect (sh);
129 sh = NULL; 127 sh = NULL;
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c
index 2ddd99197..bd0057ab4 100644
--- a/src/dv/gnunet-service-dv.c
+++ b/src/dv/gnunet-service-dv.c
@@ -398,11 +398,9 @@ static int in_shutdown;
398 * 398 *
399 * @param cls the 'struct DirectNeighbor' of the peer we're building 399 * @param cls the 'struct DirectNeighbor' of the peer we're building
400 * a routing consensus with 400 * a routing consensus with
401 * @param tc scheduler context
402 */ 401 */
403static void 402static void
404initiate_set_union (void *cls, 403initiate_set_union (void *cls);
405 const struct GNUNET_SCHEDULER_TaskContext *tc);
406 404
407 405
408/** 406/**
@@ -1132,11 +1130,9 @@ refresh_routes (void *cls,
1132 * Task to run #refresh_routes() on all direct neighbours. 1130 * Task to run #refresh_routes() on all direct neighbours.
1133 * 1131 *
1134 * @param cls NULL 1132 * @param cls NULL
1135 * @param tc unused
1136 */ 1133 */
1137static void 1134static void
1138refresh_routes_task (void *cls, 1135refresh_routes_task (void *cls)
1139 const struct GNUNET_SCHEDULER_TaskContext *tc)
1140{ 1136{
1141 rr_task = NULL; 1137 rr_task = NULL;
1142 GNUNET_CONTAINER_multipeermap_iterate (direct_neighbors, 1138 GNUNET_CONTAINER_multipeermap_iterate (direct_neighbors,
@@ -1692,11 +1688,9 @@ listen_set_union (void *cls,
1692 * 1688 *
1693 * @param cls the `struct DirectNeighbor *` of the peer we're building 1689 * @param cls the `struct DirectNeighbor *` of the peer we're building
1694 * a routing consensus with 1690 * a routing consensus with
1695 * @param tc scheduler context
1696 */ 1691 */
1697static void 1692static void
1698initiate_set_union (void *cls, 1693initiate_set_union (void *cls)
1699 const struct GNUNET_SCHEDULER_TaskContext *tc)
1700{ 1694{
1701 struct DirectNeighbor *neighbor = cls; 1695 struct DirectNeighbor *neighbor = cls;
1702 1696
@@ -2082,11 +2076,9 @@ free_direct_neighbors (void *cls,
2082 * Task run during shutdown. 2076 * Task run during shutdown.
2083 * 2077 *
2084 * @param cls unused 2078 * @param cls unused
2085 * @param tc unused
2086 */ 2079 */
2087static void 2080static void
2088shutdown_task (void *cls, 2081shutdown_task (void *cls)
2089 const struct GNUNET_SCHEDULER_TaskContext *tc)
2090{ 2082{
2091 unsigned int i; 2083 unsigned int i;
2092 2084
diff --git a/src/dv/test_transport_dv.c b/src/dv/test_transport_dv.c
index 245914f07..1afa30fa9 100644
--- a/src/dv/test_transport_dv.c
+++ b/src/dv/test_transport_dv.c
@@ -36,8 +36,7 @@ static struct GNUNET_SCHEDULER_Task * shutdown_task;
36 36
37 37
38static void 38static void
39do_shutdown (void *cls, 39do_shutdown (void *cls)
40 const struct GNUNET_SCHEDULER_TaskContext *tc)
41{ 40{
42 shutdown_task = NULL; 41 shutdown_task = NULL;
43 if (NULL != topology_op) 42 if (NULL != topology_op)
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index c44fbbfbd..8456018ab 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -3139,8 +3139,7 @@ free_iterate (void *cls,
3139 * @param tc scheduler context 3139 * @param tc scheduler context
3140 */ 3140 */
3141static void 3141static void
3142dummy_task (void *cls, 3142dummy_task (void *cls)
3143 const struct GNUNET_SCHEDULER_TaskContext *tc)
3144{ 3143{
3145 /* just terminate */ 3144 /* just terminate */
3146} 3145}
@@ -3153,8 +3152,7 @@ dummy_task (void *cls,
3153 * @param tc scheduler context 3152 * @param tc scheduler context
3154 */ 3153 */
3155static void 3154static void
3156cleanup (void *cls, 3155cleanup (void *cls)
3157 const struct GNUNET_SCHEDULER_TaskContext *tc)
3158{ 3156{
3159 unsigned int i; 3157 unsigned int i;
3160 3158
@@ -3428,11 +3426,9 @@ read_service_conf (void *cls,
3428 * DHT. This task is run periodically to do the DHT PUT. 3426 * DHT. This task is run periodically to do the DHT PUT.
3429 * 3427 *
3430 * @param cls closure 3428 * @param cls closure
3431 * @param tc scheduler context
3432 */ 3429 */
3433static void 3430static void
3434do_dht_put (void *cls, 3431do_dht_put (void *cls);
3435 const struct GNUNET_SCHEDULER_TaskContext *tc);
3436 3432
3437 3433
3438/** 3434/**
@@ -3458,11 +3454,9 @@ dht_put_cont (void *cls,
3458 * DHT. This task is run periodically to do the DHT PUT. 3454 * DHT. This task is run periodically to do the DHT PUT.
3459 * 3455 *
3460 * @param cls closure 3456 * @param cls closure
3461 * @param tc scheduler context
3462 */ 3457 */
3463static void 3458static void
3464do_dht_put (void *cls, 3459do_dht_put (void *cls)
3465 const struct GNUNET_SCHEDULER_TaskContext *tc)
3466{ 3460{
3467 struct GNUNET_TIME_Absolute expiration; 3461 struct GNUNET_TIME_Absolute expiration;
3468 3462
diff --git a/src/fragmentation/defragmentation.c b/src/fragmentation/defragmentation.c
index 5fcf1c441..5433ffb5a 100644
--- a/src/fragmentation/defragmentation.c
+++ b/src/fragmentation/defragmentation.c
@@ -258,11 +258,9 @@ GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc)
258 * Send acknowledgement to the other peer now. 258 * Send acknowledgement to the other peer now.
259 * 259 *
260 * @param cls the message context 260 * @param cls the message context
261 * @param tc the scheduler context
262 */ 261 */
263static void 262static void
264send_ack (void *cls, 263send_ack (void *cls)
265 const struct GNUNET_SCHEDULER_TaskContext *tc)
266{ 264{
267 struct MessageContext *mc = cls; 265 struct MessageContext *mc = cls;
268 struct GNUNET_DEFRAGMENT_Context *dc = mc->dc; 266 struct GNUNET_DEFRAGMENT_Context *dc = mc->dc;
diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c
index a702fd35d..3a55502e7 100644
--- a/src/fragmentation/fragmentation.c
+++ b/src/fragmentation/fragmentation.c
@@ -167,11 +167,9 @@ GNUNET_FRAGMENT_print_ack (const struct GNUNET_MessageHeader *ack)
167 * Transmit the next fragment to the other peer. 167 * Transmit the next fragment to the other peer.
168 * 168 *
169 * @param cls the `struct GNUNET_FRAGMENT_Context` 169 * @param cls the `struct GNUNET_FRAGMENT_Context`
170 * @param tc scheduler context
171 */ 170 */
172static void 171static void
173transmit_next (void *cls, 172transmit_next (void *cls)
174 const struct GNUNET_SCHEDULER_TaskContext *tc)
175{ 173{
176 struct GNUNET_FRAGMENT_Context *fc = cls; 174 struct GNUNET_FRAGMENT_Context *fc = cls;
177 char msg[fc->mtu]; 175 char msg[fc->mtu];
diff --git a/src/fragmentation/test_fragmentation.c b/src/fragmentation/test_fragmentation.c
index d3591f4a1..61ba73bb2 100644
--- a/src/fragmentation/test_fragmentation.c
+++ b/src/fragmentation/test_fragmentation.c
@@ -68,7 +68,7 @@ static struct GNUNET_TIME_Relative ack_delay;
68 68
69 69
70static void 70static void
71do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 71do_shutdown (void *cls)
72{ 72{
73 ret = 0; 73 ret = 0;
74 shutdown_task = NULL; 74 shutdown_task = NULL;
diff --git a/src/fragmentation/test_fragmentation_parallel.c b/src/fragmentation/test_fragmentation_parallel.c
index 2ade88c05..23349e6f7 100644
--- a/src/fragmentation/test_fragmentation_parallel.c
+++ b/src/fragmentation/test_fragmentation_parallel.c
@@ -60,10 +60,11 @@ static struct GNUNET_BANDWIDTH_Tracker trackers[NUM_MSGS];
60 60
61static struct GNUNET_FRAGMENT_Context *frags[NUM_MSGS]; 61static struct GNUNET_FRAGMENT_Context *frags[NUM_MSGS];
62 62
63static struct GNUNET_SCHEDULER_Task * shutdown_task; 63static struct GNUNET_SCHEDULER_Task *shutdown_task;
64
64 65
65static void 66static void
66do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 67do_shutdown (void *cls)
67{ 68{
68 unsigned int i; 69 unsigned int i;
69 70
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;
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c
index da64b3a3a..6696158c9 100644
--- a/src/gns/gns_api.c
+++ b/src/gns/gns_api.c
@@ -203,10 +203,9 @@ reconnect (struct GNUNET_GNS_Handle *handle)
203 * Reconnect to GNS 203 * Reconnect to GNS
204 * 204 *
205 * @param cls the handle 205 * @param cls the handle
206 * @param tc task context
207 */ 206 */
208static void 207static void
209reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 208reconnect_task (void *cls)
210{ 209{
211 struct GNUNET_GNS_Handle *handle = cls; 210 struct GNUNET_GNS_Handle *handle = cls;
212 211
diff --git a/src/gns/gnunet-bcd.c b/src/gns/gnunet-bcd.c
index 24014f204..e7be8fd84 100644
--- a/src/gns/gnunet-bcd.c
+++ b/src/gns/gnunet-bcd.c
@@ -287,11 +287,13 @@ prepare_daemon (struct MHD_Daemon *daemon_handle);
287 * and schedule the next run. 287 * and schedule the next run.
288 */ 288 */
289static void 289static void
290run_daemon (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 290run_daemon (void *cls)
291{ 291{
292 struct MHD_Daemon *daemon_handle = cls; 292 struct MHD_Daemon *daemon_handle = cls;
293 const struct GNUNET_SCHEDULER_TaskContext *tc;
293 294
294 http_task = NULL; 295 http_task = NULL;
296 tc = GNUNET_SCHEDULER_get_task_context ();
295 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 297 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
296 return; 298 return;
297 GNUNET_assert (MHD_YES == MHD_run (daemon_handle)); 299 GNUNET_assert (MHD_YES == MHD_run (daemon_handle));
@@ -384,8 +386,7 @@ server_start ()
384 * Stop HTTP server. 386 * Stop HTTP server.
385 */ 387 */
386static void 388static void
387server_stop (void *cls, 389server_stop (void *cls)
388 const struct GNUNET_SCHEDULER_TaskContext *tc)
389{ 390{
390 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 391 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
391 "HTTP server shutdown\n"); 392 "HTTP server shutdown\n");
diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c
index 7b5613234..119bda91a 100644
--- a/src/gns/gnunet-dns2gns.c
+++ b/src/gns/gnunet-dns2gns.c
@@ -170,11 +170,9 @@ static struct GNUNET_IDENTITY_Operation *id_op;
170 * Task run on shutdown. Cleans up everything. 170 * Task run on shutdown. Cleans up everything.
171 * 171 *
172 * @param cls unused 172 * @param cls unused
173 * @param tc scheduler context
174 */ 173 */
175static void 174static void
176do_shutdown (void *cls, 175do_shutdown (void *cls)
177 const struct GNUNET_SCHEDULER_TaskContext *tc)
178{ 176{
179 if (NULL != t4) 177 if (NULL != t4)
180 GNUNET_SCHEDULER_cancel (t4); 178 GNUNET_SCHEDULER_cancel (t4);
@@ -252,12 +250,10 @@ send_response (struct Request *request)
252/** 250/**
253 * Task run on timeout. Cleans up request. 251 * Task run on timeout. Cleans up request.
254 * 252 *
255 * @param cls 'struct Request' of the request to clean up 253 * @param cls `struct Request *` of the request to clean up
256 * @param tc scheduler context
257 */ 254 */
258static void 255static void
259do_timeout (void *cls, 256do_timeout (void *cls)
260 const struct GNUNET_SCHEDULER_TaskContext *tc)
261{ 257{
262 struct Request *request = cls; 258 struct Request *request = cls;
263 259
@@ -507,21 +503,21 @@ handle_request (struct GNUNET_NETWORK_Handle *lsock,
507 * Task to read IPv4 DNS packets. 503 * Task to read IPv4 DNS packets.
508 * 504 *
509 * @param cls the 'listen_socket4' 505 * @param cls the 'listen_socket4'
510 * @param tc scheduler context
511 */ 506 */
512static void 507static void
513read_dns4 (void *cls, 508read_dns4 (void *cls)
514 const struct GNUNET_SCHEDULER_TaskContext *tc)
515{ 509{
516 struct sockaddr_in v4; 510 struct sockaddr_in v4;
517 socklen_t addrlen; 511 socklen_t addrlen;
518 ssize_t size; 512 ssize_t size;
513 const struct GNUNET_SCHEDULER_TaskContext *tc;
519 514
520 GNUNET_assert (listen_socket4 == cls); 515 GNUNET_assert (listen_socket4 == cls);
521 t4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, 516 t4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
522 listen_socket4, 517 listen_socket4,
523 &read_dns4, 518 &read_dns4,
524 listen_socket4); 519 listen_socket4);
520 tc = GNUNET_SCHEDULER_get_task_context ();
525 if (0 == (GNUNET_SCHEDULER_REASON_READ_READY & tc->reason)) 521 if (0 == (GNUNET_SCHEDULER_REASON_READ_READY & tc->reason))
526 return; /* shutdown? */ 522 return; /* shutdown? */
527 size = GNUNET_NETWORK_socket_recvfrom_amount (listen_socket4); 523 size = GNUNET_NETWORK_socket_recvfrom_amount (listen_socket4);
@@ -550,21 +546,21 @@ read_dns4 (void *cls,
550 * Task to read IPv6 DNS packets. 546 * Task to read IPv6 DNS packets.
551 * 547 *
552 * @param cls the 'listen_socket6' 548 * @param cls the 'listen_socket6'
553 * @param tc scheduler context
554 */ 549 */
555static void 550static void
556read_dns6 (void *cls, 551read_dns6 (void *cls)
557 const struct GNUNET_SCHEDULER_TaskContext *tc)
558{ 552{
559 struct sockaddr_in6 v6; 553 struct sockaddr_in6 v6;
560 socklen_t addrlen; 554 socklen_t addrlen;
561 ssize_t size; 555 ssize_t size;
556 const struct GNUNET_SCHEDULER_TaskContext *tc;
562 557
563 GNUNET_assert (listen_socket6 == cls); 558 GNUNET_assert (listen_socket6 == cls);
564 t6 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, 559 t6 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
565 listen_socket6, 560 listen_socket6,
566 &read_dns6, 561 &read_dns6,
567 listen_socket6); 562 listen_socket6);
563 tc = GNUNET_SCHEDULER_get_task_context ();
568 if (0 == (GNUNET_SCHEDULER_REASON_READ_READY & tc->reason)) 564 if (0 == (GNUNET_SCHEDULER_REASON_READ_READY & tc->reason))
569 return; /* shutdown? */ 565 return; /* shutdown? */
570 size = GNUNET_NETWORK_socket_recvfrom_amount (listen_socket6); 566 size = GNUNET_NETWORK_socket_recvfrom_amount (listen_socket6);
diff --git a/src/gns/gnunet-gns-helper-service-w32.c b/src/gns/gnunet-gns-helper-service-w32.c
index e4fc2f304..112bcd258 100644
--- a/src/gns/gnunet-gns-helper-service-w32.c
+++ b/src/gns/gnunet-gns-helper-service-w32.c
@@ -112,11 +112,9 @@ static int got_egos = 0;
112 * Task run on shutdown. Cleans up everything. 112 * Task run on shutdown. Cleans up everything.
113 * 113 *
114 * @param cls unused 114 * @param cls unused
115 * @param tc scheduler context
116 */ 115 */
117static void 116static void
118do_shutdown (void *cls, 117do_shutdown (void *cls)
119 const struct GNUNET_SCHEDULER_TaskContext *tc)
120{ 118{
121 struct request *rq; 119 struct request *rq;
122 if (NULL != id_op) 120 if (NULL != id_op)
diff --git a/src/gns/gnunet-gns-import.c b/src/gns/gnunet-gns-import.c
index ad874cfeb..5f94e7792 100644
--- a/src/gns/gnunet-gns-import.c
+++ b/src/gns/gnunet-gns-import.c
@@ -344,11 +344,9 @@ get_ego (void *cls,
344 * Task run on shutdown. 344 * Task run on shutdown.
345 * 345 *
346 * @param cls NULL 346 * @param cls NULL
347 * @param tc unused
348 */ 347 */
349static void 348static void
350shutdown_task (void *cls, 349shutdown_task (void *cls)
351 const struct GNUNET_SCHEDULER_TaskContext *tc)
352{ 350{
353 GNUNET_free_non_null (master_zone_pkey); 351 GNUNET_free_non_null (master_zone_pkey);
354 master_zone_pkey = NULL; 352 master_zone_pkey = NULL;
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index 3b5adc8b1..9a34c83af 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -1257,10 +1257,9 @@ curl_upload_cb (void *buf, size_t size, size_t nmemb, void *cls)
1257 * from curl 1257 * from curl
1258 * 1258 *
1259 * @param cls closure 1259 * @param cls closure
1260 * @param tc task context
1261 */ 1260 */
1262static void 1261static void
1263curl_task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 1262curl_task_download (void *cls);
1264 1263
1265 1264
1266/** 1265/**
@@ -1328,11 +1327,9 @@ curl_download_prepare ()
1328 * Task that is run when we are ready to receive more data from curl. 1327 * Task that is run when we are ready to receive more data from curl.
1329 * 1328 *
1330 * @param cls closure, NULL 1329 * @param cls closure, NULL
1331 * @param tc task context
1332 */ 1330 */
1333static void 1331static void
1334curl_task_download (void *cls, 1332curl_task_download (void *cls)
1335 const struct GNUNET_SCHEDULER_TaskContext *tc)
1336{ 1333{
1337 int running; 1334 int running;
1338 int msgnum; 1335 int msgnum;
@@ -1821,11 +1818,9 @@ kill_httpd (struct MhdHttpList *hd)
1821 * Task run whenever HTTP server is idle for too long. Kill it. 1818 * Task run whenever HTTP server is idle for too long. Kill it.
1822 * 1819 *
1823 * @param cls the `struct MhdHttpList *` 1820 * @param cls the `struct MhdHttpList *`
1824 * @param tc sched context
1825 */ 1821 */
1826static void 1822static void
1827kill_httpd_task (void *cls, 1823kill_httpd_task (void *cls)
1828 const struct GNUNET_SCHEDULER_TaskContext *tc)
1829{ 1824{
1830 struct MhdHttpList *hd = cls; 1825 struct MhdHttpList *hd = cls;
1831 1826
@@ -1838,11 +1833,9 @@ kill_httpd_task (void *cls,
1838 * Task run whenever HTTP server operations are pending. 1833 * Task run whenever HTTP server operations are pending.
1839 * 1834 *
1840 * @param cls the `struct MhdHttpList *` of the daemon that is being run 1835 * @param cls the `struct MhdHttpList *` of the daemon that is being run
1841 * @param tc sched context
1842 */ 1836 */
1843static void 1837static void
1844do_httpd (void *cls, 1838do_httpd (void *cls);
1845 const struct GNUNET_SCHEDULER_TaskContext *tc);
1846 1839
1847 1840
1848/** 1841/**
@@ -1920,11 +1913,9 @@ schedule_httpd (struct MhdHttpList *hd)
1920 * Task run whenever HTTP server operations are pending. 1913 * Task run whenever HTTP server operations are pending.
1921 * 1914 *
1922 * @param cls the `struct MhdHttpList` of the daemon that is being run 1915 * @param cls the `struct MhdHttpList` of the daemon that is being run
1923 * @param tc scheduler context
1924 */ 1916 */
1925static void 1917static void
1926do_httpd (void *cls, 1918do_httpd (void *cls)
1927 const struct GNUNET_SCHEDULER_TaskContext *tc)
1928{ 1919{
1929 struct MhdHttpList *hd = cls; 1920 struct MhdHttpList *hd = cls;
1930 1921
@@ -2171,11 +2162,9 @@ lookup_ssl_httpd (const char* domain)
2171 * the SOCKS5 handshake). Clean up. 2162 * the SOCKS5 handshake). Clean up.
2172 * 2163 *
2173 * @param cls the `struct Socks5Request *` 2164 * @param cls the `struct Socks5Request *`
2174 * @param tc sched context
2175 */ 2165 */
2176static void 2166static void
2177timeout_s5r_handshake (void *cls, 2167timeout_s5r_handshake (void *cls)
2178 const struct GNUNET_SCHEDULER_TaskContext *tc)
2179{ 2168{
2180 struct Socks5Request *s5r = cls; 2169 struct Socks5Request *s5r = cls;
2181 2170
@@ -2245,11 +2234,9 @@ setup_data_transfer (struct Socks5Request *s5r)
2245 * Write data from buffer to socks5 client, then continue with state machine. 2234 * Write data from buffer to socks5 client, then continue with state machine.
2246 * 2235 *
2247 * @param cls the closure with the `struct Socks5Request` 2236 * @param cls the closure with the `struct Socks5Request`
2248 * @param tc scheduler context
2249 */ 2237 */
2250static void 2238static void
2251do_write (void *cls, 2239do_write (void *cls)
2252 const struct GNUNET_SCHEDULER_TaskContext *tc)
2253{ 2240{
2254 struct Socks5Request *s5r = cls; 2241 struct Socks5Request *s5r = cls;
2255 ssize_t len; 2242 ssize_t len;
@@ -2502,11 +2489,9 @@ clear_from_s5r_rbuf (struct Socks5Request *s5r,
2502 * Read data from incoming Socks5 connection 2489 * Read data from incoming Socks5 connection
2503 * 2490 *
2504 * @param cls the closure with the `struct Socks5Request` 2491 * @param cls the closure with the `struct Socks5Request`
2505 * @param tc the scheduler context
2506 */ 2492 */
2507static void 2493static void
2508do_s5r_read (void *cls, 2494do_s5r_read (void *cls)
2509 const struct GNUNET_SCHEDULER_TaskContext *tc)
2510{ 2495{
2511 struct Socks5Request *s5r = cls; 2496 struct Socks5Request *s5r = cls;
2512 const struct Socks5ClientHelloMessage *c_hello; 2497 const struct Socks5ClientHelloMessage *c_hello;
@@ -2514,8 +2499,10 @@ do_s5r_read (void *cls,
2514 const struct Socks5ClientRequestMessage *c_req; 2499 const struct Socks5ClientRequestMessage *c_req;
2515 ssize_t rlen; 2500 ssize_t rlen;
2516 size_t alen; 2501 size_t alen;
2502 const struct GNUNET_SCHEDULER_TaskContext *tc;
2517 2503
2518 s5r->rtask = NULL; 2504 s5r->rtask = NULL;
2505 tc = GNUNET_SCHEDULER_get_task_context ();
2519 if ( (NULL != tc->read_ready) && 2506 if ( (NULL != tc->read_ready) &&
2520 (GNUNET_NETWORK_fdset_isset (tc->read_ready, s5r->sock)) ) 2507 (GNUNET_NETWORK_fdset_isset (tc->read_ready, s5r->sock)) )
2521 { 2508 {
@@ -2721,17 +2708,18 @@ do_s5r_read (void *cls,
2721 * @param tc the scheduler context 2708 * @param tc the scheduler context
2722 */ 2709 */
2723static void 2710static void
2724do_accept (void *cls, 2711do_accept (void *cls)
2725 const struct GNUNET_SCHEDULER_TaskContext *tc)
2726{ 2712{
2727 struct GNUNET_NETWORK_Handle *lsock = cls; 2713 struct GNUNET_NETWORK_Handle *lsock = cls;
2728 struct GNUNET_NETWORK_Handle *s; 2714 struct GNUNET_NETWORK_Handle *s;
2729 struct Socks5Request *s5r; 2715 struct Socks5Request *s5r;
2716 const struct GNUNET_SCHEDULER_TaskContext *tc;
2730 2717
2731 if (lsock == lsock4) 2718 if (lsock == lsock4)
2732 ltask4 = NULL; 2719 ltask4 = NULL;
2733 else 2720 else
2734 ltask6 = NULL; 2721 ltask6 = NULL;
2722 tc = GNUNET_SCHEDULER_get_task_context ();
2735 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 2723 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
2736 return; 2724 return;
2737 if (lsock == lsock4) 2725 if (lsock == lsock4)
@@ -2769,11 +2757,9 @@ do_accept (void *cls,
2769 * Task run on shutdown 2757 * Task run on shutdown
2770 * 2758 *
2771 * @param cls closure 2759 * @param cls closure
2772 * @param tc task context
2773 */ 2760 */
2774static void 2761static void
2775do_shutdown (void *cls, 2762do_shutdown (void *cls)
2776 const struct GNUNET_SCHEDULER_TaskContext *tc)
2777{ 2763{
2778 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 2764 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
2779 "Shutting down...\n"); 2765 "Shutting down...\n");
diff --git a/src/gns/gnunet-gns.c b/src/gns/gnunet-gns.c
index 5d083cdb6..c8310db46 100644
--- a/src/gns/gnunet-gns.c
+++ b/src/gns/gnunet-gns.c
@@ -105,11 +105,9 @@ static struct GNUNET_IDENTITY_Operation *id_op;
105 * Task run on shutdown. Cleans up everything. 105 * Task run on shutdown. Cleans up everything.
106 * 106 *
107 * @param cls unused 107 * @param cls unused
108 * @param tc scheduler context
109 */ 108 */
110static void 109static void
111do_shutdown (void *cls, 110do_shutdown (void *cls)
112 const struct GNUNET_SCHEDULER_TaskContext *tc)
113{ 111{
114 if (NULL != el) 112 if (NULL != el)
115 { 113 {
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c
index 076475d2c..87b0fd04e 100644
--- a/src/gns/gnunet-service-gns.c
+++ b/src/gns/gnunet-service-gns.c
@@ -260,8 +260,7 @@ static struct GNUNET_STATISTICS_Handle *statistics;
260 * @param tc unused 260 * @param tc unused
261 */ 261 */
262static void 262static void
263shutdown_task (void *cls, 263shutdown_task (void *cls)
264 const struct GNUNET_SCHEDULER_TaskContext *tc)
265{ 264{
266 struct ClientLookupHandle *clh; 265 struct ClientLookupHandle *clh;
267 struct MonitorActivity *ma; 266 struct MonitorActivity *ma;
@@ -349,11 +348,9 @@ shutdown_task (void *cls,
349 * Method called periodically that triggers iteration over authoritative records 348 * Method called periodically that triggers iteration over authoritative records
350 * 349 *
351 * @param cls closure 350 * @param cls closure
352 * @param tc task context
353 */ 351 */
354static void 352static void
355publish_zone_dht_next (void *cls, 353publish_zone_dht_next (void *cls)
356 const struct GNUNET_SCHEDULER_TaskContext *tc)
357{ 354{
358 zone_publish_task = NULL; 355 zone_publish_task = NULL;
359 GNUNET_NAMESTORE_zone_iterator_next (namestore_iter); 356 GNUNET_NAMESTORE_zone_iterator_next (namestore_iter);
@@ -364,11 +361,9 @@ publish_zone_dht_next (void *cls,
364 * Periodically iterate over our zone and store everything in dht 361 * Periodically iterate over our zone and store everything in dht
365 * 362 *
366 * @param cls NULL 363 * @param cls NULL
367 * @param tc task context
368 */ 364 */
369static void 365static void
370publish_zone_dht_start (void *cls, 366publish_zone_dht_start (void *cls);
371 const struct GNUNET_SCHEDULER_TaskContext *tc);
372 367
373 368
374/** 369/**
@@ -629,11 +624,9 @@ put_gns_record (void *cls,
629 * Periodically iterate over all zones and store everything in DHT 624 * Periodically iterate over all zones and store everything in DHT
630 * 625 *
631 * @param cls NULL 626 * @param cls NULL
632 * @param tc task context
633 */ 627 */
634static void 628static void
635publish_zone_dht_start (void *cls, 629publish_zone_dht_start (void *cls)
636 const struct GNUNET_SCHEDULER_TaskContext *tc)
637{ 630{
638 zone_publish_task = NULL; 631 zone_publish_task = NULL;
639 632
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index 9a54a8080..daae46ab7 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -541,11 +541,9 @@ translate_dot_plus (struct GNS_ResolverHandle *rh,
541 * Task scheduled to asynchronously fail a resolution. 541 * Task scheduled to asynchronously fail a resolution.
542 * 542 *
543 * @param cls the 'struct GNS_ResolverHandle' of the resolution to fail 543 * @param cls the 'struct GNS_ResolverHandle' of the resolution to fail
544 * @param tc task context
545 */ 544 */
546static void 545static void
547fail_resolution (void *cls, 546fail_resolution (void *cls)
548 const struct GNUNET_SCHEDULER_TaskContext *tc)
549{ 547{
550 struct GNS_ResolverHandle *rh = cls; 548 struct GNS_ResolverHandle *rh = cls;
551 549
@@ -808,8 +806,7 @@ handle_dns_result (void *cls,
808 * @param tc task context 806 * @param tc task context
809 */ 807 */
810static void 808static void
811recursive_resolution (void *cls, 809recursive_resolution (void *cls);
812 const struct GNUNET_SCHEDULER_TaskContext *tc);
813 810
814 811
815/** 812/**
@@ -2229,11 +2226,9 @@ recursive_gns_resolution_revocation (struct GNS_ResolverHandle *rh)
2229 * Task scheduled to continue with the resolution process. 2226 * Task scheduled to continue with the resolution process.
2230 * 2227 *
2231 * @param cls the `struct GNS_ResolverHandle` of the resolution 2228 * @param cls the `struct GNS_ResolverHandle` of the resolution
2232 * @param tc task context
2233 */ 2229 */
2234static void 2230static void
2235recursive_resolution (void *cls, 2231recursive_resolution (void *cls)
2236 const struct GNUNET_SCHEDULER_TaskContext *tc)
2237{ 2232{
2238 struct GNS_ResolverHandle *rh = cls; 2233 struct GNS_ResolverHandle *rh = cls;
2239 2234
diff --git a/src/gns/plugin_rest_gns.c b/src/gns/plugin_rest_gns.c
index 4878669e4..8a3f26041 100644
--- a/src/gns/plugin_rest_gns.c
+++ b/src/gns/plugin_rest_gns.c
@@ -211,11 +211,12 @@ cleanup_handle (struct LookupHandle *handle)
211 * @param tc scheduler context 211 * @param tc scheduler context
212 */ 212 */
213static void 213static void
214do_error (void *cls, 214do_error (void *cls)
215 const struct GNUNET_SCHEDULER_TaskContext *tc)
216{ 215{
217 struct LookupHandle *handle = cls; 216 struct LookupHandle *handle = cls;
218 struct MHD_Response *resp = GNUNET_REST_create_json_response (NULL); 217 struct MHD_Response *resp;
218
219 resp = GNUNET_REST_create_json_response (NULL);
219 handle->proc (handle->proc_cls, resp, MHD_HTTP_BAD_REQUEST); 220 handle->proc (handle->proc_cls, resp, MHD_HTTP_BAD_REQUEST);
220 cleanup_handle (handle); 221 cleanup_handle (handle);
221} 222}
@@ -550,7 +551,7 @@ get_gns_cont (struct RestConnectionDataHandle *conndata_handle,
550 GNUNET_CONTAINER_multihashmap_contains (conndata_handle->url_param_map, 551 GNUNET_CONTAINER_multihashmap_contains (conndata_handle->url_param_map,
551 &key) ) 552 &key) )
552 { 553 {
553 handle->type = GNUNET_GNSRECORD_typename_to_number 554 handle->type = GNUNET_GNSRECORD_typename_to_number
554 (GNUNET_CONTAINER_multihashmap_get (conndata_handle->url_param_map, 555 (GNUNET_CONTAINER_multihashmap_get (conndata_handle->url_param_map,
555 &key)); 556 &key));
556 } 557 }
diff --git a/src/gns/test_gns_proxy.c b/src/gns/test_gns_proxy.c
index 72e8ff20b..0afc3ea0b 100644
--- a/src/gns/test_gns_proxy.c
+++ b/src/gns/test_gns_proxy.c
@@ -165,8 +165,7 @@ curl_main (void);
165 165
166 166
167static void 167static void
168curl_task (void *cls, 168curl_task (void *cls)
169 const struct GNUNET_SCHEDULER_TaskContext *tc)
170{ 169{
171 curl_task_id = NULL; 170 curl_task_id = NULL;
172 curl_main (); 171 curl_main ();
@@ -247,7 +246,7 @@ curl_main ()
247} 246}
248 247
249static void 248static void
250start_curl (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 249start_curl (void *cls)
251{ 250{
252 GNUNET_asprintf (&url, 251 GNUNET_asprintf (&url,
253 "http://%s:%d/hello_world", 252 "http://%s:%d/hello_world",
@@ -269,12 +268,14 @@ start_curl (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
269 curl_main (); 268 curl_main ();
270} 269}
271 270
271
272static void 272static void
273disco_ns (void* cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 273disco_ns (void* cls)
274{ 274{
275 GNUNET_NAMESTORE_disconnect (namestore); 275 GNUNET_NAMESTORE_disconnect (namestore);
276} 276}
277 277
278
278/** 279/**
279 * Callback invoked from the namestore service once record is 280 * Callback invoked from the namestore service once record is
280 * created. 281 * created.
@@ -315,8 +316,7 @@ mhd_main (void);
315 316
316 317
317static void 318static void
318mhd_task (void *cls, 319mhd_task (void *cls)
319 const struct GNUNET_SCHEDULER_TaskContext *tc)
320{ 320{
321 mhd_task_id = NULL; 321 mhd_task_id = NULL;
322 MHD_run (mhd); 322 MHD_run (mhd);
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index 42b5959f2..6a4689af1 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -212,11 +212,9 @@ disconnect_handler (void *cls,
212 * the other services. 212 * the other services.
213 * 213 *
214 * @param cls NULL 214 * @param cls NULL
215 * @param tc scheduler context
216 */ 215 */
217static void 216static void
218cleaning_task (void *cls, 217cleaning_task (void *cls)
219 const struct GNUNET_SCHEDULER_TaskContext *tc)
220{ 218{
221 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 219 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
222 "Hostlist daemon is shutting down\n"); 220 "Hostlist daemon is shutting down\n");
diff --git a/src/hostlist/gnunet-daemon-hostlist_client.c b/src/hostlist/gnunet-daemon-hostlist_client.c
index e0a73f0f0..dbf6eaeda 100644
--- a/src/hostlist/gnunet-daemon-hostlist_client.c
+++ b/src/hostlist/gnunet-daemon-hostlist_client.c
@@ -774,8 +774,7 @@ clean_up ()
774 * @param tc task context, unused 774 * @param tc task context, unused
775 */ 775 */
776static void 776static void
777task_download (void *cls, 777task_download (void *cls);
778 const struct GNUNET_SCHEDULER_TaskContext *tc);
779 778
780 779
781/** 780/**
@@ -841,17 +840,17 @@ download_prepare ()
841 * server. 840 * server.
842 * 841 *
843 * @param cls closure, unused 842 * @param cls closure, unused
844 * @param tc task context, unused
845 */ 843 */
846static void 844static void
847task_download (void *cls, 845task_download (void *cls)
848 const struct GNUNET_SCHEDULER_TaskContext *tc)
849{ 846{
850 int running; 847 int running;
851 struct CURLMsg *msg; 848 struct CURLMsg *msg;
852 CURLMcode mret; 849 CURLMcode mret;
850 const struct GNUNET_SCHEDULER_TaskContext *tc;
853 851
854 ti_download = NULL; 852 ti_download = NULL;
853 tc = GNUNET_SCHEDULER_get_task_context ();
855 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 854 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
856 { 855 {
857 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 856 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1046,10 +1045,12 @@ download_hostlist ()
1046 1045
1047 1046
1048static void 1047static void
1049task_download_dispatcher (void *cls, 1048task_download_dispatcher (void *cls)
1050 const struct GNUNET_SCHEDULER_TaskContext *tc)
1051{ 1049{
1050 const struct GNUNET_SCHEDULER_TaskContext *tc;
1051
1052 ti_download_dispatcher_task = NULL; 1052 ti_download_dispatcher_task = NULL;
1053 tc = GNUNET_SCHEDULER_get_task_context ();
1053 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1054 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1054 return; 1055 return;
1055 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download is initiated...\n"); 1056 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download is initiated...\n");
@@ -1075,12 +1076,14 @@ task_download_dispatcher (void *cls,
1075 * this task again for a later time. 1076 * this task again for a later time.
1076 */ 1077 */
1077static void 1078static void
1078task_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1079task_check (void *cls)
1079{ 1080{
1080 static int once; 1081 static int once;
1081 struct GNUNET_TIME_Relative delay; 1082 struct GNUNET_TIME_Relative delay;
1083 const struct GNUNET_SCHEDULER_TaskContext *tc;
1082 1084
1083 ti_check_download = NULL; 1085 ti_check_download = NULL;
1086 tc = GNUNET_SCHEDULER_get_task_context ();
1084 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1087 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1085 return; 1088 return;
1086 if (stats == NULL) 1089 if (stats == NULL)
@@ -1125,13 +1128,14 @@ task_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1125 * This tasks sets hostlist testing to allowed after intervall between to testings is reached 1128 * This tasks sets hostlist testing to allowed after intervall between to testings is reached
1126 * 1129 *
1127 * @param cls closure 1130 * @param cls closure
1128 * @param tc TaskContext
1129 */ 1131 */
1130static void 1132static void
1131task_testing_intervall_reset (void *cls, 1133task_testing_intervall_reset (void *cls)
1132 const struct GNUNET_SCHEDULER_TaskContext *tc)
1133{ 1134{
1135 const struct GNUNET_SCHEDULER_TaskContext *tc;
1136
1134 ti_testing_intervall_task = NULL; 1137 ti_testing_intervall_task = NULL;
1138 tc = GNUNET_SCHEDULER_get_task_context ();
1135 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1139 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1136 return; 1140 return;
1137 stat_testing_allowed = GNUNET_OK; 1141 stat_testing_allowed = GNUNET_OK;
@@ -1144,12 +1148,14 @@ task_testing_intervall_reset (void *cls,
1144 * Task that writes hostlist entries to a file on a regular base 1148 * Task that writes hostlist entries to a file on a regular base
1145 * 1149 *
1146 * @param cls closure 1150 * @param cls closure
1147 * @param tc TaskContext
1148 */ 1151 */
1149static void 1152static void
1150task_hostlist_saving (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1153task_hostlist_saving (void *cls)
1151{ 1154{
1155 const struct GNUNET_SCHEDULER_TaskContext *tc;
1156
1152 ti_saving_task = NULL; 1157 ti_saving_task = NULL;
1158 tc = GNUNET_SCHEDULER_get_task_context ();
1153 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1159 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1154 return; 1160 return;
1155 save_hostlist_file (GNUNET_NO); 1161 save_hostlist_file (GNUNET_NO);
diff --git a/src/hostlist/gnunet-daemon-hostlist_server.c b/src/hostlist/gnunet-daemon-hostlist_server.c
index 7c5b18605..6e2cb7ee4 100644
--- a/src/hostlist/gnunet-daemon-hostlist_server.c
+++ b/src/hostlist/gnunet-daemon-hostlist_server.c
@@ -627,19 +627,18 @@ prepare_daemon (struct MHD_Daemon *daemon_handle);
627 * and schedule the next run. 627 * and schedule the next run.
628 * 628 *
629 * @param cls the `struct MHD_Daemon` of the HTTP server to run 629 * @param cls the `struct MHD_Daemon` of the HTTP server to run
630 * @param tc scheduler context
631 */ 630 */
632static void 631static void
633run_daemon (void *cls, 632run_daemon (void *cls)
634 const struct GNUNET_SCHEDULER_TaskContext *tc)
635{ 633{
636 struct MHD_Daemon *daemon_handle = cls; 634 struct MHD_Daemon *daemon_handle = cls;
635 const struct GNUNET_SCHEDULER_TaskContext *tc;
637 636
638 if (daemon_handle == daemon_handle_v4) 637 if (daemon_handle == daemon_handle_v4)
639 hostlist_task_v4 = NULL; 638 hostlist_task_v4 = NULL;
640 else 639 else
641 hostlist_task_v6 = NULL; 640 hostlist_task_v6 = NULL;
642 641 tc = GNUNET_SCHEDULER_get_task_context ();
643 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 642 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
644 return; 643 return;
645 GNUNET_assert (MHD_YES == MHD_run (daemon_handle)); 644 GNUNET_assert (MHD_YES == MHD_run (daemon_handle));
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c
index 05e05e24e..2f99b887d 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist.c
@@ -52,7 +52,7 @@ static struct PeerContext p2;
52 52
53 53
54static void 54static void
55clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 55clean_up (void *cls)
56{ 56{
57 if (p1.th != NULL) 57 if (p1.th != NULL)
58 { 58 {
@@ -81,12 +81,12 @@ clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
81 * Timeout, give up. 81 * Timeout, give up.
82 */ 82 */
83static void 83static void
84timeout_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 84timeout_error (void *cls)
85{ 85{
86 timeout_task = NULL; 86 timeout_task = NULL;
87 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 87 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
88 "Timeout trying to connect peers, test failed.\n"); 88 "Timeout trying to connect peers, test failed.\n");
89 clean_up (NULL, tc); 89 clean_up (NULL);
90} 90}
91 91
92 92
@@ -150,7 +150,7 @@ setup_peer (struct PeerContext *p, const char *cfgname)
150 150
151 151
152static void 152static void
153waitpid_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 153waitpid_task (void *cls)
154{ 154{
155 struct PeerContext *p = cls; 155 struct PeerContext *p = cls;
156 156
@@ -179,7 +179,7 @@ stop_arm (struct PeerContext *p)
179 * Try again to connect to transport service. 179 * Try again to connect to transport service.
180 */ 180 */
181static void 181static void
182shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 182shutdown_task (void *cls)
183{ 183{
184 stop_arm (&p1); 184 stop_arm (&p1);
185 stop_arm (&p2); 185 stop_arm (&p2);
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
index d04c5c57f..a71b8ecae 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
@@ -166,7 +166,7 @@ shutdown_testcase ()
166 * Timeout, give up. 166 * Timeout, give up.
167 */ 167 */
168static void 168static void
169timeout_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 169timeout_error (void *cls)
170{ 170{
171 timeout_task = NULL; 171 timeout_task = NULL;
172 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 172 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -184,8 +184,7 @@ process_downloads_done (void *cls, int success)
184 184
185 185
186static void 186static void
187do_shutdown (void *cls, 187do_shutdown (void *cls)
188 const struct GNUNET_SCHEDULER_TaskContext *tc)
189{ 188{
190 shutdown_testcase (); 189 shutdown_testcase ();
191} 190}
@@ -265,11 +264,13 @@ process_adv_sent (void *cls, const char *subsystem, const char *name,
265 * Check the server statistics regularly 264 * Check the server statistics regularly
266 */ 265 */
267static void 266static void
268check_statistics (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 267check_statistics (void *cls)
269{ 268{
270 char *stat; 269 char *stat;
270 const struct GNUNET_SCHEDULER_TaskContext *tc;
271 271
272 check_task = NULL; 272 check_task = NULL;
273 tc = GNUNET_SCHEDULER_get_task_context ();
273 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 274 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
274 return; 275 return;
275 GNUNET_asprintf (&stat, gettext_noop ("# advertised URI `%s' downloaded"), 276 GNUNET_asprintf (&stat, gettext_noop ("# advertised URI `%s' downloaded"),
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
index e7ac9b2bc..0af16e065 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
@@ -52,7 +52,7 @@ static struct PeerContext p2;
52 52
53 53
54static void 54static void
55clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 55clean_up (void *cls)
56{ 56{
57 if (NULL != p1.ghh) 57 if (NULL != p1.ghh)
58 { 58 {
@@ -81,12 +81,12 @@ clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
81 * Timeout, give up. 81 * Timeout, give up.
82 */ 82 */
83static void 83static void
84timeout_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 84timeout_error (void *cls)
85{ 85{
86 timeout_task = NULL; 86 timeout_task = NULL;
87 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 87 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
88 "Timeout trying to connect peers, test failed.\n"); 88 "Timeout trying to connect peers, test failed.\n");
89 clean_up (NULL, tc); 89 clean_up (NULL);
90} 90}
91 91
92 92
@@ -150,7 +150,7 @@ setup_peer (struct PeerContext *p, const char *cfgname)
150 150
151 151
152static void 152static void
153waitpid_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 153waitpid_task (void *cls)
154{ 154{
155 struct PeerContext *p = cls; 155 struct PeerContext *p = cls;
156 156
@@ -179,7 +179,7 @@ stop_arm (struct PeerContext *p)
179 * Try again to connect to transport service. 179 * Try again to connect to transport service.
180 */ 180 */
181static void 181static void
182shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 182shutdown_task (void *cls)
183{ 183{
184 stop_arm (&p1); 184 stop_arm (&p1);
185 stop_arm (&p2); 185 stop_arm (&p2);
diff --git a/src/identity-provider/gnunet-service-identity-provider.c b/src/identity-provider/gnunet-service-identity-provider.c
index 3328035e6..59e678b24 100644
--- a/src/identity-provider/gnunet-service-identity-provider.c
+++ b/src/identity-provider/gnunet-service-identity-provider.c
@@ -182,7 +182,7 @@ struct ExchangeHandle
182 * LookupRequest 182 * LookupRequest
183 */ 183 */
184 struct GNUNET_GNS_LookupRequest *lookup_request; 184 struct GNUNET_GNS_LookupRequest *lookup_request;
185 185
186 /** 186 /**
187 * Audience Key 187 * Audience Key
188 */ 188 */
@@ -324,11 +324,9 @@ store_token_cont (void *cls,
324 * removes deleted attributes and expiration times. 324 * removes deleted attributes and expiration times.
325 * 325 *
326 * @param cls the ego entry 326 * @param cls the ego entry
327 * @param tc task context
328 */ 327 */
329static void 328static void
330handle_token_update (void *cls, 329handle_token_update (void *cls)
331 const struct GNUNET_SCHEDULER_TaskContext *tc)
332{ 330{
333 char *token_metadata; 331 char *token_metadata;
334 char *write_ptr; 332 char *write_ptr;
@@ -428,13 +426,13 @@ handle_token_update (void *cls,
428 attr->name, 426 attr->name,
429 attr->val_head->value); 427 attr->val_head->value);
430 } 428 }
431 else 429 else
432 { 430 {
433 GNUNET_CRYPTO_hash (attr->name, 431 GNUNET_CRYPTO_hash (attr->name,
434 strlen (attr->name), 432 strlen (attr->name),
435 &key_hash); 433 &key_hash);
436 //Check if attr still exists. omit of not 434 //Check if attr still exists. omit of not
437 if (GNUNET_NO != 435 if (GNUNET_NO !=
438 GNUNET_CONTAINER_multihashmap_contains (ego_entry->attr_map, 436 GNUNET_CONTAINER_multihashmap_contains (ego_entry->attr_map,
439 &key_hash)) 437 &key_hash))
440 { 438 {
@@ -497,8 +495,7 @@ handle_token_update (void *cls,
497} 495}
498 496
499static void 497static void
500update_identities(void *cls, 498update_identities(void *cls);
501 const struct GNUNET_SCHEDULER_TaskContext *tc);
502 499
503/** 500/**
504 * 501 *
@@ -568,7 +565,7 @@ token_collect (void *cls,
568 GNUNET_CONTAINER_multihashmap_clear (ego_entry->attr_map); 565 GNUNET_CONTAINER_multihashmap_clear (ego_entry->attr_map);
569 update_task = GNUNET_SCHEDULER_add_now (&update_identities, 566 update_task = GNUNET_SCHEDULER_add_now (&update_identities,
570 ego_entry->next); 567 ego_entry->next);
571 return; 568 return;
572 } 569 }
573 570
574 //There should be only a single record for a token under a label 571 //There should be only a single record for a token under a label
@@ -607,7 +604,7 @@ token_collect (void *cls,
607 aud_key, 604 aud_key,
608 &token); 605 &token);
609 606
610 label = GNUNET_strdup (lbl); 607 label = GNUNET_strdup (lbl);
611 rd_exp = token_record->expiration_time; 608 rd_exp = token_record->expiration_time;
612 609
613 GNUNET_SCHEDULER_add_now (&handle_token_update, ego_entry); 610 GNUNET_SCHEDULER_add_now (&handle_token_update, ego_entry);
@@ -711,12 +708,9 @@ attribute_collect (void *cls,
711 * dirty, first update the attributes. 708 * dirty, first update the attributes.
712 * 709 *
713 * @param cls the ego to update 710 * @param cls the ego to update
714 * param tc task context
715 *
716 */ 711 */
717static void 712static void
718update_identities(void *cls, 713update_identities(void *cls)
719 const struct GNUNET_SCHEDULER_TaskContext *tc)
720{ 714{
721 struct EgoEntry *next_ego = cls; 715 struct EgoEntry *next_ego = cls;
722 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key; 716 const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key;
@@ -866,8 +860,7 @@ cleanup()
866 * @param tc task context 860 * @param tc task context
867 */ 861 */
868static void 862static void
869do_shutdown (void *cls, 863do_shutdown (void *cls)
870 const struct GNUNET_SCHEDULER_TaskContext *tc)
871{ 864{
872 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 865 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
873 "Shutting down...\n"); 866 "Shutting down...\n");
@@ -882,10 +875,10 @@ create_exchange_result_message (const char* token,
882{ 875{
883 struct GNUNET_IDENTITY_PROVIDER_ExchangeResultMessage *erm; 876 struct GNUNET_IDENTITY_PROVIDER_ExchangeResultMessage *erm;
884 uint16_t token_len = strlen (token) + 1; 877 uint16_t token_len = strlen (token) + 1;
885 erm = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_PROVIDER_ExchangeResultMessage) 878 erm = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_PROVIDER_ExchangeResultMessage)
886 + token_len); 879 + token_len);
887 erm->header.type = htons (GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_EXCHANGE_RESULT); 880 erm->header.type = htons (GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_EXCHANGE_RESULT);
888 erm->header.size = htons (sizeof (struct GNUNET_IDENTITY_PROVIDER_ExchangeResultMessage) 881 erm->header.size = htons (sizeof (struct GNUNET_IDENTITY_PROVIDER_ExchangeResultMessage)
889 + token_len); 882 + token_len);
890 erm->ticket_nonce = htonl (ticket_nonce); 883 erm->ticket_nonce = htonl (ticket_nonce);
891 memcpy (&erm[1], token, token_len); 884 memcpy (&erm[1], token, token_len);
@@ -901,12 +894,12 @@ create_issue_result_message (const char* label,
901 struct GNUNET_IDENTITY_PROVIDER_IssueResultMessage *irm; 894 struct GNUNET_IDENTITY_PROVIDER_IssueResultMessage *irm;
902 char *tmp_str; 895 char *tmp_str;
903 896
904 irm = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_PROVIDER_IssueResultMessage) 897 irm = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_PROVIDER_IssueResultMessage)
905 + strlen (label) + 1 898 + strlen (label) + 1
906 + strlen (ticket) + 1 899 + strlen (ticket) + 1
907 + strlen (token) + 1); 900 + strlen (token) + 1);
908 irm->header.type = htons (GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_RESULT); 901 irm->header.type = htons (GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_ISSUE_RESULT);
909 irm->header.size = htons (sizeof (struct GNUNET_IDENTITY_PROVIDER_IssueResultMessage) 902 irm->header.size = htons (sizeof (struct GNUNET_IDENTITY_PROVIDER_IssueResultMessage)
910 + strlen (label) + 1 903 + strlen (label) + 1
911 + strlen (ticket) + 1 904 + strlen (ticket) + 1
912 + strlen (token) + 1); 905 + strlen (token) + 1);
@@ -957,7 +950,7 @@ store_token_issue_cont (void *cls,
957 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s\n", 950 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s\n",
958 "Error serializing ticket\n"); 951 "Error serializing ticket\n");
959 cleanup_issue_handle (handle); 952 cleanup_issue_handle (handle);
960 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 953 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
961 return; 954 return;
962 } 955 }
963 if (GNUNET_OK != token_to_string (handle->token, 956 if (GNUNET_OK != token_to_string (handle->token,
@@ -968,7 +961,7 @@ store_token_issue_cont (void *cls,
968 "Error serializing token\n"); 961 "Error serializing token\n");
969 GNUNET_free (ticket_str); 962 GNUNET_free (ticket_str);
970 cleanup_issue_handle (handle); 963 cleanup_issue_handle (handle);
971 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 964 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
972 return; 965 return;
973 } 966 }
974 irm = create_issue_result_message (handle->label, ticket_str, token_str); 967 irm = create_issue_result_message (handle->label, ticket_str, token_str);
@@ -983,8 +976,12 @@ store_token_issue_cont (void *cls,
983 GNUNET_free (token_str); 976 GNUNET_free (token_str);
984} 977}
985 978
979
986/** 980/**
987 * Build a GNUid token for identity 981 * Build a GNUid token for identity
982 *
983 * FIXME: doxygen is very wrong here!
984 *
988 * @param handle the handle 985 * @param handle the handle
989 * @param ego_entry the ego to build the token for 986 * @param ego_entry the ego to build the token for
990 * @param name name of the ego 987 * @param name name of the ego
@@ -993,8 +990,7 @@ store_token_issue_cont (void *cls,
993 * @return identifier string of token (label) 990 * @return identifier string of token (label)
994 */ 991 */
995static void 992static void
996sign_and_return_token (void *cls, 993sign_and_return_token (void *cls)
997 const struct GNUNET_SCHEDULER_TaskContext *tc)
998{ 994{
999 struct GNUNET_CRYPTO_EcdsaPublicKey pub_key; 995 struct GNUNET_CRYPTO_EcdsaPublicKey pub_key;
1000 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey; 996 struct GNUNET_CRYPTO_EcdhePrivateKey *ecdhe_privkey;
@@ -1008,7 +1004,7 @@ sign_and_return_token (void *cls,
1008 uint64_t exp_time; 1004 uint64_t exp_time;
1009 size_t token_metadata_len; 1005 size_t token_metadata_len;
1010 1006
1011 //Remote nonce 1007 //Remote nonce
1012 nonce_str = NULL; 1008 nonce_str = NULL;
1013 GNUNET_asprintf (&nonce_str, "%lu", handle->nonce); 1009 GNUNET_asprintf (&nonce_str, "%lu", handle->nonce);
1014 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Request nonce: %s\n", nonce_str); 1010 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Request nonce: %s\n", nonce_str);
@@ -1028,7 +1024,7 @@ sign_and_return_token (void *cls,
1028 token_add_attr_int (handle->token, "exp", exp_time); 1024 token_add_attr_int (handle->token, "exp", exp_time);
1029 token_add_attr (handle->token, "nonce", nonce_str); 1025 token_add_attr (handle->token, "nonce", nonce_str);
1030 1026
1031 //Token in a serialized encrypted format 1027 //Token in a serialized encrypted format
1032 GNUNET_assert (token_serialize (handle->token, 1028 GNUNET_assert (token_serialize (handle->token,
1033 &handle->iss_key, 1029 &handle->iss_key,
1034 &ecdhe_privkey, 1030 &ecdhe_privkey,
@@ -1150,7 +1146,7 @@ attr_collect (void *cls,
1150static void 1146static void
1151cleanup_exchange_handle (struct ExchangeHandle *handle) 1147cleanup_exchange_handle (struct ExchangeHandle *handle)
1152{ 1148{
1153 if (NULL != handle->ticket) 1149 if (NULL != handle->ticket)
1154 ticket_destroy (handle->ticket); 1150 ticket_destroy (handle->ticket);
1155 if (NULL != handle->token) 1151 if (NULL != handle->token)
1156 token_destroy (handle->token); 1152 token_destroy (handle->token);
@@ -1177,7 +1173,7 @@ process_lookup_result (void *cls, uint32_t rd_count,
1177 return; 1173 return;
1178 } 1174 }
1179 1175
1180 record_str = 1176 record_str =
1181 GNUNET_GNSRECORD_value_to_string (GNUNET_GNSRECORD_TYPE_ID_TOKEN, 1177 GNUNET_GNSRECORD_value_to_string (GNUNET_GNSRECORD_TYPE_ID_TOKEN,
1182 rd->data, 1178 rd->data,
1183 rd->data_size); 1179 rd->data_size);
@@ -1307,7 +1303,7 @@ find_existing_token (void *cls,
1307 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1303 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1308 ">>> No existing token found\n"); 1304 ">>> No existing token found\n");
1309 //Label 1305 //Label
1310 rnd_key = 1306 rnd_key =
1311 GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_STRONG, 1307 GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_STRONG,
1312 UINT64_MAX); 1308 UINT64_MAX);
1313 GNUNET_STRINGS_base64_encode ((char*)&rnd_key, 1309 GNUNET_STRINGS_base64_encode ((char*)&rnd_key,
@@ -1318,7 +1314,7 @@ find_existing_token (void *cls,
1318 &handle->iss_key, 1314 &handle->iss_key,
1319 &attr_collect, 1315 &attr_collect,
1320 handle); 1316 handle);
1321 return; 1317 return;
1322 } 1318 }
1323 1319
1324 //There should be only a single record for a token under a label 1320 //There should be only a single record for a token under a label
@@ -1340,7 +1336,7 @@ find_existing_token (void *cls,
1340 return; 1336 return;
1341 } 1337 }
1342 ecdhe_privkey = *((struct GNUNET_CRYPTO_EcdhePrivateKey *)token_metadata_record->data); 1338 ecdhe_privkey = *((struct GNUNET_CRYPTO_EcdhePrivateKey *)token_metadata_record->data);
1343 aud_key = 1339 aud_key =
1344 (struct GNUNET_CRYPTO_EcdsaPublicKey *)(token_metadata_record->data+sizeof(struct GNUNET_CRYPTO_EcdhePrivateKey)); 1340 (struct GNUNET_CRYPTO_EcdsaPublicKey *)(token_metadata_record->data+sizeof(struct GNUNET_CRYPTO_EcdhePrivateKey));
1345 tmp_scopes = GNUNET_strdup ((char*) aud_key+sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)); 1341 tmp_scopes = GNUNET_strdup ((char*) aud_key+sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
1346 1342
@@ -1435,12 +1431,11 @@ handle_issue_message (void *cls,
1435 } 1431 }
1436 im = (const struct GNUNET_IDENTITY_PROVIDER_IssueMessage *) message; 1432 im = (const struct GNUNET_IDENTITY_PROVIDER_IssueMessage *) message;
1437 scopes = (const char *) &im[1]; 1433 scopes = (const char *) &im[1];
1438 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1439 "Received ISSUE of `%s' from client\n",
1440 scope);
1441 issue_handle = GNUNET_malloc (sizeof (struct IssueHandle)); 1434 issue_handle = GNUNET_malloc (sizeof (struct IssueHandle));
1442 issue_handle->attr_map = GNUNET_CONTAINER_multihashmap_create (5, 1435 issue_handle->attr_map = GNUNET_CONTAINER_multihashmap_create (5,
1443 GNUNET_NO); 1436 GNUNET_NO);
1437 /* FIXME: check that scopes is 0-termianted, Out-of-bounds access
1438 possible here!!! */
1444 scopes_tmp = GNUNET_strdup (scopes); 1439 scopes_tmp = GNUNET_strdup (scopes);
1445 scope = strtok(scopes_tmp, ","); 1440 scope = strtok(scopes_tmp, ",");
1446 for (; NULL != scope; scope = strtok (NULL, ",")) 1441 for (; NULL != scope; scope = strtok (NULL, ","))
@@ -1484,7 +1479,7 @@ handle_issue_message (void *cls,
1484 * @param c configuration 1479 * @param c configuration
1485 */ 1480 */
1486static void 1481static void
1487run (void *cls, 1482run (void *cls,
1488 struct GNUNET_SERVER_Handle *server, 1483 struct GNUNET_SERVER_Handle *server,
1489 const struct GNUNET_CONFIGURATION_Handle *c) 1484 const struct GNUNET_CONFIGURATION_Handle *c)
1490{ 1485{
@@ -1519,7 +1514,7 @@ run (void *cls,
1519 &list_ego, 1514 &list_ego,
1520 NULL); 1515 NULL);
1521 1516
1522 if (GNUNET_OK == 1517 if (GNUNET_OK ==
1523 GNUNET_CONFIGURATION_get_value_time (cfg, 1518 GNUNET_CONFIGURATION_get_value_time (cfg,
1524 "identity-provider", 1519 "identity-provider",
1525 "TOKEN_EXPIRATION_INTERVAL", 1520 "TOKEN_EXPIRATION_INTERVAL",
diff --git a/src/identity-provider/identity_provider_api.c b/src/identity-provider/identity_provider_api.c
index f702ba890..f3280cb18 100644
--- a/src/identity-provider/identity_provider_api.c
+++ b/src/identity-provider/identity_provider_api.c
@@ -138,11 +138,9 @@ struct GNUNET_IDENTITY_PROVIDER_Handle
138 * Try again to connect to the service. 138 * Try again to connect to the service.
139 * 139 *
140 * @param cls handle to the service. 140 * @param cls handle to the service.
141 * @param tc scheduler context
142 */ 141 */
143static void 142static void
144reconnect (void *cls, 143reconnect (void *cls);
145 const struct GNUNET_SCHEDULER_TaskContext *tc);
146 144
147 145
148/** 146/**
@@ -233,7 +231,7 @@ message_handler (void *cls,
233 str = NULL; 231 str = NULL;
234 } 232 }
235 label_str = strtok (str, ","); 233 label_str = strtok (str, ",");
236 234
237 if (NULL == label_str) 235 if (NULL == label_str)
238 { 236 {
239 GNUNET_free (str); 237 GNUNET_free (str);
@@ -301,7 +299,7 @@ message_handler (void *cls,
301 op->ex_cb (op->cls, &token, ticket_nonce); 299 op->ex_cb (op->cls, &token, ticket_nonce);
302 GNUNET_free (op); 300 GNUNET_free (op);
303 break; 301 break;
304 302
305 default: 303 default:
306 GNUNET_break (0); 304 GNUNET_break (0);
307 reschedule_connect (h); 305 reschedule_connect (h);
@@ -397,10 +395,9 @@ transmit_next (struct GNUNET_IDENTITY_PROVIDER_Handle *h)
397 * Try again to connect to the service. 395 * Try again to connect to the service.
398 * 396 *
399 * @param cls handle to the identity provider service. 397 * @param cls handle to the identity provider service.
400 * @param tc scheduler context
401 */ 398 */
402static void 399static void
403reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 400reconnect (void *cls)
404{ 401{
405 struct GNUNET_IDENTITY_PROVIDER_Handle *h = cls; 402 struct GNUNET_IDENTITY_PROVIDER_Handle *h = cls;
406 403
diff --git a/src/identity-provider/plugin_rest_identity_provider.c b/src/identity-provider/plugin_rest_identity_provider.c
index 3a6151682..b104950ba 100644
--- a/src/identity-provider/plugin_rest_identity_provider.c
+++ b/src/identity-provider/plugin_rest_identity_provider.c
@@ -150,12 +150,12 @@ struct EgoEntry
150 * DLL 150 * DLL
151 */ 151 */
152 struct EgoEntry *next; 152 struct EgoEntry *next;
153 153
154 /** 154 /**
155 * DLL 155 * DLL
156 */ 156 */
157 struct EgoEntry *prev; 157 struct EgoEntry *prev;
158 158
159 /** 159 /**
160 * Ego Identifier 160 * Ego Identifier
161 */ 161 */
@@ -165,7 +165,7 @@ struct EgoEntry
165 * Public key string 165 * Public key string
166 */ 166 */
167 char *keystring; 167 char *keystring;
168 168
169 /** 169 /**
170 * The Ego 170 * The Ego
171 */ 171 */
@@ -189,7 +189,7 @@ struct RequestHandle
189 * Selected ego 189 * Selected ego
190 */ 190 */
191 struct EgoEntry *ego_entry; 191 struct EgoEntry *ego_entry;
192 192
193 /** 193 /**
194 * Ptr to current ego private key 194 * Ptr to current ego private key
195 */ 195 */
@@ -199,7 +199,7 @@ struct RequestHandle
199 * Handle to the rest connection 199 * Handle to the rest connection
200 */ 200 */
201 struct RestConnectionDataHandle *conndata_handle; 201 struct RestConnectionDataHandle *conndata_handle;
202 202
203 /** 203 /**
204 * The processing state 204 * The processing state
205 */ 205 */
@@ -248,8 +248,8 @@ struct RequestHandle
248 /** 248 /**
249 * ID of a task associated with the resolution process. 249 * ID of a task associated with the resolution process.
250 */ 250 */
251 struct GNUNET_SCHEDULER_Task * timeout_task; 251 struct GNUNET_SCHEDULER_Task * timeout_task;
252 252
253 /** 253 /**
254 * The plugin result processor 254 * The plugin result processor
255 */ 255 */
@@ -289,7 +289,7 @@ cleanup_handle (struct RequestHandle *handle)
289 struct EgoEntry *ego_tmp; 289 struct EgoEntry *ego_tmp;
290 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 290 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
291 "Cleaning up\n"); 291 "Cleaning up\n");
292 if (NULL != handle->resp_object) 292 if (NULL != handle->resp_object)
293 GNUNET_REST_jsonapi_object_delete (handle->resp_object); 293 GNUNET_REST_jsonapi_object_delete (handle->resp_object);
294 if (NULL != handle->timeout_task) 294 if (NULL != handle->timeout_task)
295 GNUNET_SCHEDULER_cancel (handle->timeout_task); 295 GNUNET_SCHEDULER_cancel (handle->timeout_task);
@@ -324,11 +324,9 @@ cleanup_handle (struct RequestHandle *handle)
324 * Task run on shutdown. Cleans up everything. 324 * Task run on shutdown. Cleans up everything.
325 * 325 *
326 * @param cls unused 326 * @param cls unused
327 * @param tc scheduler context
328 */ 327 */
329static void 328static void
330do_error (void *cls, 329do_error (void *cls)
331 const struct GNUNET_SCHEDULER_TaskContext *tc)
332{ 330{
333 struct RequestHandle *handle = cls; 331 struct RequestHandle *handle = cls;
334 struct MHD_Response *resp; 332 struct MHD_Response *resp;
@@ -347,11 +345,9 @@ do_error (void *cls,
347 * Task run on shutdown. Cleans up everything. 345 * Task run on shutdown. Cleans up everything.
348 * 346 *
349 * @param cls unused 347 * @param cls unused
350 * @param tc scheduler context
351 */ 348 */
352static void 349static void
353do_cleanup_handle_delayed (void *cls, 350do_cleanup_handle_delayed (void *cls)
354 const struct GNUNET_SCHEDULER_TaskContext *tc)
355{ 351{
356 struct RequestHandle *handle = cls; 352 struct RequestHandle *handle = cls;
357 cleanup_handle(handle); 353 cleanup_handle(handle);
@@ -377,7 +373,7 @@ token_creat_cont (void *cls,
377 char *ticket_str; 373 char *ticket_str;
378 char *token_str; 374 char *token_str;
379 char *result_str; 375 char *result_str;
380 376
381 if (NULL == ticket) 377 if (NULL == ticket)
382 { 378 {
383 handle->emsg = GNUNET_strdup ("Error in token issue"); 379 handle->emsg = GNUNET_strdup ("Error in token issue");
@@ -536,7 +532,7 @@ issue_token_cont (struct RestConnectionDataHandle *con,
536 &aud_key, 532 &aud_key,
537 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)); 533 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
538 534
539 //Remote nonce 535 //Remote nonce
540 nonce_str = NULL; 536 nonce_str = NULL;
541 GNUNET_CRYPTO_hash (GNUNET_IDENTITY_TOKEN_REQUEST_NONCE, 537 GNUNET_CRYPTO_hash (GNUNET_IDENTITY_TOKEN_REQUEST_NONCE,
542 strlen (GNUNET_IDENTITY_TOKEN_REQUEST_NONCE), 538 strlen (GNUNET_IDENTITY_TOKEN_REQUEST_NONCE),
@@ -600,11 +596,9 @@ issue_token_cont (struct RestConnectionDataHandle *con,
600 * Build a GNUid token for identity 596 * Build a GNUid token for identity
601 * 597 *
602 * @param cls the request handle 598 * @param cls the request handle
603 * @param tc task context
604 */ 599 */
605static void 600static void
606return_token_list (void *cls, 601return_token_list (void *cls)
607 const struct GNUNET_SCHEDULER_TaskContext *tc)
608{ 602{
609 char* result_str; 603 char* result_str;
610 struct RequestHandle *handle = cls; 604 struct RequestHandle *handle = cls;
@@ -784,7 +778,7 @@ exchange_cont (void *cls,
784 char* token_str; 778 char* token_str;
785 char* nonce_str; 779 char* nonce_str;
786 uint64_t expected_nonce; 780 uint64_t expected_nonce;
787 781
788 //Get nonce 782 //Get nonce
789 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_IDENTITY_PROVIDER_EXPECTED_NONCE, 783 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_IDENTITY_PROVIDER_EXPECTED_NONCE,
790 strlen (GNUNET_REST_JSONAPI_IDENTITY_PROVIDER_EXPECTED_NONCE), 784 strlen (GNUNET_REST_JSONAPI_IDENTITY_PROVIDER_EXPECTED_NONCE),
@@ -823,7 +817,7 @@ exchange_cont (void *cls,
823 GNUNET_free (result); 817 GNUNET_free (result);
824 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 818 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
825 cleanup_handle (handle); 819 cleanup_handle (handle);
826 json_decref (root); 820 json_decref (root);
827} 821}
828 822
829 823
@@ -1010,7 +1004,7 @@ list_ego (void *cls,
1010 if (ID_REST_STATE_INIT == handle->state) { 1004 if (ID_REST_STATE_INIT == handle->state) {
1011 ego_entry = GNUNET_new (struct EgoEntry); 1005 ego_entry = GNUNET_new (struct EgoEntry);
1012 GNUNET_IDENTITY_ego_get_public_key (ego, &pk); 1006 GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
1013 ego_entry->keystring = 1007 ego_entry->keystring =
1014 GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); 1008 GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk);
1015 ego_entry->ego = ego; 1009 ego_entry->ego = ego;
1016 GNUNET_asprintf (&ego_entry->identifier, "%s", identifier); 1010 GNUNET_asprintf (&ego_entry->identifier, "%s", identifier);
diff --git a/src/identity/gnunet-identity.c b/src/identity/gnunet-identity.c
index 574586b40..dc9174d21 100644
--- a/src/identity/gnunet-identity.c
+++ b/src/identity/gnunet-identity.c
@@ -84,11 +84,9 @@ static struct GNUNET_IDENTITY_Operation *delete_op;
84 * Task run on shutdown. 84 * Task run on shutdown.
85 * 85 *
86 * @param cls NULL 86 * @param cls NULL
87 * @param tc unused
88 */ 87 */
89static void 88static void
90shutdown_task (void *cls, 89shutdown_task (void *cls)
91 const struct GNUNET_SCHEDULER_TaskContext *tc)
92{ 90{
93 if (NULL != set_op) 91 if (NULL != set_op)
94 { 92 {
diff --git a/src/identity/gnunet-service-identity.c b/src/identity/gnunet-service-identity.c
index 8a26fb8c3..d36319a99 100644
--- a/src/identity/gnunet-service-identity.c
+++ b/src/identity/gnunet-service-identity.c
@@ -134,10 +134,9 @@ get_ego_filename (struct Ego *ego)
134 * Task run during shutdown. 134 * Task run during shutdown.
135 * 135 *
136 * @param cls unused 136 * @param cls unused
137 * @param tc unused
138 */ 137 */
139static void 138static void
140shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 139shutdown_task (void *cls)
141{ 140{
142 struct Ego *e; 141 struct Ego *e;
143 142
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c
index 6b7ca5c44..1406ddd41 100644
--- a/src/identity/identity_api.c
+++ b/src/identity/identity_api.c
@@ -195,11 +195,9 @@ GNUNET_IDENTITY_ego_get_anonymous ()
195 * Try again to connect to the identity service. 195 * Try again to connect to the identity service.
196 * 196 *
197 * @param cls handle to the identity service. 197 * @param cls handle to the identity service.
198 * @param tc scheduler context
199 */ 198 */
200static void 199static void
201reconnect (void *cls, 200reconnect (void *cls);
202 const struct GNUNET_SCHEDULER_TaskContext *tc);
203 201
204 202
205/** 203/**
@@ -533,10 +531,9 @@ transmit_next (struct GNUNET_IDENTITY_Handle *h)
533 * Try again to connect to the identity service. 531 * Try again to connect to the identity service.
534 * 532 *
535 * @param cls handle to the identity service. 533 * @param cls handle to the identity service.
536 * @param tc scheduler context
537 */ 534 */
538static void 535static void
539reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 536reconnect (void *cls)
540{ 537{
541 struct GNUNET_IDENTITY_Handle *h = cls; 538 struct GNUNET_IDENTITY_Handle *h = cls;
542 struct GNUNET_IDENTITY_Operation *op; 539 struct GNUNET_IDENTITY_Operation *op;
diff --git a/src/identity/plugin_rest_identity.c b/src/identity/plugin_rest_identity.c
index 9ab3a8772..22ade6a0e 100644
--- a/src/identity/plugin_rest_identity.c
+++ b/src/identity/plugin_rest_identity.c
@@ -107,12 +107,12 @@ struct EgoEntry
107 * DLL 107 * DLL
108 */ 108 */
109 struct EgoEntry *next; 109 struct EgoEntry *next;
110 110
111 /** 111 /**
112 * DLL 112 * DLL
113 */ 113 */
114 struct EgoEntry *prev; 114 struct EgoEntry *prev;
115 115
116 /** 116 /**
117 * Ego Identifier 117 * Ego Identifier
118 */ 118 */
@@ -122,7 +122,7 @@ struct EgoEntry
122 * Public key string 122 * Public key string
123 */ 123 */
124 char *keystring; 124 char *keystring;
125 125
126 /** 126 /**
127 * The Ego 127 * The Ego
128 */ 128 */
@@ -146,7 +146,7 @@ struct RequestHandle
146 * Handle to the rest connection 146 * Handle to the rest connection
147 */ 147 */
148 struct RestConnectionDataHandle *conndata_handle; 148 struct RestConnectionDataHandle *conndata_handle;
149 149
150 /** 150 /**
151 * The processing state 151 * The processing state
152 */ 152 */
@@ -170,7 +170,7 @@ struct RequestHandle
170 /** 170 /**
171 * ID of a task associated with the resolution process. 171 * ID of a task associated with the resolution process.
172 */ 172 */
173 struct GNUNET_SCHEDULER_Task * timeout_task; 173 struct GNUNET_SCHEDULER_Task * timeout_task;
174 174
175 /** 175 /**
176 * The plugin result processor 176 * The plugin result processor
@@ -260,11 +260,9 @@ cleanup_handle (struct RequestHandle *handle)
260 * Task run on shutdown. Cleans up everything. 260 * Task run on shutdown. Cleans up everything.
261 * 261 *
262 * @param cls unused 262 * @param cls unused
263 * @param tc scheduler context
264 */ 263 */
265static void 264static void
266do_error (void *cls, 265do_error (void *cls)
267 const struct GNUNET_SCHEDULER_TaskContext *tc)
268{ 266{
269 struct RequestHandle *handle = cls; 267 struct RequestHandle *handle = cls;
270 struct MHD_Response *resp; 268 struct MHD_Response *resp;
@@ -528,7 +526,7 @@ ego_create_cont (struct RestConnectionDataHandle *con,
528 egoname_json = GNUNET_REST_jsonapi_resource_read_attr (json_res, GNUNET_REST_JSONAPI_IDENTITY_NAME); 526 egoname_json = GNUNET_REST_jsonapi_resource_read_attr (json_res, GNUNET_REST_JSONAPI_IDENTITY_NAME);
529 if (!json_is_string (egoname_json)) 527 if (!json_is_string (egoname_json))
530 { 528 {
531 GNUNET_REST_jsonapi_object_delete (json_obj); 529 GNUNET_REST_jsonapi_object_delete (json_obj);
532 handle->emsg = GNUNET_strdup ("No name provided"); 530 handle->emsg = GNUNET_strdup ("No name provided");
533 GNUNET_SCHEDULER_add_now (&do_error, handle); 531 GNUNET_SCHEDULER_add_now (&do_error, handle);
534 return; 532 return;
@@ -563,7 +561,7 @@ ego_create_cont (struct RestConnectionDataHandle *con,
563 * @param url the url that is requested 561 * @param url the url that is requested
564 * @param cls the RequestHandle 562 * @param cls the RequestHandle
565 */ 563 */
566static void 564static void
567ego_edit_cont (struct RestConnectionDataHandle *con, 565ego_edit_cont (struct RestConnectionDataHandle *con,
568 const char *url, 566 const char *url,
569 void *cls) 567 void *cls)
@@ -633,7 +631,7 @@ ego_edit_cont (struct RestConnectionDataHandle *con,
633 GNUNET_SCHEDULER_add_now (&do_error, handle); 631 GNUNET_SCHEDULER_add_now (&do_error, handle);
634 return; 632 return;
635 } 633 }
636 json_res = GNUNET_REST_jsonapi_object_get_resource (json_obj, 0); 634 json_res = GNUNET_REST_jsonapi_object_get_resource (json_obj, 0);
637 635
638 if (GNUNET_NO == GNUNET_REST_jsonapi_resource_check_type (json_res, GNUNET_REST_JSONAPI_IDENTITY_EGO)) 636 if (GNUNET_NO == GNUNET_REST_jsonapi_resource_check_type (json_res, GNUNET_REST_JSONAPI_IDENTITY_EGO))
639 { 637 {
@@ -692,7 +690,7 @@ ego_edit_cont (struct RestConnectionDataHandle *con,
692 GNUNET_SCHEDULER_add_now (&do_error, handle); 690 GNUNET_SCHEDULER_add_now (&do_error, handle);
693} 691}
694 692
695void 693void
696ego_delete_cont (struct RestConnectionDataHandle *con_handle, 694ego_delete_cont (struct RestConnectionDataHandle *con_handle,
697 const char* url, 695 const char* url,
698 void *cls) 696 void *cls)
@@ -836,7 +834,7 @@ list_ego (void *cls,
836 if (ID_REST_STATE_INIT == handle->state) { 834 if (ID_REST_STATE_INIT == handle->state) {
837 ego_entry = GNUNET_new (struct EgoEntry); 835 ego_entry = GNUNET_new (struct EgoEntry);
838 GNUNET_IDENTITY_ego_get_public_key (ego, &pk); 836 GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
839 ego_entry->keystring = 837 ego_entry->keystring =
840 GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); 838 GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk);
841 ego_entry->ego = ego; 839 ego_entry->ego = ego;
842 GNUNET_asprintf (&ego_entry->identifier, "%s", identifier); 840 GNUNET_asprintf (&ego_entry->identifier, "%s", identifier);
diff --git a/src/identity/test_identity.c b/src/identity/test_identity.c
index 12d182c65..6eaa86e91 100644
--- a/src/identity/test_identity.c
+++ b/src/identity/test_identity.c
@@ -77,10 +77,9 @@ cleanup ()
77 * Termiante the testcase (failure). 77 * Termiante the testcase (failure).
78 * 78 *
79 * @param cls NULL 79 * @param cls NULL
80 * @param tc scheduler context
81 */ 80 */
82static void 81static void
83endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 82endbadly (void *cls)
84{ 83{
85 cleanup (); 84 cleanup ();
86 res = 1; 85 res = 1;
@@ -91,10 +90,9 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
91 * Termiante the testcase (success). 90 * Termiante the testcase (success).
92 * 91 *
93 * @param cls NULL 92 * @param cls NULL
94 * @param tc scheduler context
95 */ 93 */
96static void 94static void
97end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 95end_normally (void *cls)
98{ 96{
99 cleanup (); 97 cleanup ();
100 res = 0; 98 res = 0;
diff --git a/src/identity/test_identity_defaults.c b/src/identity/test_identity_defaults.c
index 961066627..207db321f 100644
--- a/src/identity/test_identity_defaults.c
+++ b/src/identity/test_identity_defaults.c
@@ -77,10 +77,9 @@ cleanup ()
77 * Termiante the testcase (failure). 77 * Termiante the testcase (failure).
78 * 78 *
79 * @param cls NULL 79 * @param cls NULL
80 * @param tc scheduler context
81 */ 80 */
82static void 81static void
83endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 82endbadly (void *cls)
84{ 83{
85 cleanup (); 84 cleanup ();
86 res = 1; 85 res = 1;
@@ -91,10 +90,9 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
91 * Termiante the testcase (success). 90 * Termiante the testcase (success).
92 * 91 *
93 * @param cls NULL 92 * @param cls NULL
94 * @param tc scheduler context
95 */ 93 */
96static void 94static void
97end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 95end_normally (void *cls)
98{ 96{
99 cleanup (); 97 cleanup ();
100 res = 0; 98 res = 0;
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h
index 3fa2497d6..1cb01d038 100644
--- a/src/include/gnunet_os_lib.h
+++ b/src/include/gnunet_os_lib.h
@@ -572,12 +572,9 @@ GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc);
572 * variable) and raise those signals. 572 * variable) and raise those signals.
573 * 573 *
574 * @param cls closure (unused) 574 * @param cls closure (unused)
575 * @param tc scheduler context (unused)
576 */ 575 */
577void 576void
578GNUNET_OS_install_parent_control_handler (void *cls, 577GNUNET_OS_install_parent_control_handler (void *cls);
579 const struct
580 GNUNET_SCHEDULER_TaskContext *tc);
581 578
582 579
583/** 580/**
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index e93eab41f..d9b63775a 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet 2 This file is part of GNUnet
3 Copyright (C) 2009-2015 GNUnet e.V. 3 Copyright (C) 2009-2016 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -131,8 +131,7 @@ struct GNUNET_SCHEDULER_TaskContext
131 * @param tc context information (why was this task triggered now) 131 * @param tc context information (why was this task triggered now)
132 */ 132 */
133typedef void 133typedef void
134(*GNUNET_SCHEDULER_TaskCallback) (void *cls, 134(*GNUNET_SCHEDULER_TaskCallback) (void *cls);
135 const struct GNUNET_SCHEDULER_TaskContext *tc);
136 135
137 136
138/** 137/**
@@ -200,14 +199,13 @@ GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p);
200 199
201 200
202/** 201/**
203 * Obtain the reason code for why the current task was 202 * Obtain the reasoning why the current task was
204 * started. Will return the same value as 203 * started.
205 * the GNUNET_SCHEDULER_TaskContext's reason field.
206 * 204 *
207 * @return reason(s) why the current task is run 205 * @return task context with information why the current task is run
208 */ 206 */
209enum GNUNET_SCHEDULER_Reason 207const struct GNUNET_SCHEDULER_TaskContext *
210GNUNET_SCHEDULER_get_reason (void); 208GNUNET_SCHEDULER_get_task_context (void);
211 209
212 210
213/** 211/**
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h
index f70f28116..1ad2fc8b7 100644
--- a/src/include/gnunet_server_lib.h
+++ b/src/include/gnunet_server_lib.h
@@ -453,8 +453,9 @@ GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client,
453 * @param client identification of the client; NULL 453 * @param client identification of the client; NULL
454 * for the last call when the server is destroyed 454 * for the last call when the server is destroyed
455 */ 455 */
456typedef void (*GNUNET_SERVER_DisconnectCallback) (void *cls, 456typedef void
457 struct GNUNET_SERVER_Client *client); 457(*GNUNET_SERVER_DisconnectCallback) (void *cls,
458 struct GNUNET_SERVER_Client *client);
458 459
459 460
460/** 461/**
@@ -464,8 +465,9 @@ typedef void (*GNUNET_SERVER_DisconnectCallback) (void *cls,
464 * @param cls closure 465 * @param cls closure
465 * @param client identification of the client 466 * @param client identification of the client
466 */ 467 */
467typedef void (*GNUNET_SERVER_ConnectCallback) (void *cls, 468typedef void
468 struct GNUNET_SERVER_Client *client); 469(*GNUNET_SERVER_ConnectCallback) (void *cls,
470 struct GNUNET_SERVER_Client *client);
469 471
470 472
471/** 473/**
@@ -799,8 +801,9 @@ GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer *mst);
799 * @param client handle to client the tokenzier will be used for 801 * @param client handle to client the tokenzier will be used for
800 * @return handle to custom tokenizer ('mst') 802 * @return handle to custom tokenizer ('mst')
801 */ 803 */
802typedef void* (*GNUNET_SERVER_MstCreateCallback) (void *cls, 804typedef void*
803 struct GNUNET_SERVER_Client *client); 805(*GNUNET_SERVER_MstCreateCallback) (void *cls,
806 struct GNUNET_SERVER_Client *client);
804 807
805 808
806/** 809/**
@@ -809,7 +812,9 @@ typedef void* (*GNUNET_SERVER_MstCreateCallback) (void *cls,
809 * @param cls closure from #GNUNET_SERVER_set_callbacks 812 * @param cls closure from #GNUNET_SERVER_set_callbacks
810 * @param mst custom tokenizer handle 813 * @param mst custom tokenizer handle
811 */ 814 */
812typedef void (*GNUNET_SERVER_MstDestroyCallback) (void *cls, void *mst); 815typedef void
816(*GNUNET_SERVER_MstDestroyCallback) (void *cls,
817 void *mst);
813 818
814 819
815/** 820/**
@@ -828,10 +833,13 @@ typedef void (*GNUNET_SERVER_MstDestroyCallback) (void *cls, void *mst);
828 * #GNUNET_NO if one_shot was set and we have another message ready 833 * #GNUNET_NO if one_shot was set and we have another message ready
829 * #GNUNET_SYSERR if the data stream is corrupt 834 * #GNUNET_SYSERR if the data stream is corrupt
830 */ 835 */
831typedef int (*GNUNET_SERVER_MstReceiveCallback) (void *cls, void *mst, 836typedef int
832 struct GNUNET_SERVER_Client *client, 837(*GNUNET_SERVER_MstReceiveCallback) (void *cls, void *mst,
833 const char *buf, size_t size, 838 struct GNUNET_SERVER_Client *client,
834 int purge, int one_shot); 839 const char *buf,
840 size_t size,
841 int purge,
842 int one_shot);
835 843
836 844
837/** 845/**
diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c
index 69a0d3fd7..8041119b0 100644
--- a/src/multicast/gnunet-service-multicast.c
+++ b/src/multicast/gnunet-service-multicast.c
@@ -327,10 +327,9 @@ struct ReplayRequestKey
327 * Task run during shutdown. 327 * Task run during shutdown.
328 * 328 *
329 * @param cls unused 329 * @param cls unused
330 * @param tc unused
331 */ 330 */
332static void 331static void
333shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 332shutdown_task (void *cls)
334{ 333{
335 if (NULL != core) 334 if (NULL != core)
336 { 335 {
diff --git a/src/multicast/test_multicast.c b/src/multicast/test_multicast.c
index a81c1f379..9550b8894 100644
--- a/src/multicast/test_multicast.c
+++ b/src/multicast/test_multicast.c
@@ -132,10 +132,9 @@ cleanup ()
132 * Terminate the test case (failure). 132 * Terminate the test case (failure).
133 * 133 *
134 * @param cls NULL 134 * @param cls NULL
135 * @param tc scheduler context
136 */ 135 */
137static void 136static void
138end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 137end_badly (void *cls)
139{ 138{
140 res = 1; 139 res = 1;
141 cleanup (); 140 cleanup ();
@@ -147,10 +146,9 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
147 * Terminate the test case (success). 146 * Terminate the test case (success).
148 * 147 *
149 * @param cls NULL 148 * @param cls NULL
150 * @param tc scheduler context
151 */ 149 */
152static void 150static void
153end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 151end_normally (void *cls)
154{ 152{
155 res = 0; 153 res = 0;
156 cleanup (); 154 cleanup ();
@@ -176,8 +174,8 @@ end ()
176} 174}
177 175
178 176
179void 177static void
180tmit_resume (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 178tmit_resume (void *cls)
181{ 179{
182 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmission resumed.\n"); 180 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmission resumed.\n");
183 struct TransmitClosure *tmit = cls; 181 struct TransmitClosure *tmit = cls;
@@ -254,7 +252,7 @@ origin_stopped (void *cls)
254 252
255 253
256static void 254static void
257schedule_origin_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 255schedule_origin_stop (void *cls)
258{ 256{
259 test = TEST_ORIGIN_STOP; 257 test = TEST_ORIGIN_STOP;
260 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 258 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -290,7 +288,7 @@ member_parted (void *cls)
290 288
291 289
292static void 290static void
293schedule_member_part (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 291schedule_member_part (void *cls)
294{ 292{
295 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 293 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
296 "Test #%u: schedule_member_part()\n", test); 294 "Test #%u: schedule_member_part()\n", test);
diff --git a/src/namecache/gnunet-namecache.c b/src/namecache/gnunet-namecache.c
index eed40da22..6abcb7b92 100644
--- a/src/namecache/gnunet-namecache.c
+++ b/src/namecache/gnunet-namecache.c
@@ -68,11 +68,9 @@ static int ret;
68 * Task run on shutdown. Cleans up everything. 68 * Task run on shutdown. Cleans up everything.
69 * 69 *
70 * @param cls unused 70 * @param cls unused
71 * @param tc scheduler context
72 */ 71 */
73static void 72static void
74do_shutdown (void *cls, 73do_shutdown (void *cls)
75 const struct GNUNET_SCHEDULER_TaskContext *tc)
76{ 74{
77 if (NULL != qe) 75 if (NULL != qe)
78 { 76 {
diff --git a/src/namecache/gnunet-service-namecache.c b/src/namecache/gnunet-service-namecache.c
index 3eedb18a5..81b1cce9b 100644
--- a/src/namecache/gnunet-service-namecache.c
+++ b/src/namecache/gnunet-service-namecache.c
@@ -105,10 +105,9 @@ static struct GNUNET_SERVER_NotificationContext *monitor_nc;
105 * Task run during shutdown. 105 * Task run during shutdown.
106 * 106 *
107 * @param cls unused 107 * @param cls unused
108 * @param tc unused
109 */ 108 */
110static void 109static void
111cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 110cleanup_task (void *cls)
112{ 111{
113 struct NamecacheClient *nc; 112 struct NamecacheClient *nc;
114 113
@@ -426,4 +425,3 @@ main (int argc, char *const *argv)
426} 425}
427 426
428/* end of gnunet-service-namecache.c */ 427/* end of gnunet-service-namecache.c */
429
diff --git a/src/namecache/namecache_api.c b/src/namecache/namecache_api.c
index 7f9baf1b4..15a750448 100644
--- a/src/namecache/namecache_api.c
+++ b/src/namecache/namecache_api.c
@@ -495,11 +495,9 @@ reconnect (struct GNUNET_NAMECACHE_Handle *h)
495 * Re-establish the connection to the service. 495 * Re-establish the connection to the service.
496 * 496 *
497 * @param cls handle to use to re-connect. 497 * @param cls handle to use to re-connect.
498 * @param tc scheduler context
499 */ 498 */
500static void 499static void
501reconnect_task (void *cls, 500reconnect_task (void *cls)
502 const struct GNUNET_SCHEDULER_TaskContext *tc)
503{ 501{
504 struct GNUNET_NAMECACHE_Handle *h = cls; 502 struct GNUNET_NAMECACHE_Handle *h = cls;
505 503
diff --git a/src/namecache/test_namecache_api_cache_block.c b/src/namecache/test_namecache_api_cache_block.c
index ff4d93b4f..5522b207d 100644
--- a/src/namecache/test_namecache_api_cache_block.c
+++ b/src/namecache/test_namecache_api_cache_block.c
@@ -68,10 +68,9 @@ cleanup ()
68 * Re-establish the connection to the service. 68 * Re-establish the connection to the service.
69 * 69 *
70 * @param cls handle to use to re-connect. 70 * @param cls handle to use to re-connect.
71 * @param tc scheduler context
72 */ 71 */
73static void 72static void
74endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 73endbadly (void *cls)
75{ 74{
76 if (NULL != nsqe) 75 if (NULL != nsqe)
77 { 76 {
@@ -84,7 +83,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
84 83
85 84
86static void 85static void
87end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 86end (void *cls)
88{ 87{
89 cleanup (); 88 cleanup ();
90 res = 0; 89 res = 0;
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c
index b00510ae7..82d73f6de 100644
--- a/src/namestore/gnunet-namestore-fcfsd.c
+++ b/src/namestore/gnunet-namestore-fcfsd.c
@@ -226,11 +226,9 @@ static unsigned long long port;
226 * Task run whenever HTTP server operations are pending. 226 * Task run whenever HTTP server operations are pending.
227 * 227 *
228 * @param cls unused 228 * @param cls unused
229 * @param tc scheduler context
230 */ 229 */
231static void 230static void
232do_httpd (void *cls, 231do_httpd (void *cls);
233 const struct GNUNET_SCHEDULER_TaskContext *tc);
234 232
235 233
236/** 234/**
@@ -840,11 +838,9 @@ run_httpd ()
840 * Task run whenever HTTP server operations are pending. 838 * Task run whenever HTTP server operations are pending.
841 * 839 *
842 * @param cls unused 840 * @param cls unused
843 * @param tc scheduler context
844 */ 841 */
845static void 842static void
846do_httpd (void *cls, 843do_httpd (void *cls)
847 const struct GNUNET_SCHEDULER_TaskContext *tc)
848{ 844{
849 httpd_task = NULL; 845 httpd_task = NULL;
850 MHD_run (httpd); 846 MHD_run (httpd);
@@ -856,11 +852,9 @@ do_httpd (void *cls,
856 * Task run on shutdown. Cleans up everything. 852 * Task run on shutdown. Cleans up everything.
857 * 853 *
858 * @param cls unused 854 * @param cls unused
859 * @param tc scheduler context
860 */ 855 */
861static void 856static void
862do_shutdown (void *cls, 857do_shutdown (void *cls)
863 const struct GNUNET_SCHEDULER_TaskContext *tc)
864{ 858{
865 if (NULL != httpd_task) 859 if (NULL != httpd_task)
866 { 860 {
diff --git a/src/namestore/gnunet-namestore.c b/src/namestore/gnunet-namestore.c
index 378832a65..0965d8cbe 100644
--- a/src/namestore/gnunet-namestore.c
+++ b/src/namestore/gnunet-namestore.c
@@ -199,11 +199,9 @@ static int monitor;
199 * Task run on shutdown. Cleans up everything. 199 * Task run on shutdown. Cleans up everything.
200 * 200 *
201 * @param cls unused 201 * @param cls unused
202 * @param tc scheduler context
203 */ 202 */
204static void 203static void
205do_shutdown (void *cls, 204do_shutdown (void *cls)
206 const struct GNUNET_SCHEDULER_TaskContext *tc)
207{ 205{
208 if (NULL != get_default) 206 if (NULL != get_default)
209 { 207 {
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index 4d60c8ea5..0bfd002f5 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -270,10 +270,9 @@ static struct GNUNET_SERVER_NotificationContext *monitor_nc;
270 * Task run during shutdown. 270 * Task run during shutdown.
271 * 271 *
272 * @param cls unused 272 * @param cls unused
273 * @param tc unused
274 */ 273 */
275static void 274static void
276cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 275cleanup_task (void *cls)
277{ 276{
278 struct ZoneIteration *no; 277 struct ZoneIteration *no;
279 struct NamestoreClient *nc; 278 struct NamestoreClient *nc;
@@ -1525,11 +1524,9 @@ monitor_sync (struct ZoneMonitor *zm)
1525 * Obtain the next datum during the zone monitor's zone intiial iteration. 1524 * Obtain the next datum during the zone monitor's zone intiial iteration.
1526 * 1525 *
1527 * @param cls zone monitor that does its initial iteration 1526 * @param cls zone monitor that does its initial iteration
1528 * @param tc scheduler context
1529 */ 1527 */
1530static void 1528static void
1531monitor_next (void *cls, 1529monitor_next (void *cls);
1532 const struct GNUNET_SCHEDULER_TaskContext *tc);
1533 1530
1534 1531
1535/** 1532/**
@@ -1606,11 +1603,9 @@ handle_monitor_start (void *cls,
1606 * Obtain the next datum during the zone monitor's zone intiial iteration. 1603 * Obtain the next datum during the zone monitor's zone intiial iteration.
1607 * 1604 *
1608 * @param cls zone monitor that does its initial iteration 1605 * @param cls zone monitor that does its initial iteration
1609 * @param tc scheduler context
1610 */ 1606 */
1611static void 1607static void
1612monitor_next (void *cls, 1608monitor_next (void *cls)
1613 const struct GNUNET_SCHEDULER_TaskContext *tc)
1614{ 1609{
1615 struct ZoneMonitor *zm = cls; 1610 struct ZoneMonitor *zm = cls;
1616 int ret; 1611 int ret;
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c
index 70695b85a..f65c45e85 100644
--- a/src/namestore/namestore_api.c
+++ b/src/namestore/namestore_api.c
@@ -866,11 +866,9 @@ reconnect (struct GNUNET_NAMESTORE_Handle *h)
866 * Re-establish the connection to the service. 866 * Re-establish the connection to the service.
867 * 867 *
868 * @param cls handle to use to re-connect. 868 * @param cls handle to use to re-connect.
869 * @param tc scheduler context
870 */ 869 */
871static void 870static void
872reconnect_task (void *cls, 871reconnect_task (void *cls)
873 const struct GNUNET_SCHEDULER_TaskContext *tc)
874{ 872{
875 struct GNUNET_NAMESTORE_Handle *h = cls; 873 struct GNUNET_NAMESTORE_Handle *h = cls;
876 874
diff --git a/src/namestore/plugin_rest_namestore.c b/src/namestore/plugin_rest_namestore.c
index a3938cfd8..cfebd63a7 100644
--- a/src/namestore/plugin_rest_namestore.c
+++ b/src/namestore/plugin_rest_namestore.c
@@ -82,12 +82,12 @@ struct RecordEntry
82 * DLL 82 * DLL
83 */ 83 */
84 struct RecordEntry *next; 84 struct RecordEntry *next;
85 85
86 /** 86 /**
87 * DLL 87 * DLL
88 */ 88 */
89 struct RecordEntry *prev; 89 struct RecordEntry *prev;
90 90
91}; 91};
92 92
93struct RequestHandle 93struct RequestHandle
@@ -106,12 +106,12 @@ struct RequestHandle
106 * JSON response object 106 * JSON response object
107 */ 107 */
108 struct JsonApiObject *resp_object; 108 struct JsonApiObject *resp_object;
109 109
110 /** 110 /**
111 * Rest connection 111 * Rest connection
112 */ 112 */
113 struct RestConnectionDataHandle *conndata_handle; 113 struct RestConnectionDataHandle *conndata_handle;
114 114
115 /** 115 /**
116 * Handle to GNS service. 116 * Handle to GNS service.
117 */ 117 */
@@ -121,12 +121,12 @@ struct RequestHandle
121 * Handle to NAMESTORE 121 * Handle to NAMESTORE
122 */ 122 */
123 struct GNUNET_NAMESTORE_Handle *ns_handle; 123 struct GNUNET_NAMESTORE_Handle *ns_handle;
124 124
125 /** 125 /**
126 * Handle to NAMESTORE it 126 * Handle to NAMESTORE it
127 */ 127 */
128 struct GNUNET_NAMESTORE_ZoneIterator *list_it; 128 struct GNUNET_NAMESTORE_ZoneIterator *list_it;
129 129
130 /** 130 /**
131 * Private key for the zone 131 * Private key for the zone
132 */ 132 */
@@ -205,7 +205,7 @@ struct RequestHandle
205 /** 205 /**
206 * ID of a task associated with the resolution process. 206 * ID of a task associated with the resolution process.
207 */ 207 */
208 struct GNUNET_SCHEDULER_Task * timeout_task; 208 struct GNUNET_SCHEDULER_Task * timeout_task;
209 209
210 /** 210 /**
211 * The plugin result processor 211 * The plugin result processor
@@ -353,25 +353,25 @@ gnsrecord_to_json (const struct GNUNET_GNSRECORD_Data *rd)
353 * Task run on shutdown. Cleans up everything. 353 * Task run on shutdown. Cleans up everything.
354 * 354 *
355 * @param cls unused 355 * @param cls unused
356 * @param tc scheduler context
357 */ 356 */
358static void 357static void
359do_error (void *cls, 358do_error (void *cls)
360 const struct GNUNET_SCHEDULER_TaskContext *tc)
361{ 359{
362 struct RequestHandle *handle = cls; 360 struct RequestHandle *handle = cls;
363 struct MHD_Response *resp = GNUNET_REST_create_json_response (NULL); 361 struct MHD_Response *resp = GNUNET_REST_create_json_response (NULL);
362
364 handle->proc (handle->proc_cls, resp, MHD_HTTP_BAD_REQUEST); 363 handle->proc (handle->proc_cls, resp, MHD_HTTP_BAD_REQUEST);
365 cleanup_handle (handle); 364 cleanup_handle (handle);
366} 365}
367 366
367
368static void 368static void
369cleanup_handle_delayed (void *cls, 369cleanup_handle_delayed (void *cls)
370 const struct GNUNET_SCHEDULER_TaskContext *tc)
371{ 370{
372 cleanup_handle (cls); 371 cleanup_handle (cls);
373} 372}
374 373
374
375/** 375/**
376 * Create a response with requested records 376 * Create a response with requested records
377 * 377 *
@@ -688,7 +688,7 @@ json_to_gnsrecord (const json_t *records_json,
688 { 688 {
689 (*rd)[i].expiration_time = etime_abs.abs_value_us; 689 (*rd)[i].expiration_time = etime_abs.abs_value_us;
690 } 690 }
691 else 691 else
692 { 692 {
693 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Value `%s' invalid for record type `%s'\n"), 693 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Value `%s' invalid for record type `%s'\n"),
694 value, typestring); 694 value, typestring);
@@ -760,7 +760,7 @@ namestore_create_cont (struct RestConnectionDataHandle *con,
760 { 760 {
761 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 761 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
762 "Name property is no string\n"); 762 "Name property is no string\n");
763 GNUNET_REST_jsonapi_object_delete (json_obj); 763 GNUNET_REST_jsonapi_object_delete (json_obj);
764 GNUNET_SCHEDULER_add_now (&do_error, handle); 764 GNUNET_SCHEDULER_add_now (&do_error, handle);
765 return; 765 return;
766 } 766 }
@@ -844,7 +844,7 @@ namestore_zkey_cont (struct RestConnectionDataHandle *con,
844 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_NAMESTORE_ZKEY, 844 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_NAMESTORE_ZKEY,
845 strlen (GNUNET_REST_JSONAPI_NAMESTORE_ZKEY), 845 strlen (GNUNET_REST_JSONAPI_NAMESTORE_ZKEY),
846 &key); 846 &key);
847 if ( GNUNET_NO == 847 if ( GNUNET_NO ==
848 GNUNET_CONTAINER_multihashmap_contains (handle->conndata_handle->url_param_map, 848 GNUNET_CONTAINER_multihashmap_contains (handle->conndata_handle->url_param_map,
849 &key) ) 849 &key) )
850 { 850 {
@@ -1058,7 +1058,7 @@ testservice_id_task (void *cls, int result)
1058 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_NAMESTORE_EGO, 1058 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_NAMESTORE_EGO,
1059 strlen (GNUNET_REST_JSONAPI_NAMESTORE_EGO), 1059 strlen (GNUNET_REST_JSONAPI_NAMESTORE_EGO),
1060 &key); 1060 &key);
1061 if ( GNUNET_YES == 1061 if ( GNUNET_YES ==
1062 GNUNET_CONTAINER_multihashmap_contains (handle->conndata_handle->url_param_map, 1062 GNUNET_CONTAINER_multihashmap_contains (handle->conndata_handle->url_param_map,
1063 &key) ) 1063 &key) )
1064 { 1064 {
@@ -1070,7 +1070,7 @@ testservice_id_task (void *cls, int result)
1070 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_NAMESTORE_RECORD_TYPE, 1070 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_NAMESTORE_RECORD_TYPE,
1071 strlen (GNUNET_REST_JSONAPI_NAMESTORE_RECORD_TYPE), 1071 strlen (GNUNET_REST_JSONAPI_NAMESTORE_RECORD_TYPE),
1072 &key); 1072 &key);
1073 if ( GNUNET_YES == 1073 if ( GNUNET_YES ==
1074 GNUNET_CONTAINER_multihashmap_contains (handle->conndata_handle->url_param_map, 1074 GNUNET_CONTAINER_multihashmap_contains (handle->conndata_handle->url_param_map,
1075 &key) ) 1075 &key) )
1076 { 1076 {
diff --git a/src/namestore/test_namestore_api_lookup_nick.c b/src/namestore/test_namestore_api_lookup_nick.c
index 804b6fc42..d6d3945b7 100644
--- a/src/namestore/test_namestore_api_lookup_nick.c
+++ b/src/namestore/test_namestore_api_lookup_nick.c
@@ -79,7 +79,7 @@ cleanup ()
79 * @param tc scheduler context 79 * @param tc scheduler context
80 */ 80 */
81static void 81static void
82endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 82endbadly (void *cls)
83{ 83{
84 if (NULL != nsqe) 84 if (NULL != nsqe)
85 { 85 {
@@ -92,17 +92,19 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
92 92
93 93
94static void 94static void
95end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 95end (void *cls)
96{ 96{
97 cleanup (); 97 cleanup ();
98 res = 0; 98 res = 0;
99} 99}
100 100
101void lookup_it (void *cls, 101
102 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 102static void
103 const char *label, 103lookup_it (void *cls,
104 unsigned int rd_count, 104 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
105 const struct GNUNET_GNSRECORD_Data *rd) 105 const char *label,
106 unsigned int rd_count,
107 const struct GNUNET_GNSRECORD_Data *rd)
106{ 108{
107 nsqe = NULL; 109 nsqe = NULL;
108 int c; 110 int c;
diff --git a/src/namestore/test_namestore_api_lookup_private.c b/src/namestore/test_namestore_api_lookup_private.c
index 6d99f738a..92b2cad6f 100644
--- a/src/namestore/test_namestore_api_lookup_private.c
+++ b/src/namestore/test_namestore_api_lookup_private.c
@@ -74,7 +74,7 @@ cleanup ()
74 * @param tc scheduler context 74 * @param tc scheduler context
75 */ 75 */
76static void 76static void
77endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 77endbadly (void *cls)
78{ 78{
79 if (NULL != nsqe) 79 if (NULL != nsqe)
80 { 80 {
@@ -87,17 +87,19 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
87 87
88 88
89static void 89static void
90end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 90end (void *cls)
91{ 91{
92 cleanup (); 92 cleanup ();
93 res = 0; 93 res = 0;
94} 94}
95 95
96void lookup_it (void *cls, 96
97 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone, 97static void
98 const char *label, 98lookup_it (void *cls,
99 unsigned int rd_count, 99 const struct GNUNET_CRYPTO_EcdsaPrivateKey *zone,
100 const struct GNUNET_GNSRECORD_Data *rd) 100 const char *label,
101 unsigned int rd_count,
102 const struct GNUNET_GNSRECORD_Data *rd)
101{ 103{
102 nsqe = NULL; 104 nsqe = NULL;
103 105
diff --git a/src/namestore/test_namestore_api_lookup_public.c b/src/namestore/test_namestore_api_lookup_public.c
index ef63b94f1..09d6b302d 100644
--- a/src/namestore/test_namestore_api_lookup_public.c
+++ b/src/namestore/test_namestore_api_lookup_public.c
@@ -79,10 +79,9 @@ cleanup ()
79 * Re-establish the connection to the service. 79 * Re-establish the connection to the service.
80 * 80 *
81 * @param cls handle to use to re-connect. 81 * @param cls handle to use to re-connect.
82 * @param tc scheduler context
83 */ 82 */
84static void 83static void
85endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 84endbadly (void *cls)
86{ 85{
87 if (NULL != nsqe) 86 if (NULL != nsqe)
88 { 87 {
@@ -100,7 +99,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
100 99
101 100
102static void 101static void
103end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 102end (void *cls)
104{ 103{
105 cleanup (); 104 cleanup ();
106 res = 0; 105 res = 0;
diff --git a/src/namestore/test_namestore_api_lookup_shadow.c b/src/namestore/test_namestore_api_lookup_shadow.c
index b7f89c0ff..7f9a90704 100644
--- a/src/namestore/test_namestore_api_lookup_shadow.c
+++ b/src/namestore/test_namestore_api_lookup_shadow.c
@@ -81,10 +81,9 @@ cleanup ()
81 * Re-establish the connection to the service. 81 * Re-establish the connection to the service.
82 * 82 *
83 * @param cls handle to use to re-connect. 83 * @param cls handle to use to re-connect.
84 * @param tc scheduler context
85 */ 84 */
86static void 85static void
87endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 86endbadly (void *cls)
88{ 87{
89 if (NULL != nsqe) 88 if (NULL != nsqe)
90 { 89 {
@@ -102,7 +101,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
102 101
103 102
104static void 103static void
105end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 104end (void *cls)
106{ 105{
107 cleanup (); 106 cleanup ();
108 res = 0; 107 res = 0;
diff --git a/src/namestore/test_namestore_api_lookup_shadow_filter.c b/src/namestore/test_namestore_api_lookup_shadow_filter.c
index fd3d573f6..a22baa17b 100644
--- a/src/namestore/test_namestore_api_lookup_shadow_filter.c
+++ b/src/namestore/test_namestore_api_lookup_shadow_filter.c
@@ -94,10 +94,9 @@ cleanup ()
94 * Re-establish the connection to the service. 94 * Re-establish the connection to the service.
95 * 95 *
96 * @param cls handle to use to re-connect. 96 * @param cls handle to use to re-connect.
97 * @param tc scheduler context
98 */ 97 */
99static void 98static void
100endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 99endbadly (void *cls)
101{ 100{
102 if (NULL != delayed_lookup_task) 101 if (NULL != delayed_lookup_task)
103 { 102 {
@@ -120,7 +119,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
120 119
121 120
122static void 121static void
123end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 122end (void *cls)
124{ 123{
125 cleanup (); 124 cleanup ();
126 res = 0; 125 res = 0;
@@ -244,8 +243,9 @@ name_lookup_active_proc (void *cls,
244 &pubkey, TEST_NAME, &rd_decrypt_cb, expected_rd)); 243 &pubkey, TEST_NAME, &rd_decrypt_cb, expected_rd));
245} 244}
246 245
246
247static void 247static void
248name_lookup_shadow (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 248name_lookup_shadow (void *cls)
249{ 249{
250 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 250 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
251 "Performing lookup for shadow record \n"); 251 "Performing lookup for shadow record \n");
diff --git a/src/namestore/test_namestore_api_monitoring.c b/src/namestore/test_namestore_api_monitoring.c
index 85d1659b4..2ea271d50 100644
--- a/src/namestore/test_namestore_api_monitoring.c
+++ b/src/namestore/test_namestore_api_monitoring.c
@@ -126,10 +126,9 @@ do_shutdown ()
126 * Re-establish the connection to the service. 126 * Re-establish the connection to the service.
127 * 127 *
128 * @param cls handle to use to re-connect. 128 * @param cls handle to use to re-connect.
129 * @param tc scheduler context
130 */ 129 */
131static void 130static void
132endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 131endbadly (void *cls)
133{ 132{
134 do_shutdown (); 133 do_shutdown ();
135 res = 1; 134 res = 1;
@@ -137,7 +136,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
137 136
138 137
139static void 138static void
140end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 139end (void *cls)
141{ 140{
142 do_shutdown (); 141 do_shutdown ();
143 res = 0; 142 res = 0;
diff --git a/src/namestore/test_namestore_api_monitoring_existing.c b/src/namestore/test_namestore_api_monitoring_existing.c
index cdf7fd80e..eae10e2ae 100644
--- a/src/namestore/test_namestore_api_monitoring_existing.c
+++ b/src/namestore/test_namestore_api_monitoring_existing.c
@@ -127,10 +127,9 @@ do_shutdown ()
127 * Re-establish the connection to the service. 127 * Re-establish the connection to the service.
128 * 128 *
129 * @param cls handle to use to re-connect. 129 * @param cls handle to use to re-connect.
130 * @param tc scheduler context
131 */ 130 */
132static void 131static void
133endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 132endbadly (void *cls)
134{ 133{
135 do_shutdown (); 134 do_shutdown ();
136 res = 1; 135 res = 1;
@@ -138,7 +137,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
138 137
139 138
140static void 139static void
141end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 140end (void *cls)
142{ 141{
143 do_shutdown (); 142 do_shutdown ();
144 res = 0; 143 res = 0;
@@ -152,8 +151,9 @@ zone_proc (void *cls,
152 unsigned int rd_count, 151 unsigned int rd_count,
153 const struct GNUNET_GNSRECORD_Data *rd) 152 const struct GNUNET_GNSRECORD_Data *rd)
154{ 153{
155 static int returned_records; 154 static int returned_records;
156 static int fail = GNUNET_NO; 155 static int fail = GNUNET_NO;
156
157 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 157 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
158 "Comparing results name %s\n", 158 "Comparing results name %s\n",
159 name); 159 name);
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c
index 35911e08f..c6c439e86 100644
--- a/src/namestore/test_namestore_api_remove.c
+++ b/src/namestore/test_namestore_api_remove.c
@@ -71,10 +71,9 @@ cleanup ()
71 * Re-establish the connection to the service. 71 * Re-establish the connection to the service.
72 * 72 *
73 * @param cls handle to use to re-connect. 73 * @param cls handle to use to re-connect.
74 * @param tc scheduler context
75 */ 74 */
76static void 75static void
77endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 76endbadly (void *cls)
78{ 77{
79 if (NULL != nsqe) 78 if (NULL != nsqe)
80 { 79 {
@@ -87,7 +86,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
87 86
88 87
89static void 88static void
90end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 89end (void *cls)
91{ 90{
92 cleanup (); 91 cleanup ();
93 res = 0; 92 res = 0;
diff --git a/src/namestore/test_namestore_api_remove_not_existing_record.c b/src/namestore/test_namestore_api_remove_not_existing_record.c
index ed7f7088e..ef199cdf6 100644
--- a/src/namestore/test_namestore_api_remove_not_existing_record.c
+++ b/src/namestore/test_namestore_api_remove_not_existing_record.c
@@ -69,10 +69,9 @@ cleanup ()
69 * Re-establish the connection to the service. 69 * Re-establish the connection to the service.
70 * 70 *
71 * @param cls handle to use to re-connect. 71 * @param cls handle to use to re-connect.
72 * @param tc scheduler context
73 */ 72 */
74static void 73static void
75endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 74endbadly (void *cls)
76{ 75{
77 if (NULL != nsqe) 76 if (NULL != nsqe)
78 { 77 {
@@ -85,8 +84,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
85 84
86 85
87static void 86static void
88end (void *cls, 87end (void *cls)
89 const struct GNUNET_SCHEDULER_TaskContext *tc)
90{ 88{
91 cleanup (); 89 cleanup ();
92 res = 0; 90 res = 0;
diff --git a/src/namestore/test_namestore_api_store.c b/src/namestore/test_namestore_api_store.c
index 7345e68da..d80676770 100644
--- a/src/namestore/test_namestore_api_store.c
+++ b/src/namestore/test_namestore_api_store.c
@@ -69,10 +69,9 @@ cleanup ()
69 * Re-establish the connection to the service. 69 * Re-establish the connection to the service.
70 * 70 *
71 * @param cls handle to use to re-connect. 71 * @param cls handle to use to re-connect.
72 * @param tc scheduler context
73 */ 72 */
74static void 73static void
75endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 74endbadly (void *cls)
76{ 75{
77 if (NULL != nsqe) 76 if (NULL != nsqe)
78 { 77 {
@@ -85,7 +84,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
85 84
86 85
87static void 86static void
88end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 87end (void *cls)
89{ 88{
90 cleanup (); 89 cleanup ();
91 res = 0; 90 res = 0;
diff --git a/src/namestore/test_namestore_api_store_update.c b/src/namestore/test_namestore_api_store_update.c
index 22508b1d3..ed5a399bd 100644
--- a/src/namestore/test_namestore_api_store_update.c
+++ b/src/namestore/test_namestore_api_store_update.c
@@ -91,11 +91,9 @@ cleanup ()
91 * Re-establish the connection to the service. 91 * Re-establish the connection to the service.
92 * 92 *
93 * @param cls handle to use to re-connect. 93 * @param cls handle to use to re-connect.
94 * @param tc scheduler context
95 */ 94 */
96static void 95static void
97endbadly (void *cls, 96endbadly (void *cls)
98 const struct GNUNET_SCHEDULER_TaskContext *tc)
99{ 97{
100 if (NULL != nsqe) 98 if (NULL != nsqe)
101 { 99 {
@@ -113,8 +111,7 @@ endbadly (void *cls,
113 111
114 112
115static void 113static void
116end (void *cls, 114end (void *cls)
117 const struct GNUNET_SCHEDULER_TaskContext *tc)
118{ 115{
119 cleanup (); 116 cleanup ();
120 res = 0; 117 res = 0;
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c
index 9f60fa43d..070c06870 100644
--- a/src/namestore/test_namestore_api_zone_iteration.c
+++ b/src/namestore/test_namestore_api_zone_iteration.c
@@ -66,7 +66,7 @@ static char *directory;
66 * @param tc scheduler context 66 * @param tc scheduler context
67 */ 67 */
68static void 68static void
69endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 69endbadly (void *cls)
70{ 70{
71 if (NULL != zi) 71 if (NULL != zi)
72 { 72 {
@@ -110,7 +110,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
110 110
111 111
112static void 112static void
113end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 113end (void *cls)
114{ 114{
115 if (NULL != zi) 115 if (NULL != zi)
116 { 116 {
diff --git a/src/namestore/test_namestore_api_zone_iteration_nick.c b/src/namestore/test_namestore_api_zone_iteration_nick.c
index 98d3b882c..362533ef9 100644
--- a/src/namestore/test_namestore_api_zone_iteration_nick.c
+++ b/src/namestore/test_namestore_api_zone_iteration_nick.c
@@ -69,7 +69,7 @@ static char *directory;
69 * @param tc scheduler context 69 * @param tc scheduler context
70 */ 70 */
71static void 71static void
72endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 72endbadly (void *cls)
73{ 73{
74 if (NULL != zi) 74 if (NULL != zi)
75 { 75 {
@@ -113,7 +113,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
113 113
114 114
115static void 115static void
116end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 116end (void *cls)
117{ 117{
118 if (NULL != zi) 118 if (NULL != zi)
119 { 119 {
diff --git a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
index dc2129b88..1a0279f50 100644
--- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
+++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
@@ -66,14 +66,13 @@ static char *directory;
66 * @param tc scheduler context 66 * @param tc scheduler context
67 */ 67 */
68static void 68static void
69endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 69endbadly (void *cls)
70{ 70{
71 if (NULL != zi) 71 if (NULL != zi)
72 { 72 {
73 GNUNET_NAMESTORE_zone_iteration_stop (zi); 73 GNUNET_NAMESTORE_zone_iteration_stop (zi);
74 zi = NULL; 74 zi = NULL;
75 } 75 }
76
77 if (nsh != NULL) 76 if (nsh != NULL)
78 GNUNET_NAMESTORE_disconnect (nsh); 77 GNUNET_NAMESTORE_disconnect (nsh);
79 nsh = NULL; 78 nsh = NULL;
@@ -110,13 +109,13 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
110 109
111 110
112static void 111static void
113end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 112end (void *cls)
114{ 113{
115 if (NULL != zi) 114 if (NULL != zi)
116 { 115 {
117 GNUNET_NAMESTORE_zone_iteration_stop (zi); 116 GNUNET_NAMESTORE_zone_iteration_stop (zi);
118 zi = NULL; 117 zi = NULL;
119 } 118 }
120 119
121 if (endbadly_task != NULL) 120 if (endbadly_task != NULL)
122 { 121 {
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c
index 8700c6698..52645b5eb 100644
--- a/src/namestore/test_namestore_api_zone_iteration_stop.c
+++ b/src/namestore/test_namestore_api_zone_iteration_stop.c
@@ -63,16 +63,15 @@ static char *directory;
63 * Re-establish the connection to the service. 63 * Re-establish the connection to the service.
64 * 64 *
65 * @param cls handle to use to re-connect. 65 * @param cls handle to use to re-connect.
66 * @param tc scheduler context
67 */ 66 */
68static void 67static void
69endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 68endbadly (void *cls)
70{ 69{
71 if (NULL != zi) 70 if (NULL != zi)
72 { 71 {
73 GNUNET_NAMESTORE_zone_iteration_stop (zi); 72 GNUNET_NAMESTORE_zone_iteration_stop (zi);
74 zi = NULL; 73 zi = NULL;
75 } 74 }
76 75
77 if (nsh != NULL) 76 if (nsh != NULL)
78 GNUNET_NAMESTORE_disconnect (nsh); 77 GNUNET_NAMESTORE_disconnect (nsh);
@@ -110,13 +109,13 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
110 109
111 110
112static void 111static void
113end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 112end (void *cls)
114{ 113{
115 if (NULL != zi) 114 if (NULL != zi)
116 { 115 {
117 GNUNET_NAMESTORE_zone_iteration_stop (zi); 116 GNUNET_NAMESTORE_zone_iteration_stop (zi);
118 zi = NULL; 117 zi = NULL;
119 } 118 }
120 119
121 if (endbadly_task != NULL) 120 if (endbadly_task != NULL)
122 { 121 {
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c
index 348b9178b..12bc870b4 100644
--- a/src/namestore/test_namestore_api_zone_to_name.c
+++ b/src/namestore/test_namestore_api_zone_to_name.c
@@ -63,10 +63,9 @@ static char *directory;
63 * Re-establish the connection to the service. 63 * Re-establish the connection to the service.
64 * 64 *
65 * @param cls handle to use to re-connect. 65 * @param cls handle to use to re-connect.
66 * @param tc scheduler context
67 */ 66 */
68static void 67static void
69endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 68endbadly (void *cls)
70{ 69{
71 if (nsh != NULL) 70 if (nsh != NULL)
72 GNUNET_NAMESTORE_disconnect (nsh); 71 GNUNET_NAMESTORE_disconnect (nsh);
@@ -79,7 +78,7 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
79 78
80 79
81static void 80static void
82end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 81end (void *cls)
83{ 82{
84 if (endbadly_task != NULL) 83 if (endbadly_task != NULL)
85 { 84 {
diff --git a/src/nat/gnunet-nat-server.c b/src/nat/gnunet-nat-server.c
index 31a8f294b..0069303ca 100644
--- a/src/nat/gnunet-nat-server.c
+++ b/src/nat/gnunet-nat-server.c
@@ -92,13 +92,14 @@ struct TcpContext
92 * (or once we failed to connect...). 92 * (or once we failed to connect...).
93 * 93 *
94 * @param cls the 'struct TcpContext' 94 * @param cls the 'struct TcpContext'
95 * @param tc scheduler context
96 */ 95 */
97static void 96static void
98tcp_send (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 97tcp_send (void *cls)
99{ 98{
100 struct TcpContext *ctx = cls; 99 struct TcpContext *ctx = cls;
100 const struct GNUNET_SCHEDULER_TaskContext *tc;
101 101
102 tc = GNUNET_SCHEDULER_get_task_context ();
102 if ((NULL != tc->write_ready) && 103 if ((NULL != tc->write_ready) &&
103 (GNUNET_NETWORK_fdset_isset (tc->write_ready, ctx->s))) 104 (GNUNET_NETWORK_fdset_isset (tc->write_ready, ctx->s)))
104 { 105 {
@@ -228,10 +229,9 @@ test (void *cls, struct GNUNET_SERVER_Client *client,
228 * Task run during shutdown. 229 * Task run during shutdown.
229 * 230 *
230 * @param cls unused 231 * @param cls unused
231 * @param tc scheduler context
232 */ 232 */
233static void 233static void
234shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 234shutdown_task (void *cls)
235{ 235{
236 GNUNET_SERVER_destroy (server); 236 GNUNET_SERVER_destroy (server);
237 server = NULL; 237 server = NULL;
diff --git a/src/nat/nat.c b/src/nat/nat.c
index 57961ffaf..1c60e4e0d 100644
--- a/src/nat/nat.c
+++ b/src/nat/nat.c
@@ -463,11 +463,9 @@ start_gnunet_nat_server (struct GNUNET_NAT_Handle *h);
463 * Call task to process STUN 463 * Call task to process STUN
464 * 464 *
465 * @param cls handle to NAT 465 * @param cls handle to NAT
466 * @param tc TaskContext
467 */ 466 */
468static void 467static void
469process_stun (void *cls, 468process_stun (void *cls);
470 const struct GNUNET_SCHEDULER_TaskContext *tc);
471 469
472 470
473/** 471/**
@@ -662,10 +660,9 @@ add_ip_to_address_list (struct GNUNET_NAT_Handle *h,
662 * get DynDNS-IP addresses. 660 * get DynDNS-IP addresses.
663 * 661 *
664 * @param cls the NAT handle 662 * @param cls the NAT handle
665 * @param tc scheduler context
666 */ 663 */
667static void 664static void
668resolve_dns (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 665resolve_dns (void *cls);
669 666
670 667
671/** 668/**
@@ -716,11 +713,9 @@ process_external_ip (void *cls,
716 * Task to do a lookup on our hostname for IP addresses. 713 * Task to do a lookup on our hostname for IP addresses.
717 * 714 *
718 * @param cls the NAT handle 715 * @param cls the NAT handle
719 * @param tc scheduler context
720 */ 716 */
721static void 717static void
722resolve_hostname (void *cls, 718resolve_hostname (void *cls);
723 const struct GNUNET_SCHEDULER_TaskContext *tc);
724 719
725 720
726/** 721/**
@@ -938,14 +933,15 @@ process_interfaces (void *cls,
938 * after a certain delay. 933 * after a certain delay.
939 * 934 *
940 * @param cls the `struct GNUNET_NAT_Handle` 935 * @param cls the `struct GNUNET_NAT_Handle`
941 * @param tc scheduler context
942 */ 936 */
943static void 937static void
944restart_nat_server (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 938restart_nat_server (void *cls)
945{ 939{
946 struct GNUNET_NAT_Handle *h = cls; 940 struct GNUNET_NAT_Handle *h = cls;
941 const struct GNUNET_SCHEDULER_TaskContext *tc;
947 942
948 h->server_read_task = NULL; 943 h->server_read_task = NULL;
944 tc = GNUNET_SCHEDULER_get_task_context ();
949 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 945 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
950 return; 946 return;
951 start_gnunet_nat_server (h); 947 start_gnunet_nat_server (h);
@@ -958,11 +954,9 @@ restart_nat_server (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
958 * function to be called again once more is available. 954 * function to be called again once more is available.
959 * 955 *
960 * @param cls the NAT handle 956 * @param cls the NAT handle
961 * @param tc the scheduling context
962 */ 957 */
963static void 958static void
964nat_server_read (void *cls, 959nat_server_read (void *cls)
965 const struct GNUNET_SCHEDULER_TaskContext *tc)
966{ 960{
967 struct GNUNET_NAT_Handle *h = cls; 961 struct GNUNET_NAT_Handle *h = cls;
968 char mybuf[40]; 962 char mybuf[40];
@@ -971,8 +965,10 @@ nat_server_read (void *cls,
971 int port; 965 int port;
972 const char *port_start; 966 const char *port_start;
973 struct sockaddr_in sin_addr; 967 struct sockaddr_in sin_addr;
968 const struct GNUNET_SCHEDULER_TaskContext *tc;
974 969
975 h->server_read_task = NULL; 970 h->server_read_task = NULL;
971 tc = GNUNET_SCHEDULER_get_task_context ();
976 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 972 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
977 return; 973 return;
978 memset (mybuf, 0, sizeof (mybuf)); 974 memset (mybuf, 0, sizeof (mybuf));
@@ -1099,11 +1095,9 @@ start_gnunet_nat_server (struct GNUNET_NAT_Handle *h)
1099 * Task to scan the local network interfaces for IP addresses. 1095 * Task to scan the local network interfaces for IP addresses.
1100 * 1096 *
1101 * @param cls the NAT handle 1097 * @param cls the NAT handle
1102 * @param tc scheduler context
1103 */ 1098 */
1104static void 1099static void
1105list_interfaces (void *cls, 1100list_interfaces (void *cls)
1106 const struct GNUNET_SCHEDULER_TaskContext *tc)
1107{ 1101{
1108 struct GNUNET_NAT_Handle *h = cls; 1102 struct GNUNET_NAT_Handle *h = cls;
1109 1103
@@ -1209,11 +1203,9 @@ GNUNET_NAT_is_valid_stun_packet (void *cls,
1209 * Task to do a STUN request 1203 * Task to do a STUN request
1210 * 1204 *
1211 * @param cls the NAT handle 1205 * @param cls the NAT handle
1212 * @param tc scheduler context
1213 */ 1206 */
1214static void 1207static void
1215process_stun (void *cls, 1208process_stun (void *cls)
1216 const struct GNUNET_SCHEDULER_TaskContext *tc)
1217{ 1209{
1218 struct GNUNET_NAT_Handle *h = cls; 1210 struct GNUNET_NAT_Handle *h = cls;
1219 struct StunServerList* elem = h->actual_stun_server; 1211 struct StunServerList* elem = h->actual_stun_server;
@@ -1264,11 +1256,9 @@ process_stun (void *cls,
1264 * Task to do a lookup on our hostname for IP addresses. 1256 * Task to do a lookup on our hostname for IP addresses.
1265 * 1257 *
1266 * @param cls the NAT handle 1258 * @param cls the NAT handle
1267 * @param tc scheduler context
1268 */ 1259 */
1269static void 1260static void
1270resolve_hostname (void *cls, 1261resolve_hostname (void *cls)
1271 const struct GNUNET_SCHEDULER_TaskContext *tc)
1272{ 1262{
1273 struct GNUNET_NAT_Handle *h = cls; 1263 struct GNUNET_NAT_Handle *h = cls;
1274 1264
@@ -1285,11 +1275,9 @@ resolve_hostname (void *cls,
1285 * get DynDNS-IP addresses. 1275 * get DynDNS-IP addresses.
1286 * 1276 *
1287 * @param cls the NAT handle 1277 * @param cls the NAT handle
1288 * @param tc scheduler context
1289 */ 1278 */
1290static void 1279static void
1291resolve_dns (void *cls, 1280resolve_dns (void *cls)
1292 const struct GNUNET_SCHEDULER_TaskContext *tc)
1293{ 1281{
1294 struct GNUNET_NAT_Handle *h = cls; 1282 struct GNUNET_NAT_Handle *h = cls;
1295 struct LocalAddressList *pos; 1283 struct LocalAddressList *pos;
diff --git a/src/nat/nat_auto.c b/src/nat/nat_auto.c
index 9fab8bf67..82e067f73 100644
--- a/src/nat/nat_auto.c
+++ b/src/nat/nat_auto.c
@@ -258,18 +258,17 @@ stop_stun ()
258 * incoming connection. 258 * incoming connection.
259 * 259 *
260 * @param cls 260 * @param cls
261 * @param tc scheduler context
262 */ 261 */
263static void 262static void
264do_udp_read (void *cls, 263do_udp_read (void *cls)
265 const struct GNUNET_SCHEDULER_TaskContext *tc)
266{ 264{
267 struct GNUNET_NAT_AutoHandle *ah = cls; 265 struct GNUNET_NAT_AutoHandle *ah = cls;
268 unsigned char reply_buf[1024]; 266 unsigned char reply_buf[1024];
269 ssize_t rlen; 267 ssize_t rlen;
270 struct sockaddr_in answer; 268 struct sockaddr_in answer;
269 const struct GNUNET_SCHEDULER_TaskContext *tc;
271 270
272 271 tc = GNUNET_SCHEDULER_get_task_context ();
273 if ((0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) && 272 if ((0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) &&
274 (GNUNET_NETWORK_fdset_isset (tc->read_ready, 273 (GNUNET_NETWORK_fdset_isset (tc->read_ready,
275 lsock4))) 274 lsock4)))
@@ -402,11 +401,9 @@ result_callback (void *cls,
402 * Main function for the connection reversal test. 401 * Main function for the connection reversal test.
403 * 402 *
404 * @param cls the `struct GNUNET_NAT_AutoHandle` 403 * @param cls the `struct GNUNET_NAT_AutoHandle`
405 * @param tc scheduler context
406 */ 404 */
407static void 405static void
408reversal_test (void *cls, 406reversal_test (void *cls)
409 const struct GNUNET_SCHEDULER_TaskContext *tc)
410{ 407{
411 struct GNUNET_NAT_AutoHandle *ah = cls; 408 struct GNUNET_NAT_AutoHandle *ah = cls;
412 409
diff --git a/src/nat/nat_mini.c b/src/nat/nat_mini.c
index aa29ff07b..d310b3e14 100644
--- a/src/nat/nat_mini.c
+++ b/src/nat/nat_mini.c
@@ -110,17 +110,17 @@ struct GNUNET_NAT_ExternalHandle
110 * address and call our callback. 110 * address and call our callback.
111 * 111 *
112 * @param cls the `struct GNUNET_NAT_ExternalHandle` 112 * @param cls the `struct GNUNET_NAT_ExternalHandle`
113 * @param tc scheduler context
114 */ 113 */
115static void 114static void
116read_external_ipv4 (void *cls, 115read_external_ipv4 (void *cls)
117 const struct GNUNET_SCHEDULER_TaskContext *tc)
118{ 116{
119 struct GNUNET_NAT_ExternalHandle *eh = cls; 117 struct GNUNET_NAT_ExternalHandle *eh = cls;
120 ssize_t ret; 118 ssize_t ret;
121 struct in_addr addr; 119 struct in_addr addr;
120 const struct GNUNET_SCHEDULER_TaskContext *tc;
122 121
123 eh->task = NULL; 122 eh->task = NULL;
123 tc = GNUNET_SCHEDULER_get_task_context ();
124 if (GNUNET_YES == GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, eh->r)) 124 if (GNUNET_YES == GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, eh->r))
125 ret = 125 ret =
126 GNUNET_DISK_file_read (eh->r, &eh->buf[eh->off], 126 GNUNET_DISK_file_read (eh->r, &eh->buf[eh->off],
@@ -162,11 +162,9 @@ read_external_ipv4 (void *cls,
162 * (Asynchronously) signal error invoking "external-ip" to client. 162 * (Asynchronously) signal error invoking "external-ip" to client.
163 * 163 *
164 * @param cls the `struct GNUNET_NAT_ExternalHandle` (freed) 164 * @param cls the `struct GNUNET_NAT_ExternalHandle` (freed)
165 * @param tc scheduler context
166 */ 165 */
167static void 166static void
168signal_external_ip_error (void *cls, 167signal_external_ip_error (void *cls)
169 const struct GNUNET_SCHEDULER_TaskContext *tc)
170{ 168{
171 struct GNUNET_NAT_ExternalHandle *eh = cls; 169 struct GNUNET_NAT_ExternalHandle *eh = cls;
172 170
@@ -329,10 +327,9 @@ struct GNUNET_NAT_MiniHandle
329 * Run "upnpc -l" to find out if our mapping changed. 327 * Run "upnpc -l" to find out if our mapping changed.
330 * 328 *
331 * @param cls the `struct GNUNET_NAT_MiniHandle` 329 * @param cls the `struct GNUNET_NAT_MiniHandle`
332 * @param tc scheduler context
333 */ 330 */
334static void 331static void
335do_refresh (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 332do_refresh (void *cls);
336 333
337 334
338/** 335/**
@@ -478,10 +475,9 @@ process_refresh_output (void *cls, const char *line)
478 * Run "upnpc -l" to find out if our mapping changed. 475 * Run "upnpc -l" to find out if our mapping changed.
479 * 476 *
480 * @param cls the 'struct GNUNET_NAT_MiniHandle' 477 * @param cls the 'struct GNUNET_NAT_MiniHandle'
481 * @param tc scheduler context
482 */ 478 */
483static void 479static void
484do_refresh (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 480do_refresh (void *cls)
485{ 481{
486 struct GNUNET_NAT_MiniHandle *mini = cls; 482 struct GNUNET_NAT_MiniHandle *mini = cls;
487 int ac; 483 int ac;
diff --git a/src/nat/nat_test.c b/src/nat/nat_test.c
index 32cf6c42c..33f81d800 100644
--- a/src/nat/nat_test.c
+++ b/src/nat/nat_test.c
@@ -205,15 +205,15 @@ reversal_cb (void *cls,
205 * incoming connection. 205 * incoming connection.
206 * 206 *
207 * @param cls the `struct GNUNET_NAT_Test` 207 * @param cls the `struct GNUNET_NAT_Test`
208 * @param tc scheduler context
209 */ 208 */
210static void 209static void
211do_udp_read (void *cls, 210do_udp_read (void *cls)
212 const struct GNUNET_SCHEDULER_TaskContext *tc)
213{ 211{
214 struct GNUNET_NAT_Test *tst = cls; 212 struct GNUNET_NAT_Test *tst = cls;
215 uint16_t data; 213 uint16_t data;
214 const struct GNUNET_SCHEDULER_TaskContext *tc;
216 215
216 tc = GNUNET_SCHEDULER_get_task_context ();
217 tst->ltask = 217 tst->ltask =
218 GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, 218 GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
219 tst->lsock, 219 tst->lsock,
@@ -240,16 +240,16 @@ do_udp_read (void *cls,
240 * incoming connection. 240 * incoming connection.
241 * 241 *
242 * @param cls the `struct NatActivity` 242 * @param cls the `struct NatActivity`
243 * @param tc scheduler context
244 */ 243 */
245static void 244static void
246do_read (void *cls, 245do_read (void *cls)
247 const struct GNUNET_SCHEDULER_TaskContext *tc)
248{ 246{
249 struct NatActivity *na = cls; 247 struct NatActivity *na = cls;
250 struct GNUNET_NAT_Test *tst; 248 struct GNUNET_NAT_Test *tst;
251 uint16_t data; 249 uint16_t data;
250 const struct GNUNET_SCHEDULER_TaskContext *tc;
252 251
252 tc = GNUNET_SCHEDULER_get_task_context ();
253 na->rtask = NULL; 253 na->rtask = NULL;
254 tst = na->h; 254 tst = na->h;
255 GNUNET_CONTAINER_DLL_remove (tst->na_head, tst->na_tail, na); 255 GNUNET_CONTAINER_DLL_remove (tst->na_head, tst->na_tail, na);
@@ -277,17 +277,17 @@ do_read (void *cls,
277 * incoming connection. 277 * incoming connection.
278 * 278 *
279 * @param cls the `struct GNUNET_NAT_Test` 279 * @param cls the `struct GNUNET_NAT_Test`
280 * @param tc scheduler context
281 */ 280 */
282static void 281static void
283do_accept (void *cls, 282do_accept (void *cls)
284 const struct GNUNET_SCHEDULER_TaskContext *tc)
285{ 283{
286 struct GNUNET_NAT_Test *tst = cls; 284 struct GNUNET_NAT_Test *tst = cls;
287 struct GNUNET_NETWORK_Handle *s; 285 struct GNUNET_NETWORK_Handle *s;
288 struct NatActivity *wl; 286 struct NatActivity *wl;
287 const struct GNUNET_SCHEDULER_TaskContext *tc;
289 288
290 tst->ltask = NULL; 289 tst->ltask = NULL;
290 tc = GNUNET_SCHEDULER_get_task_context ();
291 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 291 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
292 return; 292 return;
293 tst->ltask = 293 tst->ltask =
@@ -378,11 +378,9 @@ addr_cb (void *cls,
378 * Destroys the nat handle after the callback has been processed. 378 * Destroys the nat handle after the callback has been processed.
379 * 379 *
380 * @param cls handle to the timed out NAT test 380 * @param cls handle to the timed out NAT test
381 * @param tc not used
382 */ 381 */
383static void 382static void
384do_timeout (void *cls, 383do_timeout (void *cls)
385 const struct GNUNET_SCHEDULER_TaskContext *tc)
386{ 384{
387 struct GNUNET_NAT_Test *nh = cls; 385 struct GNUNET_NAT_Test *nh = cls;
388 386
@@ -440,8 +438,8 @@ GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
440 nh->status = GNUNET_NAT_ERROR_SUCCESS; 438 nh->status = GNUNET_NAT_ERROR_SUCCESS;
441 if (0 == bnd_port) 439 if (0 == bnd_port)
442 { 440 {
443 nh->nat 441 nh->nat
444 = GNUNET_NAT_register (cfg, is_tcp, 0, 0, 442 = GNUNET_NAT_register (cfg, is_tcp, 0, 0,
445 NULL, NULL, 443 NULL, NULL,
446 &addr_cb, 444 &addr_cb,
447 &reversal_cb, nh, NULL); 445 &reversal_cb, nh, NULL);
diff --git a/src/nat/test_nat.c b/src/nat/test_nat.c
index de8ff8c13..a840f3ef9 100644
--- a/src/nat/test_nat.c
+++ b/src/nat/test_nat.c
@@ -65,7 +65,7 @@ addr_callback (void *cls, int add_remove, const struct sockaddr *addr,
65 * Function that terminates the test. 65 * Function that terminates the test.
66 */ 66 */
67static void 67static void
68stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 68stop (void *cls)
69{ 69{
70 struct GNUNET_NAT_Handle *nat = cls; 70 struct GNUNET_NAT_Handle *nat = cls;
71 71
diff --git a/src/nat/test_nat_mini.c b/src/nat/test_nat_mini.c
index 1819d5e91..f5b63f698 100644
--- a/src/nat/test_nat_mini.c
+++ b/src/nat/test_nat_mini.c
@@ -67,7 +67,7 @@ addr_callback (void *cls, int add_remove,
67 * Function that terminates the test. 67 * Function that terminates the test.
68 */ 68 */
69static void 69static void
70stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 70stop (void *cls)
71{ 71{
72 struct GNUNET_NAT_MiniHandle *mini = cls; 72 struct GNUNET_NAT_MiniHandle *mini = cls;
73 73
diff --git a/src/nat/test_nat_test.c b/src/nat/test_nat_test.c
index c0cce6e45..402671bd2 100644
--- a/src/nat/test_nat_test.c
+++ b/src/nat/test_nat_test.c
@@ -59,8 +59,7 @@ report_result (void *cls,
59 59
60 60
61static void 61static void
62failed_timeout (void *cls, 62failed_timeout (void *cls)
63 const struct GNUNET_SCHEDULER_TaskContext *tc)
64{ 63{
65 tsk = NULL; 64 tsk = NULL;
66 fprintf (stderr, 65 fprintf (stderr,
@@ -86,7 +85,7 @@ run (void *cls, char *const *args, const char *cfgfile,
86 2), 85 2),
87 &failed_timeout, 86 &failed_timeout,
88 NULL); 87 NULL);
89 88
90} 89}
91 90
92 91
@@ -127,7 +126,7 @@ main (int argc, char *const argv[])
127 "12345", NULL); 126 "12345", NULL);
128 GNUNET_assert (NULL != gns); 127 GNUNET_assert (NULL != gns);
129 GNUNET_PROGRAM_run (3, argv_prog, 128 GNUNET_PROGRAM_run (3, argv_prog,
130 "test-nat-test", "nohelp", 129 "test-nat-test", "nohelp",
131 options, &run, 130 options, &run,
132 NULL); 131 NULL);
133 GNUNET_break (0 == GNUNET_OS_process_kill (gns, GNUNET_TERM_SIG)); 132 GNUNET_break (0 == GNUNET_OS_process_kill (gns, GNUNET_TERM_SIG));
diff --git a/src/nat/test_stun.c b/src/nat/test_stun.c
index a856fa971..7fbba1cd6 100644
--- a/src/nat/test_stun.c
+++ b/src/nat/test_stun.c
@@ -112,18 +112,18 @@ stop ()
112 * incoming connection. 112 * incoming connection.
113 * 113 *
114 * @param cls 114 * @param cls
115 * @param tc scheduler context
116 */ 115 */
117static void 116static void
118do_udp_read (void *cls, 117do_udp_read (void *cls)
119 const struct GNUNET_SCHEDULER_TaskContext *tc)
120{ 118{
121 //struct GNUNET_NAT_Test *tst = cls; 119 //struct GNUNET_NAT_Test *tst = cls;
122 unsigned char reply_buf[1024]; 120 unsigned char reply_buf[1024];
123 ssize_t rlen; 121 ssize_t rlen;
124 struct sockaddr_in answer; 122 struct sockaddr_in answer;
123 const struct GNUNET_SCHEDULER_TaskContext *tc;
125 124
126 ltask4 = NULL; 125 ltask4 = NULL;
126 tc = GNUNET_SCHEDULER_get_task_context ();
127 if ( (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) || 127 if ( (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) ||
128 (! GNUNET_NETWORK_fdset_isset (tc->read_ready, 128 (! GNUNET_NETWORK_fdset_isset (tc->read_ready,
129 lsock4)) ) 129 lsock4)) )
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c
index 91ca97fbd..5b893ae47 100644
--- a/src/nse/gnunet-nse-profiler.c
+++ b/src/nse/gnunet-nse-profiler.c
@@ -265,10 +265,9 @@ close_monitor_connections ()
265 * Task run on shutdown; cleans up everything. 265 * Task run on shutdown; cleans up everything.
266 * 266 *
267 * @param cls unused 267 * @param cls unused
268 * @param tc unused
269 */ 268 */
270static void 269static void
271shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 270shutdown_task (void *cls)
272{ 271{
273 shutdown_task_id = NULL; 272 shutdown_task_id = NULL;
274 if (GNUNET_YES == shutting_down) 273 if (GNUNET_YES == shutting_down)
@@ -542,11 +541,9 @@ connect_nse_service ()
542 * Task that starts/stops peers to move to the next round. 541 * Task that starts/stops peers to move to the next round.
543 * 542 *
544 * @param cls NULL, unused 543 * @param cls NULL, unused
545 * @param tc scheduler context (unused)
546 */ 544 */
547static void 545static void
548next_round (void *cls, 546next_round (void *cls);
549 const struct GNUNET_SCHEDULER_TaskContext *tc);
550 547
551 548
552/** 549/**
@@ -555,12 +552,13 @@ next_round (void *cls,
555 * the next round. 552 * the next round.
556 * 553 *
557 * @param cls unused, NULL 554 * @param cls unused, NULL
558 * @param tc unused
559 */ 555 */
560static void 556static void
561finish_round (void *cls, 557finish_round (void *cls)
562 const struct GNUNET_SCHEDULER_TaskContext *tc)
563{ 558{
559 const struct GNUNET_SCHEDULER_TaskContext *tc;
560
561 tc = GNUNET_SCHEDULER_get_task_context ();
564 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 562 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
565 return; 563 return;
566 LOG (GNUNET_ERROR_TYPE_INFO, "Have %u connections\n", total_connections); 564 LOG (GNUNET_ERROR_TYPE_INFO, "Have %u connections\n", total_connections);
@@ -670,12 +668,13 @@ adjust_running_peers ()
670 * peers; then get statistics from *all* peers. 668 * peers; then get statistics from *all* peers.
671 * 669 *
672 * @param cls NULL, unused 670 * @param cls NULL, unused
673 * @param tc unused
674 */ 671 */
675static void 672static void
676next_round (void *cls, 673next_round (void *cls)
677 const struct GNUNET_SCHEDULER_TaskContext *tc)
678{ 674{
675 const struct GNUNET_SCHEDULER_TaskContext *tc;
676
677 tc = GNUNET_SCHEDULER_get_task_context ();
679 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 678 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
680 return; 679 return;
681 LOG_DEBUG ("Disconnecting nse service of peers\n"); 680 LOG_DEBUG ("Disconnecting nse service of peers\n");
diff --git a/src/nse/gnunet-nse.c b/src/nse/gnunet-nse.c
index 29f0003cb..97c3da29b 100644
--- a/src/nse/gnunet-nse.c
+++ b/src/nse/gnunet-nse.c
@@ -21,7 +21,7 @@
21/** 21/**
22 * @file nse/gnunet-nse.c 22 * @file nse/gnunet-nse.c
23 * @brief Program to display network size estimates from the NSE service 23 * @brief Program to display network size estimates from the NSE service
24 * @author Sree Harsha Totakura <sreeharsha@totakura.in> 24 * @author Sree Harsha Totakura <sreeharsha@totakura.in>
25 */ 25 */
26 26
27#include "platform.h" 27#include "platform.h"
@@ -57,10 +57,9 @@ static int status;
57 * Task to shutdown and clean up all state 57 * Task to shutdown and clean up all state
58 * 58 *
59 * @param cls NULL 59 * @param cls NULL
60 * @param tc the scheduler task context
61 */ 60 */
62static void 61static void
63do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 62do_shutdown (void *cls)
64{ 63{
65 shutdown_task = NULL; 64 shutdown_task = NULL;
66 if (NULL != test) 65 if (NULL != test)
@@ -160,7 +159,7 @@ main (int argc, char *const *argv)
160 static struct GNUNET_GETOPT_CommandLineOption options[] = { 159 static struct GNUNET_GETOPT_CommandLineOption options[] = {
161 GNUNET_GETOPT_OPTION_END 160 GNUNET_GETOPT_OPTION_END
162 }; 161 };
163 162
164 status = 1; 163 status = 1;
165 if (GNUNET_OK != 164 if (GNUNET_OK !=
166 GNUNET_PROGRAM_run (argc, argv, "gnunet-nse", 165 GNUNET_PROGRAM_run (argc, argv, "gnunet-nse",
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index 12e4100d7..608274ae1 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -593,11 +593,9 @@ get_transmit_delay (int round_offset)
593 * Task that triggers a NSE P2P transmission. 593 * Task that triggers a NSE P2P transmission.
594 * 594 *
595 * @param cls the `struct NSEPeerEntry *` 595 * @param cls the `struct NSEPeerEntry *`
596 * @param tc scheduler context
597 */ 596 */
598static void 597static void
599transmit_task_cb (void *cls, 598transmit_task_cb (void *cls);
600 const struct GNUNET_SCHEDULER_TaskContext *tc);
601 599
602 600
603/** 601/**
@@ -673,11 +671,9 @@ transmit_ready (void *cls,
673 * Task that triggers a NSE P2P transmission. 671 * Task that triggers a NSE P2P transmission.
674 * 672 *
675 * @param cls the `struct NSEPeerEntry *` 673 * @param cls the `struct NSEPeerEntry *`
676 * @param tc scheduler context
677 */ 674 */
678static void 675static void
679transmit_task_cb (void *cls, 676transmit_task_cb (void *cls)
680 const struct GNUNET_SCHEDULER_TaskContext *tc)
681{ 677{
682 struct NSEPeerEntry *peer_entry = cls; 678 struct NSEPeerEntry *peer_entry = cls;
683 679
@@ -797,16 +793,16 @@ schedule_current_round (void *cls,
797 * Update our flood message to be sent (and our timestamps). 793 * Update our flood message to be sent (and our timestamps).
798 * 794 *
799 * @param cls unused 795 * @param cls unused
800 * @param tc context for this message
801 */ 796 */
802static void 797static void
803update_flood_message (void *cls, 798update_flood_message (void *cls)
804 const struct GNUNET_SCHEDULER_TaskContext *tc)
805{ 799{
806 struct GNUNET_TIME_Relative offset; 800 struct GNUNET_TIME_Relative offset;
807 unsigned int i; 801 unsigned int i;
802 const struct GNUNET_SCHEDULER_TaskContext *tc;
808 803
809 flood_task = NULL; 804 flood_task = NULL;
805 tc = GNUNET_SCHEDULER_get_task_context ();
810 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 806 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
811 return; 807 return;
812 offset = GNUNET_TIME_absolute_get_remaining (next_timestamp); 808 offset = GNUNET_TIME_absolute_get_remaining (next_timestamp);
@@ -918,11 +914,9 @@ write_proof ()
918 * Find our proof of work. 914 * Find our proof of work.
919 * 915 *
920 * @param cls closure (unused) 916 * @param cls closure (unused)
921 * @param tc task context
922 */ 917 */
923static void 918static void
924find_proof (void *cls, 919find_proof (void *cls)
925 const struct GNUNET_SCHEDULER_TaskContext *tc)
926{ 920{
927#define ROUND_SIZE 10 921#define ROUND_SIZE 10
928 uint64_t counter; 922 uint64_t counter;
@@ -1343,11 +1337,9 @@ flush_comp_cb (void *cls,
1343 * Task run during shutdown. 1337 * Task run during shutdown.
1344 * 1338 *
1345 * @param cls unused 1339 * @param cls unused
1346 * @param tc unused
1347 */ 1340 */
1348static void 1341static void
1349shutdown_task (void *cls, 1342shutdown_task (void *cls)
1350 const struct GNUNET_SCHEDULER_TaskContext *tc)
1351{ 1343{
1352 if (NULL != flood_task) 1344 if (NULL != flood_task)
1353 { 1345 {
diff --git a/src/nse/nse_api.c b/src/nse/nse_api.c
index 2c1260047..a42dcb369 100644
--- a/src/nse/nse_api.c
+++ b/src/nse/nse_api.c
@@ -81,10 +81,9 @@ struct GNUNET_NSE_Handle
81 * Try again to connect to network size estimation service. 81 * Try again to connect to network size estimation service.
82 * 82 *
83 * @param cls the handle to the transport service 83 * @param cls the handle to the transport service
84 * @param tc scheduler context
85 */ 84 */
86static void 85static void
87reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 86reconnect (void *cls);
88 87
89 88
90/** 89/**
@@ -198,11 +197,9 @@ send_start (void *cls, size_t size, void *buf)
198 * Try again to connect to network size estimation service. 197 * Try again to connect to network size estimation service.
199 * 198 *
200 * @param cls the `struct GNUNET_NSE_Handle *` 199 * @param cls the `struct GNUNET_NSE_Handle *`
201 * @param tc scheduler context
202 */ 200 */
203static void 201static void
204reconnect (void *cls, 202reconnect (void *cls)
205 const struct GNUNET_SCHEDULER_TaskContext *tc)
206{ 203{
207 struct GNUNET_NSE_Handle *h = cls; 204 struct GNUNET_NSE_Handle *h = cls;
208 205
diff --git a/src/nse/test_nse_api.c b/src/nse/test_nse_api.c
index 9f3c85c5c..22826b298 100644
--- a/src/nse/test_nse_api.c
+++ b/src/nse/test_nse_api.c
@@ -36,10 +36,9 @@ static struct GNUNET_SCHEDULER_Task * die_task;
36 * Signature of the main function of a task. 36 * Signature of the main function of a task.
37 * 37 *
38 * @param cls closure 38 * @param cls closure
39 * @param tc context information (why was this task triggered now)
40 */ 39 */
41static void 40static void
42end_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 41end_test (void *cls)
43{ 42{
44 if (h != NULL) 43 if (h != NULL)
45 { 44 {
diff --git a/src/nse/test_nse_multipeer.c b/src/nse/test_nse_multipeer.c
index 549cbdf12..5e6c31e6c 100644
--- a/src/nse/test_nse_multipeer.c
+++ b/src/nse/test_nse_multipeer.c
@@ -72,7 +72,7 @@ static int ok;
72 * Task run on timeout to shut everything down. 72 * Task run on timeout to shut everything down.
73 */ 73 */
74static void 74static void
75shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 75shutdown_task (void *cls)
76{ 76{
77 unsigned int i; 77 unsigned int i;
78 78
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c
index f2f1ad92a..8cfb67a73 100644
--- a/src/peerinfo-tool/gnunet-peerinfo.c
+++ b/src/peerinfo-tool/gnunet-peerinfo.c
@@ -223,11 +223,9 @@ static struct GNUNET_HELLO_Message *my_hello;
223 * runs the next requested function. 223 * runs the next requested function.
224 * 224 *
225 * @param cls unused 225 * @param cls unused
226 * @param tc unused
227 */ 226 */
228static void 227static void
229state_machine (void *cls, 228state_machine (void *cls);
230 const struct GNUNET_SCHEDULER_TaskContext *tc);
231 229
232 230
233/* ********************* 'get_info' ******************* */ 231/* ********************* 'get_info' ******************* */
@@ -620,11 +618,9 @@ parse_hello_uri (const char *put_uri)
620 * runs the next requested function. 618 * runs the next requested function.
621 * 619 *
622 * @param cls unused 620 * @param cls unused
623 * @param tc scheduler context
624 */ 621 */
625static void 622static void
626shutdown_task (void *cls, 623shutdown_task (void *cls)
627 const struct GNUNET_SCHEDULER_TaskContext *tc)
628{ 624{
629 struct PrintContext *pc; 625 struct PrintContext *pc;
630 struct AddressRecord *ar; 626 struct AddressRecord *ar;
@@ -809,11 +805,9 @@ run (void *cls,
809 * runs the next requested function. 805 * runs the next requested function.
810 * 806 *
811 * @param cls unused 807 * @param cls unused
812 * @param tc scheduler context
813 */ 808 */
814static void 809static void
815state_machine (void *cls, 810state_machine (void *cls)
816 const struct GNUNET_SCHEDULER_TaskContext *tc)
817{ 811{
818 tt = NULL; 812 tt = NULL;
819 813
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index 456a3546b..a0defb8cc 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -651,15 +651,15 @@ hosts_directory_scan_callback (void *cls,
651 * Call this method periodically to scan data/hosts for new hosts. 651 * Call this method periodically to scan data/hosts for new hosts.
652 * 652 *
653 * @param cls unused 653 * @param cls unused
654 * @param tc scheduler context, aborted if reason is shutdown
655 */ 654 */
656static void 655static void
657cron_scan_directory_data_hosts (void *cls, 656cron_scan_directory_data_hosts (void *cls)
658 const struct GNUNET_SCHEDULER_TaskContext *tc)
659{ 657{
660 static unsigned int retries; 658 static unsigned int retries;
661 struct DirScanContext dsc; 659 struct DirScanContext dsc;
660 const struct GNUNET_SCHEDULER_TaskContext *tc;
662 661
662 tc = GNUNET_SCHEDULER_get_task_context ();
663 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 663 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
664 return; 664 return;
665 if (GNUNET_SYSERR == GNUNET_DISK_directory_create (networkIdDirectory)) 665 if (GNUNET_SYSERR == GNUNET_DISK_directory_create (networkIdDirectory))
@@ -1041,14 +1041,14 @@ discard_hosts_helper (void *cls,
1041 * HELLOs to expire. 1041 * HELLOs to expire.
1042 * 1042 *
1043 * @param cls unused 1043 * @param cls unused
1044 * @param tc scheduler context, aborted if reason is shutdown
1045 */ 1044 */
1046static void 1045static void
1047cron_clean_data_hosts (void *cls, 1046cron_clean_data_hosts (void *cls)
1048 const struct GNUNET_SCHEDULER_TaskContext *tc)
1049{ 1047{
1050 struct GNUNET_TIME_Absolute now; 1048 struct GNUNET_TIME_Absolute now;
1049 const struct GNUNET_SCHEDULER_TaskContext *tc;
1051 1050
1051 tc = GNUNET_SCHEDULER_get_task_context ();
1052 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1052 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1053 return; 1053 return;
1054 now = GNUNET_TIME_absolute_get (); 1054 now = GNUNET_TIME_absolute_get ();
@@ -1277,11 +1277,9 @@ free_host_entry (void *cls,
1277 * Clean up our state. Called during shutdown. 1277 * Clean up our state. Called during shutdown.
1278 * 1278 *
1279 * @param cls unused 1279 * @param cls unused
1280 * @param tc scheduler task context, unused
1281 */ 1280 */
1282static void 1281static void
1283shutdown_task (void *cls, 1282shutdown_task (void *cls)
1284 const struct GNUNET_SCHEDULER_TaskContext *tc)
1285{ 1283{
1286 struct NotificationContext *cur; 1284 struct NotificationContext *cur;
1287 struct NotificationContext *next; 1285 struct NotificationContext *next;
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index c8b85e94c..ad4576fc2 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -279,11 +279,9 @@ reconnect (struct GNUNET_PEERINFO_Handle *h);
279 * Task scheduled to re-try connecting to the peerinfo service. 279 * Task scheduled to re-try connecting to the peerinfo service.
280 * 280 *
281 * @param cls the `struct GNUNET_PEERINFO_Handle *` 281 * @param cls the `struct GNUNET_PEERINFO_Handle *`
282 * @param tc scheduler context
283 */ 282 */
284static void 283static void
285reconnect_task (void *cls, 284reconnect_task (void *cls)
286 const struct GNUNET_SCHEDULER_TaskContext *tc)
287{ 285{
288 struct GNUNET_PEERINFO_Handle *h = cls; 286 struct GNUNET_PEERINFO_Handle *h = cls;
289 287
@@ -698,11 +696,9 @@ iterator_start_receive (void *cls,
698 * Peerinfo iteration request has timed out. 696 * Peerinfo iteration request has timed out.
699 * 697 *
700 * @param cls the `struct GNUNET_PEERINFO_IteratorContext *` 698 * @param cls the `struct GNUNET_PEERINFO_IteratorContext *`
701 * @param tc scheduler context
702 */ 699 */
703static void 700static void
704signal_timeout (void *cls, 701signal_timeout (void *cls)
705 const struct GNUNET_SCHEDULER_TaskContext *tc)
706{ 702{
707 struct GNUNET_PEERINFO_IteratorContext *ic = cls; 703 struct GNUNET_PEERINFO_IteratorContext *ic = cls;
708 GNUNET_PEERINFO_Processor cb; 704 GNUNET_PEERINFO_Processor cb;
diff --git a/src/peerinfo/peerinfo_api_notify.c b/src/peerinfo/peerinfo_api_notify.c
index 1b0974631..16331548d 100644
--- a/src/peerinfo/peerinfo_api_notify.c
+++ b/src/peerinfo/peerinfo_api_notify.c
@@ -99,11 +99,10 @@ receive_notifications (struct GNUNET_PEERINFO_NotifyContext *nc);
99/** 99/**
100 * Task to re-try connecting to peerinfo. 100 * Task to re-try connecting to peerinfo.
101 * 101 *
102 * @param cls the 'struct GNUNET_PEERINFO_NotifyContext' 102 * @param cls the `struct GNUNET_PEERINFO_NotifyContext *`
103 * @param tc scheduler context
104 */ 103 */
105static void 104static void
106reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 105reconnect (void *cls)
107{ 106{
108 struct GNUNET_PEERINFO_NotifyContext *nc = cls; 107 struct GNUNET_PEERINFO_NotifyContext *nc = cls;
109 108
@@ -138,7 +137,7 @@ process_notification (void *cls, const struct GNUNET_MessageHeader *msg)
138 if (msg == NULL) 137 if (msg == NULL)
139 { 138 {
140 GNUNET_CLIENT_disconnect (nc->client); 139 GNUNET_CLIENT_disconnect (nc->client);
141 reconnect (nc, NULL); 140 reconnect (nc);
142 return; 141 return;
143 } 142 }
144 ms = ntohs (msg->size); 143 ms = ntohs (msg->size);
diff --git a/src/peerinfo/test_peerinfo_api_notify_friend_only.c b/src/peerinfo/test_peerinfo_api_notify_friend_only.c
index b3d5e4b6e..d0322713c 100644
--- a/src/peerinfo/test_peerinfo_api_notify_friend_only.c
+++ b/src/peerinfo/test_peerinfo_api_notify_friend_only.c
@@ -58,10 +58,10 @@ static int res_cb_wo_fo;
58 58
59struct GNUNET_PeerIdentity pid; 59struct GNUNET_PeerIdentity pid;
60 60
61struct GNUNET_SCHEDULER_Task * timeout_task; 61struct GNUNET_SCHEDULER_Task *timeout_task;
62 62
63static void 63static void
64end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 64end_badly (void *cls)
65{ 65{
66 timeout_task = NULL; 66 timeout_task = NULL;
67 GNUNET_break(0); 67 GNUNET_break(0);
@@ -83,8 +83,9 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
83 global_ret = 255; 83 global_ret = 255;
84} 84}
85 85
86
86static void 87static void
87done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 88done (void *cls)
88{ 89{
89 if (NULL != pnc_w_fo) 90 if (NULL != pnc_w_fo)
90 GNUNET_PEERINFO_notify_cancel (pnc_w_fo); 91 GNUNET_PEERINFO_notify_cancel (pnc_w_fo);
diff --git a/src/peerstore/gnunet-peerstore.c b/src/peerstore/gnunet-peerstore.c
index e274a1751..68ae1746f 100644
--- a/src/peerstore/gnunet-peerstore.c
+++ b/src/peerstore/gnunet-peerstore.c
@@ -32,16 +32,16 @@ static int ret;
32/* 32/*
33 * Handle to PEERSTORE service 33 * Handle to PEERSTORE service
34 */ 34 */
35struct GNUNET_PEERSTORE_Handle *peerstore_handle; 35static struct GNUNET_PEERSTORE_Handle *peerstore_handle;
36
36 37
37/** 38/**
38 * Run on shutdown 39 * Run on shutdown
39 * 40 *
40 * @param cls unused 41 * @param cls unused
41 * @param tc scheduler context
42 */ 42 */
43static void 43static void
44shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 44shutdown_task (void *cls)
45{ 45{
46 if (NULL != peerstore_handle) 46 if (NULL != peerstore_handle)
47 { 47 {
diff --git a/src/peerstore/gnunet-service-peerstore.c b/src/peerstore/gnunet-service-peerstore.c
index f680c5d14..3a2d928e3 100644
--- a/src/peerstore/gnunet-service-peerstore.c
+++ b/src/peerstore/gnunet-service-peerstore.c
@@ -125,10 +125,9 @@ do_shutdown ()
125 * Task run during shutdown. 125 * Task run during shutdown.
126 * 126 *
127 * @param cls unused 127 * @param cls unused
128 * @param tc unused
129 */ 128 */
130static void 129static void
131shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 130shutdown_task (void *cls)
132{ 131{
133 in_shutdown = GNUNET_YES; 132 in_shutdown = GNUNET_YES;
134 if (NULL == client_head) /* Only when no connected clients. */ 133 if (NULL == client_head) /* Only when no connected clients. */
@@ -145,11 +144,12 @@ expire_records_continuation (void *cls, int success);
145 * Deletes any expired records from storage 144 * Deletes any expired records from storage
146 */ 145 */
147static void 146static void
148cleanup_expired_records (void *cls, 147cleanup_expired_records (void *cls)
149 const struct GNUNET_SCHEDULER_TaskContext *tc)
150{ 148{
151 int ret; 149 int ret;
150 const struct GNUNET_SCHEDULER_TaskContext *tc;
152 151
152 tc = GNUNET_SCHEDULER_get_task_context ();
153 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 153 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
154 return; 154 return;
155 GNUNET_assert (NULL != db); 155 GNUNET_assert (NULL != db);
diff --git a/src/peerstore/peerstore_api.c b/src/peerstore/peerstore_api.c
index a792f37ff..14117a333 100644
--- a/src/peerstore/peerstore_api.c
+++ b/src/peerstore/peerstore_api.c
@@ -358,10 +358,9 @@ rewatch_it (void *cls, const struct GNUNET_HashCode *key, void *value)
358 * Called when the iterate request is timedout 358 * Called when the iterate request is timedout
359 * 359 *
360 * @param cls a `struct GNUNET_PEERSTORE_IterateContext *` 360 * @param cls a `struct GNUNET_PEERSTORE_IterateContext *`
361 * @param tc Scheduler task context (unused)
362 */ 361 */
363static void 362static void
364iterate_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 363iterate_timeout (void *cls)
365{ 364{
366 struct GNUNET_PEERSTORE_IterateContext *ic = cls; 365 struct GNUNET_PEERSTORE_IterateContext *ic = cls;
367 GNUNET_PEERSTORE_Processor callback; 366 GNUNET_PEERSTORE_Processor callback;
diff --git a/src/peerstore/test_peerstore_api_sync.c b/src/peerstore/test_peerstore_api_sync.c
index ad113a778..765ae9113 100644
--- a/src/peerstore/test_peerstore_api_sync.c
+++ b/src/peerstore/test_peerstore_api_sync.c
@@ -80,7 +80,7 @@ static const char *val = "test_peerstore_api_store_val";
80 * @return #GNUNET_YES (all good, continue) 80 * @return #GNUNET_YES (all good, continue)
81 */ 81 */
82static int 82static int
83iterate_cb (void *cls, 83iterate_cb (void *cls,
84 const struct GNUNET_PEERSTORE_Record *record, 84 const struct GNUNET_PEERSTORE_Record *record,
85 const char *emsg) 85 const char *emsg)
86{ 86{
@@ -89,7 +89,7 @@ iterate_cb (void *cls,
89 GNUNET_break (NULL == emsg); 89 GNUNET_break (NULL == emsg);
90 if (NULL == record) 90 if (NULL == record)
91 { 91 {
92 GNUNET_PEERSTORE_disconnect (h, 92 GNUNET_PEERSTORE_disconnect (h,
93 GNUNET_NO); 93 GNUNET_NO);
94 GNUNET_SCHEDULER_shutdown (); 94 GNUNET_SCHEDULER_shutdown ();
95 return GNUNET_YES; 95 return GNUNET_YES;
@@ -106,17 +106,15 @@ iterate_cb (void *cls,
106 * data that should have been stored. 106 * data that should have been stored.
107 * 107 *
108 * @param cls NULL 108 * @param cls NULL
109 * @param tc unused
110 */ 109 */
111static void 110static void
112test_cont (void *cls, 111test_cont (void *cls)
113 const struct GNUNET_SCHEDULER_TaskContext *tc)
114{ 112{
115 h = GNUNET_PEERSTORE_connect (cfg); 113 h = GNUNET_PEERSTORE_connect (cfg);
116 GNUNET_PEERSTORE_iterate (h, 114 GNUNET_PEERSTORE_iterate (h,
117 subsystem, 115 subsystem,
118 &pid, key, 116 &pid, key,
119 GNUNET_TIME_UNIT_FOREVER_REL, 117 GNUNET_TIME_UNIT_FOREVER_REL,
120 &iterate_cb, NULL); 118 &iterate_cb, NULL);
121} 119}
122 120
@@ -128,15 +126,15 @@ static void
128test1 () 126test1 ()
129{ 127{
130 h = GNUNET_PEERSTORE_connect (cfg); 128 h = GNUNET_PEERSTORE_connect (cfg);
131 GNUNET_PEERSTORE_store (h, 129 GNUNET_PEERSTORE_store (h,
132 subsystem, 130 subsystem,
133 &pid, 131 &pid,
134 key, 132 key,
135 val, strlen (val) + 1, 133 val, strlen (val) + 1,
136 GNUNET_TIME_UNIT_FOREVER_ABS, 134 GNUNET_TIME_UNIT_FOREVER_ABS,
137 GNUNET_PEERSTORE_STOREOPTION_REPLACE, 135 GNUNET_PEERSTORE_STOREOPTION_REPLACE,
138 NULL, NULL); 136 NULL, NULL);
139 GNUNET_PEERSTORE_disconnect (h, 137 GNUNET_PEERSTORE_disconnect (h,
140 GNUNET_YES); 138 GNUNET_YES);
141 h = NULL; 139 h = NULL;
142 /* We need to wait a little bit to give the disconnect 140 /* We need to wait a little bit to give the disconnect
@@ -158,7 +156,7 @@ test1 ()
158 * @param peer handle to our peer (unused) 156 * @param peer handle to our peer (unused)
159 */ 157 */
160static void 158static void
161run (void *cls, 159run (void *cls,
162 const struct GNUNET_CONFIGURATION_Handle *c, 160 const struct GNUNET_CONFIGURATION_Handle *c,
163 struct GNUNET_TESTING_Peer *peer) 161 struct GNUNET_TESTING_Peer *peer)
164{ 162{
@@ -173,7 +171,7 @@ int
173main (int argc, char *argv[]) 171main (int argc, char *argv[])
174{ 172{
175 if (0 != 173 if (0 !=
176 GNUNET_TESTING_service_run ("test-gnunet-peerstore-sync", 174 GNUNET_TESTING_service_run ("test-gnunet-peerstore-sync",
177 "peerstore", 175 "peerstore",
178 "test_peerstore_api_data.conf", 176 "test_peerstore_api_data.conf",
179 &run, NULL)) 177 &run, NULL))
diff --git a/src/pq/test_pq.c b/src/pq/test_pq.c
index b8ffc6403..49705103f 100644
--- a/src/pq/test_pq.c
+++ b/src/pq/test_pq.c
@@ -102,8 +102,9 @@ run_queries (PGconn *conn)
102 PGresult *result; 102 PGresult *result;
103 int ret; 103 int ret;
104 struct GNUNET_CRYPTO_RsaPrivateKey *priv; 104 struct GNUNET_CRYPTO_RsaPrivateKey *priv;
105 char msg[] = "Hello"; 105 const char msg[] = "hello";
106 void *msg2; 106 void *msg2;
107 struct GNUNET_HashCode hmsg;
107 size_t msg2_len; 108 size_t msg2_len;
108 uint16_t u16; 109 uint16_t u16;
109 uint16_t u162; 110 uint16_t u162;
@@ -114,9 +115,9 @@ run_queries (PGconn *conn)
114 115
115 priv = GNUNET_CRYPTO_rsa_private_key_create (1024); 116 priv = GNUNET_CRYPTO_rsa_private_key_create (1024);
116 pub = GNUNET_CRYPTO_rsa_private_key_get_public (priv); 117 pub = GNUNET_CRYPTO_rsa_private_key_get_public (priv);
117 sig = GNUNET_CRYPTO_rsa_sign (priv, 118 memset (&hmsg, 42, sizeof (hmsg));
118 msg, 119 sig = GNUNET_CRYPTO_rsa_sign_fdh (priv,
119 sizeof (msg)); 120 &hmsg);
120 u16 = 16; 121 u16 = 16;
121 u32 = 32; 122 u32 = 32;
122 u64 = 64; 123 u64 = 64;
diff --git a/src/psyc/gnunet-service-psyc.c b/src/psyc/gnunet-service-psyc.c
index 38ec10e4d..2b436aa21 100644
--- a/src/psyc/gnunet-service-psyc.c
+++ b/src/psyc/gnunet-service-psyc.c
@@ -428,10 +428,10 @@ message_queue_drop (struct Channel *chn);
428 428
429 429
430static void 430static void
431schedule_transmit_message (void *cls, 431schedule_transmit_message (void *cls)
432 const struct GNUNET_SCHEDULER_TaskContext *tc)
433{ 432{
434 struct Channel *chn = cls; 433 struct Channel *chn = cls;
434
435 transmit_message (chn); 435 transmit_message (chn);
436} 436}
437 437
@@ -440,10 +440,9 @@ schedule_transmit_message (void *cls,
440 * Task run during shutdown. 440 * Task run during shutdown.
441 * 441 *
442 * @param cls unused 442 * @param cls unused
443 * @param tc unused
444 */ 443 */
445static void 444static void
446shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 445shutdown_task (void *cls)
447{ 446{
448 if (NULL != nc) 447 if (NULL != nc)
449 { 448 {
diff --git a/src/psyc/test_psyc.c b/src/psyc/test_psyc.c
index 4aae5e122..1169b49d5 100644
--- a/src/psyc/test_psyc.c
+++ b/src/psyc/test_psyc.c
@@ -158,10 +158,9 @@ cleanup ()
158 * Terminate the test case (failure). 158 * Terminate the test case (failure).
159 * 159 *
160 * @param cls NULL 160 * @param cls NULL
161 * @param tc scheduler context
162 */ 161 */
163void 162static void
164end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 163end_badly (void *cls)
165{ 164{
166 res = 1; 165 res = 1;
167 cleanup (); 166 cleanup ();
@@ -173,10 +172,9 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
173 * Terminate the test case (success). 172 * Terminate the test case (success).
174 * 173 *
175 * @param cls NULL 174 * @param cls NULL
176 * @param tc scheduler context
177 */ 175 */
178void 176static void
179end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 177end_normally (void *cls)
180{ 178{
181 res = 0; 179 res = 0;
182 cleanup (); 180 cleanup ();
@@ -545,8 +543,8 @@ master_history_replay_latest ()
545} 543}
546 544
547 545
548void 546static void
549transmit_resume (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 547transmit_resume (void *cls)
550{ 548{
551 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmission resumed.\n"); 549 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmission resumed.\n");
552 struct TransmitClosure *tmit = cls; 550 struct TransmitClosure *tmit = cls;
@@ -753,8 +751,8 @@ void first_slave_parted (void *cls)
753} 751}
754 752
755 753
756void 754static void
757schedule_slave_part (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 755schedule_slave_part (void *cls)
758{ 756{
759 GNUNET_PSYC_slave_part (slv, GNUNET_NO, first_slave_parted, NULL); 757 GNUNET_PSYC_slave_part (slv, GNUNET_NO, first_slave_parted, NULL);
760} 758}
@@ -925,8 +923,9 @@ master_start ()
925 mst_chn = GNUNET_PSYC_master_get_channel (mst); 923 mst_chn = GNUNET_PSYC_master_get_channel (mst);
926} 924}
927 925
928void 926
929schedule_master_start (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 927static void
928schedule_master_start (void *cls)
930{ 929{
931 master_start (); 930 master_start ();
932} 931}
diff --git a/src/psycstore/gnunet-service-psycstore.c b/src/psycstore/gnunet-service-psycstore.c
index ae108fc4d..737cff422 100644
--- a/src/psycstore/gnunet-service-psycstore.c
+++ b/src/psycstore/gnunet-service-psycstore.c
@@ -1,4 +1,4 @@
1/* 1/**
2 * This file is part of GNUnet 2 * This file is part of GNUnet
3 * Copyright (C) 2013 GNUnet e.V. 3 * Copyright (C) 2013 GNUnet e.V.
4 * 4 *
@@ -68,10 +68,9 @@ static char *db_lib_name;
68 * Task run during shutdown. 68 * Task run during shutdown.
69 * 69 *
70 * @param cls unused 70 * @param cls unused
71 * @param tc unused
72 */ 71 */
73static void 72static void
74shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 73shutdown_task (void *cls)
75{ 74{
76 if (NULL != nc) 75 if (NULL != nc)
77 { 76 {
diff --git a/src/psycstore/psycstore_api.c b/src/psycstore/psycstore_api.c
index b729d7440..b8f00a41c 100644
--- a/src/psycstore/psycstore_api.c
+++ b/src/psycstore/psycstore_api.c
@@ -186,10 +186,9 @@ find_op_by_id (struct GNUNET_PSYCSTORE_Handle *h, uint64_t op_id)
186 * Try again to connect to the PSYCstore service. 186 * Try again to connect to the PSYCstore service.
187 * 187 *
188 * @param cls handle to the PSYCstore service. 188 * @param cls handle to the PSYCstore service.
189 * @param tc scheduler context
190 */ 189 */
191static void 190static void
192reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 191reconnect (void *cls);
193 192
194 193
195/** 194/**
@@ -531,10 +530,9 @@ transmit_next (struct GNUNET_PSYCSTORE_Handle *h)
531 * Try again to connect to the PSYCstore service. 530 * Try again to connect to the PSYCstore service.
532 * 531 *
533 * @param cls Handle to the PSYCstore service. 532 * @param cls Handle to the PSYCstore service.
534 * @param tc Scheduler context.
535 */ 533 */
536static void 534static void
537reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 535reconnect (void *cls)
538{ 536{
539 struct GNUNET_PSYCSTORE_Handle *h = cls; 537 struct GNUNET_PSYCSTORE_Handle *h = cls;
540 538
diff --git a/src/psycstore/test_psycstore.c b/src/psycstore/test_psycstore.c
index b0ae3b924..266ee5c1d 100644
--- a/src/psycstore/test_psycstore.c
+++ b/src/psycstore/test_psycstore.c
@@ -113,10 +113,9 @@ cleanup ()
113 * Terminate the testcase (failure). 113 * Terminate the testcase (failure).
114 * 114 *
115 * @param cls NULL 115 * @param cls NULL
116 * @param tc scheduler context
117 */ 116 */
118static void 117static void
119end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 118end_badly (void *cls)
120{ 119{
121 res = 1; 120 res = 1;
122 cleanup (); 121 cleanup ();
@@ -127,10 +126,9 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
127 * Terminate the testcase (success). 126 * Terminate the testcase (success).
128 * 127 *
129 * @param cls NULL 128 * @param cls NULL
130 * @param tc scheduler context
131 */ 129 */
132static void 130static void
133end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 131end_normally (void *cls)
134{ 132{
135 res = 0; 133 res = 0;
136 cleanup (); 134 cleanup ();
diff --git a/src/pt/gnunet-daemon-pt.c b/src/pt/gnunet-daemon-pt.c
index c377c3f90..a86cbd316 100644
--- a/src/pt/gnunet-daemon-pt.c
+++ b/src/pt/gnunet-daemon-pt.c
@@ -800,11 +800,9 @@ transmit_dns_request_to_cadet (void *cls,
800 * Task run if the time to answer a DNS request via CADET is over. 800 * Task run if the time to answer a DNS request via CADET is over.
801 * 801 *
802 * @param cls the `struct RequestContext` to abort 802 * @param cls the `struct RequestContext` to abort
803 * @param tc scheduler context
804 */ 803 */
805static void 804static void
806timeout_request (void *cls, 805timeout_request (void *cls)
807 const struct GNUNET_SCHEDULER_TaskContext *tc)
808{ 806{
809 struct RequestContext *rc = cls; 807 struct RequestContext *rc = cls;
810 struct CadetExit *exit = rc->exit; 808 struct CadetExit *exit = rc->exit;
@@ -1023,11 +1021,9 @@ abort_all_requests (struct CadetExit *exit)
1023 * Function scheduled as very last function, cleans up after us 1021 * Function scheduled as very last function, cleans up after us
1024 * 1022 *
1025 * @param cls closure, NULL 1023 * @param cls closure, NULL
1026 * @param tskctx scheduler context, unused
1027 */ 1024 */
1028static void 1025static void
1029cleanup (void *cls, 1026cleanup (void *cls)
1030 const struct GNUNET_SCHEDULER_TaskContext *tskctx)
1031{ 1027{
1032 struct CadetExit *exit; 1028 struct CadetExit *exit;
1033 1029
diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c
index f1ddcddc2..c0d50d177 100644
--- a/src/pt/test_gns_vpn.c
+++ b/src/pt/test_gns_vpn.c
@@ -140,8 +140,7 @@ mhd_ahc (void *cls,
140 140
141 141
142static void 142static void
143do_shutdown (void *cls, 143do_shutdown (void *cls)
144 const struct GNUNET_SCHEDULER_TaskContext *c)
145{ 144{
146 if (mhd_task_id != NULL) 145 if (mhd_task_id != NULL)
147 { 146 {
@@ -181,8 +180,7 @@ curl_main (void);
181 180
182 181
183static void 182static void
184curl_task (void *cls, 183curl_task (void *cls)
185 const struct GNUNET_SCHEDULER_TaskContext *tc)
186{ 184{
187 curl_task_id = NULL; 185 curl_task_id = NULL;
188 curl_main (); 186 curl_main ();
@@ -264,7 +262,7 @@ curl_main ()
264 262
265 263
266static void 264static void
267start_curl (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 265start_curl (void *cls)
268{ 266{
269 GNUNET_asprintf (&url, 267 GNUNET_asprintf (&url,
270 "http://%s/hello_world", 268 "http://%s/hello_world",
@@ -289,7 +287,7 @@ start_curl (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
289 287
290 288
291static void 289static void
292disco_ns (void* cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 290disco_ns (void* cls)
293{ 291{
294 GNUNET_NAMESTORE_disconnect (namestore); 292 GNUNET_NAMESTORE_disconnect (namestore);
295 namestore = NULL; 293 namestore = NULL;
@@ -340,8 +338,7 @@ mhd_main (void);
340 338
341 339
342static void 340static void
343mhd_task (void *cls, 341mhd_task (void *cls)
344 const struct GNUNET_SCHEDULER_TaskContext *tc)
345{ 342{
346 mhd_task_id = NULL; 343 mhd_task_id = NULL;
347 MHD_run (mhd); 344 MHD_run (mhd);
diff --git a/src/pt/test_gnunet_vpn.c b/src/pt/test_gnunet_vpn.c
index b5bc1395b..85b28fbf8 100644
--- a/src/pt/test_gnunet_vpn.c
+++ b/src/pt/test_gnunet_vpn.c
@@ -171,8 +171,7 @@ do_shutdown ()
171 * Function to run the HTTP client. 171 * Function to run the HTTP client.
172 */ 172 */
173static void 173static void
174curl_main (void *cls, 174curl_main (void *cls)
175 const struct GNUNET_SCHEDULER_TaskContext *tc)
176{ 175{
177 fd_set rs; 176 fd_set rs;
178 fd_set ws; 177 fd_set ws;
@@ -304,7 +303,7 @@ mhd_main (void);
304 303
305 304
306static void 305static void
307mhd_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 306mhd_task (void *cls)
308{ 307{
309 mhd_task_id = NULL; 308 mhd_task_id = NULL;
310 MHD_run (mhd); 309 MHD_run (mhd);
@@ -313,7 +312,7 @@ mhd_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
313 312
314 313
315static void 314static void
316ctrl_c_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 315ctrl_c_shutdown (void *cls)
317{ 316{
318 ctrl_c_task_id = NULL; 317 ctrl_c_task_id = NULL;
319 do_shutdown (); 318 do_shutdown ();
diff --git a/src/regex/gnunet-daemon-regexprofiler.c b/src/regex/gnunet-daemon-regexprofiler.c
index 2ff8ad0f2..1ff3b55e3 100644
--- a/src/regex/gnunet-daemon-regexprofiler.c
+++ b/src/regex/gnunet-daemon-regexprofiler.c
@@ -106,10 +106,9 @@ static struct GNUNET_CRYPTO_EddsaPrivateKey *my_private_key;
106 * Task run during shutdown. 106 * Task run during shutdown.
107 * 107 *
108 * @param cls unused 108 * @param cls unused
109 * @param tc unused
110 */ 109 */
111static void 110static void
112shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 111shutdown_task (void *cls)
113{ 112{
114 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutting down\n"); 113 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutting down\n");
115 114
@@ -137,15 +136,16 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
137 * Announce a previously announced regex re-using cached data. 136 * Announce a previously announced regex re-using cached data.
138 * 137 *
139 * @param cls Closure (regex to announce if needed). 138 * @param cls Closure (regex to announce if needed).
140 * @param tc TaskContext.
141 */ 139 */
142static void 140static void
143reannounce_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 141reannounce_regex (void *cls)
144{ 142{
145 struct GNUNET_TIME_Relative random_delay;
146 char *regex = cls; 143 char *regex = cls;
144 struct GNUNET_TIME_Relative random_delay;
145 const struct GNUNET_SCHEDULER_TaskContext *tc;
147 146
148 reannounce_task = NULL; 147 reannounce_task = NULL;
148 tc = GNUNET_SCHEDULER_get_task_context ();
149 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 149 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
150 { 150 {
151 GNUNET_free (regex); 151 GNUNET_free (regex);
diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c
index 5fe6186cf..5938c99b1 100644
--- a/src/regex/gnunet-regex-profiler.c
+++ b/src/regex/gnunet-regex-profiler.c
@@ -384,10 +384,9 @@ stats_connect_cb (void *cls,
384 * Start announcing the next regex in the DHT. 384 * Start announcing the next regex in the DHT.
385 * 385 *
386 * @param cls Index of the next peer in the peers array. 386 * @param cls Index of the next peer in the peers array.
387 * @param tc TaskContext.
388 */ 387 */
389static void 388static void
390announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 389announce_next_regex (void *cls);
391 390
392 391
393/******************************************************************************/ 392/******************************************************************************/
@@ -399,10 +398,9 @@ announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
399 * Shutdown nicely 398 * Shutdown nicely
400 * 399 *
401 * @param cls NULL 400 * @param cls NULL
402 * @param tc the task context
403 */ 401 */
404static void 402static void
405do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 403do_shutdown (void *cls)
406{ 404{
407 struct RegexPeer *peer; 405 struct RegexPeer *peer;
408 unsigned int peer_cnt; 406 unsigned int peer_cnt;
@@ -471,10 +469,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
471 * abort task to run on test timed out 469 * abort task to run on test timed out
472 * 470 *
473 * @param cls NULL 471 * @param cls NULL
474 * @param tc the task context
475 */ 472 */
476static void 473static void
477do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 474do_abort (void *cls)
478{ 475{
479 unsigned long i = (unsigned long) cls; 476 unsigned long i = (unsigned long) cls;
480 477
@@ -664,10 +661,9 @@ stats_connect_cb (void *cls,
664 * profiler, when done. 661 * profiler, when done.
665 * 662 *
666 * @param cls NULL 663 * @param cls NULL
667 * @param tc the task context
668 */ 664 */
669static void 665static void
670do_collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 666do_collect_stats (void *cls)
671{ 667{
672 struct RegexPeer *peer = &peers[0]; 668 struct RegexPeer *peer = &peers[0];
673 669
@@ -694,10 +690,9 @@ do_collect_stats (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
694 * Start searching for the next string in the DHT. 690 * Start searching for the next string in the DHT.
695 * 691 *
696 * @param cls Index of the next peer in the peers array. 692 * @param cls Index of the next peer in the peers array.
697 * @param tc TaskContext.
698 */ 693 */
699static void 694static void
700find_string (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 695find_string (void *cls);
701 696
702 697
703/** 698/**
@@ -808,10 +803,9 @@ regex_found_handler (void *cls,
808 * specified timeout 'search_timeout'. 803 * specified timeout 'search_timeout'.
809 * 804 *
810 * @param cls NULL 805 * @param cls NULL
811 * @param tc the task context
812 */ 806 */
813static void 807static void
814search_timed_out (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc) 808search_timed_out (void *cls)
815{ 809{
816 unsigned int i; 810 unsigned int i;
817 811
@@ -846,15 +840,15 @@ search_timed_out (void *cls, const struct GNUNET_SCHEDULER_TaskContext * tc)
846 * but we should start another one. 840 * but we should start another one.
847 * 841 *
848 * @param cls Index of the next peer in the peers array. 842 * @param cls Index of the next peer in the peers array.
849 * @param tc TaskContext.
850 */ 843 */
851static void 844static void
852find_timed_out (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 845find_timed_out (void *cls)
853{ 846{
854 struct RegexPeer *p = cls; 847 struct RegexPeer *p = cls;
848 const struct GNUNET_SCHEDULER_TaskContext *tc;
855 849
856 p->timeout = NULL; 850 p->timeout = NULL;
857 851 tc = GNUNET_SCHEDULER_get_task_context ();
858 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 852 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
859 return; 853 return;
860 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 854 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -870,13 +864,14 @@ find_timed_out (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
870 * Start searching for a string in the DHT. 864 * Start searching for a string in the DHT.
871 * 865 *
872 * @param cls Index of the next peer in the peers array. 866 * @param cls Index of the next peer in the peers array.
873 * @param tc TaskContext.
874 */ 867 */
875static void 868static void
876find_string (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 869find_string (void *cls)
877{ 870{
878 unsigned int search_peer = (unsigned int) (long) cls; 871 unsigned int search_peer = (unsigned int) (long) cls;
872 const struct GNUNET_SCHEDULER_TaskContext *tc;
879 873
874 tc = GNUNET_SCHEDULER_get_task_context ();
880 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) || 875 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) ||
881 search_peer >= num_peers || 876 search_peer >= num_peers ||
882 GNUNET_YES == in_shutdown) 877 GNUNET_YES == in_shutdown)
@@ -962,7 +957,7 @@ daemon_started (void *cls, struct GNUNET_TESTBED_Operation *op,
962 * @param tc the task context 957 * @param tc the task context
963 */ 958 */
964static void 959static void
965do_announce (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 960do_announce (void *cls)
966{ 961{
967 unsigned int i; 962 unsigned int i;
968 963
@@ -982,13 +977,14 @@ do_announce (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
982 * Start announcing the next regex in the DHT. 977 * Start announcing the next regex in the DHT.
983 * 978 *
984 * @param cls Closure (unused). 979 * @param cls Closure (unused).
985 * @param tc TaskContext.
986 */ 980 */
987static void 981static void
988announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 982announce_next_regex (void *cls)
989{ 983{
990 struct RegexPeer *peer; 984 struct RegexPeer *peer;
985 const struct GNUNET_SCHEDULER_TaskContext *tc;
991 986
987 tc = GNUNET_SCHEDULER_get_task_context ();
992 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 988 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
993 return; 989 return;
994 if (next_search >= num_peers) 990 if (next_search >= num_peers)
diff --git a/src/regex/gnunet-regex-simulation-profiler.c b/src/regex/gnunet-regex-simulation-profiler.c
index 04aa66b32..27dfa773d 100644
--- a/src/regex/gnunet-regex-simulation-profiler.c
+++ b/src/regex/gnunet-regex-simulation-profiler.c
@@ -271,10 +271,9 @@ free_meter (struct ProgressMeter *meter)
271 * Shutdown task. 271 * Shutdown task.
272 * 272 *
273 * @param cls NULL 273 * @param cls NULL
274 * @param tc the task context
275 */ 274 */
276static void 275static void
277do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 276do_shutdown (void *cls)
278{ 277{
279 shutdown_task = NULL; 278 shutdown_task = NULL;
280 if (NULL != abort_task) 279 if (NULL != abort_task)
@@ -292,10 +291,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
292 * abort task to run on test timed out 291 * abort task to run on test timed out
293 * 292 *
294 * @param cls NULL 293 * @param cls NULL
295 * @param tc the task context
296 */ 294 */
297static void 295static void
298do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 296do_abort (void *cls)
299{ 297{
300 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Aborting\n"); 298 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
301 abort_task = NULL; 299 abort_task = NULL;
@@ -564,10 +562,9 @@ policy_filename_cb (void *cls, const char *filename)
564 * Iterate over files contained in policy_dir. 562 * Iterate over files contained in policy_dir.
565 * 563 *
566 * @param cls NULL 564 * @param cls NULL
567 * @param tc the task context
568 */ 565 */
569static void 566static void
570do_directory_scan (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 567do_directory_scan (void *cls)
571{ 568{
572 struct GNUNET_TIME_Absolute start_time; 569 struct GNUNET_TIME_Absolute start_time;
573 struct GNUNET_TIME_Relative duration; 570 struct GNUNET_TIME_Relative duration;
diff --git a/src/regex/gnunet-service-regex.c b/src/regex/gnunet-service-regex.c
index 2150b0973..a70876534 100644
--- a/src/regex/gnunet-service-regex.c
+++ b/src/regex/gnunet-service-regex.c
@@ -152,11 +152,9 @@ handle_client_disconnect (void *cls,
152 * Task run during shutdown. 152 * Task run during shutdown.
153 * 153 *
154 * @param cls unused 154 * @param cls unused
155 * @param tc unused
156 */ 155 */
157static void 156static void
158cleanup_task (void *cls, 157cleanup_task (void *cls)
159 const struct GNUNET_SCHEDULER_TaskContext *tc)
160{ 158{
161 struct ClientEntry *ce; 159 struct ClientEntry *ce;
162 160
@@ -177,13 +175,11 @@ cleanup_task (void *cls,
177/** 175/**
178 * Periodic task to refresh our announcement of the regex. 176 * Periodic task to refresh our announcement of the regex.
179 * 177 *
180 * @param cls the 'struct ClientEntry' of the client that triggered the 178 * @param cls the `struct ClientEntry *` of the client that triggered the
181 * announcement 179 * announcement
182 * @param tc scheduler context
183 */ 180 */
184static void 181static void
185reannounce (void *cls, 182reannounce (void *cls)
186 const struct GNUNET_SCHEDULER_TaskContext *tc)
187{ 183{
188 struct ClientEntry *ce = cls; 184 struct ClientEntry *ce = cls;
189 185
diff --git a/src/regex/test_regex_api.c b/src/regex/test_regex_api.c
index ab387d755..01f455854 100644
--- a/src/regex/test_regex_api.c
+++ b/src/regex/test_regex_api.c
@@ -45,12 +45,11 @@ static struct GNUNET_REGEX_Search *s;
45 45
46static int ok = 1; 46static int ok = 1;
47 47
48static struct GNUNET_SCHEDULER_Task * die_task; 48static struct GNUNET_SCHEDULER_Task *die_task;
49 49
50 50
51static void 51static void
52end (void *cls, 52end (void *cls)
53 const struct GNUNET_SCHEDULER_TaskContext *tc)
54{ 53{
55 die_task = NULL; 54 die_task = NULL;
56 GNUNET_REGEX_announce_cancel (a); 55 GNUNET_REGEX_announce_cancel (a);
diff --git a/src/regex/test_regex_integration.c b/src/regex/test_regex_integration.c
index 453500fa1..d98d80070 100644
--- a/src/regex/test_regex_integration.c
+++ b/src/regex/test_regex_integration.c
@@ -57,8 +57,7 @@ static struct GNUNET_SCHEDULER_Task *die_task;
57 57
58 58
59static void 59static void
60end (void *cls, 60end (void *cls)
61 const struct GNUNET_SCHEDULER_TaskContext *tc)
62{ 61{
63 die_task = NULL; 62 die_task = NULL;
64 GNUNET_REGEX_announce_cancel (a4); 63 GNUNET_REGEX_announce_cancel (a4);
@@ -77,7 +76,7 @@ static void
77end_badly () 76end_badly ()
78{ 77{
79 FPRINTF (stderr, "%s", "Testcase failed (timeout).\n"); 78 FPRINTF (stderr, "%s", "Testcase failed (timeout).\n");
80 end (NULL, NULL); 79 end (NULL);
81 ok = 1; 80 ok = 1;
82} 81}
83 82
diff --git a/src/rest/gnunet-rest-server.c b/src/rest/gnunet-rest-server.c
index fdba7fcc4..705fcbeb3 100644
--- a/src/rest/gnunet-rest-server.c
+++ b/src/rest/gnunet-rest-server.c
@@ -119,7 +119,7 @@ static char* allow_origin;
119static char* allow_headers; 119static char* allow_headers;
120 120
121/** 121/**
122 * MHD Connection handle 122 * MHD Connection handle
123 */ 123 */
124struct MhdConnectionHandle 124struct MhdConnectionHandle
125{ 125{
@@ -143,11 +143,9 @@ struct MhdConnectionHandle
143 * Task run whenever HTTP server operations are pending. 143 * Task run whenever HTTP server operations are pending.
144 * 144 *
145 * @param cls NULL 145 * @param cls NULL
146 * @param tc sched context
147 */ 146 */
148static void 147static void
149do_httpd (void *cls, 148do_httpd (void *cls);
150 const struct GNUNET_SCHEDULER_TaskContext *tc);
151 149
152 150
153/** 151/**
@@ -179,7 +177,7 @@ plugin_callback (void *cls,
179 struct MhdConnectionHandle *handle = cls; 177 struct MhdConnectionHandle *handle = cls;
180 handle->status = status; 178 handle->status = status;
181 handle->response = resp; 179 handle->response = resp;
182 run_mhd_now(); 180 run_mhd_now();
183} 181}
184 182
185 183
@@ -222,7 +220,7 @@ url_iterator (void *cls,
222 struct RestConnectionDataHandle *handle = cls; 220 struct RestConnectionDataHandle *handle = cls;
223 struct GNUNET_HashCode hkey; 221 struct GNUNET_HashCode hkey;
224 char *val; 222 char *val;
225 223
226 GNUNET_CRYPTO_hash (key, strlen (key), &hkey); 224 GNUNET_CRYPTO_hash (key, strlen (key), &hkey);
227 GNUNET_asprintf (&val, "%s", value); 225 GNUNET_asprintf (&val, "%s", value);
228 if (GNUNET_OK != 226 if (GNUNET_OK !=
@@ -394,7 +392,7 @@ kill_httpd ()
394 httpd = NULL; 392 httpd = NULL;
395 } 393 }
396 if (NULL != httpd_task) 394 if (NULL != httpd_task)
397 { 395 {
398 GNUNET_SCHEDULER_cancel (httpd_task); 396 GNUNET_SCHEDULER_cancel (httpd_task);
399 httpd_task = NULL; 397 httpd_task = NULL;
400 } 398 }
@@ -405,11 +403,9 @@ kill_httpd ()
405 * Task run whenever HTTP server is idle for too long. Kill it. 403 * Task run whenever HTTP server is idle for too long. Kill it.
406 * 404 *
407 * @param cls NULL 405 * @param cls NULL
408 * @param tc sched context
409 */ 406 */
410static void 407static void
411kill_httpd_task (void *cls, 408kill_httpd_task (void *cls)
412 const struct GNUNET_SCHEDULER_TaskContext *tc)
413{ 409{
414 httpd_task = NULL; 410 httpd_task = NULL;
415 kill_httpd (); 411 kill_httpd ();
@@ -482,11 +478,9 @@ schedule_httpd ()
482 * Task run whenever HTTP server operations are pending. 478 * Task run whenever HTTP server operations are pending.
483 * 479 *
484 * @param cls NULL 480 * @param cls NULL
485 * @param tc scheduler context
486 */ 481 */
487static void 482static void
488do_httpd (void *cls, 483do_httpd (void *cls)
489 const struct GNUNET_SCHEDULER_TaskContext *tc)
490{ 484{
491 httpd_task = NULL; 485 httpd_task = NULL;
492 MHD_run (httpd); 486 MHD_run (httpd);
@@ -501,10 +495,10 @@ do_httpd (void *cls,
501 * @param tc the scheduler context 495 * @param tc the scheduler context
502 */ 496 */
503static void 497static void
504do_accept (void *cls, 498do_accept (void *cls)
505 const struct GNUNET_SCHEDULER_TaskContext *tc)
506{ 499{
507 struct GNUNET_NETWORK_Handle *lsock = cls; 500 struct GNUNET_NETWORK_Handle *lsock = cls;
501 const struct GNUNET_SCHEDULER_TaskContext *tc;
508 struct GNUNET_NETWORK_Handle *s; 502 struct GNUNET_NETWORK_Handle *s;
509 int fd; 503 int fd;
510 const struct sockaddr *addr; 504 const struct sockaddr *addr;
@@ -514,8 +508,9 @@ do_accept (void *cls,
514 ltask4 = NULL; 508 ltask4 = NULL;
515 else 509 else
516 ltask6 = NULL; 510 ltask6 = NULL;
511 tc = GNUNET_SCHEDULER_get_task_context ();
517 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 512 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
518 return; 513 return;
519 if (lsock == lsock4) 514 if (lsock == lsock4)
520 ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, 515 ltask4 = GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
521 lsock, 516 lsock,
@@ -550,11 +545,9 @@ do_accept (void *cls,
550 * Task run on shutdown 545 * Task run on shutdown
551 * 546 *
552 * @param cls closure 547 * @param cls closure
553 * @param tc task context
554 */ 548 */
555static void 549static void
556do_shutdown (void *cls, 550do_shutdown (void *cls)
557 const struct GNUNET_SCHEDULER_TaskContext *tc)
558{ 551{
559 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 552 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
560 "Shutting down...\n"); 553 "Shutting down...\n");
@@ -581,7 +574,7 @@ bind_v4 ()
581 sa4.sin_port = htons (port); 574 sa4.sin_port = htons (port);
582#if HAVE_SOCKADDR_IN_SIN_LEN 575#if HAVE_SOCKADDR_IN_SIN_LEN
583 sa4.sin_len = sizeof (sa4); 576 sa4.sin_len = sizeof (sa4);
584#endif 577#endif
585 ls = GNUNET_NETWORK_socket_create (AF_INET, 578 ls = GNUNET_NETWORK_socket_create (AF_INET,
586 SOCK_STREAM, 579 SOCK_STREAM,
587 0); 580 0);
@@ -617,7 +610,7 @@ bind_v6 ()
617 sa6.sin6_port = htons (port); 610 sa6.sin6_port = htons (port);
618#if HAVE_SOCKADDR_IN_SIN_LEN 611#if HAVE_SOCKADDR_IN_SIN_LEN
619 sa6.sin6_len = sizeof (sa6); 612 sa6.sin6_len = sizeof (sa6);
620#endif 613#endif
621 ls = GNUNET_NETWORK_socket_create (AF_INET6, 614 ls = GNUNET_NETWORK_socket_create (AF_INET6,
622 SOCK_STREAM, 615 SOCK_STREAM,
623 0); 616 0);
@@ -685,8 +678,8 @@ load_plugin (void *cls,
685 * @param c configuration 678 * @param c configuration
686 */ 679 */
687static void 680static void
688run (void *cls, 681run (void *cls,
689 char *const *args, 682 char *const *args,
690 const char *cfgfile, 683 const char *cfgfile,
691 const struct GNUNET_CONFIGURATION_Handle *c) 684 const struct GNUNET_CONFIGURATION_Handle *c)
692{ 685{
@@ -756,7 +749,7 @@ run (void *cls,
756 { 749 {
757 GNUNET_SCHEDULER_shutdown (); 750 GNUNET_SCHEDULER_shutdown ();
758 return; 751 return;
759 } 752 }
760 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 753 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
761 "Service listens on port %u\n", 754 "Service listens on port %u\n",
762 port); 755 port);
diff --git a/src/revocation/gnunet-revocation.c b/src/revocation/gnunet-revocation.c
index 86e5c017d..f68c18aa4 100644
--- a/src/revocation/gnunet-revocation.c
+++ b/src/revocation/gnunet-revocation.c
@@ -84,11 +84,9 @@ static unsigned long long matching_bits;
84 * Function run if the user aborts with CTRL-C. 84 * Function run if the user aborts with CTRL-C.
85 * 85 *
86 * @param cls closure 86 * @param cls closure
87 * @param tc scheduler context
88 */ 87 */
89static void 88static void
90do_shutdown (void *cls, 89do_shutdown (void *cls)
91 const struct GNUNET_SCHEDULER_TaskContext *tc)
92{ 90{
93 if (NULL != el) 91 if (NULL != el)
94 { 92 {
@@ -231,15 +229,15 @@ perform_revocation (const struct RevocationData *rd)
231 * Perform the proof-of-work calculation. 229 * Perform the proof-of-work calculation.
232 * 230 *
233 * @param cls the `struct RevocationData` 231 * @param cls the `struct RevocationData`
234 * @param tc scheduler context
235 */ 232 */
236static void 233static void
237calculate_pow (void *cls, 234calculate_pow (void *cls)
238 const struct GNUNET_SCHEDULER_TaskContext *tc)
239{ 235{
240 struct RevocationData *rd = cls; 236 struct RevocationData *rd = cls;
237 const struct GNUNET_SCHEDULER_TaskContext *tc;
241 238
242 /* store temporary results */ 239 /* store temporary results */
240 tc = GNUNET_SCHEDULER_get_task_context ();
243 if ( (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) || 241 if ( (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) ||
244 (0 == (rd->pow % 128) ) ) 242 (0 == (rd->pow % 128) ) )
245 { 243 {
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c
index 9cf1bb812..e41195d55 100644
--- a/src/revocation/gnunet-service-revocation.c
+++ b/src/revocation/gnunet-service-revocation.c
@@ -521,11 +521,9 @@ add_revocation (void *cls,
521 * run the set operation on the revocation certificates. 521 * run the set operation on the revocation certificates.
522 * 522 *
523 * @param cls NULL 523 * @param cls NULL
524 * @param tc scheduler context (unused)
525 */ 524 */
526static void 525static void
527transmit_task_cb (void *cls, 526transmit_task_cb (void *cls)
528 const struct GNUNET_SCHEDULER_TaskContext *tc)
529{ 527{
530 struct PeerEntry *peer_entry = cls; 528 struct PeerEntry *peer_entry = cls;
531 529
@@ -662,11 +660,9 @@ free_entry (void *cls,
662 * Task run during shutdown. 660 * Task run during shutdown.
663 * 661 *
664 * @param cls unused 662 * @param cls unused
665 * @param tc unused
666 */ 663 */
667static void 664static void
668shutdown_task (void *cls, 665shutdown_task (void *cls)
669 const struct GNUNET_SCHEDULER_TaskContext *tc)
670{ 666{
671 if (NULL != revocation_set) 667 if (NULL != revocation_set)
672 { 668 {
diff --git a/src/revocation/test_revocation.c b/src/revocation/test_revocation.c
index e9836cc5a..6d6db1b5c 100644
--- a/src/revocation/test_revocation.c
+++ b/src/revocation/test_revocation.c
@@ -57,8 +57,7 @@ static int ok;
57 57
58 58
59static void 59static void
60do_shutdown (void *cls, 60do_shutdown (void *cls)
61 const struct GNUNET_SCHEDULER_TaskContext *tc)
62{ 61{
63 unsigned int c; 62 unsigned int c;
64 63
@@ -94,8 +93,7 @@ do_shutdown (void *cls,
94 93
95 94
96static void 95static void
97check_revocation (void *cls, 96check_revocation (void *cls);
98 const struct GNUNET_SCHEDULER_TaskContext *tc);
99 97
100 98
101static void 99static void
@@ -128,8 +126,7 @@ revocation_remote_cb (void *cls,
128 126
129 127
130static void 128static void
131check_revocation (void *cls, 129check_revocation (void *cls)
132 const struct GNUNET_SCHEDULER_TaskContext *tc)
133{ 130{
134 GNUNET_REVOCATION_query (testpeers[0].cfg, 131 GNUNET_REVOCATION_query (testpeers[0].cfg,
135 &testpeers[1].pubkey, 132 &testpeers[1].pubkey,
@@ -146,7 +143,7 @@ revocation_cb (void *cls,
146 { 143 {
147 fprintf (stderr, 144 fprintf (stderr,
148 "Revocation successful\n"); 145 "Revocation successful\n");
149 check_revocation (NULL, NULL); 146 check_revocation (NULL);
150 } 147 }
151} 148}
152 149
diff --git a/src/rps/gnunet-rps.c b/src/rps/gnunet-rps.c
index 23516b626..01be2aeb3 100644
--- a/src/rps/gnunet-rps.c
+++ b/src/rps/gnunet-rps.c
@@ -92,11 +92,9 @@ GNUNET_GETOPT_set_peerid (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
92 * Cancels pending request and disconnects. 92 * Cancels pending request and disconnects.
93 * 93 *
94 * @param cls NULL 94 * @param cls NULL
95 * @param tc scheduler context
96 */ 95 */
97static void 96static void
98do_shutdown (void *cls, 97do_shutdown (void *cls)
99 const struct GNUNET_SCHEDULER_TaskContext *tc)
100{ 98{
101 shutdown_task = NULL; 99 shutdown_task = NULL;
102 if (NULL != req_handle) 100 if (NULL != req_handle)
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index e3ddb4bff..af06cf1bd 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -1482,10 +1482,10 @@ send_push (const struct GNUNET_PeerIdentity *peer_id)
1482 1482
1483 1483
1484static void 1484static void
1485do_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 1485do_round (void *cls);
1486 1486
1487static void 1487static void
1488do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 1488do_mal_round (void *cls);
1489 1489
1490 1490
1491#ifdef ENABLE_MALICIOUS 1491#ifdef ENABLE_MALICIOUS
@@ -1624,7 +1624,7 @@ handle_client_act_malicious (void *cls,
1624 * This is executed regylary. 1624 * This is executed regylary.
1625 */ 1625 */
1626static void 1626static void
1627do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1627do_mal_round (void *cls)
1628{ 1628{
1629 uint32_t num_pushes; 1629 uint32_t num_pushes;
1630 uint32_t i; 1630 uint32_t i;
@@ -1756,7 +1756,7 @@ do_mal_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1756 * This is executed regylary. 1756 * This is executed regylary.
1757 */ 1757 */
1758static void 1758static void
1759do_round (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1759do_round (void *cls)
1760{ 1760{
1761 LOG (GNUNET_ERROR_TYPE_DEBUG, "Going to execute next round.\n"); 1761 LOG (GNUNET_ERROR_TYPE_DEBUG, "Going to execute next round.\n");
1762 1762
@@ -2032,11 +2032,9 @@ process_peerinfo_peers (void *cls,
2032 * Task run during shutdown. 2032 * Task run during shutdown.
2033 * 2033 *
2034 * @param cls unused 2034 * @param cls unused
2035 * @param tc unused
2036 */ 2035 */
2037static void 2036static void
2038shutdown_task (void *cls, 2037shutdown_task (void *cls)
2039 const struct GNUNET_SCHEDULER_TaskContext *tc)
2040{ 2038{
2041 2039
2042 LOG (GNUNET_ERROR_TYPE_DEBUG, "RPS is going down\n"); 2040 LOG (GNUNET_ERROR_TYPE_DEBUG, "RPS is going down\n");
diff --git a/src/rps/gnunet-service-rps_sampler.c b/src/rps/gnunet-service-rps_sampler.c
index b65dd7c47..e5f6595bb 100644
--- a/src/rps/gnunet-service-rps_sampler.c
+++ b/src/rps/gnunet-service-rps_sampler.c
@@ -107,8 +107,7 @@ struct GetPeerCls
107 * Sampler. 107 * Sampler.
108 */ 108 */
109typedef void 109typedef void
110(*RPS_get_peers_type) (void *cls, 110(*RPS_get_peers_type) (void *cls);
111 const struct GNUNET_SCHEDULER_TaskContext *tc);
112 111
113/** 112/**
114 * Get one random peer out of the sampled peers. 113 * Get one random peer out of the sampled peers.
@@ -118,8 +117,8 @@ typedef void
118 * Only used internally 117 * Only used internally
119 */ 118 */
120static void 119static void
121sampler_get_rand_peer (void *cls, 120sampler_get_rand_peer (void *cls);
122 const struct GNUNET_SCHEDULER_TaskContext *tc); 121
123 122
124/** 123/**
125 * Get one random peer out of the sampled peers. 124 * Get one random peer out of the sampled peers.
@@ -128,8 +127,7 @@ sampler_get_rand_peer (void *cls,
128 * corrsponding peer to the client. 127 * corrsponding peer to the client.
129 */ 128 */
130static void 129static void
131sampler_mod_get_rand_peer (void *cls, 130sampler_mod_get_rand_peer (void *cls);
132 const struct GNUNET_SCHEDULER_TaskContext *tc);
133 131
134 132
135/** 133/**
@@ -530,14 +528,15 @@ RPS_sampler_reinitialise_by_value (struct RPS_Sampler *sampler,
530 * Only used internally 528 * Only used internally
531 */ 529 */
532static void 530static void
533sampler_get_rand_peer (void *cls, 531sampler_get_rand_peer (void *cls)
534 const struct GNUNET_SCHEDULER_TaskContext *tc)
535{ 532{
536 struct GetPeerCls *gpc = cls; 533 struct GetPeerCls *gpc = cls;
537 uint32_t r_index; 534 uint32_t r_index;
538 struct RPS_Sampler *sampler; 535 struct RPS_Sampler *sampler;
536 const struct GNUNET_SCHEDULER_TaskContext *tc;
539 537
540 gpc->get_peer_task = NULL; 538 gpc->get_peer_task = NULL;
539 tc = GNUNET_SCHEDULER_get_task_context ();
541 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 540 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
542 return; 541 return;
543 sampler = gpc->req_handle->sampler; 542 sampler = gpc->req_handle->sampler;
@@ -583,15 +582,16 @@ sampler_get_rand_peer (void *cls,
583 * corrsponding peer to the client. 582 * corrsponding peer to the client.
584 */ 583 */
585static void 584static void
586sampler_mod_get_rand_peer (void *cls, 585sampler_mod_get_rand_peer (void *cls)
587 const struct GNUNET_SCHEDULER_TaskContext *tc)
588{ 586{
589 struct GetPeerCls *gpc = cls; 587 struct GetPeerCls *gpc = cls;
590 struct RPS_SamplerElement *s_elem; 588 struct RPS_SamplerElement *s_elem;
591 struct GNUNET_TIME_Relative last_request_diff; 589 struct GNUNET_TIME_Relative last_request_diff;
592 struct RPS_Sampler *sampler; 590 struct RPS_Sampler *sampler;
591 const struct GNUNET_SCHEDULER_TaskContext *tc;
593 592
594 gpc->get_peer_task = NULL; 593 gpc->get_peer_task = NULL;
594 tc = GNUNET_SCHEDULER_get_task_context ();
595 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 595 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
596 return; 596 return;
597 sampler = gpc->req_handle->sampler; 597 sampler = gpc->req_handle->sampler;
diff --git a/src/rps/test_rps.c b/src/rps/test_rps.c
index 63eb8417a..aca58d55e 100644
--- a/src/rps/test_rps.c
+++ b/src/rps/test_rps.c
@@ -430,7 +430,7 @@ tofile_ (const char *file_name, char *line)
430 430
431 431
432/** 432/**
433 * Write the ids and their according index in the given array to a file 433 * Write the ids and their according index in the given array to a file
434 * Unused 434 * Unused
435 */ 435 */
436/* static void 436/* static void
@@ -493,7 +493,7 @@ make_oplist_entry ()
493 * Task run on timeout to shut everything down. 493 * Task run on timeout to shut everything down.
494 */ 494 */
495static void 495static void
496shutdown_op (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 496shutdown_op (void *cls)
497{ 497{
498 unsigned int i; 498 unsigned int i;
499 499
@@ -513,11 +513,11 @@ shutdown_op (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
513/** 513/**
514 * Seed peers. 514 * Seed peers.
515 */ 515 */
516 void 516static void
517seed_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 517seed_peers (void *cls)
518{ 518{
519 struct RPSPeer *peer = cls;
519 unsigned int amount; 520 unsigned int amount;
520 struct RPSPeer *peer = (struct RPSPeer *) cls;
521 unsigned int i; 521 unsigned int i;
522 522
523 // TODO if malicious don't seed mal peers 523 // TODO if malicious don't seed mal peers
@@ -532,13 +532,14 @@ seed_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
532 GNUNET_RPS_seed_ids (peer->rps_handle, amount, rps_peer_ids); 532 GNUNET_RPS_seed_ids (peer->rps_handle, amount, rps_peer_ids);
533} 533}
534 534
535
535/** 536/**
536 * Seed peers. 537 * Seed peers.
537 */ 538 */
538 void 539static void
539seed_peers_big (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 540seed_peers_big (void *cls)
540{ 541{
541 struct RPSPeer *peer = (struct RPSPeer *) cls; 542 struct RPSPeer *peer = cls;
542 unsigned int seed_msg_size; 543 unsigned int seed_msg_size;
543 uint32_t num_peers_max; 544 uint32_t num_peers_max;
544 unsigned int amount; 545 unsigned int amount;
@@ -740,7 +741,7 @@ default_reply_handle (void *cls,
740 "[%s] got %" PRIu64 " peers:\n", 741 "[%s] got %" PRIu64 " peers:\n",
741 GNUNET_i2s (rps_peer->peer_id), 742 GNUNET_i2s (rps_peer->peer_id),
742 n); 743 n);
743 744
744 for (i = 0; i < n; i++) 745 for (i = 0; i < n; i++)
745 { 746 {
746 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 747 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -762,11 +763,10 @@ default_reply_handle (void *cls,
762 * Request random peers. 763 * Request random peers.
763 */ 764 */
764static void 765static void
765request_peers (void *cls, 766request_peers (void *cls)
766 const struct GNUNET_SCHEDULER_TaskContext *tc)
767{ 767{
768 struct PendingRequest *pending_req = cls;
768 struct RPSPeer *rps_peer; 769 struct RPSPeer *rps_peer;
769 struct PendingRequest *pending_req = (struct PendingRequest *) cls;
770 struct PendingReply *pending_rep; 770 struct PendingReply *pending_rep;
771 771
772 if (GNUNET_YES == in_shutdown) 772 if (GNUNET_YES == in_shutdown)
@@ -827,11 +827,10 @@ cancel_request (struct PendingReply *pending_rep)
827 * Cancel a request. 827 * Cancel a request.
828 */ 828 */
829static void 829static void
830cancel_request_cb (void *cls, 830cancel_request_cb (void *cls)
831 const struct GNUNET_SCHEDULER_TaskContext *tc)
832{ 831{
832 struct RPSPeer *rps_peer = cls;
833 struct PendingReply *pending_rep; 833 struct PendingReply *pending_rep;
834 struct RPSPeer *rps_peer = (struct RPSPeer *) cls;
835 834
836 if (GNUNET_YES == in_shutdown) 835 if (GNUNET_YES == in_shutdown)
837 return; 836 return;
@@ -1137,8 +1136,9 @@ manage_service_wrapper (unsigned int i, unsigned int j, int delta,
1137 } 1136 }
1138} 1137}
1139 1138
1139
1140static void 1140static void
1141churn (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1141churn (void *cls)
1142{ 1142{
1143 unsigned int i; 1143 unsigned int i;
1144 unsigned int j; 1144 unsigned int j;
diff --git a/src/scalarproduct/gnunet-scalarproduct.c b/src/scalarproduct/gnunet-scalarproduct.c
index 864e77a69..5811ee57b 100644
--- a/src/scalarproduct/gnunet-scalarproduct.c
+++ b/src/scalarproduct/gnunet-scalarproduct.c
@@ -184,8 +184,7 @@ requester_callback (void *cls,
184 * @param tc unused 184 * @param tc unused
185 */ 185 */
186static void 186static void
187shutdown_task (void *cls, 187shutdown_task (void *cls)
188 const struct GNUNET_SCHEDULER_TaskContext *tc)
189{ 188{
190 if (NULL != computation) 189 if (NULL != computation)
191 { 190 {
diff --git a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
index f619f971b..c22b4e09e 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
@@ -1092,8 +1092,7 @@ GSS_handle_alice_client_message (void *cls,
1092 * @param tc unused 1092 * @param tc unused
1093 */ 1093 */
1094static void 1094static void
1095shutdown_task (void *cls, 1095shutdown_task (void *cls)
1096 const struct GNUNET_SCHEDULER_TaskContext *tc)
1097{ 1096{
1098 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1097 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1099 "Shutting down, initiating cleanup.\n"); 1098 "Shutting down, initiating cleanup.\n");
diff --git a/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c b/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
index c17aea999..41cf7d1a8 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
@@ -1137,11 +1137,9 @@ GSS_handle_bob_client_message (void *cls,
1137 * Task run during shutdown. 1137 * Task run during shutdown.
1138 * 1138 *
1139 * @param cls unused 1139 * @param cls unused
1140 * @param tc unused
1141 */ 1140 */
1142static void 1141static void
1143shutdown_task (void *cls, 1142shutdown_task (void *cls)
1144 const struct GNUNET_SCHEDULER_TaskContext *tc)
1145{ 1143{
1146 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1144 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1147 "Shutting down, initiating cleanup.\n"); 1145 "Shutting down, initiating cleanup.\n");
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_alice.c b/src/scalarproduct/gnunet-service-scalarproduct_alice.c
index ab66b8b51..0b7ba00d5 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct_alice.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct_alice.c
@@ -1313,11 +1313,9 @@ GSS_handle_alice_client_message (void *cls,
1313 * Task run during shutdown. 1313 * Task run during shutdown.
1314 * 1314 *
1315 * @param cls unused 1315 * @param cls unused
1316 * @param tc unused
1317 */ 1316 */
1318static void 1317static void
1319shutdown_task (void *cls, 1318shutdown_task (void *cls)
1320 const struct GNUNET_SCHEDULER_TaskContext *tc)
1321{ 1319{
1322 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1320 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1323 "Shutting down, initiating cleanup.\n"); 1321 "Shutting down, initiating cleanup.\n");
diff --git a/src/scalarproduct/gnunet-service-scalarproduct_bob.c b/src/scalarproduct/gnunet-service-scalarproduct_bob.c
index a75f0a671..c9db1e9ae 100644
--- a/src/scalarproduct/gnunet-service-scalarproduct_bob.c
+++ b/src/scalarproduct/gnunet-service-scalarproduct_bob.c
@@ -1433,11 +1433,9 @@ GSS_handle_bob_client_message (void *cls,
1433 * Task run during shutdown. 1433 * Task run during shutdown.
1434 * 1434 *
1435 * @param cls unused 1435 * @param cls unused
1436 * @param tc unused
1437 */ 1436 */
1438static void 1437static void
1439shutdown_task (void *cls, 1438shutdown_task (void *cls)
1440 const struct GNUNET_SCHEDULER_TaskContext *tc)
1441{ 1439{
1442 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1440 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1443 "Shutting down, initiating cleanup.\n"); 1441 "Shutting down, initiating cleanup.\n");
diff --git a/src/secretsharing/gnunet-secretsharing-profiler.c b/src/secretsharing/gnunet-secretsharing-profiler.c
index 6d1eea198..917431df4 100644
--- a/src/secretsharing/gnunet-secretsharing-profiler.c
+++ b/src/secretsharing/gnunet-secretsharing-profiler.c
@@ -480,11 +480,9 @@ peer_info_cb (void *cb_cls,
480 * Signature of the main function of a task. 480 * Signature of the main function of a task.
481 * 481 *
482 * @param cls closure 482 * @param cls closure
483 * @param tc context information (why was this task triggered now)
484 */ 483 */
485static void 484static void
486handle_shutdown (void *cls, 485handle_shutdown (void *cls)
487 const struct GNUNET_SCHEDULER_TaskContext *tc)
488{ 486{
489 in_shutdown = GNUNET_YES; 487 in_shutdown = GNUNET_YES;
490 488
@@ -633,4 +631,3 @@ main (int argc, char **argv)
633 options, &run, NULL, GNUNET_YES); 631 options, &run, NULL, GNUNET_YES);
634 return 0; 632 return 0;
635} 633}
636
diff --git a/src/secretsharing/gnunet-service-secretsharing.c b/src/secretsharing/gnunet-service-secretsharing.c
index 81714d279..6babe209a 100644
--- a/src/secretsharing/gnunet-service-secretsharing.c
+++ b/src/secretsharing/gnunet-service-secretsharing.c
@@ -703,7 +703,7 @@ keygen_session_destroy (struct KeygenSession *ks)
703 * @param tc unused 703 * @param tc unused
704 */ 704 */
705static void 705static void
706cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 706cleanup_task (void *cls)
707{ 707{
708 while (NULL != decrypt_sessions_head) 708 while (NULL != decrypt_sessions_head)
709 decrypt_session_destroy (decrypt_sessions_head); 709 decrypt_session_destroy (decrypt_sessions_head);
@@ -2274,4 +2274,3 @@ main (int argc, char *const *argv)
2274 GNUNET_SERVICE_run (argc, argv, "secretsharing", 2274 GNUNET_SERVICE_run (argc, argv, "secretsharing",
2275 GNUNET_SERVICE_OPTION_NONE, &run, NULL)) ? 0 : 1; 2275 GNUNET_SERVICE_OPTION_NONE, &run, NULL)) ? 0 : 1;
2276} 2276}
2277
diff --git a/src/secretsharing/test_secretsharing_api.c b/src/secretsharing/test_secretsharing_api.c
index fbf7681a1..5057d5c33 100644
--- a/src/secretsharing/test_secretsharing_api.c
+++ b/src/secretsharing/test_secretsharing_api.c
@@ -47,9 +47,9 @@ static void secret_ready_cb (void *cls,
47 GNUNET_SCHEDULER_shutdown (); 47 GNUNET_SCHEDULER_shutdown ();
48} 48}
49 49
50
50static void 51static void
51handle_shutdown (void *cls, 52handle_shutdown (void *cls)
52 const struct GNUNET_SCHEDULER_TaskContext * tc)
53{ 53{
54 if (NULL != keygen) 54 if (NULL != keygen)
55 { 55 {
@@ -58,12 +58,13 @@ handle_shutdown (void *cls,
58 } 58 }
59} 59}
60 60
61
61static void 62static void
62run (void *cls, 63run (void *cls,
63 const struct GNUNET_CONFIGURATION_Handle *cfg, 64 const struct GNUNET_CONFIGURATION_Handle *cfg,
64 struct GNUNET_TESTING_Peer *peer) 65 struct GNUNET_TESTING_Peer *peer)
65{ 66{
66 struct GNUNET_HashCode session_id; 67 struct GNUNET_HashCode session_id;
67 struct GNUNET_TIME_Absolute start; 68 struct GNUNET_TIME_Absolute start;
68 struct GNUNET_TIME_Absolute deadline; 69 struct GNUNET_TIME_Absolute deadline;
69 70
@@ -100,4 +101,3 @@ main (int argc, char **argv)
100 return ret; 101 return ret;
101 return (GNUNET_YES == success) ? 0 : 1; 102 return (GNUNET_YES == success) ? 0 : 1;
102} 103}
103
diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c
index 4b65fd737..e9555928a 100644
--- a/src/set/gnunet-service-set.c
+++ b/src/set/gnunet-service-set.c
@@ -1713,8 +1713,7 @@ handle_client_accept (void *cls,
1713 * @param tc context information (why was this task triggered now) 1713 * @param tc context information (why was this task triggered now)
1714 */ 1714 */
1715static void 1715static void
1716shutdown_task (void *cls, 1716shutdown_task (void *cls)
1717 const struct GNUNET_SCHEDULER_TaskContext *tc)
1718{ 1717{
1719 while (NULL != incoming_head) 1718 while (NULL != incoming_head)
1720 incoming_destroy (incoming_head); 1719 incoming_destroy (incoming_head);
@@ -1747,13 +1746,14 @@ shutdown_task (void *cls,
1747 * @param tc context information (why was this task triggered now) 1746 * @param tc context information (why was this task triggered now)
1748 */ 1747 */
1749static void 1748static void
1750incoming_timeout_cb (void *cls, 1749incoming_timeout_cb (void *cls)
1751 const struct GNUNET_SCHEDULER_TaskContext *tc)
1752{ 1750{
1753 struct Operation *incoming = cls; 1751 struct Operation *incoming = cls;
1752 const struct GNUNET_SCHEDULER_TaskContext *tc;
1754 1753
1755 incoming->timeout_task = NULL; 1754 incoming->timeout_task = NULL;
1756 GNUNET_assert (GNUNET_YES == incoming->is_incoming); 1755 GNUNET_assert (GNUNET_YES == incoming->is_incoming);
1756 tc = GNUNET_SCHEDULER_get_task_context ();
1757 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1757 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1758 return; 1758 return;
1759 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1759 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/set/gnunet-set-profiler.c b/src/set/gnunet-set-profiler.c
index 0586b8b3d..ff76b27ce 100644
--- a/src/set/gnunet-set-profiler.c
+++ b/src/set/gnunet-set-profiler.c
@@ -247,8 +247,7 @@ set_insert_iterator (void *cls,
247 247
248 248
249static void 249static void
250handle_shutdown (void *cls, 250handle_shutdown (void *cls)
251 const struct GNUNET_SCHEDULER_TaskContext *tc)
252{ 251{
253 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 252 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
254 "Shutting down set profiler\n"); 253 "Shutting down set profiler\n");
@@ -393,4 +392,3 @@ main (int argc, char **argv)
393 options, &pre_run, NULL, GNUNET_YES); 392 options, &pre_run, NULL, GNUNET_YES);
394 return ret; 393 return ret;
395} 394}
396
diff --git a/src/set/set_api.c b/src/set/set_api.c
index 503c0c9c2..772140269 100644
--- a/src/set/set_api.c
+++ b/src/set/set_api.c
@@ -275,12 +275,12 @@ handle_copy_lazy (void *cls,
275 275
276 LOG (GNUNET_ERROR_TYPE_DEBUG, 276 LOG (GNUNET_ERROR_TYPE_DEBUG,
277 "Handling response to lazy copy\n"); 277 "Handling response to lazy copy\n");
278 278
279 GNUNET_CONTAINER_DLL_remove (set->copy_req_head, 279 GNUNET_CONTAINER_DLL_remove (set->copy_req_head,
280 set->copy_req_tail, 280 set->copy_req_tail,
281 req); 281 req);
282 282
283 283
284 // We pass none as operation here, since it doesn't matter when 284 // We pass none as operation here, since it doesn't matter when
285 // cloning. 285 // cloning.
286 new_set = create_internal (set->cfg, GNUNET_SET_OPERATION_NONE, &msg->cookie); 286 new_set = create_internal (set->cfg, GNUNET_SET_OPERATION_NONE, &msg->cookie);
@@ -790,11 +790,9 @@ GNUNET_SET_prepare (const struct GNUNET_PeerIdentity *other_peer,
790 * Connect to the set service in order to listen for requests. 790 * Connect to the set service in order to listen for requests.
791 * 791 *
792 * @param cls the `struct GNUNET_SET_ListenHandle *` to connect 792 * @param cls the `struct GNUNET_SET_ListenHandle *` to connect
793 * @param tc task context if invoked as a task, NULL otherwise
794 */ 793 */
795static void 794static void
796listen_connect (void *cls, 795listen_connect (void *cls);
797 const struct GNUNET_SCHEDULER_TaskContext *tc);
798 796
799 797
800/** 798/**
@@ -882,11 +880,9 @@ handle_client_listener_error (void *cls,
882 * Connect to the set service in order to listen for requests. 880 * Connect to the set service in order to listen for requests.
883 * 881 *
884 * @param cls the `struct GNUNET_SET_ListenHandle *` to connect 882 * @param cls the `struct GNUNET_SET_ListenHandle *` to connect
885 * @param tc task context if invoked as a task, NULL otherwise
886 */ 883 */
887static void 884static void
888listen_connect (void *cls, 885listen_connect (void *cls)
889 const struct GNUNET_SCHEDULER_TaskContext *tc)
890{ 886{
891 static const struct GNUNET_MQ_MessageHandler mq_handlers[] = { 887 static const struct GNUNET_MQ_MessageHandler mq_handlers[] = {
892 { &handle_request, GNUNET_MESSAGE_TYPE_SET_REQUEST }, 888 { &handle_request, GNUNET_MESSAGE_TYPE_SET_REQUEST },
@@ -895,9 +891,10 @@ listen_connect (void *cls,
895 struct GNUNET_SET_ListenHandle *lh = cls; 891 struct GNUNET_SET_ListenHandle *lh = cls;
896 struct GNUNET_MQ_Envelope *mqm; 892 struct GNUNET_MQ_Envelope *mqm;
897 struct GNUNET_SET_ListenMessage *msg; 893 struct GNUNET_SET_ListenMessage *msg;
894 const struct GNUNET_SCHEDULER_TaskContext *tc;
898 895
899 if ( (NULL != tc) && 896 tc = GNUNET_SCHEDULER_get_task_context ();
900 (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) ) 897 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
901 { 898 {
902 LOG (GNUNET_ERROR_TYPE_DEBUG, 899 LOG (GNUNET_ERROR_TYPE_DEBUG,
903 "Listener not reconnecting due to shutdown\n"); 900 "Listener not reconnecting due to shutdown\n");
@@ -947,7 +944,7 @@ GNUNET_SET_listen (const struct GNUNET_CONFIGURATION_Handle *cfg,
947 lh->operation = operation; 944 lh->operation = operation;
948 lh->app_id = *app_id; 945 lh->app_id = *app_id;
949 lh->reconnect_backoff = GNUNET_TIME_UNIT_MILLISECONDS; 946 lh->reconnect_backoff = GNUNET_TIME_UNIT_MILLISECONDS;
950 listen_connect (lh, NULL); 947 listen_connect (lh);
951 if (NULL == lh->client) 948 if (NULL == lh->client)
952 { 949 {
953 GNUNET_free (lh); 950 GNUNET_free (lh);
diff --git a/src/set/test_set_api.c b/src/set/test_set_api.c
index fbb303257..b5c21f8a3 100644
--- a/src/set/test_set_api.c
+++ b/src/set/test_set_api.c
@@ -246,12 +246,13 @@ test_iter ()
246 * Signature of the main function of a task. 246 * Signature of the main function of a task.
247 * 247 *
248 * @param cls closure 248 * @param cls closure
249 * @param tc context information (why was this task triggered now)
250 */ 249 */
251static void 250static void
252timeout_fail (void *cls, 251timeout_fail (void *cls)
253 const struct GNUNET_SCHEDULER_TaskContext *tc)
254{ 252{
253 const struct GNUNET_SCHEDULER_TaskContext *tc;
254
255 tc = GNUNET_SCHEDULER_get_task_context ();
255 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 256 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
256 return; 257 return;
257 GNUNET_SCHEDULER_shutdown (); 258 GNUNET_SCHEDULER_shutdown ();
@@ -316,4 +317,3 @@ main (int argc, char **argv)
316 } 317 }
317 return ret; 318 return ret;
318} 319}
319
diff --git a/src/set/test_set_union_copy.c b/src/set/test_set_union_copy.c
index 247d91498..fdf6bf9df 100644
--- a/src/set/test_set_union_copy.c
+++ b/src/set/test_set_union_copy.c
@@ -73,12 +73,13 @@ remove_element_str (struct GNUNET_SET_Handle *set, char *str)
73 * Signature of the main function of a task. 73 * Signature of the main function of a task.
74 * 74 *
75 * @param cls closure 75 * @param cls closure
76 * @param tc context information (why was this task triggered now)
77 */ 76 */
78static void 77static void
79timeout_fail (void *cls, 78timeout_fail (void *cls)
80 const struct GNUNET_SCHEDULER_TaskContext *tc)
81{ 79{
80 const struct GNUNET_SCHEDULER_TaskContext *tc;
81
82 tc = GNUNET_SCHEDULER_get_task_context ();
82 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 83 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
83 return; 84 return;
84 GNUNET_SCHEDULER_shutdown (); 85 GNUNET_SCHEDULER_shutdown ();
diff --git a/src/set/test_set_union_result_symmetric.c b/src/set/test_set_union_result_symmetric.c
index 9a49abaf0..b312bcb4c 100644
--- a/src/set/test_set_union_result_symmetric.c
+++ b/src/set/test_set_union_result_symmetric.c
@@ -293,12 +293,13 @@ test_iter ()
293 * Signature of the main function of a task. 293 * Signature of the main function of a task.
294 * 294 *
295 * @param cls closure 295 * @param cls closure
296 * @param tc context information (why was this task triggered now)
297 */ 296 */
298static void 297static void
299timeout_fail (void *cls, 298timeout_fail (void *cls)
300 const struct GNUNET_SCHEDULER_TaskContext *tc)
301{ 299{
300 const struct GNUNET_SCHEDULER_TaskContext *tc;
301
302 tc = GNUNET_SCHEDULER_get_task_context ();
302 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 303 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
303 return; 304 return;
304 GNUNET_SCHEDULER_shutdown (); 305 GNUNET_SCHEDULER_shutdown ();
diff --git a/src/social/gnunet-service-social.c b/src/social/gnunet-service-social.c
index 98b1d4b59..1746a82ca 100644
--- a/src/social/gnunet-service-social.c
+++ b/src/social/gnunet-service-social.c
@@ -421,8 +421,10 @@ psyc_transmit_queue_message (struct Place *plc,
421 struct MessageTransmitQueue *tmit_msg); 421 struct MessageTransmitQueue *tmit_msg);
422 422
423 423
424int 424static int
425place_entry_cleanup (void *cls, const struct GNUNET_HashCode *key, void *value) 425place_entry_cleanup (void *cls,
426 const struct GNUNET_HashCode *key,
427 void *value)
426{ 428{
427 cleanup_place (value); 429 cleanup_place (value);
428 return GNUNET_YES; 430 return GNUNET_YES;
@@ -433,10 +435,9 @@ place_entry_cleanup (void *cls, const struct GNUNET_HashCode *key, void *value)
433 * Task run during shutdown. 435 * Task run during shutdown.
434 * 436 *
435 * @param cls unused 437 * @param cls unused
436 * @param tc unused
437 */ 438 */
438static void 439static void
439shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 440shutdown_task (void *cls)
440{ 441{
441 GNUNET_CONTAINER_multihashmap_iterate (hosts, place_entry_cleanup, NULL); 442 GNUNET_CONTAINER_multihashmap_iterate (hosts, place_entry_cleanup, NULL);
442 GNUNET_CONTAINER_multihashmap_iterate (guests, place_entry_cleanup, NULL); 443 GNUNET_CONTAINER_multihashmap_iterate (guests, place_entry_cleanup, NULL);
@@ -541,7 +542,7 @@ cleanup_place (struct Place *plc)
541 542
542 543
543static void 544static void
544schedule_cleanup_place (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 545schedule_cleanup_place (void *cls)
545{ 546{
546 cleanup_place (cls); 547 cleanup_place (cls);
547} 548}
diff --git a/src/social/test_social.c b/src/social/test_social.c
index 1d2673a11..5eeb20196 100644
--- a/src/social/test_social.c
+++ b/src/social/test_social.c
@@ -149,7 +149,8 @@ enum
149 149
150 150
151static void 151static void
152schedule_guest_leave (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 152schedule_guest_leave (void *cls);
153
153 154
154static void 155static void
155host_answer_door (void *cls, 156host_answer_door (void *cls,
@@ -229,10 +230,9 @@ cleanup ()
229 * Terminate the test case (failure). 230 * Terminate the test case (failure).
230 * 231 *
231 * @param cls NULL 232 * @param cls NULL
232 * @param tc scheduler context
233 */ 233 */
234static void 234static void
235end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 235end_badly (void *cls)
236{ 236{
237 res = 1; 237 res = 1;
238 cleanup (); 238 cleanup ();
@@ -244,10 +244,9 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
244 * Terminate the test case (success). 244 * Terminate the test case (success).
245 * 245 *
246 * @param cls NULL 246 * @param cls NULL
247 * @param tc scheduler context
248 */ 247 */
249static void 248static void
250end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 249end_normally (void *cls)
251{ 250{
252 res = 0; 251 res = 0;
253 cleanup (); 252 cleanup ();
@@ -274,7 +273,7 @@ end ()
274 273
275 274
276static void 275static void
277transmit_resume (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 276transmit_resume (void *cls)
278{ 277{
279 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmission resumed.\n"); 278 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmission resumed.\n");
280 struct TransmitClosure *tmit = cls; 279 struct TransmitClosure *tmit = cls;
@@ -342,7 +341,7 @@ host_left ()
342 341
343 342
344static void 343static void
345schedule_host_leave (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 344schedule_host_leave (void *cls)
346{ 345{
347 test = TEST_HOST_LEAVE; 346 test = TEST_HOST_LEAVE;
348 GNUNET_SOCIAL_host_leave (hst, NULL, &host_left, NULL); 347 GNUNET_SOCIAL_host_leave (hst, NULL, &host_left, NULL);
@@ -478,7 +477,7 @@ app_recv_ego (void *cls,
478 477
479 478
480static void 479static void
481schedule_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 480schedule_reconnect (void *cls)
482{ 481{
483 test = TEST_RECONNECT; 482 test = TEST_RECONNECT;
484 483
@@ -577,7 +576,7 @@ guest_leave()
577 576
578 577
579static void 578static void
580schedule_guest_leave (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 579schedule_guest_leave (void *cls)
581{ 580{
582 guest_leave (); 581 guest_leave ();
583} 582}
diff --git a/src/statistics/gnunet-service-statistics.c b/src/statistics/gnunet-service-statistics.c
index 3aa3d5897..0126f149b 100644
--- a/src/statistics/gnunet-service-statistics.c
+++ b/src/statistics/gnunet-service-statistics.c
@@ -967,11 +967,9 @@ do_shutdown ()
967 * Task run during shutdown. 967 * Task run during shutdown.
968 * 968 *
969 * @param cls unused 969 * @param cls unused
970 * @param tc unused
971 */ 970 */
972static void 971static void
973shutdown_task (void *cls, 972shutdown_task (void *cls)
974 const struct GNUNET_SCHEDULER_TaskContext *tc)
975{ 973{
976 in_shutdown = GNUNET_YES; 974 in_shutdown = GNUNET_YES;
977 if (0 != client_count) 975 if (0 != client_count)
diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c
index ff1ec39a0..2bf5959e3 100644
--- a/src/statistics/gnunet-statistics.c
+++ b/src/statistics/gnunet-statistics.c
@@ -158,11 +158,9 @@ cleanup (void *cls, int success)
158 * Function run on shutdown to clean up. 158 * Function run on shutdown to clean up.
159 * 159 *
160 * @param cls the statistics handle 160 * @param cls the statistics handle
161 * @param tc scheduler context
162 */ 161 */
163static void 162static void
164shutdown_task (void *cls, 163shutdown_task (void *cls)
165 const struct GNUNET_SCHEDULER_TaskContext *tc)
166{ 164{
167 struct GNUNET_STATISTICS_Handle *h = cls; 165 struct GNUNET_STATISTICS_Handle *h = cls;
168 166
@@ -185,8 +183,7 @@ shutdown_task (void *cls,
185 * @param tc schedueler context 183 * @param tc schedueler context
186 */ 184 */
187static void 185static void
188main_task (void *cls, 186main_task (void *cls)
189 const struct GNUNET_SCHEDULER_TaskContext *tc)
190{ 187{
191 const struct GNUNET_CONFIGURATION_Handle *cfg = cls; 188 const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
192 struct GNUNET_STATISTICS_Handle *h; 189 struct GNUNET_STATISTICS_Handle *h;
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c
index 1592483f8..2b491df72 100644
--- a/src/statistics/statistics_api.c
+++ b/src/statistics/statistics_api.c
@@ -462,11 +462,9 @@ try_connect (struct GNUNET_STATISTICS_Handle *h)
462 * We've waited long enough, reconnect now. 462 * We've waited long enough, reconnect now.
463 * 463 *
464 * @param cls the `struct GNUNET_STATISTICS_Handle` to reconnect 464 * @param cls the `struct GNUNET_STATISTICS_Handle` to reconnect
465 * @param tc scheduler context (unused)
466 */ 465 */
467static void 466static void
468reconnect_task (void *cls, 467reconnect_task (void *cls)
469 const struct GNUNET_SCHEDULER_TaskContext *tc)
470{ 468{
471 struct GNUNET_STATISTICS_Handle *h = cls; 469 struct GNUNET_STATISTICS_Handle *h = cls;
472 470
@@ -479,11 +477,9 @@ reconnect_task (void *cls,
479 * Task used by 'reconnect_later' to shutdown the handle 477 * Task used by 'reconnect_later' to shutdown the handle
480 * 478 *
481 * @param cls the statistics handle 479 * @param cls the statistics handle
482 * @param tc scheduler context
483 */ 480 */
484static void 481static void
485do_destroy (void *cls, 482do_destroy (void *cls)
486 const struct GNUNET_SCHEDULER_TaskContext *tc)
487{ 483{
488 struct GNUNET_STATISTICS_Handle *h = cls; 484 struct GNUNET_STATISTICS_Handle *h = cls;
489 485
@@ -627,11 +623,9 @@ process_watch_value (struct GNUNET_STATISTICS_Handle *h,
627 * Task used to destroy the statistics handle. 623 * Task used to destroy the statistics handle.
628 * 624 *
629 * @param cls the `struct GNUNET_STATISTICS_Handle` 625 * @param cls the `struct GNUNET_STATISTICS_Handle`
630 * @param tc the scheduler context
631 */ 626 */
632static void 627static void
633destroy_task (void *cls, 628destroy_task (void *cls)
634 const struct GNUNET_SCHEDULER_TaskContext *tc)
635{ 629{
636 struct GNUNET_STATISTICS_Handle *h = cls; 630 struct GNUNET_STATISTICS_Handle *h = cls;
637 631
@@ -1159,11 +1153,9 @@ schedule_action (struct GNUNET_STATISTICS_Handle *h)
1159 * call the continuation. 1153 * call the continuation.
1160 * 1154 *
1161 * @param cls the `struct GNUNET_STATISTICS_GetHandle` 1155 * @param cls the `struct GNUNET_STATISTICS_GetHandle`
1162 * @param tc scheduler context
1163 */ 1156 */
1164static void 1157static void
1165run_get_timeout (void *cls, 1158run_get_timeout (void *cls)
1166 const struct GNUNET_SCHEDULER_TaskContext *tc)
1167{ 1159{
1168 struct GNUNET_STATISTICS_GetHandle *gh = cls; 1160 struct GNUNET_STATISTICS_GetHandle *gh = cls;
1169 GNUNET_STATISTICS_Callback cont = gh->cont; 1161 GNUNET_STATISTICS_Callback cont = gh->cont;
diff --git a/src/statistics/test_statistics_api_watch.c b/src/statistics/test_statistics_api_watch.c
index defa20a07..c7fe54b1f 100644
--- a/src/statistics/test_statistics_api_watch.c
+++ b/src/statistics/test_statistics_api_watch.c
@@ -33,11 +33,11 @@ static struct GNUNET_STATISTICS_Handle *h;
33 33
34static struct GNUNET_STATISTICS_Handle *h2; 34static struct GNUNET_STATISTICS_Handle *h2;
35 35
36static struct GNUNET_SCHEDULER_Task * shutdown_task; 36static struct GNUNET_SCHEDULER_Task *shutdown_task;
37 37
38 38
39static void 39static void
40force_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 40force_shutdown (void *cls)
41{ 41{
42 fprintf (stderr, "Timeout, failed to receive notifications: %d\n", ok); 42 fprintf (stderr, "Timeout, failed to receive notifications: %d\n", ok);
43 GNUNET_STATISTICS_destroy (h, GNUNET_NO); 43 GNUNET_STATISTICS_destroy (h, GNUNET_NO);
@@ -47,7 +47,7 @@ force_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
47 47
48 48
49static void 49static void
50normal_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 50normal_shutdown (void *cls)
51{ 51{
52 GNUNET_STATISTICS_destroy (h, GNUNET_NO); 52 GNUNET_STATISTICS_destroy (h, GNUNET_NO);
53 GNUNET_STATISTICS_destroy (h2, GNUNET_NO); 53 GNUNET_STATISTICS_destroy (h2, GNUNET_NO);
diff --git a/src/statistics/test_statistics_api_watch_zero_value.c b/src/statistics/test_statistics_api_watch_zero_value.c
index edfc9f85c..8bf656ed0 100644
--- a/src/statistics/test_statistics_api_watch_zero_value.c
+++ b/src/statistics/test_statistics_api_watch_zero_value.c
@@ -33,11 +33,11 @@ static struct GNUNET_STATISTICS_Handle *h;
33 33
34static struct GNUNET_STATISTICS_Handle *h2; 34static struct GNUNET_STATISTICS_Handle *h2;
35 35
36static struct GNUNET_SCHEDULER_Task * shutdown_task; 36static struct GNUNET_SCHEDULER_Task *shutdown_task;
37 37
38 38
39static void 39static void
40force_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 40force_shutdown (void *cls)
41{ 41{
42 fprintf (stderr, "Timeout, failed to receive notifications: %d\n", ok); 42 fprintf (stderr, "Timeout, failed to receive notifications: %d\n", ok);
43 GNUNET_STATISTICS_destroy (h, GNUNET_NO); 43 GNUNET_STATISTICS_destroy (h, GNUNET_NO);
@@ -47,7 +47,7 @@ force_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
47 47
48 48
49static void 49static void
50normal_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 50normal_shutdown (void *cls)
51{ 51{
52 GNUNET_STATISTICS_destroy (h, GNUNET_NO); 52 GNUNET_STATISTICS_destroy (h, GNUNET_NO);
53 GNUNET_STATISTICS_destroy (h2, GNUNET_NO); 53 GNUNET_STATISTICS_destroy (h2, GNUNET_NO);
diff --git a/src/template/gnunet-service-template.c b/src/template/gnunet-service-template.c
index 4125311fe..556d44bd8 100644
--- a/src/template/gnunet-service-template.c
+++ b/src/template/gnunet-service-template.c
@@ -31,10 +31,9 @@
31 * Task run during shutdown. 31 * Task run during shutdown.
32 * 32 *
33 * @param cls unused 33 * @param cls unused
34 * @param tc unused
35 */ 34 */
36static void 35static void
37cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 36cleanup_task (void *cls)
38{ 37{
39 /* FIXME: do clean up here */ 38 /* FIXME: do clean up here */
40} 39}
diff --git a/src/testbed/gnunet-daemon-latency-logger.c b/src/testbed/gnunet-daemon-latency-logger.c
index 84d8e223a..9652721a1 100644
--- a/src/testbed/gnunet-daemon-latency-logger.c
+++ b/src/testbed/gnunet-daemon-latency-logger.c
@@ -131,11 +131,10 @@ free_iterator (void *cls,
131 * Shutdown 131 * Shutdown
132 * 132 *
133 * @param cls NULL 133 * @param cls NULL
134 * @param tc task context from scheduler
135 * @return 134 * @return
136 */ 135 */
137static void 136static void
138do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 137do_shutdown (void *cls)
139{ 138{
140 shutdown_task = NULL; 139 shutdown_task = NULL;
141 GNUNET_ATS_performance_done (ats); 140 GNUNET_ATS_performance_done (ats);
diff --git a/src/testbed/gnunet-daemon-testbed-blacklist.c b/src/testbed/gnunet-daemon-testbed-blacklist.c
index ed1c061a0..0e0c7ebd5 100644
--- a/src/testbed/gnunet-daemon-testbed-blacklist.c
+++ b/src/testbed/gnunet-daemon-testbed-blacklist.c
@@ -121,10 +121,9 @@ cleanup_map ()
121 * Shutdown task to cleanup our resources and exit. 121 * Shutdown task to cleanup our resources and exit.
122 * 122 *
123 * @param cls NULL 123 * @param cls NULL
124 * @param tc scheduler task context
125 */ 124 */
126static void 125static void
127do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 126do_shutdown (void *cls)
128{ 127{
129 cleanup_map (); 128 cleanup_map ();
130 if (NULL != bh) 129 if (NULL != bh)
diff --git a/src/testbed/gnunet-daemon-testbed-underlay.c b/src/testbed/gnunet-daemon-testbed-underlay.c
index c4dbc5178..ce0cc46d9 100644
--- a/src/testbed/gnunet-daemon-testbed-underlay.c
+++ b/src/testbed/gnunet-daemon-testbed-underlay.c
@@ -286,10 +286,9 @@ unload_keys ()
286 * Shutdown task to cleanup our resources and exit. 286 * Shutdown task to cleanup our resources and exit.
287 * 287 *
288 * @param cls NULL 288 * @param cls NULL
289 * @param tc scheduler task context
290 */ 289 */
291static void 290static void
292do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 291do_shutdown (void *cls)
293{ 292{
294 if (NULL != transport) 293 if (NULL != transport)
295 { 294 {
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c
index 4cde1b4d0..b43f10983 100644
--- a/src/testbed/gnunet-helper-testbed.c
+++ b/src/testbed/gnunet-helper-testbed.c
@@ -156,10 +156,9 @@ static int status;
156 * Task to shut down cleanly 156 * Task to shut down cleanly
157 * 157 *
158 * @param cls NULL 158 * @param cls NULL
159 * @param tc the task context
160 */ 159 */
161static void 160static void
162shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 161shutdown_task (void *cls)
163{ 162{
164 LOG_DEBUG ("Shutting down\n"); 163 LOG_DEBUG ("Shutting down\n");
165 shutdown_task_id = NULL; 164 shutdown_task_id = NULL;
@@ -219,16 +218,17 @@ shutdown_now (void)
219 * Task to write to the standard out 218 * Task to write to the standard out
220 * 219 *
221 * @param cls the WriteContext 220 * @param cls the WriteContext
222 * @param tc the TaskContext
223 */ 221 */
224static void 222static void
225write_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 223write_task (void *cls)
226{ 224{
227 struct WriteContext *wc = cls; 225 struct WriteContext *wc = cls;
228 ssize_t bytes_wrote; 226 ssize_t bytes_wrote;
227 const struct GNUNET_SCHEDULER_TaskContext *tc;
229 228
230 GNUNET_assert (NULL != wc); 229 GNUNET_assert (NULL != wc);
231 write_task_id = NULL; 230 write_task_id = NULL;
231 tc = GNUNET_SCHEDULER_get_task_context ();
232 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 232 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
233 { 233 {
234 GNUNET_free (wc->data); 234 GNUNET_free (wc->data);
@@ -263,19 +263,20 @@ write_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
263 * process died). 263 * process died).
264 * 264 *
265 * @param cls closure, NULL if we need to self-restart 265 * @param cls closure, NULL if we need to self-restart
266 * @param tc context
267 */ 266 */
268static void 267static void
269child_death_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 268child_death_task (void *cls)
270{ 269{
271 const struct GNUNET_DISK_FileHandle *pr; 270 const struct GNUNET_DISK_FileHandle *pr;
272 char c[16]; 271 char c[16];
273 enum GNUNET_OS_ProcessStatusType type; 272 enum GNUNET_OS_ProcessStatusType type;
274 unsigned long code; 273 unsigned long code;
275 int ret; 274 int ret;
275 const struct GNUNET_SCHEDULER_TaskContext *tc;
276 276
277 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ); 277 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
278 child_death_task_id = NULL; 278 child_death_task_id = NULL;
279 tc = GNUNET_SCHEDULER_get_task_context ();
279 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 280 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
280 { 281 {
281 child_death_task_id = 282 child_death_task_id =
@@ -518,15 +519,16 @@ error:
518 * Task to read from stdin 519 * Task to read from stdin
519 * 520 *
520 * @param cls NULL 521 * @param cls NULL
521 * @param tc the task context
522 */ 522 */
523static void 523static void
524read_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 524read_task (void *cls)
525{ 525{
526 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; 526 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE];
527 ssize_t sread; 527 ssize_t sread;
528 const struct GNUNET_SCHEDULER_TaskContext *tc;
528 529
529 read_task_id = NULL; 530 read_task_id = NULL;
531 tc = GNUNET_SCHEDULER_get_task_context ();
530 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 532 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
531 return; 533 return;
532 sread = GNUNET_DISK_file_read (stdin_fd, buf, sizeof (buf)); 534 sread = GNUNET_DISK_file_read (stdin_fd, buf, sizeof (buf));
diff --git a/src/testbed/gnunet-service-test-barriers.c b/src/testbed/gnunet-service-test-barriers.c
index 444cb4a6d..281172cbf 100644
--- a/src/testbed/gnunet-service-test-barriers.c
+++ b/src/testbed/gnunet-service-test-barriers.c
@@ -46,10 +46,9 @@ struct GNUNET_TESTBED_BarrierWaitHandle *wh;
46 * Dummy task callback to keep us running forever 46 * Dummy task callback to keep us running forever
47 * 47 *
48 * @param cls NULL 48 * @param cls NULL
49 * @param tc scheduler task context
50 */ 49 */
51static void 50static void
52do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 51do_shutdown (void *cls)
53{ 52{
54 if (NULL != wh) 53 if (NULL != wh)
55 GNUNET_TESTBED_barrier_wait_cancel (wh); 54 GNUNET_TESTBED_barrier_wait_cancel (wh);
@@ -80,12 +79,14 @@ barrier_wait_cb (void *cls, const char *name, int status)
80 * Task to wait for the barrier 79 * Task to wait for the barrier
81 * 80 *
82 * @param cls NULL 81 * @param cls NULL
83 * @param tc scheduler task context
84 * @return 82 * @return
85 */ 83 */
86static void 84static void
87do_wait (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 85do_wait (void *cls)
88{ 86{
87 const struct GNUNET_SCHEDULER_TaskContext *tc;
88
89 tc = GNUNET_SCHEDULER_get_task_context ();
89 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 90 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
90 return; 91 return;
91 wh = GNUNET_TESTBED_barrier_wait (TEST_BARRIER_NAME, &barrier_wait_cb, NULL); 92 wh = GNUNET_TESTBED_barrier_wait (TEST_BARRIER_NAME, &barrier_wait_cb, NULL);
diff --git a/src/testbed/gnunet-service-testbed-logger.c b/src/testbed/gnunet-service-testbed-logger.c
index bd52b8d52..ab5b17460 100644
--- a/src/testbed/gnunet-service-testbed-logger.c
+++ b/src/testbed/gnunet-service-testbed-logger.c
@@ -119,10 +119,9 @@ handle_log_msg (void *cls, struct GNUNET_SERVER_Client *client,
119 * Task to clean up and shutdown nicely 119 * Task to clean up and shutdown nicely
120 * 120 *
121 * @param cls NULL 121 * @param cls NULL
122 * @param tc the TaskContext from scheduler
123 */ 122 */
124static void 123static void
125shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 124shutdown_task (void *cls)
126{ 125{
127 struct MessageQueue *mq_entry; 126 struct MessageQueue *mq_entry;
128 127
@@ -155,7 +154,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
155 * @param client identification of the client; NULL 154 * @param client identification of the client; NULL
156 * for the last call when the server is destroyed 155 * for the last call when the server is destroyed
157 */ 156 */
158static void 157static void
159client_disconnected (void *cls, struct GNUNET_SERVER_Client *client) 158client_disconnected (void *cls, struct GNUNET_SERVER_Client *client)
160{ 159{
161 if (NULL == client) 160 if (NULL == client)
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c
index 68878b69b..e4fe87fcd 100644
--- a/src/testbed/gnunet-service-testbed.c
+++ b/src/testbed/gnunet-service-testbed.c
@@ -405,11 +405,9 @@ GST_forwarded_operation_reply_relay (void *cls,
405 * Task to free resources when forwarded operation has been timedout 405 * Task to free resources when forwarded operation has been timedout
406 * 406 *
407 * @param cls the ForwardedOperationContext 407 * @param cls the ForwardedOperationContext
408 * @param tc the task context from scheduler
409 */ 408 */
410void 409void
411GST_forwarded_operation_timeout (void *cls, 410GST_forwarded_operation_timeout (void *cls)
412 const struct GNUNET_SCHEDULER_TaskContext *tc)
413{ 411{
414 struct ForwardedOperationContext *fopc = cls; 412 struct ForwardedOperationContext *fopc = cls;
415 413
@@ -776,10 +774,9 @@ GST_clear_fopcq ()
776 * Task to clean up and shutdown nicely 774 * Task to clean up and shutdown nicely
777 * 775 *
778 * @param cls NULL 776 * @param cls NULL
779 * @param tc the TaskContext from scheduler
780 */ 777 */
781static void 778static void
782shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 779shutdown_task (void *cls)
783{ 780{
784 struct MessageQueue *mq_entry; 781 struct MessageQueue *mq_entry;
785 uint32_t id; 782 uint32_t id;
diff --git a/src/testbed/gnunet-service-testbed.h b/src/testbed/gnunet-service-testbed.h
index 825056880..b19d3c516 100644
--- a/src/testbed/gnunet-service-testbed.h
+++ b/src/testbed/gnunet-service-testbed.h
@@ -590,8 +590,7 @@ GST_forwarded_operation_reply_relay (void *cls,
590 * @param tc the task context from scheduler 590 * @param tc the task context from scheduler
591 */ 591 */
592void 592void
593GST_forwarded_operation_timeout (void *cls, 593GST_forwarded_operation_timeout (void *cls);
594 const struct GNUNET_SCHEDULER_TaskContext *tc);
595 594
596 595
597/** 596/**
diff --git a/src/testbed/gnunet-service-testbed_barriers.c b/src/testbed/gnunet-service-testbed_barriers.c
index e1992cccb..5b081ed12 100644
--- a/src/testbed/gnunet-service-testbed_barriers.c
+++ b/src/testbed/gnunet-service-testbed_barriers.c
@@ -672,10 +672,9 @@ wbarrier_status_cb (void *cls, const char *name,
672 * subcontrollers to barrier init message 672 * subcontrollers to barrier init message
673 * 673 *
674 * @param cls barrier 674 * @param cls barrier
675 * @param tc scheduler task context
676 */ 675 */
677static void 676static void
678fwd_tout_barrier_init (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 677fwd_tout_barrier_init (void *cls)
679{ 678{
680 struct Barrier *barrier = cls; 679 struct Barrier *barrier = cls;
681 680
diff --git a/src/testbed/gnunet-service-testbed_connectionpool.c b/src/testbed/gnunet-service-testbed_connectionpool.c
index e06538ac7..0fa2a6456 100644
--- a/src/testbed/gnunet-service-testbed_connectionpool.c
+++ b/src/testbed/gnunet-service-testbed_connectionpool.c
@@ -333,11 +333,9 @@ destroy_pooled_connection (struct PooledConnection *entry)
333 * Expire a #PooledConnection object 333 * Expire a #PooledConnection object
334 * 334 *
335 * @param cls the #PooledConnection object 335 * @param cls the #PooledConnection object
336 * @param tc scheduler task context
337 */ 336 */
338static void 337static void
339expire (void *cls, 338expire (void *cls)
340 const struct GNUNET_SCHEDULER_TaskContext *tc)
341{ 339{
342 struct PooledConnection *entry = cls; 340 struct PooledConnection *entry = cls;
343 341
@@ -429,10 +427,9 @@ search_waiting (const struct PooledConnection *entry,
429 * further schedules itself if there are similar waiting objects which can be notified. 427 * further schedules itself if there are similar waiting objects which can be notified.
430 * 428 *
431 * @param cls the #PooledConnection object 429 * @param cls the #PooledConnection object
432 * @param tc the task context from scheduler
433 */ 430 */
434static void 431static void
435connection_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 432connection_ready (void *cls)
436{ 433{
437 struct PooledConnection *entry = cls; 434 struct PooledConnection *entry = cls;
438 struct GST_ConnectionPool_GetHandle *gh; 435 struct GST_ConnectionPool_GetHandle *gh;
diff --git a/src/testbed/gnunet-service-testbed_cpustatus.c b/src/testbed/gnunet-service-testbed_cpustatus.c
index 066c680b3..cda669caa 100644
--- a/src/testbed/gnunet-service-testbed_cpustatus.c
+++ b/src/testbed/gnunet-service-testbed_cpustatus.c
@@ -646,7 +646,7 @@ get_nproc ()
646 646
647 647
648static void 648static void
649sample_load_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 649sample_load_task (void *cls)
650{ 650{
651 struct GNUNET_TIME_Absolute now; 651 struct GNUNET_TIME_Absolute now;
652 char *str; 652 char *str;
@@ -655,8 +655,10 @@ sample_load_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
655 int ld_disk; 655 int ld_disk;
656 unsigned int mem_usage; 656 unsigned int mem_usage;
657 unsigned int nproc; 657 unsigned int nproc;
658 const struct GNUNET_SCHEDULER_TaskContext *tc;
658 659
659 sample_load_task_id = NULL; 660 sample_load_task_id = NULL;
661 tc = GNUNET_SCHEDULER_get_task_context ();
660 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 662 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
661 return; 663 return;
662 ld_cpu = cpu_get_load (); 664 ld_cpu = cpu_get_load ();
diff --git a/src/testbed/gnunet-service-testbed_links.c b/src/testbed/gnunet-service-testbed_links.c
index 9fbc3197e..a2692e8a6 100644
--- a/src/testbed/gnunet-service-testbed_links.c
+++ b/src/testbed/gnunet-service-testbed_links.c
@@ -585,10 +585,9 @@ send_controller_link_response (struct GNUNET_SERVER_Client *client,
585 * The Link Controller forwarding task 585 * The Link Controller forwarding task
586 * 586 *
587 * @param cls the LCFContext 587 * @param cls the LCFContext
588 * @param tc the Task context from scheduler
589 */ 588 */
590static void 589static void
591lcf_proc_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 590lcf_proc_task (void *cls);
592 591
593 592
594/** 593/**
@@ -634,21 +633,18 @@ registration_error:
634 * The Link Controller forwarding task 633 * The Link Controller forwarding task
635 * 634 *
636 * @param cls the LCFContext 635 * @param cls the LCFContext
637 * @param tc the Task context from scheduler
638 */ 636 */
639static void 637static void
640lcf_proc_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 638lcf_proc_task (void *cls);
641 639
642 640
643/** 641/**
644 * Task to free resources when forwarded link controllers has been timedout 642 * Task to free resources when forwarded link controllers has been timedout
645 * 643 *
646 * @param cls the LCFContext 644 * @param cls the LCFContext
647 * @param tc the task context from scheduler
648 */ 645 */
649static void 646static void
650lcf_forwarded_operation_timeout (void *cls, 647lcf_forwarded_operation_timeout (void *cls)
651 const struct GNUNET_SCHEDULER_TaskContext *tc)
652{ 648{
653 struct LCFContext *lcf = cls; 649 struct LCFContext *lcf = cls;
654 650
@@ -668,10 +664,9 @@ lcf_forwarded_operation_timeout (void *cls,
668 * The Link Controller forwarding task 664 * The Link Controller forwarding task
669 * 665 *
670 * @param cls the LCFContext 666 * @param cls the LCFContext
671 * @param tc the Task context from scheduler
672 */ 667 */
673static void 668static void
674lcf_proc_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 669lcf_proc_task (void *cls)
675{ 670{
676 struct LCFContext *lcf = cls; 671 struct LCFContext *lcf = cls;
677 struct LCFContextQueue *lcfq; 672 struct LCFContextQueue *lcfq;
@@ -852,11 +847,9 @@ trigger_notifications (struct Neighbour *n);
852 * neighbour 847 * neighbour
853 * 848 *
854 * @param cls the neighbour 849 * @param cls the neighbour
855 * @param tc scheduler task context
856 */ 850 */
857static void 851static void
858neighbour_connect_notify_task (void *cls, 852neighbour_connect_notify_task (void *cls)
859 const struct GNUNET_SCHEDULER_TaskContext *tc)
860{ 853{
861 struct Neighbour *n = cls; 854 struct Neighbour *n = cls;
862 struct NeighbourConnectNotification *h; 855 struct NeighbourConnectNotification *h;
@@ -1118,11 +1111,9 @@ GST_free_nccq ()
1118 * Task to be run upon timeout while attempting to connect to the neighbour 1111 * Task to be run upon timeout while attempting to connect to the neighbour
1119 * 1112 *
1120 * @param cls the NeighbourConnectCtxt created in GST_handle_link_controllers() 1113 * @param cls the NeighbourConnectCtxt created in GST_handle_link_controllers()
1121 * @param tc the scheduler task context
1122 */ 1114 */
1123static void 1115static void
1124timeout_neighbour_connect (void *cls, 1116timeout_neighbour_connect (void *cls)
1125 const struct GNUNET_SCHEDULER_TaskContext *tc)
1126{ 1117{
1127 struct NeighbourConnectCtxt *ncc = cls; 1118 struct NeighbourConnectCtxt *ncc = cls;
1128 1119
diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c
index 6bb4ec4fb..34bf8e047 100644
--- a/src/testbed/gnunet-service-testbed_oc.c
+++ b/src/testbed/gnunet-service-testbed_oc.c
@@ -362,12 +362,9 @@ GST_cleanup_focc (struct ForwardedOverlayConnectContext *focc)
362 * Timeout task for cancelling a forwarded overlay connect connect 362 * Timeout task for cancelling a forwarded overlay connect connect
363 * 363 *
364 * @param cls the ForwardedOverlayConnectContext 364 * @param cls the ForwardedOverlayConnectContext
365 * @param tc the task context from the scheduler
366 */ 365 */
367static void 366static void
368forwarded_overlay_connect_timeout (void *cls, 367forwarded_overlay_connect_timeout (void *cls)
369 const struct GNUNET_SCHEDULER_TaskContext
370 *tc)
371{ 368{
372 struct ForwardedOperationContext *fopc = cls; 369 struct ForwardedOperationContext *fopc = cls;
373 struct RegisteredHostContext *rhc; 370 struct RegisteredHostContext *rhc;
@@ -379,7 +376,7 @@ forwarded_overlay_connect_timeout (void *cls,
379 LOG_DEBUG ("Overlay linking between peers %u and %u failed\n", focc->peer1, 376 LOG_DEBUG ("Overlay linking between peers %u and %u failed\n", focc->peer1,
380 focc->peer2); 377 focc->peer2);
381 GST_cleanup_focc (focc); 378 GST_cleanup_focc (focc);
382 GST_forwarded_operation_timeout (fopc, tc); 379 GST_forwarded_operation_timeout (fopc);
383 if (NULL != rhc->focc_dll_head) 380 if (NULL != rhc->focc_dll_head)
384 GST_process_next_focc (rhc); 381 GST_process_next_focc (rhc);
385} 382}
@@ -573,11 +570,9 @@ cleanup_occ (struct OverlayConnectContext *occ)
573 * Task for cleaing up overlay connect context structure 570 * Task for cleaing up overlay connect context structure
574 * 571 *
575 * @param cls the overlay connect context 572 * @param cls the overlay connect context
576 * @param tc the task context
577 */ 573 */
578static void 574static void
579do_cleanup_occ (void *cls, 575do_cleanup_occ (void *cls)
580 const struct GNUNET_SCHEDULER_TaskContext *tc)
581{ 576{
582 struct OverlayConnectContext *occ = cls; 577 struct OverlayConnectContext *occ = cls;
583 578
@@ -590,11 +585,9 @@ do_cleanup_occ (void *cls,
590 * Task which will be run when overlay connect request has been timed out 585 * Task which will be run when overlay connect request has been timed out
591 * 586 *
592 * @param cls the OverlayConnectContext 587 * @param cls the OverlayConnectContext
593 * @param tc the TaskContext
594 */ 588 */
595static void 589static void
596timeout_overlay_connect (void *cls, 590timeout_overlay_connect (void *cls)
597 const struct GNUNET_SCHEDULER_TaskContext *tc)
598{ 591{
599 struct OverlayConnectContext *occ = cls; 592 struct OverlayConnectContext *occ = cls;
600 593
@@ -777,29 +770,27 @@ occ_cache_get_handle_ats_rocc_cb (void *cls,
777 * peer 1. 770 * peer 1.
778 * 771 *
779 * @param cls the OverlayConnectContext 772 * @param cls the OverlayConnectContext
780 * @param tc the TaskContext from scheduler
781 */ 773 */
782static void 774static void
783send_hello (void *cls, 775send_hello (void *cls);
784 const struct GNUNET_SCHEDULER_TaskContext *tc);
785 776
786 777
787/** 778/**
788 * Task that is run when hello has been sent 779 * Task that is run when hello has been sent If tc->reason =
780 * #GNUNET_SCHEDULER_REASON_TIMEOUT then sending HELLO failed; if
781 * #GNUNET_SCHEDULER_REASON_READ_READY is succeeded
789 * 782 *
790 * @param cls the overlay connect context 783 * @param cls the overlay connect context
791 * @param tc the scheduler task context; if tc->reason =
792 * #GNUNET_SCHEDULER_REASON_TIMEOUT then sending HELLO failed; if
793 * #GNUNET_SCHEDULER_REASON_READ_READY is succeeded
794 */ 784 */
795static void 785static void
796occ_hello_sent_cb (void *cls, 786occ_hello_sent_cb (void *cls)
797 const struct GNUNET_SCHEDULER_TaskContext *tc)
798{ 787{
799 struct OverlayConnectContext *occ = cls; 788 struct OverlayConnectContext *occ = cls;
800 struct LocalPeer2Context *lp2c; 789 struct LocalPeer2Context *lp2c;
801 struct Peer *peer2; 790 struct Peer *peer2;
791 const struct GNUNET_SCHEDULER_TaskContext *tc;
802 792
793 tc = GNUNET_SCHEDULER_get_task_context ();
803 GNUNET_assert (OCC_TYPE_LOCAL == occ->type); 794 GNUNET_assert (OCC_TYPE_LOCAL == occ->type);
804 GNUNET_assert (NULL != occ->timeout_task); 795 GNUNET_assert (NULL != occ->timeout_task);
805 lp2c = &occ->p2ctx.local; 796 lp2c = &occ->p2ctx.local;
@@ -881,18 +872,18 @@ send_hello_thru_rocc (struct OverlayConnectContext *occ)
881 * send_hello_thru_rocc() 872 * send_hello_thru_rocc()
882 * 873 *
883 * @param cls the OverlayConnectContext 874 * @param cls the OverlayConnectContext
884 * @param tc the TaskContext from scheduler
885 */ 875 */
886static void 876static void
887send_hello (void *cls, 877send_hello (void *cls)
888 const struct GNUNET_SCHEDULER_TaskContext *tc)
889{ 878{
890 struct OverlayConnectContext *occ = cls; 879 struct OverlayConnectContext *occ = cls;
891 struct LocalPeer2Context *lp2c; 880 struct LocalPeer2Context *lp2c;
892 char *other_peer_str; 881 char *other_peer_str;
882 const struct GNUNET_SCHEDULER_TaskContext *tc;
893 883
894 occ->send_hello_task = NULL; 884 occ->send_hello_task = NULL;
895 GNUNET_assert (NULL != occ->timeout_task); 885 GNUNET_assert (NULL != occ->timeout_task);
886 tc = GNUNET_SCHEDULER_get_task_context ();
896 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 887 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
897 return; 888 return;
898 GNUNET_assert (NULL != occ->hello); 889 GNUNET_assert (NULL != occ->hello);
@@ -1652,11 +1643,9 @@ cleanup_rocc (struct RemoteOverlayConnectCtx *rocc)
1652 * Task to timeout rocc and cleanit up 1643 * Task to timeout rocc and cleanit up
1653 * 1644 *
1654 * @param cls the RemoteOverlayConnectCtx 1645 * @param cls the RemoteOverlayConnectCtx
1655 * @param tc the TaskContext from scheduler
1656 */ 1646 */
1657static void 1647static void
1658timeout_rocc_task (void *cls, 1648timeout_rocc_task (void *cls)
1659 const struct GNUNET_SCHEDULER_TaskContext *tc)
1660{ 1649{
1661 struct RemoteOverlayConnectCtx *rocc = cls; 1650 struct RemoteOverlayConnectCtx *rocc = cls;
1662 1651
@@ -1698,26 +1687,23 @@ cache_transport_peer_connect_notify (void *cls,
1698 * whose identity is in RemoteOverlayConnectCtx 1687 * whose identity is in RemoteOverlayConnectCtx
1699 * 1688 *
1700 * @param cls the RemoteOverlayConnectCtx 1689 * @param cls the RemoteOverlayConnectCtx
1701 * @param tc the TaskContext from scheduler
1702 */ 1690 */
1703static void 1691static void
1704attempt_connect_task (void *cls, 1692attempt_connect_task (void *cls);
1705 const struct GNUNET_SCHEDULER_TaskContext *tc);
1706 1693
1707 1694
1708/** 1695/**
1709 * Task that is run when hello has been sent 1696 * Task that is run when hello has been sent If tc->reason =
1697 * #GNUNET_SCHEDULER_REASON_TIMEOUT then sending HELLO failed; if
1698 * #GNUNET_SCHEDULER_REASON_READ_READY is succeeded
1710 * 1699 *
1711 * @param cls the overlay connect context 1700 * @param cls the overlay connect context
1712 * @param tc the scheduler task context; if tc->reason =
1713 * #GNUNET_SCHEDULER_REASON_TIMEOUT then sending HELLO failed; if
1714 * #GNUNET_SCHEDULER_REASON_READ_READY is succeeded
1715 */ 1701 */
1716static void 1702static void
1717rocc_hello_sent_cb (void *cls, 1703rocc_hello_sent_cb (void *cls)
1718 const struct GNUNET_SCHEDULER_TaskContext *tc)
1719{ 1704{
1720 struct RemoteOverlayConnectCtx *rocc = cls; 1705 struct RemoteOverlayConnectCtx *rocc = cls;
1706 const struct GNUNET_SCHEDULER_TaskContext *tc;
1721 1707
1722 rocc->ohh = NULL; 1708 rocc->ohh = NULL;
1723 GNUNET_assert (NULL == rocc->attempt_connect_task_id); 1709 GNUNET_assert (NULL == rocc->attempt_connect_task_id);
@@ -1725,6 +1711,7 @@ rocc_hello_sent_cb (void *cls,
1725 rocc->op_id, 1711 rocc->op_id,
1726 GNUNET_i2s (&rocc->a_id), 1712 GNUNET_i2s (&rocc->a_id),
1727 rocc->peer->id); 1713 rocc->peer->id);
1714 tc = GNUNET_SCHEDULER_get_task_context ();
1728 if (GNUNET_SCHEDULER_REASON_TIMEOUT == tc->reason) 1715 if (GNUNET_SCHEDULER_REASON_TIMEOUT == tc->reason)
1729 { 1716 {
1730 GNUNET_break (0); 1717 GNUNET_break (0);
@@ -1754,11 +1741,9 @@ rocc_hello_sent_cb (void *cls,
1754 * whose identity is in RemoteOverlayConnectCtx 1741 * whose identity is in RemoteOverlayConnectCtx
1755 * 1742 *
1756 * @param cls the RemoteOverlayConnectCtx 1743 * @param cls the RemoteOverlayConnectCtx
1757 * @param tc the TaskContext from scheduler
1758 */ 1744 */
1759static void 1745static void
1760attempt_connect_task (void *cls, 1746attempt_connect_task (void *cls)
1761 const struct GNUNET_SCHEDULER_TaskContext *tc)
1762{ 1747{
1763 struct RemoteOverlayConnectCtx *rocc = cls; 1748 struct RemoteOverlayConnectCtx *rocc = cls;
1764 1749
diff --git a/src/testbed/gnunet-service-testbed_peers.c b/src/testbed/gnunet-service-testbed_peers.c
index a5f1abe4d..ba20d6d6b 100644
--- a/src/testbed/gnunet-service-testbed_peers.c
+++ b/src/testbed/gnunet-service-testbed_peers.c
@@ -211,16 +211,14 @@ peer_list_remove (struct Peer *peer)
211 * timed out 211 * timed out
212 * 212 *
213 * @param cls the FowardedOperationContext 213 * @param cls the FowardedOperationContext
214 * @param tc the TaskContext from the scheduler
215 */ 214 */
216static void 215static void
217peer_create_forward_timeout (void *cls, 216peer_create_forward_timeout (void *cls)
218 const struct GNUNET_SCHEDULER_TaskContext *tc)
219{ 217{
220 struct ForwardedOperationContext *fopc = cls; 218 struct ForwardedOperationContext *fopc = cls;
221 219
222 GNUNET_free (fopc->cls); 220 GNUNET_free (fopc->cls);
223 GST_forwarded_operation_timeout (fopc, tc); 221 GST_forwarded_operation_timeout (fopc);
224} 222}
225 223
226 224
diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c
index 350b7379d..308ec0386 100644
--- a/src/testbed/gnunet-testbed-profiler.c
+++ b/src/testbed/gnunet-testbed-profiler.c
@@ -107,10 +107,9 @@ static int noninteractive;
107 * Shutdown nicely 107 * Shutdown nicely
108 * 108 *
109 * @param cls NULL 109 * @param cls NULL
110 * @param tc the task context
111 */ 110 */
112static void 111static void
113do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 112do_shutdown (void *cls)
114{ 113{
115 shutdown_task = NULL; 114 shutdown_task = NULL;
116 if (NULL != abort_task) 115 if (NULL != abort_task)
@@ -131,10 +130,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
131 * abort task to run on test timed out 130 * abort task to run on test timed out
132 * 131 *
133 * @param cls NULL 132 * @param cls NULL
134 * @param tc the task context
135 */ 133 */
136static void 134static void
137do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 135do_abort (void *cls)
138{ 136{
139 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n"); 137 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
140 abort_task = NULL; 138 abort_task = NULL;
diff --git a/src/testbed/gnunet_testbed_mpi_spawn.c b/src/testbed/gnunet_testbed_mpi_spawn.c
index 3fb50cb8f..191f658b7 100644
--- a/src/testbed/gnunet_testbed_mpi_spawn.c
+++ b/src/testbed/gnunet_testbed_mpi_spawn.c
@@ -74,7 +74,7 @@ static struct GNUNET_SCHEDULER_Task * child_death_task_id;
74 * The shutdown task 74 * The shutdown task
75 */ 75 */
76static void 76static void
77shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 77shutdown_task (void *cls)
78{ 78{
79 shutdown_task_id = NULL; 79 shutdown_task_id = NULL;
80 if (0 != child_exit_code) 80 if (0 != child_exit_code)
@@ -96,7 +96,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
96 96
97 97
98static void 98static void
99terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 99terminate_task (void *cls)
100{ 100{
101 static int hard_kill; 101 static int hard_kill;
102 102
@@ -131,16 +131,18 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
131 * process died). 131 * process died).
132 * 132 *
133 * @param cls closure, NULL if we need to self-restart 133 * @param cls closure, NULL if we need to self-restart
134 * @param tc context
135 */ 134 */
136static void 135static void
137child_death_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 136child_death_task (void *cls)
138{ 137{
139 const struct GNUNET_DISK_FileHandle *pr; 138 const struct GNUNET_DISK_FileHandle *pr;
140 char c[16]; 139 char c[16];
140 const struct GNUNET_SCHEDULER_TaskContext *tc;
141
141 142
142 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ); 143 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
143 child_death_task_id = NULL; 144 child_death_task_id = NULL;
145 tc = GNUNET_SCHEDULER_get_task_context ();
144 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 146 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
145 { 147 {
146 child_death_task_id = 148 child_death_task_id =
@@ -179,10 +181,9 @@ destroy_hosts(struct GNUNET_TESTBED_Host **hosts, unsigned int nhosts)
179 * The main scheduler run task 181 * The main scheduler run task
180 * 182 *
181 * @param cls NULL 183 * @param cls NULL
182 * @param tc scheduler task context
183 */ 184 */
184static void 185static void
185run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 186run (void *cls)
186{ 187{
187 struct GNUNET_TESTBED_Host **hosts; 188 struct GNUNET_TESTBED_Host **hosts;
188 const struct GNUNET_CONFIGURATION_Handle *null_cfg; 189 const struct GNUNET_CONFIGURATION_Handle *null_cfg;
diff --git a/src/testbed/test_gnunet_helper_testbed.c b/src/testbed/test_gnunet_helper_testbed.c
index ebcfd5a37..7a2dce8a5 100644
--- a/src/testbed/test_gnunet_helper_testbed.c
+++ b/src/testbed/test_gnunet_helper_testbed.c
@@ -80,10 +80,9 @@ static int result;
80 * Shutdown nicely 80 * Shutdown nicely
81 * 81 *
82 * @param cls NULL 82 * @param cls NULL
83 * @param tc the task context
84 */ 83 */
85static void 84static void
86do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 85do_shutdown (void *cls)
87{ 86{
88 if (NULL != abort_task) 87 if (NULL != abort_task)
89 GNUNET_SCHEDULER_cancel (abort_task); 88 GNUNET_SCHEDULER_cancel (abort_task);
@@ -99,10 +98,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
99 * abort task to run on test timed out 98 * abort task to run on test timed out
100 * 99 *
101 * @param cls NULL 100 * @param cls NULL
102 * @param tc the task context
103 */ 101 */
104static void 102static void
105do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 103do_abort (void *cls)
106{ 104{
107 abort_task = NULL; 105 abort_task = NULL;
108 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); 106 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
@@ -118,9 +116,9 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
118 * Continuation function. 116 * Continuation function.
119 * 117 *
120 * @param cls closure 118 * @param cls closure
121 * @param result GNUNET_OK on success, 119 * @param result #GNUNET_OK on success,
122 * GNUNET_NO if helper process died 120 * #GNUNET_NO if helper process died
123 * GNUNET_SYSERR during GNUNET_HELPER_stop 121 * #GNUNET_SYSERR during GNUNET_HELPER_stop()
124 */ 122 */
125static void 123static void
126cont_cb (void *cls, int result) 124cont_cb (void *cls, int result)
@@ -141,7 +139,7 @@ cont_cb (void *cls, int result)
141 * @param client identification of the client 139 * @param client identification of the client
142 * @param message the actual message 140 * @param message the actual message
143 * 141 *
144 * @return GNUNET_OK on success, GNUNET_SYSERR to stop further processing 142 * @return #GNUNET_OK on success, #GNUNET_SYSERR to stop further processing
145 */ 143 */
146static int 144static int
147mst_cb (void *cls, void *client, const struct GNUNET_MessageHeader *message) 145mst_cb (void *cls, void *client, const struct GNUNET_MessageHeader *message)
diff --git a/src/testbed/test_testbed_api.c b/src/testbed/test_testbed_api.c
index 01207c0d4..fdf9d80f9 100644
--- a/src/testbed/test_testbed_api.c
+++ b/src/testbed/test_testbed_api.c
@@ -136,7 +136,7 @@ static enum Test sub_test;
136 * @param tc the task context 136 * @param tc the task context
137 */ 137 */
138static void 138static void
139do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 139do_shutdown (void *cls)
140{ 140{
141 LOG (GNUNET_ERROR_TYPE_DEBUG, "Shutting down...\n"); 141 LOG (GNUNET_ERROR_TYPE_DEBUG, "Shutting down...\n");
142 if (NULL != abort_task) 142 if (NULL != abort_task)
@@ -178,11 +178,11 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
178 * @param tc the task context 178 * @param tc the task context
179 */ 179 */
180static void 180static void
181do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 181do_abort (void *cls)
182{ 182{
183 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); 183 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
184 abort_task = NULL; 184 abort_task = NULL;
185 do_shutdown (cls, tc); 185 do_shutdown (cls);
186} 186}
187 187
188 188
diff --git a/src/testbed/test_testbed_api_2peers_1controller.c b/src/testbed/test_testbed_api_2peers_1controller.c
index 0bee03de9..1e15d07aa 100644
--- a/src/testbed/test_testbed_api_2peers_1controller.c
+++ b/src/testbed/test_testbed_api_2peers_1controller.c
@@ -186,10 +186,9 @@ static enum Stage result;
186 * Shutdown nicely 186 * Shutdown nicely
187 * 187 *
188 * @param cls NULL 188 * @param cls NULL
189 * @param tc the task context
190 */ 189 */
191static void 190static void
192do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 191do_shutdown (void *cls)
193{ 192{
194 if (NULL != abort_task) 193 if (NULL != abort_task)
195 GNUNET_SCHEDULER_cancel (abort_task); 194 GNUNET_SCHEDULER_cancel (abort_task);
@@ -210,14 +209,13 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
210 * abort task to run on test timed out 209 * abort task to run on test timed out
211 * 210 *
212 * @param cls NULL 211 * @param cls NULL
213 * @param tc the task context
214 */ 212 */
215static void 213static void
216do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 214do_abort (void *cls)
217{ 215{
218 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); 216 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
219 abort_task = NULL; 217 abort_task = NULL;
220 do_shutdown (cls, tc); 218 do_shutdown (cls);
221} 219}
222 220
223 221
@@ -237,10 +235,9 @@ op_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg);
237 * task for delaying a connect 235 * task for delaying a connect
238 * 236 *
239 * @param cls NULL 237 * @param cls NULL
240 * @param tc the task context
241 */ 238 */
242static void 239static void
243do_delayed_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 240do_delayed_connect (void *cls)
244{ 241{
245 delayed_connect_task = NULL; 242 delayed_connect_task = NULL;
246 FAIL_TEST (NULL == common_operation); 243 FAIL_TEST (NULL == common_operation);
diff --git a/src/testbed/test_testbed_api_3peers_3controllers.c b/src/testbed/test_testbed_api_3peers_3controllers.c
index 5919cbefa..a728048f3 100644
--- a/src/testbed/test_testbed_api_3peers_3controllers.c
+++ b/src/testbed/test_testbed_api_3peers_3controllers.c
@@ -254,10 +254,9 @@ static enum Stage result;
254 * Shutdown nicely 254 * Shutdown nicely
255 * 255 *
256 * @param cls NULL 256 * @param cls NULL
257 * @param tc the task context
258 */ 257 */
259static void 258static void
260do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 259do_shutdown (void *cls)
261{ 260{
262 if (NULL != abort_task) 261 if (NULL != abort_task)
263 GNUNET_SCHEDULER_cancel (abort_task); 262 GNUNET_SCHEDULER_cancel (abort_task);
@@ -288,10 +287,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
288 * abort task to run on test timed out 287 * abort task to run on test timed out
289 * 288 *
290 * @param cls NULL 289 * @param cls NULL
291 * @param tc the task context
292 */ 290 */
293static void 291static void
294do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 292do_abort (void *cls)
295{ 293{
296 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); 294 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
297 abort_task = NULL; 295 abort_task = NULL;
@@ -300,7 +298,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
300 GNUNET_SCHEDULER_cancel (delayed_connect_task); 298 GNUNET_SCHEDULER_cancel (delayed_connect_task);
301 delayed_connect_task = NULL; 299 delayed_connect_task = NULL;
302 } 300 }
303 do_shutdown (cls, tc); 301 do_shutdown (cls);
304} 302}
305 303
306static void 304static void
@@ -328,10 +326,9 @@ op_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg);
328 * task for delaying a connect 326 * task for delaying a connect
329 * 327 *
330 * @param cls NULL 328 * @param cls NULL
331 * @param tc the task context
332 */ 329 */
333static void 330static void
334do_delayed_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 331do_delayed_connect (void *cls)
335{ 332{
336 delayed_connect_task = NULL; 333 delayed_connect_task = NULL;
337 if (NULL != common_operation) 334 if (NULL != common_operation)
diff --git a/src/testbed/test_testbed_api_barriers.c b/src/testbed/test_testbed_api_barriers.c
index 0a0f482d9..8ee9c41af 100644
--- a/src/testbed/test_testbed_api_barriers.c
+++ b/src/testbed/test_testbed_api_barriers.c
@@ -62,10 +62,9 @@ static int result;
62 * Shutdown this test case when it takes too long 62 * Shutdown this test case when it takes too long
63 * 63 *
64 * @param cls NULL 64 * @param cls NULL
65 * @param tc scheduler task context
66 */ 65 */
67static void 66static void
68do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 67do_shutdown (void *cls)
69{ 68{
70 shutdown_task = NULL; 69 shutdown_task = NULL;
71 if (NULL != barrier) 70 if (NULL != barrier)
diff --git a/src/testbed/test_testbed_api_controllerlink.c b/src/testbed/test_testbed_api_controllerlink.c
index 78d4d3bc7..fd876a07f 100644
--- a/src/testbed/test_testbed_api_controllerlink.c
+++ b/src/testbed/test_testbed_api_controllerlink.c
@@ -300,7 +300,7 @@ static enum Stage result;
300 if (NULL != abort_task) \ 300 if (NULL != abort_task) \
301 GNUNET_SCHEDULER_cancel (abort_task); \ 301 GNUNET_SCHEDULER_cancel (abort_task); \
302 abort_task = NULL; \ 302 abort_task = NULL; \
303 GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \ 303 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); \
304 return; \ 304 return; \
305 } \ 305 } \
306 } while (0) 306 } while (0)
@@ -310,10 +310,9 @@ static enum Stage result;
310 * Shutdown nicely 310 * Shutdown nicely
311 * 311 *
312 * @param cls NULL 312 * @param cls NULL
313 * @param tc the task context
314 */ 313 */
315static void 314static void
316do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 315do_shutdown (void *cls)
317{ 316{
318 if (NULL != abort_task) 317 if (NULL != abort_task)
319 GNUNET_SCHEDULER_cancel (abort_task); 318 GNUNET_SCHEDULER_cancel (abort_task);
@@ -349,14 +348,13 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
349 * abort task to run on test timed out 348 * abort task to run on test timed out
350 * 349 *
351 * @param cls NULL 350 * @param cls NULL
352 * @param tc the task context
353 */ 351 */
354static void 352static void
355do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 353do_abort (void *cls)
356{ 354{
357 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n"); 355 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
358 abort_task = NULL; 356 abort_task = NULL;
359 do_shutdown (cls, tc); 357 do_shutdown (cls);
360} 358}
361 359
362 360
@@ -392,7 +390,7 @@ registration_cont (void *cls, const char *emsg);
392 * @return 390 * @return
393 */ 391 */
394static void 392static void
395delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 393delay_task (void *cls)
396{ 394{
397 delay_task_id = NULL; 395 delay_task_id = NULL;
398 switch (result) 396 switch (result)
@@ -644,8 +642,8 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
644 result = SUCCESS; 642 result = SUCCESS;
645 GNUNET_TESTBED_operation_done (op); 643 GNUNET_TESTBED_operation_done (op);
646 op = NULL; 644 op = NULL;
647 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 645 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
648 (GNUNET_TIME_UNIT_SECONDS, 1), &do_shutdown, 646 &do_shutdown,
649 NULL); 647 NULL);
650 break; 648 break;
651 default: 649 default:
diff --git a/src/testbed/test_testbed_api_hosts.c b/src/testbed/test_testbed_api_hosts.c
index a355ddd0c..2141dc46f 100644
--- a/src/testbed/test_testbed_api_hosts.c
+++ b/src/testbed/test_testbed_api_hosts.c
@@ -67,10 +67,9 @@ struct GNUNET_SCHEDULER_Task * shutdown_id;
67 * The shutdown task 67 * The shutdown task
68 * 68 *
69 * @param cls NULL 69 * @param cls NULL
70 * @param tc the task context
71 */ 70 */
72static void 71static void
73do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 72do_shutdown (void *cls)
74{ 73{
75 GNUNET_TESTBED_host_destroy (host); 74 GNUNET_TESTBED_host_destroy (host);
76 while (0 != num_hosts) 75 while (0 != num_hosts)
diff --git a/src/testbed/test_testbed_api_operations.c b/src/testbed/test_testbed_api_operations.c
index b522262ba..f2fc4e6e3 100644
--- a/src/testbed/test_testbed_api_operations.c
+++ b/src/testbed/test_testbed_api_operations.c
@@ -262,10 +262,9 @@ release_cb (void *cls);
262 * Task to simulate artificial delay and change the test stage 262 * Task to simulate artificial delay and change the test stage
263 * 263 *
264 * @param cls NULL 264 * @param cls NULL
265 * @param tc the task context
266 */ 265 */
267static void 266static void
268step (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 267step (void *cls)
269{ 268{
270 GNUNET_assert (NULL != step_task); 269 GNUNET_assert (NULL != step_task);
271 step_task = NULL; 270 step_task = NULL;
diff --git a/src/testbed/test_testbed_api_peer_reconfiguration.c b/src/testbed/test_testbed_api_peer_reconfiguration.c
index 8b429e8fa..315d8a3f3 100644
--- a/src/testbed/test_testbed_api_peer_reconfiguration.c
+++ b/src/testbed/test_testbed_api_peer_reconfiguration.c
@@ -89,10 +89,9 @@ enum {
89 * Abort task 89 * Abort task
90 * 90 *
91 * @param cls NULL 91 * @param cls NULL
92 * @param tc scheduler task context
93 */ 92 */
94static void 93static void
95do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 94do_abort (void *cls)
96{ 95{
97 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n"); 96 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n");
98 abort_task = NULL; 97 abort_task = NULL;
diff --git a/src/testbed/test_testbed_api_peers_manage_services.c b/src/testbed/test_testbed_api_peers_manage_services.c
index d478fd1ea..170f4a067 100644
--- a/src/testbed/test_testbed_api_peers_manage_services.c
+++ b/src/testbed/test_testbed_api_peers_manage_services.c
@@ -103,10 +103,9 @@ enum {
103 * Abort task 103 * Abort task
104 * 104 *
105 * @param cls NULL 105 * @param cls NULL
106 * @param tc scheduler task context
107 */ 106 */
108static void 107static void
109do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 108do_abort (void *cls)
110{ 109{
111 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n"); 110 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n");
112 abort_task = NULL; 111 abort_task = NULL;
diff --git a/src/testbed/test_testbed_api_statistics.c b/src/testbed/test_testbed_api_statistics.c
index dc8e4c4be..20598b565 100644
--- a/src/testbed/test_testbed_api_statistics.c
+++ b/src/testbed/test_testbed_api_statistics.c
@@ -87,10 +87,9 @@ static unsigned int num_seen_peers;
87 * Abort task 87 * Abort task
88 * 88 *
89 * @param cls NULL 89 * @param cls NULL
90 * @param tc scheduler task context
91 */ 90 */
92static void 91static void
93do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 92do_abort (void *cls)
94{ 93{
95 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test timed out -- Aborting\n"); 94 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test timed out -- Aborting\n");
96 abort_task = NULL; 95 abort_task = NULL;
diff --git a/src/testbed/test_testbed_api_test.c b/src/testbed/test_testbed_api_test.c
index 80e92eb90..61d3f2aba 100644
--- a/src/testbed/test_testbed_api_test.c
+++ b/src/testbed/test_testbed_api_test.c
@@ -70,10 +70,9 @@ static int result;
70 * Shutdown nicely 70 * Shutdown nicely
71 * 71 *
72 * @param cls NULL 72 * @param cls NULL
73 * @param tc the task context
74 */ 73 */
75static void 74static void
76do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 75do_shutdown (void *cls)
77{ 76{
78 shutdown_task = NULL; 77 shutdown_task = NULL;
79 if (NULL != abort_task) 78 if (NULL != abort_task)
@@ -93,7 +92,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
93 GNUNET_SCHEDULER_cancel (abort_task); \ 92 GNUNET_SCHEDULER_cancel (abort_task); \
94 abort_task = NULL; \ 93 abort_task = NULL; \
95 if (NULL == shutdown_task) \ 94 if (NULL == shutdown_task) \
96 shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \ 95 shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); \
97 return; \ 96 return; \
98 } \ 97 } \
99 } while (0) 98 } while (0)
@@ -103,16 +102,15 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
103 * abort task to run on test timed out 102 * abort task to run on test timed out
104 * 103 *
105 * @param cls NULL 104 * @param cls NULL
106 * @param tc the task context
107 */ 105 */
108static void 106static void
109do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 107do_abort (void *cls)
110{ 108{
111 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); 109 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
112 abort_task = NULL; 110 abort_task = NULL;
113 if (NULL != shutdown_task) 111 if (NULL != shutdown_task)
114 GNUNET_SCHEDULER_cancel (shutdown_task); 112 GNUNET_SCHEDULER_cancel (shutdown_task);
115 do_shutdown (cls, tc); 113 do_shutdown (cls);
116} 114}
117 115
118 116
diff --git a/src/testbed/test_testbed_api_testbed_run.c b/src/testbed/test_testbed_api_testbed_run.c
index db3bb0d47..10beebc1f 100644
--- a/src/testbed/test_testbed_api_testbed_run.c
+++ b/src/testbed/test_testbed_api_testbed_run.c
@@ -68,10 +68,9 @@ static int wait_forever;
68 * Shutdown nicely 68 * Shutdown nicely
69 * 69 *
70 * @param cls NULL 70 * @param cls NULL
71 * @param tc the task context
72 */ 71 */
73static void 72static void
74do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 73do_shutdown (void *cls)
75{ 74{
76 if (NULL != abort_task) 75 if (NULL != abort_task)
77 GNUNET_SCHEDULER_cancel (abort_task); 76 GNUNET_SCHEDULER_cancel (abort_task);
@@ -83,10 +82,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
83 * abort task to run on test timed out 82 * abort task to run on test timed out
84 * 83 *
85 * @param cls NULL 84 * @param cls NULL
86 * @param tc the task context
87 */ 85 */
88static void 86static void
89do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 87do_abort (void *cls)
90{ 88{
91 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); 89 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
92 abort_task = NULL; 90 abort_task = NULL;
diff --git a/src/testbed/test_testbed_api_topology.c b/src/testbed/test_testbed_api_topology.c
index c6064af65..49b46b0df 100644
--- a/src/testbed/test_testbed_api_topology.c
+++ b/src/testbed/test_testbed_api_topology.c
@@ -63,10 +63,9 @@ static unsigned int overlay_connects;
63 * Shutdown nicely 63 * Shutdown nicely
64 * 64 *
65 * @param cls NULL 65 * @param cls NULL
66 * @param tc the task context
67 */ 66 */
68static void 67static void
69do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 68do_shutdown (void *cls)
70{ 69{
71 shutdown_task = NULL; 70 shutdown_task = NULL;
72 if (NULL != op) 71 if (NULL != op)
diff --git a/src/testbed/test_testbed_api_topology_clique.c b/src/testbed/test_testbed_api_topology_clique.c
index d1ccdc2c0..4ca6dbdda 100644
--- a/src/testbed/test_testbed_api_topology_clique.c
+++ b/src/testbed/test_testbed_api_topology_clique.c
@@ -63,10 +63,9 @@ static unsigned int overlay_connects;
63 * Shutdown nicely 63 * Shutdown nicely
64 * 64 *
65 * @param cls NULL 65 * @param cls NULL
66 * @param tc the task context
67 */ 66 */
68static void 67static void
69do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 68do_shutdown (void *cls)
70{ 69{
71 shutdown_task = NULL; 70 shutdown_task = NULL;
72 if (NULL != op) 71 if (NULL != op)
diff --git a/src/testbed/test_testbed_logger_api.c b/src/testbed/test_testbed_logger_api.c
index 2cc33ea5b..bedb9d4da 100644
--- a/src/testbed/test_testbed_logger_api.c
+++ b/src/testbed/test_testbed_logger_api.c
@@ -97,7 +97,7 @@ shutdown_now ()
97 97
98 98
99static void 99static void
100do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 100do_abort (void *cls)
101{ 101{
102 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n"); 102 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
103 abort_task = NULL; 103 abort_task = NULL;
@@ -173,7 +173,7 @@ flush_comp (void *cls, size_t size)
173 173
174 174
175static void 175static void
176do_write (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 176do_write (void *cls)
177{ 177{
178 static int i; 178 static int i;
179 char buf[BSIZE]; 179 char buf[BSIZE];
diff --git a/src/testbed/test_testbed_underlay.c b/src/testbed/test_testbed_underlay.c
index caea41881..098a2b3db 100644
--- a/src/testbed/test_testbed_underlay.c
+++ b/src/testbed/test_testbed_underlay.c
@@ -49,7 +49,7 @@ static struct GNUNET_TESTBED_Operation *op;
49 * @param tc scheduler task context 49 * @param tc scheduler task context
50 */ 50 */
51static void 51static void
52do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 52do_shutdown (void *cls)
53{ 53{
54 if (NULL != op) 54 if (NULL != op)
55 GNUNET_TESTBED_operation_done (op); 55 GNUNET_TESTBED_operation_done (op);
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c
index 7c8580319..d371108ec 100644
--- a/src/testbed/testbed_api_hosts.c
+++ b/src/testbed/testbed_api_hosts.c
@@ -1259,10 +1259,9 @@ struct GNUNET_TESTBED_HostHabitableCheckHandle
1259 * Task for checking whether a host is habitable or not 1259 * Task for checking whether a host is habitable or not
1260 * 1260 *
1261 * @param cls GNUNET_TESTBED_HostHabitableCheckHandle 1261 * @param cls GNUNET_TESTBED_HostHabitableCheckHandle
1262 * @param tc the scheduler task context
1263 */ 1262 */
1264static void 1263static void
1265habitability_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1264habitability_check (void *cls)
1266{ 1265{
1267 struct GNUNET_TESTBED_HostHabitableCheckHandle *h = cls; 1266 struct GNUNET_TESTBED_HostHabitableCheckHandle *h = cls;
1268 void *cb_cls; 1267 void *cb_cls;
diff --git a/src/testbed/testbed_api_operations.c b/src/testbed/testbed_api_operations.c
index e4da01fb7..7f5aaa873 100644
--- a/src/testbed/testbed_api_operations.c
+++ b/src/testbed/testbed_api_operations.c
@@ -549,10 +549,9 @@ rq_remove (struct GNUNET_TESTBED_Operation *op)
549 * the ready queue. 549 * the ready queue.
550 * 550 *
551 * @param cls NULL 551 * @param cls NULL
552 * @param tc scheduler task context. Not used.
553 */ 552 */
554static void 553static void
555process_rq_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 554process_rq_task (void *cls)
556{ 555{
557 struct GNUNET_TESTBED_Operation *op; 556 struct GNUNET_TESTBED_Operation *op;
558 struct OperationQueue *queue; 557 struct OperationQueue *queue;
diff --git a/src/testbed/testbed_api_statistics.c b/src/testbed/testbed_api_statistics.c
index 0f24446fe..a4778f84d 100644
--- a/src/testbed/testbed_api_statistics.c
+++ b/src/testbed/testbed_api_statistics.c
@@ -150,10 +150,9 @@ static struct OperationQueue *no_wait_queue;
150 * get_statistics operation. 150 * get_statistics operation.
151 * 151 *
152 * @param cls the GetStatsContext 152 * @param cls the GetStatsContext
153 * @param tc the scheduler task context
154 */ 153 */
155static void 154static void
156call_completion_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 155call_completion_task (void *cls)
157{ 156{
158 struct GetStatsContext *sc = cls; 157 struct GetStatsContext *sc = cls;
159 158
@@ -169,10 +168,9 @@ call_completion_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
169 * as we cannot destroy the statistics handle in iteration_completion_cb() 168 * as we cannot destroy the statistics handle in iteration_completion_cb()
170 * 169 *
171 * @param cls the PeerGetStatsContext 170 * @param cls the PeerGetStatsContext
172 * @param tc the scheduler task context
173 */ 171 */
174static void 172static void
175op_done_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 173op_done_task (void *cls)
176{ 174{
177 struct PeerGetStatsContext *peer_sc = cls; 175 struct PeerGetStatsContext *peer_sc = cls;
178 struct GetStatsContext *sc; 176 struct GetStatsContext *sc;
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c
index 76403e427..de99fb5a3 100644
--- a/src/testbed/testbed_api_testbed.c
+++ b/src/testbed/testbed_api_testbed.c
@@ -611,10 +611,9 @@ wait_op_completion (void *cls)
611 * Task run upon interrupts (SIGINT, SIGTERM) and upon scheduler shutdown. 611 * Task run upon interrupts (SIGINT, SIGTERM) and upon scheduler shutdown.
612 * 612 *
613 * @param cls the RunContext which has to be acted upon 613 * @param cls the RunContext which has to be acted upon
614 * @param tc the scheduler task context
615 */ 614 */
616static void 615static void
617interrupt (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 616interrupt (void *cls)
618{ 617{
619 struct GNUNET_TESTBED_RunHandle *rc = cls; 618 struct GNUNET_TESTBED_RunHandle *rc = cls;
620 struct GNUNET_TESTBED_Controller *c = rc->c; 619 struct GNUNET_TESTBED_Controller *c = rc->c;
@@ -661,10 +660,9 @@ prof_time (struct GNUNET_TESTBED_RunHandle *rc)
661 * Task for starting peers 660 * Task for starting peers
662 * 661 *
663 * @param cls the RunHandle 662 * @param cls the RunHandle
664 * @param tc the task context from scheduler
665 */ 663 */
666static void 664static void
667start_peers_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 665start_peers_task (void *cls)
668{ 666{
669 struct GNUNET_TESTBED_RunHandle *rc = cls; 667 struct GNUNET_TESTBED_RunHandle *rc = cls;
670 struct RunContextOperation *rcop; 668 struct RunContextOperation *rcop;
@@ -966,10 +964,9 @@ call_cc:
966 * Task to register all hosts available in the global host list 964 * Task to register all hosts available in the global host list
967 * 965 *
968 * @param cls the RunContext 966 * @param cls the RunContext
969 * @param tc the scheduler task context
970 */ 967 */
971static void 968static void
972register_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 969register_hosts (void *cls);
973 970
974 971
975/** 972/**
@@ -999,10 +996,9 @@ host_registration_completion (void *cls, const char *emsg)
999 * Task to register all hosts available in the global host list 996 * Task to register all hosts available in the global host list
1000 * 997 *
1001 * @param cls RunContext 998 * @param cls RunContext
1002 * @param tc the scheduler task context
1003 */ 999 */
1004static void 1000static void
1005register_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1001register_hosts (void *cls)
1006{ 1002{
1007 struct GNUNET_TESTBED_RunHandle *rc = cls; 1003 struct GNUNET_TESTBED_RunHandle *rc = cls;
1008 struct RunContextOperation *rcop; 1004 struct RunContextOperation *rcop;
@@ -1194,15 +1190,15 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *host,
1194 * Task run upon timeout while setting up the testbed 1190 * Task run upon timeout while setting up the testbed
1195 * 1191 *
1196 * @param cls the RunContext 1192 * @param cls the RunContext
1197 * @param tc the task context
1198 */ 1193 */
1199static void 1194static void
1200timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1195timeout_task (void *cls)
1201{ 1196{
1202 struct GNUNET_TESTBED_RunHandle *rc = cls; 1197 struct GNUNET_TESTBED_RunHandle *rc = cls;
1203 1198
1204 rc->timeout_task = NULL; 1199 rc->timeout_task = NULL;
1205 LOG (GNUNET_ERROR_TYPE_ERROR, _("Shutting down testbed due to timeout while setup.\n")); 1200 LOG (GNUNET_ERROR_TYPE_ERROR,
1201 _("Shutting down testbed due to timeout while setup.\n"));
1206 GNUNET_SCHEDULER_shutdown (); 1202 GNUNET_SCHEDULER_shutdown ();
1207 if (NULL != rc->test_master) 1203 if (NULL != rc->test_master)
1208 rc->test_master (rc->test_master_cls, rc, 0, NULL, 0, 0); 1204 rc->test_master (rc->test_master_cls, rc, 0, NULL, 0, 0);
diff --git a/src/testbed/testbed_logger_api.c b/src/testbed/testbed_logger_api.c
index ca6bc354e..aa182e21c 100644
--- a/src/testbed/testbed_logger_api.c
+++ b/src/testbed/testbed_logger_api.c
@@ -170,10 +170,9 @@ cancel_timeout_flush (struct GNUNET_TESTBED_LOGGER_Handle *h)
170 * Task to call the flush completion notification 170 * Task to call the flush completion notification
171 * 171 *
172 * @param cls the logger handle 172 * @param cls the logger handle
173 * @param tc the scheduler task context
174 */ 173 */
175static void 174static void
176call_flush_completion (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 175call_flush_completion (void *cls)
177{ 176{
178 struct GNUNET_TESTBED_LOGGER_Handle *h = cls; 177 struct GNUNET_TESTBED_LOGGER_Handle *h = cls;
179 GNUNET_TESTBED_LOGGER_FlushCompletion cb; 178 GNUNET_TESTBED_LOGGER_FlushCompletion cb;
@@ -416,10 +415,9 @@ GNUNET_TESTBED_LOGGER_write (struct GNUNET_TESTBED_LOGGER_Handle *h,
416 * be called with 0 as the amount of data sent. 415 * be called with 0 as the amount of data sent.
417 * 416 *
418 * @param cls the logger handle 417 * @param cls the logger handle
419 * @param tc scheduler task context
420 */ 418 */
421static void 419static void
422timeout_flush (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 420timeout_flush (void *cls)
423{ 421{
424 struct GNUNET_TESTBED_LOGGER_Handle *h = cls; 422 struct GNUNET_TESTBED_LOGGER_Handle *h = cls;
425 GNUNET_TESTBED_LOGGER_FlushCompletion cb; 423 GNUNET_TESTBED_LOGGER_FlushCompletion cb;
diff --git a/src/testing/gnunet-testing.c b/src/testing/gnunet-testing.c
index 1e640ec96..92dd17d98 100644
--- a/src/testing/gnunet-testing.c
+++ b/src/testing/gnunet-testing.c
@@ -197,10 +197,9 @@ create_hostkeys (const unsigned int no)
197 * Removes the temporary file. 197 * Removes the temporary file.
198 * 198 *
199 * @param cls unused 199 * @param cls unused
200 * @param tc scheduler context
201 */ 200 */
202static void 201static void
203cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 202cleanup (void *cls)
204{ 203{
205 if (NULL != tmpfilename) 204 if (NULL != tmpfilename)
206 { 205 {
@@ -224,14 +223,15 @@ cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
224 * Called whenever we can read stdin non-blocking 223 * Called whenever we can read stdin non-blocking
225 * 224 *
226 * @param cls unused 225 * @param cls unused
227 * @param tc scheduler context
228 */ 226 */
229static void 227static void
230stdin_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 228stdin_cb (void *cls)
231{ 229{
232 int c; 230 int c;
231 const struct GNUNET_SCHEDULER_TaskContext *tc;
233 232
234 tid = NULL; 233 tid = NULL;
234 tc = GNUNET_SCHEDULER_get_task_context ();
235 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 235 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
236 return; 236 return;
237 GNUNET_assert (0 != (GNUNET_SCHEDULER_REASON_READ_READY & tc->reason)); 237 GNUNET_assert (0 != (GNUNET_SCHEDULER_REASON_READ_READY & tc->reason));
diff --git a/src/testing/test_testing_peerstartup.c b/src/testing/test_testing_peerstartup.c
index 9b0c53642..956788f6c 100644
--- a/src/testing/test_testing_peerstartup.c
+++ b/src/testing/test_testing_peerstartup.c
@@ -63,10 +63,9 @@ struct TestingContext
63 * Task for shutdown 63 * Task for shutdown
64 * 64 *
65 * @param cls the testing context 65 * @param cls the testing context
66 * @param tc the tast context
67 */ 66 */
68static void 67static void
69do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 68do_shutdown (void *cls)
70{ 69{
71 struct TestingContext *test_ctx = cls; 70 struct TestingContext *test_ctx = cls;
72 71
diff --git a/src/testing/test_testing_peerstartup2.c b/src/testing/test_testing_peerstartup2.c
index edbd24df0..fd46e5c3e 100644
--- a/src/testing/test_testing_peerstartup2.c
+++ b/src/testing/test_testing_peerstartup2.c
@@ -83,7 +83,7 @@ struct TestingContext
83 83
84 84
85static void 85static void
86do_shutdown2 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 86do_shutdown2 (void *cls)
87{ 87{
88 struct TestingContext *test_ctx = cls; 88 struct TestingContext *test_ctx = cls;
89 89
@@ -102,10 +102,9 @@ do_shutdown2 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
102 * Task for shutdown 102 * Task for shutdown
103 * 103 *
104 * @param cls the testing context 104 * @param cls the testing context
105 * @param tc the tast context
106 */ 105 */
107static void 106static void
108do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 107do_shutdown (void *cls);
109 108
110 109
111static void 110static void
@@ -133,10 +132,9 @@ peer_status_cb (void *cls, struct GNUNET_TESTING_Peer *peer, int success)
133 * Task for shutdown 132 * Task for shutdown
134 * 133 *
135 * @param cls the testing context 134 * @param cls the testing context
136 * @param tc the tast context
137 */ 135 */
138static void 136static void
139do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 137do_shutdown (void *cls)
140{ 138{
141 struct TestingContext *test_ctx = cls; 139 struct TestingContext *test_ctx = cls;
142 140
@@ -149,7 +147,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
149 test_ctx)); 147 test_ctx));
150 } 148 }
151 else 149 else
152 do_shutdown2 (test_ctx, tc); 150 do_shutdown2 (test_ctx);
153} 151}
154 152
155 153
diff --git a/src/testing/test_testing_sharedservices.c b/src/testing/test_testing_sharedservices.c
index 7d1a3905d..ee1ac8530 100644
--- a/src/testing/test_testing_sharedservices.c
+++ b/src/testing/test_testing_sharedservices.c
@@ -64,10 +64,9 @@ struct TestingContext
64 * Task for shutdown 64 * Task for shutdown
65 * 65 *
66 * @param cls the testing context 66 * @param cls the testing context
67 * @param tc the tast context
68 */ 67 */
69static void 68static void
70do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 69do_shutdown (void *cls)
71{ 70{
72 struct TestingContext *test_ctx = cls; 71 struct TestingContext *test_ctx = cls;
73 struct GNUNET_TESTING_Peer *peer; 72 struct GNUNET_TESTING_Peer *peer;
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 07129fd6f..32cd09b84 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -1654,11 +1654,9 @@ struct ServiceContext
1654 * Callback to be called when SCHEDULER has been started 1654 * Callback to be called when SCHEDULER has been started
1655 * 1655 *
1656 * @param cls the ServiceContext 1656 * @param cls the ServiceContext
1657 * @param tc the TaskContext
1658 */ 1657 */
1659static void 1658static void
1660service_run_main (void *cls, 1659service_run_main (void *cls)
1661 const struct GNUNET_SCHEDULER_TaskContext *tc)
1662{ 1660{
1663 struct ServiceContext *sc = cls; 1661 struct ServiceContext *sc = cls;
1664 1662
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index 632cfc4ec..1a6c163ee 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -506,19 +506,19 @@ find_advertisable_hello (void *cls,
506 * peer and ask for it. 506 * peer and ask for it.
507 * 507 *
508 * @param cls for which peer to schedule the HELLO 508 * @param cls for which peer to schedule the HELLO
509 * @param tc task context
510 */ 509 */
511static void 510static void
512schedule_next_hello (void *cls, 511schedule_next_hello (void *cls)
513 const struct GNUNET_SCHEDULER_TaskContext *tc)
514{ 512{
515 struct Peer *pl = cls; 513 struct Peer *pl = cls;
516 struct FindAdvHelloContext fah; 514 struct FindAdvHelloContext fah;
517 size_t next_want; 515 size_t next_want;
518 struct GNUNET_TIME_Relative delay; 516 struct GNUNET_TIME_Relative delay;
517 const struct GNUNET_SCHEDULER_TaskContext *tc;
519 518
520 pl->hello_delay_task = NULL; 519 pl->hello_delay_task = NULL;
521 GNUNET_assert (GNUNET_YES == pl->is_connected); 520 GNUNET_assert (GNUNET_YES == pl->is_connected);
521 tc = GNUNET_SCHEDULER_get_task_context ();
522 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 522 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
523 return; /* we're out of here */ 523 return; /* we're out of here */
524 if (pl->hello_req != NULL) 524 if (pl->hello_req != NULL)
@@ -669,11 +669,9 @@ try_add_peers (void *cls,
669 * Add peers and schedule connection attempt 669 * Add peers and schedule connection attempt
670 * 670 *
671 * @param cls unused, NULL 671 * @param cls unused, NULL
672 * @param tc scheduler context
673 */ 672 */
674static void 673static void
675add_peer_task (void *cls, 674add_peer_task (void *cls)
676 const struct GNUNET_SCHEDULER_TaskContext *tc)
677{ 675{
678 add_task = NULL; 676 add_task = NULL;
679 677
@@ -1133,11 +1131,9 @@ hello_advertising_ready (void *cls,
1133 * the transport and core. 1131 * the transport and core.
1134 * 1132 *
1135 * @param cls unused, NULL 1133 * @param cls unused, NULL
1136 * @param tc scheduler context
1137 */ 1134 */
1138static void 1135static void
1139cleaning_task (void *cls, 1136cleaning_task (void *cls)
1140 const struct GNUNET_SCHEDULER_TaskContext *tc)
1141{ 1137{
1142 if (NULL != peerinfo_notify) 1138 if (NULL != peerinfo_notify)
1143 { 1139 {
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index d5c0d4a86..9fde3d83e 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -250,11 +250,9 @@ process_payload (const struct GNUNET_HELLO_Address *address,
250 * Task to asynchronously terminate a session. 250 * Task to asynchronously terminate a session.
251 * 251 *
252 * @param cls the `struct GNUNET_ATS_SessionKiller` with the information for the kill 252 * @param cls the `struct GNUNET_ATS_SessionKiller` with the information for the kill
253 * @param tc scheduler context
254 */ 253 */
255static void 254static void
256kill_session_task (void *cls, 255kill_session_task (void *cls)
257 const struct GNUNET_SCHEDULER_TaskContext *tc)
258{ 256{
259 struct GNUNET_ATS_SessionKiller *sk = cls; 257 struct GNUNET_ATS_SessionKiller *sk = cls;
260 258
@@ -756,11 +754,9 @@ ats_request_address_change (void *cls,
756 * and cancels pending validations. 754 * and cancels pending validations.
757 * 755 *
758 * @param cls closure, unused 756 * @param cls closure, unused
759 * @param tc task context (unused)
760 */ 757 */
761static void 758static void
762shutdown_task (void *cls, 759shutdown_task (void *cls)
763 const struct GNUNET_SCHEDULER_TaskContext *tc)
764{ 760{
765 GST_neighbours_stop (); 761 GST_neighbours_stop ();
766 GST_plugins_unload (); 762 GST_plugins_unload ();
diff --git a/src/transport/gnunet-service-transport_ats.c b/src/transport/gnunet-service-transport_ats.c
index 87d05b200..a20c998b3 100644
--- a/src/transport/gnunet-service-transport_ats.c
+++ b/src/transport/gnunet-service-transport_ats.c
@@ -294,11 +294,9 @@ GST_ats_is_known_no_session (const struct GNUNET_HELLO_Address *address)
294 * suggest it again. 294 * suggest it again.
295 * 295 *
296 * @param cls the `struct AddressInfo` of the address to unblock 296 * @param cls the `struct AddressInfo` of the address to unblock
297 * @param tc unused
298 */ 297 */
299static void 298static void
300unblock_address (void *cls, 299unblock_address (void *cls)
301 const struct GNUNET_SCHEDULER_TaskContext *tc)
302{ 300{
303 struct AddressInfo *ai = cls; 301 struct AddressInfo *ai = cls;
304 302
diff --git a/src/transport/gnunet-service-transport_blacklist.c b/src/transport/gnunet-service-transport_blacklist.c
index 14375fce4..ea5644390 100644
--- a/src/transport/gnunet-service-transport_blacklist.c
+++ b/src/transport/gnunet-service-transport_blacklist.c
@@ -205,11 +205,9 @@ static struct GNUNET_CONTAINER_MultiPeerMap *blacklist;
205 * Perform next action in the blacklist check. 205 * Perform next action in the blacklist check.
206 * 206 *
207 * @param cls the `struct BlacklistCheck*` 207 * @param cls the `struct BlacklistCheck*`
208 * @param tc unused
209 */ 208 */
210static void 209static void
211do_blacklist_check (void *cls, 210do_blacklist_check (void *cls);
212 const struct GNUNET_SCHEDULER_TaskContext *tc);
213 211
214 212
215/** 213/**
@@ -395,7 +393,7 @@ GST_blacklist_stop ()
395 * @return number of bytes copied to @a buf 393 * @return number of bytes copied to @a buf
396 */ 394 */
397static size_t 395static size_t
398transmit_blacklist_message (void *cls, 396transmit_blacklist_message (void *cls,
399 size_t size, 397 size_t size,
400 void *buf) 398 void *buf)
401{ 399{
@@ -416,7 +414,7 @@ transmit_blacklist_message (void *cls,
416 } 414 }
417 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 415 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
418 "Sending blacklist test for peer `%s' to client %p\n", 416 "Sending blacklist test for peer `%s' to client %p\n",
419 GNUNET_i2s (&bc->peer), 417 GNUNET_i2s (&bc->peer),
420 bc->bl_pos->client); 418 bc->bl_pos->client);
421 bl = bc->bl_pos; 419 bl = bc->bl_pos;
422 bm.header.size = htons (sizeof (struct BlacklistMessage)); 420 bm.header.size = htons (sizeof (struct BlacklistMessage));
@@ -424,7 +422,7 @@ transmit_blacklist_message (void *cls,
424 bm.is_allowed = htonl (0); 422 bm.is_allowed = htonl (0);
425 bm.peer = bc->peer; 423 bm.peer = bc->peer;
426 memcpy (buf, 424 memcpy (buf,
427 &bm, 425 &bm,
428 sizeof (bm)); 426 sizeof (bm));
429 if (GNUNET_YES == bl->call_receive_done) 427 if (GNUNET_YES == bl->call_receive_done)
430 { 428 {
@@ -442,11 +440,9 @@ transmit_blacklist_message (void *cls,
442 * Perform next action in the blacklist check. 440 * Perform next action in the blacklist check.
443 * 441 *
444 * @param cls the `struct GST_BlacklistCheck *` 442 * @param cls the `struct GST_BlacklistCheck *`
445 * @param tc unused
446 */ 443 */
447static void 444static void
448do_blacklist_check (void *cls, 445do_blacklist_check (void *cls)
449 const struct GNUNET_SCHEDULER_TaskContext *tc)
450{ 446{
451 struct GST_BlacklistCheck *bc = cls; 447 struct GST_BlacklistCheck *bc = cls;
452 struct Blacklisters *bl; 448 struct Blacklisters *bl;
@@ -459,7 +455,7 @@ do_blacklist_check (void *cls,
459 "No other blacklist clients active, will allow neighbour `%s'\n", 455 "No other blacklist clients active, will allow neighbour `%s'\n",
460 GNUNET_i2s (&bc->peer)); 456 GNUNET_i2s (&bc->peer));
461 457
462 bc->cont (bc->cont_cls, 458 bc->cont (bc->cont_cls,
463 &bc->peer, 459 &bc->peer,
464 bc->address, 460 bc->address,
465 bc->session, 461 bc->session,
@@ -475,7 +471,7 @@ do_blacklist_check (void *cls,
475 GNUNET_SERVER_notify_transmit_ready (bl->client, 471 GNUNET_SERVER_notify_transmit_ready (bl->client,
476 sizeof (struct BlacklistMessage), 472 sizeof (struct BlacklistMessage),
477 GNUNET_TIME_UNIT_FOREVER_REL, 473 GNUNET_TIME_UNIT_FOREVER_REL,
478 &transmit_blacklist_message, 474 &transmit_blacklist_message,
479 bc); 475 bc);
480} 476}
481 477
@@ -501,7 +497,7 @@ confirm_or_drop_neighbour (void *cls,
501 if (GNUNET_OK == allowed) 497 if (GNUNET_OK == allowed)
502 return; /* we're done */ 498 return; /* we're done */
503 GNUNET_STATISTICS_update (GST_stats, 499 GNUNET_STATISTICS_update (GST_stats,
504 gettext_noop ("# disconnects due to blacklist"), 500 gettext_noop ("# disconnects due to blacklist"),
505 1, 501 1,
506 GNUNET_NO); 502 GNUNET_NO);
507 GST_neighbours_force_disconnect (peer); 503 GST_neighbours_force_disconnect (peer);
@@ -666,7 +662,7 @@ GST_blacklist_handle_reply (void *cls,
666 GNUNET_CONTAINER_DLL_remove (bc_head, 662 GNUNET_CONTAINER_DLL_remove (bc_head,
667 bc_tail, 663 bc_tail,
668 bc); 664 bc);
669 bc->cont (bc->cont_cls, 665 bc->cont (bc->cont_cls,
670 &bc->peer, 666 &bc->peer,
671 bc->address, 667 bc->address,
672 bc->session, 668 bc->session,
@@ -687,7 +683,7 @@ GST_blacklist_handle_reply (void *cls,
687 GNUNET_OK); 683 GNUNET_OK);
688 bl->call_receive_done = GNUNET_NO; 684 bl->call_receive_done = GNUNET_NO;
689 bc->bl_pos = bl->next; 685 bc->bl_pos = bl->next;
690 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, 686 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check,
691 bc); 687 bc);
692 } 688 }
693 } 689 }
@@ -695,7 +691,7 @@ GST_blacklist_handle_reply (void *cls,
695 for (bc = bc_head; bc != NULL; bc = bc->next) 691 for (bc = bc_head; bc != NULL; bc = bc->next)
696 if ((bc->bl_pos == bl) && (NULL == bc->task)) 692 if ((bc->bl_pos == bl) && (NULL == bc->task))
697 { 693 {
698 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, 694 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check,
699 bc); 695 bc);
700 break; 696 break;
701 } 697 }
@@ -749,7 +745,7 @@ GST_blacklist_abort_matching (const struct GNUNET_HELLO_Address *address,
749 struct GST_BlacklistCheck *bc; 745 struct GST_BlacklistCheck *bc;
750 struct GST_BlacklistCheck *n; 746 struct GST_BlacklistCheck *n;
751 747
752 n = bc_head; 748 n = bc_head;
753 while (NULL != (bc = n)) 749 while (NULL != (bc = n))
754 { 750 {
755 n = bc->next; 751 n = bc->next;
@@ -853,15 +849,15 @@ GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer,
853 /* Disallowed by config, disapprove instantly */ 849 /* Disallowed by config, disapprove instantly */
854 GNUNET_STATISTICS_update (GST_stats, 850 GNUNET_STATISTICS_update (GST_stats,
855 gettext_noop ("# disconnects due to blacklist"), 851 gettext_noop ("# disconnects due to blacklist"),
856 1, 852 1,
857 GNUNET_NO); 853 GNUNET_NO);
858 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 854 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
859 _("Disallowing connection to peer `%s' on transport %s\n"), 855 _("Disallowing connection to peer `%s' on transport %s\n"),
860 GNUNET_i2s (peer), 856 GNUNET_i2s (peer),
861 (NULL != transport_name) ? transport_name : "unspecified"); 857 (NULL != transport_name) ? transport_name : "unspecified");
862 if (NULL != cont) 858 if (NULL != cont)
863 cont (cont_cls, 859 cont (cont_cls,
864 peer, 860 peer,
865 address, 861 address,
866 session, 862 session,
867 GNUNET_NO); 863 GNUNET_NO);
@@ -886,7 +882,7 @@ GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer,
886 882
887 /* need to query blacklist clients */ 883 /* need to query blacklist clients */
888 bc = GNUNET_new (struct GST_BlacklistCheck); 884 bc = GNUNET_new (struct GST_BlacklistCheck);
889 GNUNET_CONTAINER_DLL_insert (bc_head, 885 GNUNET_CONTAINER_DLL_insert (bc_head,
890 bc_tail, 886 bc_tail,
891 bc); 887 bc);
892 bc->peer = *peer; 888 bc->peer = *peer;
diff --git a/src/transport/gnunet-service-transport_hello.c b/src/transport/gnunet-service-transport_hello.c
index 77c382ed0..1a3c2c32e 100644
--- a/src/transport/gnunet-service-transport_hello.c
+++ b/src/transport/gnunet-service-transport_hello.c
@@ -172,11 +172,9 @@ address_generator (void *cls,
172 * all of the transports. 172 * all of the transports.
173 * 173 *
174 * @param cls unused 174 * @param cls unused
175 * @param tc scheduler context
176 */ 175 */
177static void 176static void
178refresh_hello_task (void *cls, 177refresh_hello_task (void *cls)
179 const struct GNUNET_SCHEDULER_TaskContext *tc)
180{ 178{
181 struct GeneratorContext gc; 179 struct GeneratorContext gc;
182 180
@@ -243,7 +241,7 @@ GST_hello_start (int friend_only,
243 hello_cb = cb; 241 hello_cb = cb;
244 hello_cb_cls = cb_cls; 242 hello_cb_cls = cb_cls;
245 friend_option = friend_only; 243 friend_option = friend_only;
246 refresh_hello_task (NULL, NULL); 244 refresh_hello_task (NULL);
247} 245}
248 246
249 247
diff --git a/src/transport/gnunet-service-transport_manipulation.c b/src/transport/gnunet-service-transport_manipulation.c
index 6eef8f300..bd3fed6d7 100644
--- a/src/transport/gnunet-service-transport_manipulation.c
+++ b/src/transport/gnunet-service-transport_manipulation.c
@@ -224,11 +224,9 @@ GST_manipulation_set_metric (void *cls,
224 * message. 224 * message.
225 * 225 *
226 * @param cls the `struct DelayQueueEntry` to transmit 226 * @param cls the `struct DelayQueueEntry` to transmit
227 * @param tc unused
228 */ 227 */
229static void 228static void
230send_delayed (void *cls, 229send_delayed (void *cls)
231 const struct GNUNET_SCHEDULER_TaskContext *tc)
232{ 230{
233 struct DelayQueueEntry *dqe = cls; 231 struct DelayQueueEntry *dqe = cls;
234 struct DelayQueueEntry *next; 232 struct DelayQueueEntry *next;
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 0f1e86fe6..65428ef2a 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -695,11 +695,9 @@ free_address (struct NeighbourAddress *na)
695 * clean up after disconnect). 695 * clean up after disconnect).
696 * 696 *
697 * @param cls the `struct NeighbourMapEntry` for which we are running 697 * @param cls the `struct NeighbourMapEntry` for which we are running
698 * @param tc scheduler context (unused)
699 */ 698 */
700static void 699static void
701master_task (void *cls, 700master_task (void *cls);
702 const struct GNUNET_SCHEDULER_TaskContext *tc);
703 701
704 702
705/** 703/**
@@ -2814,11 +2812,9 @@ send_utilization_data (void *cls,
2814 * Task transmitting utilization in a regular interval 2812 * Task transmitting utilization in a regular interval
2815 * 2813 *
2816 * @param cls the 'struct NeighbourMapEntry' for which we are running 2814 * @param cls the 'struct NeighbourMapEntry' for which we are running
2817 * @param tc scheduler context (unused)
2818 */ 2815 */
2819static void 2816static void
2820utilization_transmission (void *cls, 2817utilization_transmission (void *cls)
2821 const struct GNUNET_SCHEDULER_TaskContext *tc)
2822{ 2818{
2823 util_transmission_tk = NULL; 2819 util_transmission_tk = NULL;
2824 GNUNET_CONTAINER_multipeermap_iterate (neighbours, 2820 GNUNET_CONTAINER_multipeermap_iterate (neighbours,
@@ -2883,11 +2879,9 @@ GST_neighbours_notify_data_sent (const struct GNUNET_HELLO_Address *address,
2883 * clean up after disconnect). 2879 * clean up after disconnect).
2884 * 2880 *
2885 * @param cls the 'struct NeighbourMapEntry' for which we are running 2881 * @param cls the 'struct NeighbourMapEntry' for which we are running
2886 * @param tc scheduler context (unused)
2887 */ 2882 */
2888static void 2883static void
2889master_task (void *cls, 2884master_task (void *cls)
2890 const struct GNUNET_SCHEDULER_TaskContext *tc)
2891{ 2885{
2892 struct NeighbourMapEntry *n = cls; 2886 struct NeighbourMapEntry *n = cls;
2893 struct GNUNET_TIME_Relative delay; 2887 struct GNUNET_TIME_Relative delay;
@@ -3448,11 +3442,9 @@ GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target)
3448 * Task to asynchronously run #free_neighbour(). 3442 * Task to asynchronously run #free_neighbour().
3449 * 3443 *
3450 * @param cls the `struct NeighbourMapEntry` to free 3444 * @param cls the `struct NeighbourMapEntry` to free
3451 * @param tc unused
3452 */ 3445 */
3453static void 3446static void
3454delayed_disconnect (void *cls, 3447delayed_disconnect (void *cls)
3455 const struct GNUNET_SCHEDULER_TaskContext* tc)
3456{ 3448{
3457 struct NeighbourMapEntry *n = cls; 3449 struct NeighbourMapEntry *n = cls;
3458 3450
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index 9b8d750f0..836aa418c 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -463,11 +463,9 @@ cleanup_validation_entry (void *cls,
463 * longer valid and then possibly triggers its removal. 463 * longer valid and then possibly triggers its removal.
464 * 464 *
465 * @param cls the `struct ValidationEntry` 465 * @param cls the `struct ValidationEntry`
466 * @param tc scheduler context (unused)
467 */ 466 */
468static void 467static void
469timeout_hello_validation (void *cls, 468timeout_hello_validation (void *cls)
470 const struct GNUNET_SCHEDULER_TaskContext *tc)
471{ 469{
472 struct ValidationEntry *ve = cls; 470 struct ValidationEntry *ve = cls;
473 struct GNUNET_TIME_Absolute max; 471 struct GNUNET_TIME_Absolute max;
@@ -652,11 +650,9 @@ transmit_ping_if_allowed (void *cls,
652 * Do address validation again to keep address valid. 650 * Do address validation again to keep address valid.
653 * 651 *
654 * @param cls the `struct ValidationEntry` 652 * @param cls the `struct ValidationEntry`
655 * @param tc scheduler context (unused)
656 */ 653 */
657static void 654static void
658revalidate_address (void *cls, 655revalidate_address (void *cls)
659 const struct GNUNET_SCHEDULER_TaskContext *tc)
660{ 656{
661 struct ValidationEntry *ve = cls; 657 struct ValidationEntry *ve = cls;
662 struct GNUNET_TIME_Relative canonical_delay; 658 struct GNUNET_TIME_Relative canonical_delay;
diff --git a/src/transport/gnunet-transport-profiler.c b/src/transport/gnunet-transport-profiler.c
index ed18bf418..624d1a16c 100644
--- a/src/transport/gnunet-transport-profiler.c
+++ b/src/transport/gnunet-transport-profiler.c
@@ -161,11 +161,9 @@ static int verbosity;
161 * Stops monitoring activity. 161 * Stops monitoring activity.
162 * 162 *
163 * @param cls NULL 163 * @param cls NULL
164 * @param tc scheduler context
165 */ 164 */
166static void 165static void
167shutdown_task (void *cls, 166shutdown_task (void *cls)
168 const struct GNUNET_SCHEDULER_TaskContext *tc)
169{ 167{
170 struct Iteration *icur; 168 struct Iteration *icur;
171 struct Iteration *inext; 169 struct Iteration *inext;
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c
index 03bece6b7..bed9bdc85 100644
--- a/src/transport/gnunet-transport.c
+++ b/src/transport/gnunet-transport.c
@@ -487,11 +487,9 @@ destroy_it (void *cls,
487 * Stops monitoring activity. 487 * Stops monitoring activity.
488 * 488 *
489 * @param cls NULL 489 * @param cls NULL
490 * @param tc scheduler context
491 */ 490 */
492static void 491static void
493shutdown_task (void *cls, 492shutdown_task (void *cls)
494 const struct GNUNET_SCHEDULER_TaskContext *tc)
495{ 493{
496 struct GNUNET_TIME_Relative duration; 494 struct GNUNET_TIME_Relative duration;
497 struct ValidationResolutionContext *cur; 495 struct ValidationResolutionContext *cur;
@@ -598,8 +596,7 @@ shutdown_task (void *cls,
598 * We are done, shut down. 596 * We are done, shut down.
599 */ 597 */
600static void 598static void
601operation_timeout (void *cls, 599operation_timeout (void *cls)
602 const struct GNUNET_SCHEDULER_TaskContext *tc)
603{ 600{
604 struct PeerResolutionContext *cur; 601 struct PeerResolutionContext *cur;
605 struct PeerResolutionContext *next; 602 struct PeerResolutionContext *next;
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index cd4710417..2b0b8939e 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -557,8 +557,7 @@ client_reschedule_session_timeout (struct GNUNET_ATS_Session *s)
557 * @param tc gnunet scheduler task context 557 * @param tc gnunet scheduler task context
558 */ 558 */
559static void 559static void
560client_run (void *cls, 560client_run (void *cls);
561 const struct GNUNET_SCHEDULER_TaskContext *tc);
562 561
563 562
564/** 563/**
@@ -997,11 +996,9 @@ client_lookup_session (struct HTTP_Client_Plugin *plugin,
997 * is the delayed task that actually disconnects the PUT. 996 * is the delayed task that actually disconnects the PUT.
998 * 997 *
999 * @param cls the `struct GNUNET_ATS_Session *` with the put 998 * @param cls the `struct GNUNET_ATS_Session *` with the put
1000 * @param tc scheduler context
1001 */ 999 */
1002static void 1000static void
1003client_put_disconnect (void *cls, 1001client_put_disconnect (void *cls)
1004 const struct GNUNET_SCHEDULER_TaskContext *tc)
1005{ 1002{
1006 struct GNUNET_ATS_Session *s = cls; 1003 struct GNUNET_ATS_Session *s = cls;
1007 1004
@@ -1128,15 +1125,15 @@ client_send_cb (void *stream,
1128 * Wake up a curl handle which was suspended 1125 * Wake up a curl handle which was suspended
1129 * 1126 *
1130 * @param cls the session 1127 * @param cls the session
1131 * @param tc task context
1132 */ 1128 */
1133static void 1129static void
1134client_wake_up (void *cls, 1130client_wake_up (void *cls)
1135 const struct GNUNET_SCHEDULER_TaskContext *tc)
1136{ 1131{
1137 struct GNUNET_ATS_Session *s = cls; 1132 struct GNUNET_ATS_Session *s = cls;
1133 const struct GNUNET_SCHEDULER_TaskContext *tc;
1138 1134
1139 s->recv_wakeup_task = NULL; 1135 s->recv_wakeup_task = NULL;
1136 tc = GNUNET_SCHEDULER_get_task_context ();
1140 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1137 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1141 return; 1138 return;
1142 LOG (GNUNET_ERROR_TYPE_DEBUG, 1139 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1293,11 +1290,9 @@ client_receive (void *stream,
1293 * Task performing curl operations 1290 * Task performing curl operations
1294 * 1291 *
1295 * @param cls plugin as closure 1292 * @param cls plugin as closure
1296 * @param tc scheduler task context
1297 */ 1293 */
1298static void 1294static void
1299client_run (void *cls, 1295client_run (void *cls)
1300 const struct GNUNET_SCHEDULER_TaskContext *tc)
1301{ 1296{
1302 struct HTTP_Client_Plugin *plugin = cls; 1297 struct HTTP_Client_Plugin *plugin = cls;
1303 int running; 1298 int running;
@@ -1306,8 +1301,10 @@ client_run (void *cls,
1306 CURLMsg *msg; 1301 CURLMsg *msg;
1307 int put_request; /* GNUNET_YES if easy handle is put, GNUNET_NO for get */ 1302 int put_request; /* GNUNET_YES if easy handle is put, GNUNET_NO for get */
1308 int msgs_left; 1303 int msgs_left;
1304 const struct GNUNET_SCHEDULER_TaskContext *tc;
1309 1305
1310 plugin->client_perform_task = NULL; 1306 plugin->client_perform_task = NULL;
1307 tc = GNUNET_SCHEDULER_get_task_context ();
1311 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1308 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1312 return; 1309 return;
1313 1310
@@ -1963,11 +1960,9 @@ http_client_plugin_get_network_for_address (void *cls,
1963 * Session was idle, so disconnect it 1960 * Session was idle, so disconnect it
1964 * 1961 *
1965 * @param cls the `struct GNUNET_ATS_Session` of the idle session 1962 * @param cls the `struct GNUNET_ATS_Session` of the idle session
1966 * @param tc scheduler context
1967 */ 1963 */
1968static void 1964static void
1969client_session_timeout (void *cls, 1965client_session_timeout (void *cls)
1970 const struct GNUNET_SCHEDULER_TaskContext *tc)
1971{ 1966{
1972 struct GNUNET_ATS_Session *s = cls; 1967 struct GNUNET_ATS_Session *s = cls;
1973 struct GNUNET_TIME_Relative left; 1968 struct GNUNET_TIME_Relative left;
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index cc1548f20..dfd0294e5 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -491,14 +491,14 @@ notify_session_monitor (struct HTTP_Server_Plugin *plugin,
491 * Wake up an MHD connection which was suspended 491 * Wake up an MHD connection which was suspended
492 * 492 *
493 * @param cls the session 493 * @param cls the session
494 * @param tc task context
495 */ 494 */
496static void 495static void
497server_wake_up (void *cls, 496server_wake_up (void *cls)
498 const struct GNUNET_SCHEDULER_TaskContext *tc)
499{ 497{
500 struct GNUNET_ATS_Session *s = cls; 498 struct GNUNET_ATS_Session *s = cls;
499 const struct GNUNET_SCHEDULER_TaskContext *tc;
501 500
501 tc = GNUNET_SCHEDULER_get_task_context ();
502 s->recv_wakeup_task = NULL; 502 s->recv_wakeup_task = NULL;
503 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 503 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
504 return; 504 return;
@@ -641,11 +641,9 @@ http_server_plugin_disconnect_session (void *cls,
641 * Session was idle, so disconnect it 641 * Session was idle, so disconnect it
642 * 642 *
643 * @param cls the session 643 * @param cls the session
644 * @param tc task context
645 */ 644 */
646static void 645static void
647server_session_timeout (void *cls, 646server_session_timeout (void *cls)
648 const struct GNUNET_SCHEDULER_TaskContext *tc)
649{ 647{
650 struct GNUNET_ATS_Session *s = cls; 648 struct GNUNET_ATS_Session *s = cls;
651 struct GNUNET_TIME_Relative left; 649 struct GNUNET_TIME_Relative left;
@@ -910,15 +908,15 @@ http_server_plugin_get_session (void *cls,
910 * and schedule the next run. 908 * and schedule the next run.
911 * 909 *
912 * @param cls plugin as closure 910 * @param cls plugin as closure
913 * @param tc task context
914 */ 911 */
915static void 912static void
916server_v4_run (void *cls, 913server_v4_run (void *cls)
917 const struct GNUNET_SCHEDULER_TaskContext *tc)
918{ 914{
919 struct HTTP_Server_Plugin *plugin = cls; 915 struct HTTP_Server_Plugin *plugin = cls;
916 const struct GNUNET_SCHEDULER_TaskContext *tc;
920 917
921 plugin->server_v4_task = NULL; 918 plugin->server_v4_task = NULL;
919 tc = GNUNET_SCHEDULER_get_task_context ();
922 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 920 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
923 return; 921 return;
924 plugin->server_v4_immediately = GNUNET_NO; 922 plugin->server_v4_immediately = GNUNET_NO;
@@ -932,15 +930,15 @@ server_v4_run (void *cls,
932 * and schedule the next run. 930 * and schedule the next run.
933 * 931 *
934 * @param cls plugin as closure 932 * @param cls plugin as closure
935 * @param tc task context
936 */ 933 */
937static void 934static void
938server_v6_run (void *cls, 935server_v6_run (void *cls)
939 const struct GNUNET_SCHEDULER_TaskContext *tc)
940{ 936{
941 struct HTTP_Server_Plugin *plugin = cls; 937 struct HTTP_Server_Plugin *plugin = cls;
938 const struct GNUNET_SCHEDULER_TaskContext *tc;
942 939
943 plugin->server_v6_task = NULL; 940 plugin->server_v6_task = NULL;
941 tc = GNUNET_SCHEDULER_get_task_context ();
944 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 942 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
945 return; 943 return;
946 plugin->server_v6_immediately = GNUNET_NO; 944 plugin->server_v6_immediately = GNUNET_NO;
@@ -2844,19 +2842,19 @@ server_check_ipv6_support (struct HTTP_Server_Plugin *plugin)
2844 * Notify server about our external hostname 2842 * Notify server about our external hostname
2845 * 2843 *
2846 * @param cls plugin 2844 * @param cls plugin
2847 * @param tc task context (unused)
2848 */ 2845 */
2849static void 2846static void
2850server_notify_external_hostname (void *cls, 2847server_notify_external_hostname (void *cls)
2851 const struct GNUNET_SCHEDULER_TaskContext *tc)
2852{ 2848{
2853 struct HTTP_Server_Plugin *plugin = cls; 2849 struct HTTP_Server_Plugin *plugin = cls;
2854 struct HttpAddress *ext_addr; 2850 struct HttpAddress *ext_addr;
2855 size_t ext_addr_len; 2851 size_t ext_addr_len;
2856 unsigned int urlen; 2852 unsigned int urlen;
2857 char *url; 2853 char *url;
2854 const struct GNUNET_SCHEDULER_TaskContext *tc;
2858 2855
2859 plugin->notify_ext_task = NULL; 2856 plugin->notify_ext_task = NULL;
2857 tc = GNUNET_SCHEDULER_get_task_context ();
2860 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 2858 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
2861 return; 2859 return;
2862 2860
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 52ab4414f..b1c68acdf 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -957,11 +957,9 @@ tcp_plugin_query_keepalive_factor (void *cls)
957 * Session was idle for too long, so disconnect it 957 * Session was idle for too long, so disconnect it
958 * 958 *
959 * @param cls the `struct GNUNET_ATS_Session` of the idle session 959 * @param cls the `struct GNUNET_ATS_Session` of the idle session
960 * @param tc scheduler context
961 */ 960 */
962static void 961static void
963session_timeout (void *cls, 962session_timeout (void *cls)
964 const struct GNUNET_SCHEDULER_TaskContext *tc)
965{ 963{
966 struct GNUNET_ATS_Session *s = cls; 964 struct GNUNET_ATS_Session *s = cls;
967 struct GNUNET_TIME_Relative left; 965 struct GNUNET_TIME_Relative left;
@@ -1457,11 +1455,9 @@ session_lookup_it (void *cls,
1457 * Task cleaning up a NAT connection attempt after timeout 1455 * Task cleaning up a NAT connection attempt after timeout
1458 * 1456 *
1459 * @param cls the `struct GNUNET_ATS_Session` 1457 * @param cls the `struct GNUNET_ATS_Session`
1460 * @param tc scheduler context (unused)
1461 */ 1458 */
1462static void 1459static void
1463nat_connect_timeout (void *cls, 1460nat_connect_timeout (void *cls)
1464 const struct GNUNET_SCHEDULER_TaskContext *tc)
1465{ 1461{
1466 struct GNUNET_ATS_Session *session = cls; 1462 struct GNUNET_ATS_Session *session = cls;
1467 1463
@@ -1500,11 +1496,9 @@ tcp_plugin_update_session_timeout (void *cls,
1500 * receiving from the TCP client now. 1496 * receiving from the TCP client now.
1501 * 1497 *
1502 * @param cls the `struct GNUNET_ATS_Session *` 1498 * @param cls the `struct GNUNET_ATS_Session *`
1503 * @param tc task context (unused)
1504 */ 1499 */
1505static void 1500static void
1506delayed_done (void *cls, 1501delayed_done (void *cls)
1507 const struct GNUNET_SCHEDULER_TaskContext *tc)
1508{ 1502{
1509 struct GNUNET_ATS_Session *session = cls; 1503 struct GNUNET_ATS_Session *session = cls;
1510 1504
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index ef470ffd1..89feb8f5c 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -728,11 +728,9 @@ udp_plugin_get_network_for_address (void *cls,
728 * Then reschedule this function to be called again once more is available. 728 * Then reschedule this function to be called again once more is available.
729 * 729 *
730 * @param cls the plugin handle 730 * @param cls the plugin handle
731 * @param tc the scheduling context (for rescheduling this function again)
732 */ 731 */
733static void 732static void
734udp_plugin_select_v4 (void *cls, 733udp_plugin_select_v4 (void *cls);
735 const struct GNUNET_SCHEDULER_TaskContext *tc);
736 734
737 735
738/** 736/**
@@ -741,11 +739,9 @@ udp_plugin_select_v4 (void *cls,
741 * Then reschedule this function to be called again once more is available. 739 * Then reschedule this function to be called again once more is available.
742 * 740 *
743 * @param cls the plugin handle 741 * @param cls the plugin handle
744 * @param tc the scheduling context (for rescheduling this function again)
745 */ 742 */
746static void 743static void
747udp_plugin_select_v6 (void *cls, 744udp_plugin_select_v6 (void *cls);
748 const struct GNUNET_SCHEDULER_TaskContext *tc);
749 745
750 746
751/** 747/**
@@ -2566,11 +2562,9 @@ udp_disconnect (void *cls,
2566 * Session was idle, so disconnect it. 2562 * Session was idle, so disconnect it.
2567 * 2563 *
2568 * @param cls the `struct GNUNET_ATS_Session` to time out 2564 * @param cls the `struct GNUNET_ATS_Session` to time out
2569 * @param tc scheduler context
2570 */ 2565 */
2571static void 2566static void
2572session_timeout (void *cls, 2567session_timeout (void *cls)
2573 const struct GNUNET_SCHEDULER_TaskContext *tc)
2574{ 2568{
2575 struct GNUNET_ATS_Session *s = cls; 2569 struct GNUNET_ATS_Session *s = cls;
2576 struct Plugin *plugin = s->plugin; 2570 struct Plugin *plugin = s->plugin;
@@ -3516,14 +3510,14 @@ udp_select_send (struct Plugin *plugin,
3516 * Then reschedule this function to be called again once more is available. 3510 * Then reschedule this function to be called again once more is available.
3517 * 3511 *
3518 * @param cls the plugin handle 3512 * @param cls the plugin handle
3519 * @param tc the scheduling context
3520 */ 3513 */
3521static void 3514static void
3522udp_plugin_select_v4 (void *cls, 3515udp_plugin_select_v4 (void *cls)
3523 const struct GNUNET_SCHEDULER_TaskContext *tc)
3524{ 3516{
3525 struct Plugin *plugin = cls; 3517 struct Plugin *plugin = cls;
3518 const struct GNUNET_SCHEDULER_TaskContext *tc;
3526 3519
3520 tc = GNUNET_SCHEDULER_get_task_context ();
3527 plugin->select_task_v4 = NULL; 3521 plugin->select_task_v4 = NULL;
3528 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 3522 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
3529 return; 3523 return;
@@ -3546,14 +3540,14 @@ udp_plugin_select_v4 (void *cls,
3546 * Then reschedule this function to be called again once more is available. 3540 * Then reschedule this function to be called again once more is available.
3547 * 3541 *
3548 * @param cls the plugin handle 3542 * @param cls the plugin handle
3549 * @param tc the scheduling context
3550 */ 3543 */
3551static void 3544static void
3552udp_plugin_select_v6 (void *cls, 3545udp_plugin_select_v6 (void *cls)
3553 const struct GNUNET_SCHEDULER_TaskContext *tc)
3554{ 3546{
3555 struct Plugin *plugin = cls; 3547 struct Plugin *plugin = cls;
3548 const struct GNUNET_SCHEDULER_TaskContext *tc;
3556 3549
3550 tc = GNUNET_SCHEDULER_get_task_context ();
3557 plugin->select_task_v6 = NULL; 3551 plugin->select_task_v6 = NULL;
3558 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 3552 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
3559 return; 3553 return;
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index b2c9e1515..6c5efd5f1 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -232,8 +232,7 @@ prepare_beacon (struct Plugin *plugin,
232 232
233 233
234static void 234static void
235udp_ipv4_broadcast_send (void *cls, 235udp_ipv4_broadcast_send (void *cls)
236 const struct GNUNET_SCHEDULER_TaskContext *tc)
237{ 236{
238 struct BroadcastAddress *baddr = cls; 237 struct BroadcastAddress *baddr = cls;
239 struct Plugin *plugin = baddr->plugin; 238 struct Plugin *plugin = baddr->plugin;
@@ -308,8 +307,7 @@ udp_ipv4_broadcast_send (void *cls,
308 307
309 308
310static void 309static void
311udp_ipv6_broadcast_send (void *cls, 310udp_ipv6_broadcast_send (void *cls)
312 const struct GNUNET_SCHEDULER_TaskContext *tc)
313{ 311{
314 struct BroadcastAddress *baddr = cls; 312 struct BroadcastAddress *baddr = cls;
315 struct Plugin *plugin = baddr->plugin; 313 struct Plugin *plugin = baddr->plugin;
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 5ad5a0432..e320785d4 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -498,11 +498,9 @@ unix_plugin_session_disconnect (void *cls,
498 * Session was idle for too long, so disconnect it 498 * Session was idle for too long, so disconnect it
499 * 499 *
500 * @param cls the `struct GNUNET_ATS_Session *` to disconnect 500 * @param cls the `struct GNUNET_ATS_Session *` to disconnect
501 * @param tc scheduler context
502 */ 501 */
503static void 502static void
504session_timeout (void *cls, 503session_timeout (void *cls)
505 const struct GNUNET_SCHEDULER_TaskContext *tc)
506{ 504{
507 struct GNUNET_ATS_Session *session = cls; 505 struct GNUNET_ATS_Session *session = cls;
508 struct GNUNET_TIME_Relative left; 506 struct GNUNET_TIME_Relative left;
@@ -1225,14 +1223,14 @@ unix_plugin_do_write (struct Plugin *plugin)
1225 * Then reschedule this function to be called again once more is available. 1223 * Then reschedule this function to be called again once more is available.
1226 * 1224 *
1227 * @param cls the plugin handle 1225 * @param cls the plugin handle
1228 * @param tc the scheduling context
1229 */ 1226 */
1230static void 1227static void
1231unix_plugin_select_read (void *cls, 1228unix_plugin_select_read (void *cls)
1232 const struct GNUNET_SCHEDULER_TaskContext *tc)
1233{ 1229{
1234 struct Plugin *plugin = cls; 1230 struct Plugin *plugin = cls;
1231 const struct GNUNET_SCHEDULER_TaskContext *tc;
1235 1232
1233 tc = GNUNET_SCHEDULER_get_task_context ();
1236 plugin->read_task = NULL; 1234 plugin->read_task = NULL;
1237 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1235 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1238 return; 1236 return;
@@ -1250,14 +1248,14 @@ unix_plugin_select_read (void *cls,
1250 * Then reschedule this function to be called again once more is available. 1248 * Then reschedule this function to be called again once more is available.
1251 * 1249 *
1252 * @param cls the plugin handle 1250 * @param cls the plugin handle
1253 * @param tc the scheduling context
1254 */ 1251 */
1255static void 1252static void
1256unix_plugin_select_write (void *cls, 1253unix_plugin_select_write (void *cls)
1257 const struct GNUNET_SCHEDULER_TaskContext *tc)
1258{ 1254{
1259 struct Plugin *plugin = cls; 1255 struct Plugin *plugin = cls;
1256 const struct GNUNET_SCHEDULER_TaskContext *tc;
1260 1257
1258 tc = GNUNET_SCHEDULER_get_task_context ();
1261 plugin->write_task = NULL; 1259 plugin->write_task = NULL;
1262 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1260 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1263 return; 1261 return;
@@ -1617,11 +1615,9 @@ unix_plugin_string_to_address (void *cls,
1617 * Notify transport service about address 1615 * Notify transport service about address
1618 * 1616 *
1619 * @param cls the plugin 1617 * @param cls the plugin
1620 * @param tc unused
1621 */ 1618 */
1622static void 1619static void
1623address_notification (void *cls, 1620address_notification (void *cls)
1624 const struct GNUNET_SCHEDULER_TaskContext *tc)
1625{ 1621{
1626 struct Plugin *plugin = cls; 1622 struct Plugin *plugin = cls;
1627 struct GNUNET_HELLO_Address *address; 1623 struct GNUNET_HELLO_Address *address;
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c
index 6e23299b9..9c9c1e8c2 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -828,11 +828,9 @@ wlan_plugin_query_keepalive_factor (void *cls)
828 * A session is timing out. Clean up. 828 * A session is timing out. Clean up.
829 * 829 *
830 * @param cls pointer to the Session 830 * @param cls pointer to the Session
831 * @param tc unused
832 */ 831 */
833static void 832static void
834session_timeout (void *cls, 833session_timeout (void *cls)
835 const struct GNUNET_SCHEDULER_TaskContext *tc)
836{ 834{
837 struct GNUNET_ATS_Session *session = cls; 835 struct GNUNET_ATS_Session *session = cls;
838 struct GNUNET_TIME_Relative left; 836 struct GNUNET_TIME_Relative left;
@@ -1072,11 +1070,9 @@ free_fragment_message (struct FragmentMessage *fm)
1072 * A FragmentMessage has timed out. Remove it. 1070 * A FragmentMessage has timed out. Remove it.
1073 * 1071 *
1074 * @param cls pointer to the 'struct FragmentMessage' 1072 * @param cls pointer to the 'struct FragmentMessage'
1075 * @param tc unused
1076 */ 1073 */
1077static void 1074static void
1078fragmentmessage_timeout (void *cls, 1075fragmentmessage_timeout (void *cls)
1079 const struct GNUNET_SCHEDULER_TaskContext *tc)
1080{ 1076{
1081 struct FragmentMessage *fm = cls; 1077 struct FragmentMessage *fm = cls;
1082 1078
@@ -1200,11 +1196,9 @@ free_macendpoint (struct MacEndpoint *endpoint)
1200 * A MAC endpoint is timing out. Clean up. 1196 * A MAC endpoint is timing out. Clean up.
1201 * 1197 *
1202 * @param cls pointer to the `struct MacEndpoint *` 1198 * @param cls pointer to the `struct MacEndpoint *`
1203 * @param tc pointer to the GNUNET_SCHEDULER_TaskContext
1204 */ 1199 */
1205static void 1200static void
1206macendpoint_timeout (void *cls, 1201macendpoint_timeout (void *cls)
1207 const struct GNUNET_SCHEDULER_TaskContext *tc)
1208{ 1202{
1209 struct MacEndpoint *endpoint = cls; 1203 struct MacEndpoint *endpoint = cls;
1210 struct GNUNET_TIME_Relative timeout; 1204 struct GNUNET_TIME_Relative timeout;
@@ -1681,11 +1675,9 @@ process_data (void *cls,
1681 * Task to (periodically) send a HELLO beacon 1675 * Task to (periodically) send a HELLO beacon
1682 * 1676 *
1683 * @param cls pointer to the plugin struct 1677 * @param cls pointer to the plugin struct
1684 * @param tc scheduler context
1685 */ 1678 */
1686static void 1679static void
1687send_hello_beacon (void *cls, 1680send_hello_beacon (void *cls)
1688 const struct GNUNET_SCHEDULER_TaskContext *tc)
1689{ 1681{
1690 struct Plugin *plugin = cls; 1682 struct Plugin *plugin = cls;
1691 uint16_t size; 1683 uint16_t size;
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c
index b906020bb..e75cb7c7f 100644
--- a/src/transport/test_plugin_transport.c
+++ b/src/transport/test_plugin_transport.c
@@ -184,7 +184,7 @@ end ()
184 184
185 185
186static void 186static void
187end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 187end_badly (void *cls)
188{ 188{
189 struct AddressWrapper *w; 189 struct AddressWrapper *w;
190 int c = 0; 190 int c = 0;
@@ -255,7 +255,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
255} 255}
256 256
257static void 257static void
258wait_end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 258wait_end (void *cls)
259{ 259{
260 timeout_wait = NULL; 260 timeout_wait = NULL;
261 if (0 == addresses_reported) 261 if (0 == addresses_reported)
@@ -325,8 +325,7 @@ address_pretty_printer_cb (void *cls, const char *address, int res)
325 325
326 326
327static void 327static void
328test_addr_string (void *cls, 328test_addr_string (void *cls)
329 const struct GNUNET_SCHEDULER_TaskContext *tc)
330{ 329{
331 struct AddressWrapper *w = cls; 330 struct AddressWrapper *w = cls;
332 void *s2a; 331 void *s2a;
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index ad1ecbe7a..3889aa0ef 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -354,7 +354,7 @@ sendtask ()
354 354
355 355
356static void 356static void
357measure (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 357measure (void *cls)
358{ 358{
359 static int counter; 359 static int counter;
360 360
diff --git a/src/transport/test_transport_address_switch.c b/src/transport/test_transport_address_switch.c
index 2780767ff..6c86a160f 100644
--- a/src/transport/test_transport_address_switch.c
+++ b/src/transport/test_transport_address_switch.c
@@ -564,8 +564,7 @@ sendtask ()
564 564
565 565
566static void 566static void
567progress_indicator (void *cls, 567progress_indicator (void *cls)
568 const struct GNUNET_SCHEDULER_TaskContext *tc)
569{ 568{
570 static int counter; 569 static int counter;
571 570
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c
index 2ebd80a0c..13333b371 100644
--- a/src/transport/test_transport_api.c
+++ b/src/transport/test_transport_api.c
@@ -96,8 +96,9 @@ end ()
96 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2); 96 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
97} 97}
98 98
99
99static void 100static void
100end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 101end_badly (void *cls)
101{ 102{
102 die_task = NULL; 103 die_task = NULL;
103 104
@@ -225,10 +226,12 @@ notify_ready (void *cls, size_t size, void *buf)
225 226
226 227
227static void 228static void
228sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 229sendtask (void *cls)
229{ 230{
230 send_task = NULL; 231 const struct GNUNET_SCHEDULER_TaskContext *tc;
231 232
233 send_task = NULL;
234 tc = GNUNET_SCHEDULER_get_task_context ();
232 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 235 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
233 return; 236 return;
234 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 237 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_bidirectional_connect.c b/src/transport/test_transport_api_bidirectional_connect.c
index 30de6b7ba..1e00e982d 100644
--- a/src/transport/test_transport_api_bidirectional_connect.c
+++ b/src/transport/test_transport_api_bidirectional_connect.c
@@ -95,7 +95,7 @@ end ()
95 95
96 96
97static void 97static void
98end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 98end_badly (void *cls)
99{ 99{
100 die_task = NULL; 100 die_task = NULL;
101 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 101 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
@@ -208,10 +208,12 @@ notify_ready (void *cls, size_t size, void *buf)
208 208
209 209
210static void 210static void
211sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 211sendtask (void *cls)
212{ 212{
213 send_task = NULL; 213 const struct GNUNET_SCHEDULER_TaskContext *tc;
214 214
215 send_task = NULL;
216 tc = GNUNET_SCHEDULER_get_task_context ();
215 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 217 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
216 return; 218 return;
217 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 219 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_blacklisting.c b/src/transport/test_transport_api_blacklisting.c
index 275567131..f65fb74f9 100644
--- a/src/transport/test_transport_api_blacklisting.c
+++ b/src/transport/test_transport_api_blacklisting.c
@@ -76,7 +76,7 @@ static struct GNUNET_SCHEDULER_Task * shutdown_task;
76 76
77 77
78static void 78static void
79end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 79end (void *cls)
80{ 80{
81 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping\n"); 81 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping\n");
82 82
@@ -136,8 +136,9 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
136 } 136 }
137} 137}
138 138
139
139static void 140static void
140end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 141end_badly (void *cls)
141{ 142{
142 if (send_task != NULL) 143 if (send_task != NULL)
143 { 144 {
@@ -259,10 +260,12 @@ notify_ready (void *cls, size_t size, void *buf)
259 260
260 261
261static void 262static void
262sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 263sendtask (void *cls)
263{ 264{
264 send_task = NULL; 265 const struct GNUNET_SCHEDULER_TaskContext *tc;
265 266
267 send_task = NULL;
268 tc = GNUNET_SCHEDULER_get_task_context ();
266 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 269 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
267 return; 270 return;
268 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 271 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_disconnect.c b/src/transport/test_transport_api_disconnect.c
index c6b247c1d..36497ece5 100644
--- a/src/transport/test_transport_api_disconnect.c
+++ b/src/transport/test_transport_api_disconnect.c
@@ -107,8 +107,9 @@ end ()
107 ok = 0; 107 ok = 0;
108} 108}
109 109
110
110static void 111static void
111end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 112end_badly (void *cls)
112{ 113{
113 die_task = NULL; 114 die_task = NULL;
114 115
@@ -162,8 +163,11 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
162 163
163 164
164static void 165static void
165stop_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 166stop_peer (void *cls)
166{ 167{
168 const struct GNUNET_SCHEDULER_TaskContext *tc;
169
170 tc = GNUNET_SCHEDULER_get_task_context ();
167 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 171 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
168 return; 172 return;
169 173
@@ -248,10 +252,12 @@ notify_ready (void *cls, size_t size, void *buf)
248 252
249 253
250static void 254static void
251sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 255sendtask (void *cls)
252{ 256{
253 send_task = NULL; 257 const struct GNUNET_SCHEDULER_TaskContext *tc;
254 258
259 send_task = NULL;
260 tc = GNUNET_SCHEDULER_get_task_context ();
255 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 261 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
256 return; 262 return;
257 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 263 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_limited_sockets.c b/src/transport/test_transport_api_limited_sockets.c
index 284f5b9cc..8d875ed52 100644
--- a/src/transport/test_transport_api_limited_sockets.c
+++ b/src/transport/test_transport_api_limited_sockets.c
@@ -102,7 +102,7 @@ end ()
102} 102}
103 103
104static void 104static void
105end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 105end_badly (void *cls)
106{ 106{
107 die_task = NULL; 107 die_task = NULL;
108 108
@@ -194,11 +194,14 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
194 th = NULL; 194 th = NULL;
195} 195}
196 196
197
197static void 198static void
198sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 199sendtask (void *cls)
199{ 200{
200 send_task = NULL; 201 const struct GNUNET_SCHEDULER_TaskContext *tc;
201 202
203 send_task = NULL;
204 tc = GNUNET_SCHEDULER_get_task_context ();
202 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 205 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
203 return; 206 return;
204 207
@@ -354,4 +357,3 @@ main (int argc, char *argv[])
354#endif 357#endif
355 358
356/* end of test_transport_api_limited_sockets.c */ 359/* end of test_transport_api_limited_sockets.c */
357
diff --git a/src/transport/test_transport_api_manipulation_cfg.c b/src/transport/test_transport_api_manipulation_cfg.c
index 89d5fe4d9..915b79719 100644
--- a/src/transport/test_transport_api_manipulation_cfg.c
+++ b/src/transport/test_transport_api_manipulation_cfg.c
@@ -109,7 +109,7 @@ end ()
109 109
110 110
111static void 111static void
112end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 112end_badly (void *cls)
113{ 113{
114 die_task = NULL; 114 die_task = NULL;
115 115
@@ -204,11 +204,12 @@ notify_request_ready (void *cls, size_t size, void *buf)
204 204
205 205
206static void 206static void
207sendtask_request_task (void *cls, 207sendtask_request_task (void *cls)
208 const struct GNUNET_SCHEDULER_TaskContext *tc)
209{ 208{
210 send_task = NULL; 209 const struct GNUNET_SCHEDULER_TaskContext *tc;
211 210
211 send_task = NULL;
212 tc = GNUNET_SCHEDULER_get_task_context ();
212 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 213 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
213 return; 214 return;
214 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p2->id)); 215 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p2->id));
@@ -269,11 +270,12 @@ notify_response_ready (void *cls, size_t size, void *buf)
269 270
270 271
271static void 272static void
272sendtask_response_task (void *cls, 273sendtask_response_task (void *cls)
273 const struct GNUNET_SCHEDULER_TaskContext *tc)
274{ 274{
275 send_task = NULL; 275 const struct GNUNET_SCHEDULER_TaskContext *tc;
276 276
277 send_task = NULL;
278 tc = GNUNET_SCHEDULER_get_task_context ();
277 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 279 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
278 return; 280 return;
279 { 281 {
diff --git a/src/transport/test_transport_api_manipulation_recv_tcp.c b/src/transport/test_transport_api_manipulation_recv_tcp.c
index f48abfc7c..7b82236f9 100644
--- a/src/transport/test_transport_api_manipulation_recv_tcp.c
+++ b/src/transport/test_transport_api_manipulation_recv_tcp.c
@@ -104,8 +104,9 @@ end ()
104 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2); 104 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
105} 105}
106 106
107
107static void 108static void
108end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 109end_badly (void *cls)
109{ 110{
110 die_task = NULL; 111 die_task = NULL;
111 112
@@ -158,7 +159,8 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
158 159
159 160
160static void 161static void
161sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 162sendtask (void *cls);
163
162 164
163static void 165static void
164notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, 166notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
@@ -288,11 +290,12 @@ notify_ready (void *cls, size_t size, void *buf)
288 290
289 291
290static void 292static void
291sendtask (void *cls, 293sendtask (void *cls)
292 const struct GNUNET_SCHEDULER_TaskContext *tc)
293{ 294{
294 send_task = NULL; 295 const struct GNUNET_SCHEDULER_TaskContext *tc;
295 296
297 send_task = NULL;
298 tc = GNUNET_SCHEDULER_get_task_context ();
296 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 299 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
297 return; 300 return;
298 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 301 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_manipulation_send_tcp.c b/src/transport/test_transport_api_manipulation_send_tcp.c
index c2eaf7a50..22b420c27 100644
--- a/src/transport/test_transport_api_manipulation_send_tcp.c
+++ b/src/transport/test_transport_api_manipulation_send_tcp.c
@@ -107,7 +107,7 @@ end ()
107 107
108 108
109static void 109static void
110end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 110end_badly (void *cls)
111{ 111{
112 die_task = NULL; 112 die_task = NULL;
113 113
@@ -160,7 +160,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
160 160
161 161
162static void 162static void
163sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 163sendtask (void *cls);
164 164
165 165
166static void 166static void
@@ -284,13 +284,14 @@ notify_ready (void *cls, size_t size, void *buf)
284 284
285 285
286static void 286static void
287sendtask (void *cls, 287sendtask (void *cls)
288 const struct GNUNET_SCHEDULER_TaskContext *tc)
289{ 288{
290 struct GNUNET_TIME_Relative delay; 289 struct GNUNET_TIME_Relative delay;
291 struct GNUNET_ATS_Properties prop; 290 struct GNUNET_ATS_Properties prop;
291 const struct GNUNET_SCHEDULER_TaskContext *tc;
292 292
293 send_task = NULL; 293 send_task = NULL;
294 tc = GNUNET_SCHEDULER_get_task_context ();
294 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 295 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
295 return; 296 return;
296 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 297 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_monitor_peers.c b/src/transport/test_transport_api_monitor_peers.c
index 152667a0b..79b39325c 100644
--- a/src/transport/test_transport_api_monitor_peers.c
+++ b/src/transport/test_transport_api_monitor_peers.c
@@ -129,8 +129,7 @@ end ()
129 129
130 130
131static void 131static void
132end_badly (void *cls, 132end_badly (void *cls)
133 const struct GNUNET_SCHEDULER_TaskContext *tc)
134{ 133{
135 die_task = NULL; 134 die_task = NULL;
136 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fail! Stopping peers\n"); 135 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fail! Stopping peers\n");
@@ -261,10 +260,12 @@ notify_ready (void *cls, size_t size, void *buf)
261 260
262 261
263static void 262static void
264sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 263sendtask (void *cls)
265{ 264{
266 send_task = NULL; 265 const struct GNUNET_SCHEDULER_TaskContext *tc;
267 266
267 send_task = NULL;
268 tc = GNUNET_SCHEDULER_get_task_context ();
268 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 269 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
269 return; 270 return;
270 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 271 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_monitor_validation.c b/src/transport/test_transport_api_monitor_validation.c
index 907b9275f..37b8494f1 100644
--- a/src/transport/test_transport_api_monitor_validation.c
+++ b/src/transport/test_transport_api_monitor_validation.c
@@ -122,7 +122,7 @@ end ()
122} 122}
123 123
124static void 124static void
125end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 125end_badly (void *cls)
126{ 126{
127 die_task = NULL; 127 die_task = NULL;
128 128
@@ -273,10 +273,12 @@ notify_ready (void *cls,
273 273
274 274
275static void 275static void
276sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 276sendtask (void *cls)
277{ 277{
278 send_task = NULL; 278 const struct GNUNET_SCHEDULER_TaskContext *tc;
279 279
280 send_task = NULL;
281 tc = GNUNET_SCHEDULER_get_task_context ();
280 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 282 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
281 return; 283 return;
282 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 284 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c
index 86f294240..cc2115a48 100644
--- a/src/transport/test_transport_api_reliability.c
+++ b/src/transport/test_transport_api_reliability.c
@@ -526,8 +526,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
526 526
527 527
528static void 528static void
529sendtask (void *cls, 529sendtask (void *cls)
530 const struct GNUNET_SCHEDULER_TaskContext *tc)
531{ 530{
532 start_time = GNUNET_TIME_absolute_get (); 531 start_time = GNUNET_TIME_absolute_get ();
533 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 532 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/transport/test_transport_api_restart_1peer.c b/src/transport/test_transport_api_restart_1peer.c
index f51b70e92..adec15f4f 100644
--- a/src/transport/test_transport_api_restart_1peer.c
+++ b/src/transport/test_transport_api_restart_1peer.c
@@ -112,8 +112,7 @@ end ()
112 112
113 113
114static void 114static void
115end_badly (void *cls, 115end_badly (void *cls)
116 const struct GNUNET_SCHEDULER_TaskContext *tc)
117{ 116{
118 die_task = NULL; 117 die_task = NULL;
119 118
@@ -259,10 +258,12 @@ notify_ready (void *cls, size_t size, void *buf)
259 258
260 259
261static void 260static void
262sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 261sendtask (void *cls)
263{ 262{
264 send_task = NULL; 263 const struct GNUNET_SCHEDULER_TaskContext *tc;
265 264
265 send_task = NULL;
266 tc = GNUNET_SCHEDULER_get_task_context ();
266 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 267 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
267 return; 268 return;
268 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 269 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_restart_2peers.c b/src/transport/test_transport_api_restart_2peers.c
index 985148d54..2a669c9a0 100644
--- a/src/transport/test_transport_api_restart_2peers.c
+++ b/src/transport/test_transport_api_restart_2peers.c
@@ -105,8 +105,7 @@ end ()
105 105
106 106
107static void 107static void
108end_badly (void *cls, 108end_badly (void *cls)
109 const struct GNUNET_SCHEDULER_TaskContext *tc)
110{ 109{
111 die_task = NULL; 110 die_task = NULL;
112 111
@@ -265,11 +264,12 @@ notify_ready (void *cls,
265 264
266 265
267static void 266static void
268sendtask (void *cls, 267sendtask (void *cls)
269 const struct GNUNET_SCHEDULER_TaskContext *tc)
270{ 268{
271 send_task = NULL; 269 const struct GNUNET_SCHEDULER_TaskContext *tc;
272 270
271 send_task = NULL;
272 tc = GNUNET_SCHEDULER_get_task_context ();
273 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 273 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
274 return; 274 return;
275 275
diff --git a/src/transport/test_transport_api_timeout.c b/src/transport/test_transport_api_timeout.c
index 256ce46a8..aa9884a2e 100644
--- a/src/transport/test_transport_api_timeout.c
+++ b/src/transport/test_transport_api_timeout.c
@@ -120,8 +120,9 @@ end ()
120 GNUNET_TRANSPORT_TESTING_done (tth); 120 GNUNET_TRANSPORT_TESTING_done (tth);
121} 121}
122 122
123
123static void 124static void
124end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 125end_badly (void *cls)
125{ 126{
126 die_task = NULL; 127 die_task = NULL;
127 128
@@ -181,12 +182,13 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
181 182
182 183
183static void 184static void
184timer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 185timer (void *cls)
185{ 186{
186 static int percentage; 187 static int percentage;
188 const struct GNUNET_SCHEDULER_TaskContext *tc;
187 189
188 timer_task = NULL; 190 timer_task = NULL;
189 191 tc = GNUNET_SCHEDULER_get_task_context ();
190 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 192 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
191 return; 193 return;
192 194
diff --git a/src/transport/test_transport_blacklisting.c b/src/transport/test_transport_blacklisting.c
index 8ac198cfe..6cb598f2f 100644
--- a/src/transport/test_transport_blacklisting.c
+++ b/src/transport/test_transport_blacklisting.c
@@ -85,11 +85,13 @@ static struct GNUNET_SCHEDULER_Task * stage_task;
85#define OKPP do { ok++; } while (0) 85#define OKPP do { ok++; } while (0)
86#endif 86#endif
87 87
88
88static void 89static void
89run_stage(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 90run_stage(void *cls);
91
90 92
91static void 93static void
92end(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 94end (void *cls)
93{ 95{
94 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping\n"); 96 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping\n");
95 97
@@ -129,8 +131,9 @@ end(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
129 } 131 }
130} 132}
131 133
134
132static void 135static void
133end_badly(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 136end_badly (void *cls)
134{ 137{
135 die_task = NULL; 138 die_task = NULL;
136 139
@@ -172,17 +175,20 @@ testing_connect_cb(struct PeerContext *p1, struct PeerContext *p2, void *cls)
172 stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL ); 175 stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL );
173} 176}
174 177
178
175static void 179static void
176connect_timeout(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 180connect_timeout(void *cls)
177{ 181{
178 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Peers not connected, next stage\n"); 182 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Peers not connected, next stage\n");
179 timeout_task = NULL; 183 timeout_task = NULL;
180 stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL ); 184 stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL);
181} 185}
182 186
187
183static int started; 188static int started;
184 189
185void 190
191static void
186start_cb(struct PeerContext *p, void *cls) 192start_cb(struct PeerContext *p, void *cls)
187{ 193{
188 194
@@ -243,8 +249,9 @@ static int check_blacklist_config (char *cfg_file,
243 return GNUNET_OK; 249 return GNUNET_OK;
244} 250}
245 251
252
246static void 253static void
247run_stage(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 254run_stage (void *cls)
248{ 255{
249 stage_task = NULL; 256 stage_task = NULL;
250 if (NULL != die_task) 257 if (NULL != die_task)
diff --git a/src/transport/test_transport_startonly.c b/src/transport/test_transport_startonly.c
index b23a516f5..d49e3a8c0 100644
--- a/src/transport/test_transport_startonly.c
+++ b/src/transport/test_transport_startonly.c
@@ -63,9 +63,13 @@ end ()
63 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting\n"); 63 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting\n");
64} 64}
65 65
66
66static void 67static void
67end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 68end_badly (void *cls)
68{ 69{
70 const struct GNUNET_SCHEDULER_TaskContext *tc;
71
72 tc = GNUNET_SCHEDULER_get_task_context ();
69 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 73 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
70 74
71 timeout_task = NULL; 75 timeout_task = NULL;
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c
index 7538e2d6a..652a4e08f 100644
--- a/src/transport/transport-testing.c
+++ b/src/transport/transport-testing.c
@@ -195,11 +195,9 @@ get_hello (void *cb_cls,
195 * Offer the current HELLO of P2 to P1. 195 * Offer the current HELLO of P2 to P1.
196 * 196 *
197 * @param cls our `struct GNUNET_TRANSPORT_TESTING_ConnectRequest ` 197 * @param cls our `struct GNUNET_TRANSPORT_TESTING_ConnectRequest `
198 * @param tc scheduler context
199 */ 198 */
200static void 199static void
201offer_hello (void *cls, 200offer_hello (void *cls);
202 const struct GNUNET_SCHEDULER_TaskContext *tc);
203 201
204 202
205/** 203/**
@@ -207,8 +205,7 @@ offer_hello (void *cls,
207 * transport service. 205 * transport service.
208 */ 206 */
209static void 207static void
210hello_offered (void *cls, 208hello_offered (void *cls)
211 const struct GNUNET_SCHEDULER_TaskContext *tc)
212{ 209{
213 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls; 210 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls;
214 211
@@ -224,17 +221,17 @@ hello_offered (void *cls,
224 * Offer the current HELLO of P2 to P1. 221 * Offer the current HELLO of P2 to P1.
225 * 222 *
226 * @param cls our `struct GNUNET_TRANSPORT_TESTING_ConnectRequest ` 223 * @param cls our `struct GNUNET_TRANSPORT_TESTING_ConnectRequest `
227 * @param tc scheduler context
228 */ 224 */
229static void 225static void
230offer_hello (void *cls, 226offer_hello (void *cls)
231 const struct GNUNET_SCHEDULER_TaskContext *tc)
232{ 227{
233 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls; 228 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls;
234 struct PeerContext *p1 = cc->p1; 229 struct PeerContext *p1 = cc->p1;
235 struct PeerContext *p2 = cc->p2; 230 struct PeerContext *p2 = cc->p2;
231 const struct GNUNET_SCHEDULER_TaskContext *tc;
236 232
237 cc->tct = NULL; 233 cc->tct = NULL;
234 tc = GNUNET_SCHEDULER_get_task_context ();
238 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 235 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
239 return; 236 return;
240 { 237 {
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index b5f9e0a6b..6fc538f25 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -401,11 +401,9 @@ disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h);
401 * A neighbour has not gotten a SEND_OK in a while. Print a warning. 401 * A neighbour has not gotten a SEND_OK in a while. Print a warning.
402 * 402 *
403 * @param cls the `struct Neighbour` 403 * @param cls the `struct Neighbour`
404 * @param tc scheduler context
405 */ 404 */
406static void 405static void
407do_warn_unready (void *cls, 406do_warn_unready (void *cls)
408 const struct GNUNET_SCHEDULER_TaskContext *tc)
409{ 407{
410 struct Neighbour *n = cls; 408 struct Neighbour *n = cls;
411 struct GNUNET_TIME_Relative delay; 409 struct GNUNET_TIME_Relative delay;
@@ -830,11 +828,9 @@ demultiplexer (void *cls,
830 * network congestion. Notify the initiator and clean up. 828 * network congestion. Notify the initiator and clean up.
831 * 829 *
832 * @param cls the `struct GNUNET_TRANSPORT_TransmitHandle` 830 * @param cls the `struct GNUNET_TRANSPORT_TransmitHandle`
833 * @param tc scheduler context
834 */ 831 */
835static void 832static void
836timeout_request_due_to_congestion (void *cls, 833timeout_request_due_to_congestion (void *cls)
837 const struct GNUNET_SCHEDULER_TaskContext *tc)
838{ 834{
839 struct GNUNET_TRANSPORT_TransmitHandle *th = cls; 835 struct GNUNET_TRANSPORT_TransmitHandle *th = cls;
840 struct Neighbour *n = th->neighbour; 836 struct Neighbour *n = th->neighbour;
@@ -1015,11 +1011,9 @@ transport_notify_ready (void *cls,
1015 * list or the peer message queues to the service. 1011 * list or the peer message queues to the service.
1016 * 1012 *
1017 * @param cls transport service to schedule a transmission for 1013 * @param cls transport service to schedule a transmission for
1018 * @param tc scheduler context
1019 */ 1014 */
1020static void 1015static void
1021schedule_transmission_task (void *cls, 1016schedule_transmission_task (void *cls)
1022 const struct GNUNET_SCHEDULER_TaskContext *tc)
1023{ 1017{
1024 struct GNUNET_TRANSPORT_Handle *h = cls; 1018 struct GNUNET_TRANSPORT_Handle *h = cls;
1025 size_t size; 1019 size_t size;
@@ -1197,15 +1191,15 @@ send_start (void *cls,
1197 * Try again to connect to transport service. 1191 * Try again to connect to transport service.
1198 * 1192 *
1199 * @param cls the handle to the transport service 1193 * @param cls the handle to the transport service
1200 * @param tc scheduler context
1201 */ 1194 */
1202static void 1195static void
1203reconnect (void *cls, 1196reconnect (void *cls)
1204 const struct GNUNET_SCHEDULER_TaskContext *tc)
1205{ 1197{
1206 struct GNUNET_TRANSPORT_Handle *h = cls; 1198 struct GNUNET_TRANSPORT_Handle *h = cls;
1199 const struct GNUNET_SCHEDULER_TaskContext *tc;
1207 1200
1208 h->reconnect_task = NULL; 1201 h->reconnect_task = NULL;
1202 tc = GNUNET_SCHEDULER_get_task_context ();
1209 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1203 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1210 { 1204 {
1211 /* shutdown, just give up */ 1205 /* shutdown, just give up */
@@ -1315,19 +1309,14 @@ send_hello (void *cls,
1315 struct GNUNET_TRANSPORT_OfferHelloHandle *ohh = cls; 1309 struct GNUNET_TRANSPORT_OfferHelloHandle *ohh = cls;
1316 struct GNUNET_MessageHeader *msg = ohh->msg; 1310 struct GNUNET_MessageHeader *msg = ohh->msg;
1317 uint16_t ssize; 1311 uint16_t ssize;
1318 struct GNUNET_SCHEDULER_TaskContext tc;
1319 1312
1320 tc.read_ready = NULL;
1321 tc.write_ready = NULL;
1322 tc.reason = GNUNET_SCHEDULER_REASON_TIMEOUT;
1323 if (NULL == buf) 1313 if (NULL == buf)
1324 { 1314 {
1325 LOG (GNUNET_ERROR_TYPE_DEBUG, 1315 LOG (GNUNET_ERROR_TYPE_DEBUG,
1326 "Timeout while trying to transmit `%s' request.\n", 1316 "Timeout while trying to transmit `%s' request.\n",
1327 "HELLO"); 1317 "HELLO");
1328 if (NULL != ohh->cont) 1318 if (NULL != ohh->cont)
1329 ohh->cont (ohh->cls, 1319 ohh->cont (ohh->cls);
1330 &tc);
1331 GNUNET_free (msg); 1320 GNUNET_free (msg);
1332 GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head, 1321 GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head,
1333 ohh->th->oh_tail, 1322 ohh->th->oh_tail,
@@ -1344,10 +1333,8 @@ send_hello (void *cls,
1344 msg, 1333 msg,
1345 ssize); 1334 ssize);
1346 GNUNET_free (msg); 1335 GNUNET_free (msg);
1347 tc.reason = GNUNET_SCHEDULER_REASON_READ_READY;
1348 if (NULL != ohh->cont) 1336 if (NULL != ohh->cont)
1349 ohh->cont (ohh->cls, 1337 ohh->cont (ohh->cls);
1350 &tc);
1351 GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head, 1338 GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head,
1352 ohh->th->oh_tail, 1339 ohh->th->oh_tail,
1353 ohh); 1340 ohh);
@@ -1529,11 +1516,9 @@ GNUNET_TRANSPORT_check_peer_connected (struct GNUNET_TRANSPORT_Handle *handle,
1529 * Task to call the HelloUpdateCallback of the GetHelloHandle 1516 * Task to call the HelloUpdateCallback of the GetHelloHandle
1530 * 1517 *
1531 * @param cls the `struct GNUNET_TRANSPORT_GetHelloHandle` 1518 * @param cls the `struct GNUNET_TRANSPORT_GetHelloHandle`
1532 * @param tc the scheduler task context
1533 */ 1519 */
1534static void 1520static void
1535call_hello_update_cb_async (void *cls, 1521call_hello_update_cb_async (void *cls)
1536 const struct GNUNET_SCHEDULER_TaskContext *tc)
1537{ 1522{
1538 struct GNUNET_TRANSPORT_GetHelloHandle *ghh = cls; 1523 struct GNUNET_TRANSPORT_GetHelloHandle *ghh = cls;
1539 1524
diff --git a/src/transport/transport_api_monitor_peers.c b/src/transport/transport_api_monitor_peers.c
index 109461090..5d19ad6d7 100644
--- a/src/transport/transport_api_monitor_peers.c
+++ b/src/transport/transport_api_monitor_peers.c
@@ -204,11 +204,9 @@ send_peer_mon_request (struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx)
204 * Task run to re-establish the connection. 204 * Task run to re-establish the connection.
205 * 205 *
206 * @param cls our `struct GNUNET_TRANSPORT_PeerMonitoringContext *` 206 * @param cls our `struct GNUNET_TRANSPORT_PeerMonitoringContext *`
207 * @param tc scheduler context, unused
208 */ 207 */
209static void 208static void
210do_peer_connect (void *cls, 209do_peer_connect (void *cls)
211 const struct GNUNET_SCHEDULER_TaskContext *tc)
212{ 210{
213 struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx = cls; 211 struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx = cls;
214 212
diff --git a/src/transport/transport_api_monitor_plugins.c b/src/transport/transport_api_monitor_plugins.c
index 9a7b3e44f..eef4a0830 100644
--- a/src/transport/transport_api_monitor_plugins.c
+++ b/src/transport/transport_api_monitor_plugins.c
@@ -133,11 +133,9 @@ send_plugin_mon_request (struct GNUNET_TRANSPORT_PluginMonitor *pm)
133 * Task run to re-establish the connection. 133 * Task run to re-establish the connection.
134 * 134 *
135 * @param cls our `struct GNUNET_TRANSPORT_PluginMonitor *` 135 * @param cls our `struct GNUNET_TRANSPORT_PluginMonitor *`
136 * @param tc scheduler context, unused
137 */ 136 */
138static void 137static void
139do_plugin_connect (void *cls, 138do_plugin_connect (void *cls)
140 const struct GNUNET_SCHEDULER_TaskContext *tc)
141{ 139{
142 struct GNUNET_TRANSPORT_PluginMonitor *pm = cls; 140 struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
143 141
diff --git a/src/transport/transport_api_monitor_validation.c b/src/transport/transport_api_monitor_validation.c
index 04463c86a..fa76645dd 100644
--- a/src/transport/transport_api_monitor_validation.c
+++ b/src/transport/transport_api_monitor_validation.c
@@ -154,11 +154,9 @@ send_val_mon_request (struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_c
154 * Task run to re-establish the connection. 154 * Task run to re-establish the connection.
155 * 155 *
156 * @param cls our `struct GNUNET_TRANSPORT_ValidationMonitoringContext *` 156 * @param cls our `struct GNUNET_TRANSPORT_ValidationMonitoringContext *`
157 * @param tc scheduler context, unused
158 */ 157 */
159static void 158static void
160do_val_connect (void *cls, 159do_val_connect (void *cls)
161 const struct GNUNET_SCHEDULER_TaskContext *tc)
162{ 160{
163 struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx = cls; 161 struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx = cls;
164 162
@@ -293,7 +291,7 @@ val_response_processor (void *cls,
293 } 291 }
294 addr = (const char *) &vr_msg[1]; 292 addr = (const char *) &vr_msg[1];
295 transport_name = &addr[alen]; 293 transport_name = &addr[alen];
296 294
297 if (transport_name[tlen - 1] != '\0') 295 if (transport_name[tlen - 1] != '\0')
298 { 296 {
299 /* Corrupt plugin name */ 297 /* Corrupt plugin name */
@@ -314,7 +312,7 @@ val_response_processor (void *cls,
314 } 312 }
315 return; 313 return;
316 } 314 }
317 315
318 /* notify client */ 316 /* notify client */
319 address = GNUNET_HELLO_address_allocate (&vr_msg->peer, 317 address = GNUNET_HELLO_address_allocate (&vr_msg->peer,
320 transport_name, 318 transport_name,
diff --git a/src/util/bandwidth.c b/src/util/bandwidth.c
index 5fbb608e7..2df2a9449 100644
--- a/src/util/bandwidth.c
+++ b/src/util/bandwidth.c
@@ -142,11 +142,9 @@ GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps,
142 * Task run whenever we hit the bandwidth limit for a tracker. 142 * Task run whenever we hit the bandwidth limit for a tracker.
143 * 143 *
144 * @param cls the `struct GNUNET_BANDWIDTH_Tracker` 144 * @param cls the `struct GNUNET_BANDWIDTH_Tracker`
145 * @param tc scheduler context
146 */ 145 */
147static void 146static void
148excess_trigger (void *cls, 147excess_trigger (void *cls)
149 const struct GNUNET_SCHEDULER_TaskContext *tc)
150{ 148{
151 struct GNUNET_BANDWIDTH_Tracker *av = cls; 149 struct GNUNET_BANDWIDTH_Tracker *av = cls;
152 150
diff --git a/src/util/client.c b/src/util/client.c
index d87be74f6..f93fd1d10 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -579,11 +579,9 @@ receive_helper (void *cls,
579 * Continuation to call the receive callback. 579 * Continuation to call the receive callback.
580 * 580 *
581 * @param cls our handle to the client connection 581 * @param cls our handle to the client connection
582 * @param tc scheduler context
583 */ 582 */
584static void 583static void
585receive_task (void *cls, 584receive_task (void *cls)
586 const struct GNUNET_SCHEDULER_TaskContext *tc)
587{ 585{
588 struct GNUNET_CLIENT_Connection *client = cls; 586 struct GNUNET_CLIENT_Connection *client = cls;
589 GNUNET_CLIENT_MessageHandler handler = client->receiver_handler; 587 GNUNET_CLIENT_MessageHandler handler = client->receiver_handler;
@@ -746,11 +744,9 @@ GNUNET_CLIENT_service_test_cancel (struct GNUNET_CLIENT_TestHandle *th)
746 * and then cleans up. 744 * and then cleans up.
747 * 745 *
748 * @param cls the `struct GNUNET_CLIENT_TestHandle` 746 * @param cls the `struct GNUNET_CLIENT_TestHandle`
749 * @param tc scheduler context
750 */ 747 */
751static void 748static void
752report_result (void *cls, 749report_result (void *cls)
753 const struct GNUNET_SCHEDULER_TaskContext *tc)
754{ 750{
755 struct GNUNET_CLIENT_TestHandle *th = cls; 751 struct GNUNET_CLIENT_TestHandle *th = cls;
756 752
@@ -1080,16 +1076,16 @@ client_notify (void *cls, size_t size, void *buf);
1080 * service after a while. 1076 * service after a while.
1081 * 1077 *
1082 * @param cls our `struct GNUNET_CLIENT_TransmitHandle` of the request 1078 * @param cls our `struct GNUNET_CLIENT_TransmitHandle` of the request
1083 * @param tc unused
1084 */ 1079 */
1085static void 1080static void
1086client_delayed_retry (void *cls, 1081client_delayed_retry (void *cls)
1087 const struct GNUNET_SCHEDULER_TaskContext *tc)
1088{ 1082{
1089 struct GNUNET_CLIENT_TransmitHandle *th = cls; 1083 struct GNUNET_CLIENT_TransmitHandle *th = cls;
1084 const struct GNUNET_SCHEDULER_TaskContext *tc;
1090 struct GNUNET_TIME_Relative delay; 1085 struct GNUNET_TIME_Relative delay;
1091 1086
1092 th->reconnect_task = NULL; 1087 th->reconnect_task = NULL;
1088 tc = GNUNET_SCHEDULER_get_task_context ();
1093 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1089 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1094 { 1090 {
1095 /* give up, was shutdown */ 1091 /* give up, was shutdown */
@@ -1153,11 +1149,14 @@ client_notify (void *cls,
1153 struct GNUNET_CLIENT_Connection *client = th->client; 1149 struct GNUNET_CLIENT_Connection *client = th->client;
1154 size_t ret; 1150 size_t ret;
1155 struct GNUNET_TIME_Relative delay; 1151 struct GNUNET_TIME_Relative delay;
1152 const struct GNUNET_SCHEDULER_TaskContext *tc;
1153
1156 1154
1157 LOG (GNUNET_ERROR_TYPE_DEBUG, 1155 LOG (GNUNET_ERROR_TYPE_DEBUG,
1158 "client_notify is running\n"); 1156 "client_notify is running\n");
1159 th->th = NULL; 1157 th->th = NULL;
1160 client->th = NULL; 1158 client->th = NULL;
1159 tc = GNUNET_SCHEDULER_get_task_context ();
1161 if (NULL == buf) 1160 if (NULL == buf)
1162 { 1161 {
1163 delay = GNUNET_TIME_absolute_get_remaining (th->timeout); 1162 delay = GNUNET_TIME_absolute_get_remaining (th->timeout);
@@ -1165,7 +1164,7 @@ client_notify (void *cls,
1165 if ( (GNUNET_YES != th->auto_retry) || 1164 if ( (GNUNET_YES != th->auto_retry) ||
1166 (0 == --th->attempts_left) || 1165 (0 == --th->attempts_left) ||
1167 (delay.rel_value_us < 1)|| 1166 (delay.rel_value_us < 1)||
1168 (0 != (GNUNET_SCHEDULER_get_reason() & GNUNET_SCHEDULER_REASON_SHUTDOWN))) 1167 (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)))
1169 { 1168 {
1170 LOG (GNUNET_ERROR_TYPE_DEBUG, 1169 LOG (GNUNET_ERROR_TYPE_DEBUG,
1171 "Transmission failed %u times, giving up.\n", 1170 "Transmission failed %u times, giving up.\n",
diff --git a/src/util/client_manager.c b/src/util/client_manager.c
index 12c37b23f..f334bb5b6 100644
--- a/src/util/client_manager.c
+++ b/src/util/client_manager.c
@@ -240,7 +240,7 @@ transmit_next (struct GNUNET_CLIENT_MANAGER_Connection *mgr);
240 240
241 241
242static void 242static void
243schedule_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 243schedule_disconnect (void *cls)
244{ 244{
245 struct GNUNET_CLIENT_MANAGER_Connection *mgr = cls; 245 struct GNUNET_CLIENT_MANAGER_Connection *mgr = cls;
246 GNUNET_CLIENT_MANAGER_disconnect (mgr, GNUNET_NO, 246 GNUNET_CLIENT_MANAGER_disconnect (mgr, GNUNET_NO,
@@ -341,11 +341,9 @@ transmit_next (struct GNUNET_CLIENT_MANAGER_Connection *mgr)
341 * 341 *
342 * @param cls 342 * @param cls
343 * Channel handle. 343 * Channel handle.
344 * @param tc
345 * Scheduler context.
346 */ 344 */
347static void 345static void
348schedule_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 346schedule_reconnect (void *cls)
349{ 347{
350 struct GNUNET_CLIENT_MANAGER_Connection *mgr = cls; 348 struct GNUNET_CLIENT_MANAGER_Connection *mgr = cls;
351 mgr->reconnect_task = NULL; 349 mgr->reconnect_task = NULL;
diff --git a/src/util/connection.c b/src/util/connection.c
index 5aa277546..b3ea3b5af 100644
--- a/src/util/connection.c
+++ b/src/util/connection.c
@@ -606,10 +606,9 @@ connect_fail_continuation (struct GNUNET_CONNECTION_Handle *connection)
606 * We are ready to transmit (or got a timeout). 606 * We are ready to transmit (or got a timeout).
607 * 607 *
608 * @param cls our connection handle 608 * @param cls our connection handle
609 * @param tc task context describing why we are here
610 */ 609 */
611static void 610static void
612transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 611transmit_ready (void *cls);
613 612
614 613
615/** 614/**
@@ -617,10 +616,9 @@ transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
617 * to read. 616 * to read.
618 * 617 *
619 * @param cls connection to read from 618 * @param cls connection to read from
620 * @param tc scheduler context
621 */ 619 */
622static void 620static void
623receive_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 621receive_ready (void *cls);
624 622
625 623
626/** 624/**
@@ -668,15 +666,14 @@ connect_success_continuation (struct GNUNET_CONNECTION_Handle *connection)
668 * Scheduler let us know that we're either ready to write on the 666 * Scheduler let us know that we're either ready to write on the
669 * socket OR connect timed out. Do the right thing. 667 * socket OR connect timed out. Do the right thing.
670 * 668 *
671 * @param cls the "struct AddressProbe*" with the address that we are probing 669 * @param cls the `struct AddressProbe *` with the address that we are probing
672 * @param tc success or failure info about the connect attempt.
673 */ 670 */
674static void 671static void
675connect_probe_continuation (void *cls, 672connect_probe_continuation (void *cls)
676 const struct GNUNET_SCHEDULER_TaskContext *tc)
677{ 673{
678 struct AddressProbe *ap = cls; 674 struct AddressProbe *ap = cls;
679 struct GNUNET_CONNECTION_Handle *connection = ap->connection; 675 struct GNUNET_CONNECTION_Handle *connection = ap->connection;
676 const struct GNUNET_SCHEDULER_TaskContext *tc;
680 struct AddressProbe *pos; 677 struct AddressProbe *pos;
681 int error; 678 int error;
682 socklen_t len; 679 socklen_t len;
@@ -686,6 +683,7 @@ connect_probe_continuation (void *cls,
686 len = sizeof (error); 683 len = sizeof (error);
687 errno = 0; 684 errno = 0;
688 error = 0; 685 error = 0;
686 tc = GNUNET_SCHEDULER_get_task_context ();
689 if ((0 == (tc->reason & GNUNET_SCHEDULER_REASON_WRITE_READY)) || 687 if ((0 == (tc->reason & GNUNET_SCHEDULER_REASON_WRITE_READY)) ||
690 (GNUNET_OK != 688 (GNUNET_OK !=
691 GNUNET_NETWORK_socket_getsockopt (ap->sock, SOL_SOCKET, SO_ERROR, &error, 689 GNUNET_NETWORK_socket_getsockopt (ap->sock, SOL_SOCKET, SO_ERROR, &error,
@@ -1095,18 +1093,18 @@ GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *connection)
1095 * or have data ready to read. 1093 * or have data ready to read.
1096 * 1094 *
1097 * @param cls connection to read from 1095 * @param cls connection to read from
1098 * @param tc scheduler context
1099 */ 1096 */
1100static void 1097static void
1101receive_ready (void *cls, 1098receive_ready (void *cls)
1102 const struct GNUNET_SCHEDULER_TaskContext *tc)
1103{ 1099{
1104 struct GNUNET_CONNECTION_Handle *connection = cls; 1100 struct GNUNET_CONNECTION_Handle *connection = cls;
1101 const struct GNUNET_SCHEDULER_TaskContext *tc;
1105 char buffer[connection->max]; 1102 char buffer[connection->max];
1106 ssize_t ret; 1103 ssize_t ret;
1107 GNUNET_CONNECTION_Receiver receiver; 1104 GNUNET_CONNECTION_Receiver receiver;
1108 1105
1109 connection->read_task = NULL; 1106 connection->read_task = NULL;
1107 tc = GNUNET_SCHEDULER_get_task_context ();
1110 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1108 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1111 { 1109 {
1112 /* ignore shutdown request, go again immediately */ 1110 /* ignore shutdown request, go again immediately */
@@ -1296,11 +1294,9 @@ process_notify (struct GNUNET_CONNECTION_Handle *connection)
1296 * This task notifies the client about the timeout. 1294 * This task notifies the client about the timeout.
1297 * 1295 *
1298 * @param cls the `struct GNUNET_CONNECTION_Handle` 1296 * @param cls the `struct GNUNET_CONNECTION_Handle`
1299 * @param tc scheduler context
1300 */ 1297 */
1301static void 1298static void
1302transmit_timeout (void *cls, 1299transmit_timeout (void *cls)
1303 const struct GNUNET_SCHEDULER_TaskContext *tc)
1304{ 1300{
1305 struct GNUNET_CONNECTION_Handle *connection = cls; 1301 struct GNUNET_CONNECTION_Handle *connection = cls;
1306 GNUNET_CONNECTION_TransmitReadyNotify notify; 1302 GNUNET_CONNECTION_TransmitReadyNotify notify;
@@ -1327,11 +1323,9 @@ transmit_timeout (void *cls,
1327 * This task notifies the client about the error. 1323 * This task notifies the client about the error.
1328 * 1324 *
1329 * @param cls the `struct GNUNET_CONNECTION_Handle` 1325 * @param cls the `struct GNUNET_CONNECTION_Handle`
1330 * @param tc scheduler context
1331 */ 1326 */
1332static void 1327static void
1333connect_error (void *cls, 1328connect_error (void *cls)
1334 const struct GNUNET_SCHEDULER_TaskContext *tc)
1335{ 1329{
1336 struct GNUNET_CONNECTION_Handle *connection = cls; 1330 struct GNUNET_CONNECTION_Handle *connection = cls;
1337 GNUNET_CONNECTION_TransmitReadyNotify notify; 1331 GNUNET_CONNECTION_TransmitReadyNotify notify;
@@ -1353,14 +1347,13 @@ connect_error (void *cls,
1353 * We are ready to transmit (or got a timeout). 1347 * We are ready to transmit (or got a timeout).
1354 * 1348 *
1355 * @param cls our connection handle 1349 * @param cls our connection handle
1356 * @param tc task context describing why we are here
1357 */ 1350 */
1358static void 1351static void
1359transmit_ready (void *cls, 1352transmit_ready (void *cls)
1360 const struct GNUNET_SCHEDULER_TaskContext *tc)
1361{ 1353{
1362 struct GNUNET_CONNECTION_Handle *connection = cls; 1354 struct GNUNET_CONNECTION_Handle *connection = cls;
1363 GNUNET_CONNECTION_TransmitReadyNotify notify; 1355 GNUNET_CONNECTION_TransmitReadyNotify notify;
1356 const struct GNUNET_SCHEDULER_TaskContext *tc;
1364 ssize_t ret; 1357 ssize_t ret;
1365 size_t have; 1358 size_t have;
1366 1359
@@ -1370,6 +1363,7 @@ transmit_ready (void *cls,
1370 GNUNET_assert (NULL != connection->write_task); 1363 GNUNET_assert (NULL != connection->write_task);
1371 connection->write_task = NULL; 1364 connection->write_task = NULL;
1372 GNUNET_assert (NULL == connection->nth.timeout_task); 1365 GNUNET_assert (NULL == connection->nth.timeout_task);
1366 tc = GNUNET_SCHEDULER_get_task_context ();
1373 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1367 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1374 { 1368 {
1375 if (NULL != connection->sock) 1369 if (NULL != connection->sock)
diff --git a/src/util/crypto_hash_file.c b/src/util/crypto_hash_file.c
index 8bb03561b..f2d49d164 100644
--- a/src/util/crypto_hash_file.c
+++ b/src/util/crypto_hash_file.c
@@ -117,10 +117,9 @@ file_hash_finish (struct GNUNET_CRYPTO_FileHashContext *fhc,
117 * File hashing task. 117 * File hashing task.
118 * 118 *
119 * @param cls closure 119 * @param cls closure
120 * @param tc context
121 */ 120 */
122static void 121static void
123file_hash_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 122file_hash_task (void *cls)
124{ 123{
125 struct GNUNET_CRYPTO_FileHashContext *fhc = cls; 124 struct GNUNET_CRYPTO_FileHashContext *fhc = cls;
126 struct GNUNET_HashCode *res; 125 struct GNUNET_HashCode *res;
diff --git a/src/util/disk_iterator.c b/src/util/disk_iterator.c
index 925d4c6fd..2315f2861 100644
--- a/src/util/disk_iterator.c
+++ b/src/util/disk_iterator.c
@@ -77,8 +77,7 @@ struct GNUNET_DISK_DirectoryIterator
77 * Task used by the directory iterator. 77 * Task used by the directory iterator.
78 */ 78 */
79static void 79static void
80directory_iterator_task (void *cls, 80directory_iterator_task (void *cls)
81 const struct GNUNET_SCHEDULER_TaskContext *tc)
82{ 81{
83 struct GNUNET_DISK_DirectoryIterator *iter = cls; 82 struct GNUNET_DISK_DirectoryIterator *iter = cls;
84 char *name; 83 char *name;
diff --git a/src/util/gnunet-scrypt.c b/src/util/gnunet-scrypt.c
index 434574ef0..7449d8042 100644
--- a/src/util/gnunet-scrypt.c
+++ b/src/util/gnunet-scrypt.c
@@ -110,8 +110,7 @@ count_leading_zeroes (const struct GNUNET_HashCode *hash)
110 * @param tc task context 110 * @param tc task context
111 */ 111 */
112static void 112static void
113find_proof (void *cls, 113find_proof (void *cls)
114 const struct GNUNET_SCHEDULER_TaskContext *tc)
115{ 114{
116 #define ROUND_SIZE 10 115 #define ROUND_SIZE 10
117 uint64_t counter; 116 uint64_t counter;
@@ -121,7 +120,9 @@ find_proof (void *cls,
121 unsigned int i; 120 unsigned int i;
122 struct GNUNET_TIME_Absolute timestamp; 121 struct GNUNET_TIME_Absolute timestamp;
123 struct GNUNET_TIME_Relative elapsed; 122 struct GNUNET_TIME_Relative elapsed;
123 const struct GNUNET_SCHEDULER_TaskContext *tc;
124 124
125 tc = GNUNET_SCHEDULER_get_task_context ();
125 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 126 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
126 { 127 {
127 write_proof (); 128 write_proof ();
diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c
index ada67e310..75e70d2b7 100644
--- a/src/util/gnunet-uri.c
+++ b/src/util/gnunet-uri.c
@@ -47,10 +47,9 @@ static struct GNUNET_DISK_PipeHandle *sigpipe;
47 * process died) or when user presses CTRL-C. 47 * process died) or when user presses CTRL-C.
48 * 48 *
49 * @param cls closure, NULL 49 * @param cls closure, NULL
50 * @param tc scheduler context
51 */ 50 */
52static void 51static void
53maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 52maint_child_death (void *cls)
54{ 53{
55 enum GNUNET_OS_ProcessStatusType type; 54 enum GNUNET_OS_ProcessStatusType type;
56 if ( (GNUNET_OK != 55 if ( (GNUNET_OK !=
diff --git a/src/util/helper.c b/src/util/helper.c
index f0123460b..3ed1c7276 100644
--- a/src/util/helper.c
+++ b/src/util/helper.c
@@ -138,7 +138,7 @@ struct GNUNET_HELPER_Handle
138 * NULL-terminated list of command-line arguments. 138 * NULL-terminated list of command-line arguments.
139 */ 139 */
140 char **binary_argv; 140 char **binary_argv;
141 141
142 /** 142 /**
143 * Task to read from the helper. 143 * Task to read from the helper.
144 */ 144 */
@@ -305,28 +305,26 @@ stop_helper (struct GNUNET_HELPER_Handle *h,
305 * Restart the helper process. 305 * Restart the helper process.
306 * 306 *
307 * @param cls handle to the helper process 307 * @param cls handle to the helper process
308 * @param tc scheduler context
309 */ 308 */
310static void 309static void
311restart_task (void *cls, 310restart_task (void *cls);
312 const struct GNUNET_SCHEDULER_TaskContext *tc);
313 311
314 312
315/** 313/**
316 * Read from the helper-process 314 * Read from the helper-process
317 * 315 *
318 * @param cls handle to the helper process 316 * @param cls handle to the helper process
319 * @param tc scheduler context
320 */ 317 */
321static void 318static void
322helper_read (void *cls, 319helper_read (void *cls)
323 const struct GNUNET_SCHEDULER_TaskContext *tc)
324{ 320{
325 struct GNUNET_HELPER_Handle *h = cls; 321 struct GNUNET_HELPER_Handle *h = cls;
322 const struct GNUNET_SCHEDULER_TaskContext *tc;
326 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE] GNUNET_ALIGN; 323 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE] GNUNET_ALIGN;
327 ssize_t t; 324 ssize_t t;
328 325
329 h->read_task = NULL; 326 h->read_task = NULL;
327 tc = GNUNET_SCHEDULER_get_task_context ();
330 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 328 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
331 { 329 {
332 /* try again */ 330 /* try again */
@@ -458,17 +456,15 @@ start_helper (struct GNUNET_HELPER_Handle *h)
458 * Restart the helper process. 456 * Restart the helper process.
459 * 457 *
460 * @param cls handle to the helper process 458 * @param cls handle to the helper process
461 * @param tc scheduler context
462 */ 459 */
463static void 460static void
464restart_task (void *cls, 461restart_task (void *cls)
465 const struct GNUNET_SCHEDULER_TaskContext *tc)
466{ 462{
467 struct GNUNET_HELPER_Handle*h = cls; 463 struct GNUNET_HELPER_Handle*h = cls;
468 464
469 h->restart_task = NULL; 465 h->restart_task = NULL;
470 h->retry_back_off++; 466 h->retry_back_off++;
471 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 467 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
472 "Restarting helper with back-off %u\n", 468 "Restarting helper with back-off %u\n",
473 h->retry_back_off); 469 h->retry_back_off);
474 start_helper (h); 470 start_helper (h);
@@ -582,18 +578,18 @@ GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h,
582 * Write to the helper-process 578 * Write to the helper-process
583 * 579 *
584 * @param cls handle to the helper process 580 * @param cls handle to the helper process
585 * @param tc scheduler context
586 */ 581 */
587static void 582static void
588helper_write (void *cls, 583helper_write (void *cls)
589 const struct GNUNET_SCHEDULER_TaskContext *tc)
590{ 584{
591 struct GNUNET_HELPER_Handle *h = cls; 585 struct GNUNET_HELPER_Handle *h = cls;
586 const struct GNUNET_SCHEDULER_TaskContext *tc;
592 struct GNUNET_HELPER_SendHandle *sh; 587 struct GNUNET_HELPER_SendHandle *sh;
593 const char *buf; 588 const char *buf;
594 ssize_t t; 589 ssize_t t;
595 590
596 h->write_task = NULL; 591 h->write_task = NULL;
592 tc = GNUNET_SCHEDULER_get_task_context ();
597 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 593 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
598 { 594 {
599 /* try again */ 595 /* try again */
diff --git a/src/util/mq.c b/src/util/mq.c
index f5ebe33a5..aff9f465c 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -297,15 +297,15 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq,
297 * results in undefined behavior if not used carefully. 297 * results in undefined behavior if not used carefully.
298 * 298 *
299 * @param cls message queue to send the next message with 299 * @param cls message queue to send the next message with
300 * @param tc scheduler context
301 */ 300 */
302static void 301static void
303impl_send_continue (void *cls, 302impl_send_continue (void *cls)
304 const struct GNUNET_SCHEDULER_TaskContext *tc)
305{ 303{
306 struct GNUNET_MQ_Handle *mq = cls; 304 struct GNUNET_MQ_Handle *mq = cls;
305 const struct GNUNET_SCHEDULER_TaskContext *tc;
307 struct GNUNET_MQ_Envelope *current_envelope; 306 struct GNUNET_MQ_Envelope *current_envelope;
308 307
308 tc = GNUNET_SCHEDULER_get_task_context ();
309 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 309 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
310 return; 310 return;
311 311
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index 52e2f6d0e..8dfec6c5e 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -70,18 +70,19 @@ static struct GNUNET_OS_Process current_process;
70 * This handler is called when there are control data to be read on the pipe 70 * This handler is called when there are control data to be read on the pipe
71 * 71 *
72 * @param cls the 'struct GNUNET_DISK_FileHandle' of the control pipe 72 * @param cls the 'struct GNUNET_DISK_FileHandle' of the control pipe
73 * @param tc scheduler context
74 */ 73 */
75static void 74static void
76parent_control_handler (void *cls, 75parent_control_handler (void *cls)
77 const struct GNUNET_SCHEDULER_TaskContext *tc)
78{ 76{
79 struct GNUNET_DISK_FileHandle *control_pipe = cls; 77 struct GNUNET_DISK_FileHandle *control_pipe = cls;
78 const struct GNUNET_SCHEDULER_TaskContext *tc;
80 char sig; 79 char sig;
81 char *pipe_fd; 80 char *pipe_fd;
82 ssize_t ret; 81 ssize_t ret;
83 82
84 LOG (GNUNET_ERROR_TYPE_DEBUG, "`%s' invoked because of %d\n", __FUNCTION__, 83 tc = GNUNET_SCHEDULER_get_task_context ();
84 LOG (GNUNET_ERROR_TYPE_DEBUG,
85 "`%s' invoked because of %d\n", __FUNCTION__,
85 tc->reason); 86 tc->reason);
86 if (0 != (tc->reason & 87 if (0 != (tc->reason &
87 (GNUNET_SCHEDULER_REASON_SHUTDOWN | GNUNET_SCHEDULER_REASON_TIMEOUT))) 88 (GNUNET_SCHEDULER_REASON_SHUTDOWN | GNUNET_SCHEDULER_REASON_TIMEOUT)))
@@ -118,12 +119,9 @@ parent_control_handler (void *cls,
118 * variable) and raise those signals. 119 * variable) and raise those signals.
119 * 120 *
120 * @param cls closure (unused) 121 * @param cls closure (unused)
121 * @param tc scheduler context (unused)
122 */ 122 */
123void 123void
124GNUNET_OS_install_parent_control_handler (void *cls, 124GNUNET_OS_install_parent_control_handler (void *cls)
125 const struct
126 GNUNET_SCHEDULER_TaskContext *tc)
127{ 125{
128 const char *env_buf; 126 const char *env_buf;
129 char *env_buf_end; 127 char *env_buf_end;
@@ -1751,18 +1749,19 @@ GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd)
1751/** 1749/**
1752 * Read from the process and call the line processor. 1750 * Read from the process and call the line processor.
1753 * 1751 *
1754 * @param cls the 'struct GNUNET_OS_CommandHandle' 1752 * @param cls the `struct GNUNET_OS_CommandHandle *`
1755 * @param tc scheduler context
1756 */ 1753 */
1757static void 1754static void
1758cmd_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1755cmd_read (void *cls)
1759{ 1756{
1760 struct GNUNET_OS_CommandHandle *cmd = cls; 1757 struct GNUNET_OS_CommandHandle *cmd = cls;
1758 const struct GNUNET_SCHEDULER_TaskContext *tc;
1761 GNUNET_OS_LineProcessor proc; 1759 GNUNET_OS_LineProcessor proc;
1762 char *end; 1760 char *end;
1763 ssize_t ret; 1761 ssize_t ret;
1764 1762
1765 cmd->rtask = NULL; 1763 cmd->rtask = NULL;
1764 tc = GNUNET_SCHEDULER_get_task_context ();
1766 if (GNUNET_YES != GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, cmd->r)) 1765 if (GNUNET_YES != GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, cmd->r))
1767 { 1766 {
1768 /* timeout, shutdown, etc. */ 1767 /* timeout, shutdown, etc. */
diff --git a/src/util/program.c b/src/util/program.c
index 7023552f6..69dd455cd 100644
--- a/src/util/program.c
+++ b/src/util/program.c
@@ -73,10 +73,12 @@ struct CommandContext
73 * program. Runs the program-specific main task. 73 * program. Runs the program-specific main task.
74 */ 74 */
75static void 75static void
76program_main (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 76program_main (void *cls)
77{ 77{
78 struct CommandContext *cc = cls; 78 struct CommandContext *cc = cls;
79 const struct GNUNET_SCHEDULER_TaskContext *tc;
79 80
81 tc = GNUNET_SCHEDULER_get_task_context ();
80 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 82 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
81 return; 83 return;
82 GNUNET_SPEEDUP_start_(cc->cfg); 84 GNUNET_SPEEDUP_start_(cc->cfg);
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c
index 81ec01af4..e7a836f03 100644
--- a/src/util/resolver_api.c
+++ b/src/util/resolver_api.c
@@ -532,11 +532,9 @@ handle_response (void *cls,
532 * numeric addresses. 532 * numeric addresses.
533 * 533 *
534 * @param cls `struct GNUNET_RESOLVER_RequestHandle` for the request 534 * @param cls `struct GNUNET_RESOLVER_RequestHandle` for the request
535 * @param tc unused scheduler context
536 */ 535 */
537static void 536static void
538numeric_resolution (void *cls, 537numeric_resolution (void *cls)
539 const struct GNUNET_SCHEDULER_TaskContext *tc)
540{ 538{
541 struct GNUNET_RESOLVER_RequestHandle *rh = cls; 539 struct GNUNET_RESOLVER_RequestHandle *rh = cls;
542 struct sockaddr_in v4; 540 struct sockaddr_in v4;
@@ -600,11 +598,9 @@ numeric_resolution (void *cls,
600 * respective loopback numeric addresses. 598 * respective loopback numeric addresses.
601 * 599 *
602 * @param cls `struct GNUNET_RESOLVER_RequestHandle` for the request 600 * @param cls `struct GNUNET_RESOLVER_RequestHandle` for the request
603 * @param tc unused scheduler context
604 */ 601 */
605static void 602static void
606loopback_resolution (void *cls, 603loopback_resolution (void *cls)
607 const struct GNUNET_SCHEDULER_TaskContext *tc)
608{ 604{
609 struct GNUNET_RESOLVER_RequestHandle *rh = cls; 605 struct GNUNET_RESOLVER_RequestHandle *rh = cls;
610 struct sockaddr_in v4; 606 struct sockaddr_in v4;
@@ -658,8 +654,7 @@ loopback_resolution (void *cls,
658 * Task executed on system shutdown. 654 * Task executed on system shutdown.
659 */ 655 */
660static void 656static void
661shutdown_task (void *cls, 657shutdown_task (void *cls)
662 const struct GNUNET_SCHEDULER_TaskContext *tc)
663{ 658{
664 s_task = NULL; 659 s_task = NULL;
665 GNUNET_RESOLVER_disconnect (); 660 GNUNET_RESOLVER_disconnect ();
@@ -728,15 +723,16 @@ process_requests ()
728 * Now try to reconnect to the resolver service. 723 * Now try to reconnect to the resolver service.
729 * 724 *
730 * @param cls NULL 725 * @param cls NULL
731 * @param tc scheduler context
732 */ 726 */
733static void 727static void
734reconnect_task (void *cls, 728reconnect_task (void *cls)
735 const struct GNUNET_SCHEDULER_TaskContext *tc)
736{ 729{
730 const struct GNUNET_SCHEDULER_TaskContext *tc;
731
737 r_task = NULL; 732 r_task = NULL;
738 if (NULL == req_head) 733 if (NULL == req_head)
739 return; /* no work pending */ 734 return; /* no work pending */
735 tc = GNUNET_SCHEDULER_get_task_context ();
740 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 736 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
741 return; 737 return;
742 LOG (GNUNET_ERROR_TYPE_DEBUG, 738 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -802,11 +798,9 @@ reconnect ()
802 * A DNS resolution timed out. Notify the application. 798 * A DNS resolution timed out. Notify the application.
803 * 799 *
804 * @param cls the `struct GNUNET_RESOLVER_RequestHandle *` 800 * @param cls the `struct GNUNET_RESOLVER_RequestHandle *`
805 * @param tc scheduler context
806 */ 801 */
807static void 802static void
808handle_lookup_timeout (void *cls, 803handle_lookup_timeout (void *cls)
809 const struct GNUNET_SCHEDULER_TaskContext *tc)
810{ 804{
811 struct GNUNET_RESOLVER_RequestHandle *rh = cls; 805 struct GNUNET_RESOLVER_RequestHandle *rh = cls;
812 806
@@ -902,11 +896,9 @@ GNUNET_RESOLVER_ip_get (const char *hostname,
902 * conversion and invoke the callback. 896 * conversion and invoke the callback.
903 * 897 *
904 * @param cls `struct GNUNET_RESOLVER_RequestHandle` for the request 898 * @param cls `struct GNUNET_RESOLVER_RequestHandle` for the request
905 * @param tc unused scheduler context
906 */ 899 */
907static void 900static void
908numeric_reverse (void *cls, 901numeric_reverse (void *cls)
909 const struct GNUNET_SCHEDULER_TaskContext *tc)
910{ 902{
911 struct GNUNET_RESOLVER_RequestHandle *rh = cls; 903 struct GNUNET_RESOLVER_RequestHandle *rh = cls;
912 char *result; 904 char *result;
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 6405ea336..dcf5aeeaa 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -256,6 +256,11 @@ static int current_lifeness;
256static GNUNET_SCHEDULER_select scheduler_select; 256static GNUNET_SCHEDULER_select scheduler_select;
257 257
258/** 258/**
259 * Task context of the current task.
260 */
261static struct GNUNET_SCHEDULER_TaskContext tc;
262
263/**
259 * Closure for #scheduler_select. 264 * Closure for #scheduler_select.
260 */ 265 */
261static void *scheduler_select_cls; 266static void *scheduler_select_cls;
@@ -533,7 +538,6 @@ run_ready (struct GNUNET_NETWORK_FDSet *rs,
533{ 538{
534 enum GNUNET_SCHEDULER_Priority p; 539 enum GNUNET_SCHEDULER_Priority p;
535 struct GNUNET_SCHEDULER_Task *pos; 540 struct GNUNET_SCHEDULER_Task *pos;
536 struct GNUNET_SCHEDULER_TaskContext tc;
537 541
538 max_priority_added = GNUNET_SCHEDULER_PRIORITY_KEEP; 542 max_priority_added = GNUNET_SCHEDULER_PRIORITY_KEEP;
539 do 543 do
@@ -584,7 +588,7 @@ run_ready (struct GNUNET_NETWORK_FDSet *rs,
584 LOG (GNUNET_ERROR_TYPE_DEBUG, 588 LOG (GNUNET_ERROR_TYPE_DEBUG,
585 "Running task: %p\n", 589 "Running task: %p\n",
586 pos); 590 pos);
587 pos->callback (pos->callback_cls, &tc); 591 pos->callback (pos->callback_cls);
588#if EXECINFO 592#if EXECINFO
589 unsigned int i; 593 unsigned int i;
590 594
@@ -902,17 +906,16 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_TaskCallback task,
902 906
903 907
904/** 908/**
905 * Obtain the reason code for why the current task was 909 * Obtain the task context, giving the reason why the current task was
906 * started. Will return the same value as 910 * started.
907 * the `struct GNUNET_SCHEDULER_TaskContext`'s reason field.
908 * 911 *
909 * @return reason(s) why the current task is run 912 * @return current tasks' scheduler context
910 */ 913 */
911enum GNUNET_SCHEDULER_Reason 914const struct GNUNET_SCHEDULER_TaskContext *
912GNUNET_SCHEDULER_get_reason () 915GNUNET_SCHEDULER_get_task_context ()
913{ 916{
914 GNUNET_assert (NULL != active_task); 917 GNUNET_assert (NULL != active_task);
915 return active_task->reason; 918 return &tc;
916} 919}
917 920
918 921
diff --git a/src/util/server.c b/src/util/server.c
index 0433feb58..8dedd28fd 100644
--- a/src/util/server.c
+++ b/src/util/server.c
@@ -389,17 +389,17 @@ GNUNET_SERVER_client_set_user_context_ (struct GNUNET_SERVER_Client *client,
389 * 389 *
390 * @param cls handle to our server for which we are processing the listen 390 * @param cls handle to our server for which we are processing the listen
391 * socket 391 * socket
392 * @param tc reason why we are running right now
393 */ 392 */
394static void 393static void
395process_listen_socket (void *cls, 394process_listen_socket (void *cls)
396 const struct GNUNET_SCHEDULER_TaskContext *tc)
397{ 395{
398 struct GNUNET_SERVER_Handle *server = cls; 396 struct GNUNET_SERVER_Handle *server = cls;
397 const struct GNUNET_SCHEDULER_TaskContext *tc;
399 struct GNUNET_CONNECTION_Handle *sock; 398 struct GNUNET_CONNECTION_Handle *sock;
400 unsigned int i; 399 unsigned int i;
401 400
402 server->listen_task = NULL; 401 server->listen_task = NULL;
402 tc = GNUNET_SCHEDULER_get_task_context ();
403 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 403 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
404 { 404 {
405 /* ignore shutdown, someone else will take care of it! */ 405 /* ignore shutdown, someone else will take care of it! */
@@ -655,12 +655,10 @@ GNUNET_SERVER_client_mark_monitor (struct GNUNET_SERVER_Client *client)
655 * Helper function for #test_monitor_clients() to trigger 655 * Helper function for #test_monitor_clients() to trigger
656 * #GNUNET_SERVER_destroy() after the stack has unwound. 656 * #GNUNET_SERVER_destroy() after the stack has unwound.
657 * 657 *
658 * @param cls the 'struct GNUNET_SERVER_Handle' to destroy 658 * @param cls the `struct GNUNET_SERVER_Handle *` to destroy
659 * @param tc unused
660 */ 659 */
661static void 660static void
662do_destroy (void *cls, 661do_destroy (void *cls)
663 const struct GNUNET_SCHEDULER_TaskContext *tc)
664{ 662{
665 struct GNUNET_SERVER_Handle *server = cls; 663 struct GNUNET_SERVER_Handle *server = cls;
666 664
@@ -887,18 +885,18 @@ GNUNET_SERVER_set_callbacks (struct GNUNET_SERVER_Handle *server,
887 * Task run to warn about missing calls to #GNUNET_SERVER_receive_done. 885 * Task run to warn about missing calls to #GNUNET_SERVER_receive_done.
888 * 886 *
889 * @param cls our `struct GNUNET_SERVER_Client *` to process more requests from 887 * @param cls our `struct GNUNET_SERVER_Client *` to process more requests from
890 * @param tc scheduler context (unused)
891 */ 888 */
892static void 889static void
893warn_no_receive_done (void *cls, 890warn_no_receive_done (void *cls)
894 const struct GNUNET_SCHEDULER_TaskContext *tc)
895{ 891{
896 struct GNUNET_SERVER_Client *client = cls; 892 struct GNUNET_SERVER_Client *client = cls;
893 const struct GNUNET_SCHEDULER_TaskContext *tc;
897 894
898 GNUNET_break (0 != client->warn_type); /* type should never be 0 here, as we don't use 0 */ 895 GNUNET_break (0 != client->warn_type); /* type should never be 0 here, as we don't use 0 */
899 client->warn_task = 896 client->warn_task =
900 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, 897 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES,
901 &warn_no_receive_done, client); 898 &warn_no_receive_done, client);
899 tc = GNUNET_SCHEDULER_get_task_context ();
902 if (0 == (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 900 if (0 == (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
903 LOG (GNUNET_ERROR_TYPE_WARNING, 901 LOG (GNUNET_ERROR_TYPE_WARNING,
904 _("Processing code for message of type %u did not call `GNUNET_SERVER_receive_done' after %s\n"), 902 _("Processing code for message of type %u did not call `GNUNET_SERVER_receive_done' after %s\n"),
@@ -1199,11 +1197,9 @@ process_incoming (void *cls,
1199 * and process requests. 1197 * and process requests.
1200 * 1198 *
1201 * @param cls our `struct GNUNET_SERVER_Client *` to process more requests from 1199 * @param cls our `struct GNUNET_SERVER_Client *` to process more requests from
1202 * @param tc scheduler context (unused)
1203 */ 1200 */
1204static void 1201static void
1205restart_processing (void *cls, 1202restart_processing (void *cls)
1206 const struct GNUNET_SCHEDULER_TaskContext *tc)
1207{ 1203{
1208 struct GNUNET_SERVER_Client *client = cls; 1204 struct GNUNET_SERVER_Client *client = cls;
1209 1205
@@ -1497,11 +1493,9 @@ GNUNET_SERVER_connect_notify_cancel (struct GNUNET_SERVER_Handle *server,
1497 * 'connection.c' is not allowed (see #2329). 1493 * 'connection.c' is not allowed (see #2329).
1498 * 1494 *
1499 * @param cls connection to destroy 1495 * @param cls connection to destroy
1500 * @param tc scheduler context (unused)
1501 */ 1496 */
1502static void 1497static void
1503destroy_connection (void *cls, 1498destroy_connection (void *cls)
1504 const struct GNUNET_SCHEDULER_TaskContext *tc)
1505{ 1499{
1506 struct GNUNET_CONNECTION_Handle *connection = cls; 1500 struct GNUNET_CONNECTION_Handle *connection = cls;
1507 1501
diff --git a/src/util/service.c b/src/util/service.c
index be3b4442a..76e540302 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -1126,11 +1126,9 @@ write_pid_file (struct GNUNET_SERVICE_Context *sctx, pid_t pid)
1126 * Task run during shutdown. Stops the server/service. 1126 * Task run during shutdown. Stops the server/service.
1127 * 1127 *
1128 * @param cls the `struct GNUNET_SERVICE_Context` 1128 * @param cls the `struct GNUNET_SERVICE_Context`
1129 * @param tc unused
1130 */ 1129 */
1131static void 1130static void
1132shutdown_task (void *cls, 1131shutdown_task (void *cls)
1133 const struct GNUNET_SCHEDULER_TaskContext *tc)
1134{ 1132{
1135 struct GNUNET_SERVICE_Context *service = cls; 1133 struct GNUNET_SERVICE_Context *service = cls;
1136 struct GNUNET_SERVER_Handle *server = service->server; 1134 struct GNUNET_SERVER_Handle *server = service->server;
@@ -1147,14 +1145,15 @@ shutdown_task (void *cls,
1147 * Initial task for the service. 1145 * Initial task for the service.
1148 * 1146 *
1149 * @param cls service context 1147 * @param cls service context
1150 * @param tc unused
1151 */ 1148 */
1152static void 1149static void
1153service_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1150service_task (void *cls)
1154{ 1151{
1155 struct GNUNET_SERVICE_Context *sctx = cls; 1152 struct GNUNET_SERVICE_Context *sctx = cls;
1156 unsigned int i; 1153 unsigned int i;
1154 const struct GNUNET_SCHEDULER_TaskContext *tc;
1157 1155
1156 tc = GNUNET_SCHEDULER_get_task_context ();
1158 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 1157 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
1159 return; 1158 return;
1160 (void) GNUNET_SPEEDUP_start_ (sctx->cfg); 1159 (void) GNUNET_SPEEDUP_start_ (sctx->cfg);
diff --git a/src/util/socks.c b/src/util/socks.c
index 3fa18cca9..cc59858dd 100644
--- a/src/util/socks.c
+++ b/src/util/socks.c
@@ -105,7 +105,7 @@ unsigned char * SOCK5_proto_string(unsigned char * b, const char * s)
105/** 105/**
106 * State of the SOCKS5 handshake. 106 * State of the SOCKS5 handshake.
107 */ 107 */
108struct GNUNET_SOCKS_Handshake 108struct GNUNET_SOCKS_Handshake
109{ 109{
110 110
111 /** 111 /**
@@ -124,7 +124,7 @@ struct GNUNET_SOCKS_Handshake
124 struct GNUNET_CONNECTION_TransmitHandle *th; 124 struct GNUNET_CONNECTION_TransmitHandle *th;
125 125
126 /** 126 /**
127 * Our stage in the SOCKS5 handshake 127 * Our stage in the SOCKS5 handshake
128 */ 128 */
129 int step; 129 int step;
130 130
@@ -199,7 +199,7 @@ SOCKS5_handshake_step (struct GNUNET_SOCKS_Handshake *ih)
199 GNUNET_assert (SOCKS5_step_done > ih->step && ih->step >= 0); 199 GNUNET_assert (SOCKS5_step_done > ih->step && ih->step >= 0);
200 switch (ih->step) { 200 switch (ih->step) {
201 case SOCKS5_step_greet: /* SOCKS5 server's greeting */ 201 case SOCKS5_step_greet: /* SOCKS5 server's greeting */
202 if (b[0] != 5) 202 if (b[0] != 5)
203 { 203 {
204 LOG (GNUNET_ERROR_TYPE_ERROR, 204 LOG (GNUNET_ERROR_TYPE_ERROR,
205 "Not a SOCKS5 server\n"); 205 "Not a SOCKS5 server\n");
@@ -234,7 +234,7 @@ SOCKS5_handshake_step (struct GNUNET_SOCKS_Handshake *ih)
234 b += 2; 234 b += 2;
235 break; 235 break;
236 case SOCKS5_step_cmd: /* SOCKS5 server's responce to command */ 236 case SOCKS5_step_cmd: /* SOCKS5 server's responce to command */
237 if (b[0] != 5) 237 if (b[0] != 5)
238 { 238 {
239 LOG (GNUNET_ERROR_TYPE_ERROR, 239 LOG (GNUNET_ERROR_TYPE_ERROR,
240 "SOCKS5 protocol error\n"); 240 "SOCKS5 protocol error\n");
@@ -271,11 +271,11 @@ SOCKS5_handshake_step (struct GNUNET_SOCKS_Handshake *ih)
271 ih->instart = b; 271 ih->instart = b;
272 SOCKS5_handshake_done (ih); 272 SOCKS5_handshake_done (ih);
273 return; 273 return;
274 case SOCKS5_step_done: 274 case SOCKS5_step_done:
275 GNUNET_assert (0); 275 GNUNET_assert (0);
276 } 276 }
277 ih->instart = b; 277 ih->instart = b;
278 /* Do not reschedule the sender unless we're done reading. 278 /* Do not reschedule the sender unless we're done reading.
279 * I imagine this lets us avoid ever cancelling the transmit handle. */ 279 * I imagine this lets us avoid ever cancelling the transmit handle. */
280 register_sender (ih); 280 register_sender (ih);
281} 281}
@@ -289,7 +289,7 @@ SOCKS5_handshake_step (struct GNUNET_SOCKS_Handshake *ih)
289 * @param handler_cls closure for @a handler 289 * @param handler_cls closure for @a handler
290 */ 290 */
291void 291void
292reciever (void *cls, 292reciever (void *cls,
293 const void *buf, size_t available, 293 const void *buf, size_t available,
294 const struct sockaddr * addr, 294 const struct sockaddr * addr,
295 socklen_t addrlen, int errCode) 295 socklen_t addrlen, int errCode)
@@ -330,7 +330,7 @@ register_reciever (struct GNUNET_SOCKS_Handshake *ih, int want)
330 */ 330 */
331 331
332size_t 332size_t
333transmit_ready (void *cls, 333transmit_ready (void *cls,
334 size_t size, 334 size_t size,
335 void *buf) 335 void *buf)
336{ 336{
@@ -345,23 +345,28 @@ transmit_ready (void *cls,
345 * GNUNET_CONNECTION_notify_transmit_ready() can schedule : 345 * GNUNET_CONNECTION_notify_transmit_ready() can schedule :
346 * transmit_timeout() - DNS still working 346 * transmit_timeout() - DNS still working
347 * connect_error() - DNS done but no socket? 347 * connect_error() - DNS done but no socket?
348 * transmit_ready() - scheduler shutdown or timeout, or signal_transmit_error() 348 * transmit_ready() - scheduler shutdown or timeout, or signal_transmit_error()
349 * We'd need to dig into the scheduler to guess at the reason, as 349 * We'd need to dig into the scheduler to guess at the reason, as
350 * connection.c tells us nothing itself, but mostly its timouts. 350 * connection.c tells us nothing itself, but mostly its timouts.
351 * Initially, we'll simply ignore this and leave massive timeouts, but 351 * Initially, we'll simply ignore this and leave massive timeouts, but
352 * maybe that should change for error handling pruposes. It appears that 352 * maybe that should change for error handling pruposes. It appears that
353 * successful operations, including DNS resolution, do not use this. */ 353 * successful operations, including DNS resolution, do not use this. */
354 if (NULL==buf) 354 if (NULL == buf)
355 { 355 {
356 enum GNUNET_SCHEDULER_Reason reason = GNUNET_SCHEDULER_get_reason (); 356 const struct GNUNET_SCHEDULER_TaskContext *tc;
357 if (0 != (reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 357
358 tc = GNUNET_SCHEDULER_get_task_context ();
359 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
358 return 0; 360 return 0;
359 if (0 != (reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) { 361 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT)) {
360 if (0==ih->step) { 362 if (0==ih->step)
363 {
361 LOG (GNUNET_ERROR_TYPE_WARNING, 364 LOG (GNUNET_ERROR_TYPE_WARNING,
362 "Timeout contacting SOCKS server, retrying indefinitely, but probably hopeless.\n"); 365 "Timeout contacting SOCKS server, retrying indefinitely, but probably hopeless.\n");
363 register_sender (ih); 366 register_sender (ih);
364 } else { 367 }
368 else
369 {
365 LOG (GNUNET_ERROR_TYPE_ERROR, 370 LOG (GNUNET_ERROR_TYPE_ERROR,
366 "Timeout during mid SOCKS handshake (step %u), probably not a SOCKS server.\n", 371 "Timeout during mid SOCKS handshake (step %u), probably not a SOCKS server.\n",
367 ih->step); 372 ih->step);
@@ -418,7 +423,7 @@ register_sender (struct GNUNET_SOCKS_Handshake *ih)
418/** 423/**
419 * Initialize a SOCKS5 handshake for authentication via username and 424 * Initialize a SOCKS5 handshake for authentication via username and
420 * password. Tor uses SOCKS username and password authentication to assign 425 * password. Tor uses SOCKS username and password authentication to assign
421 * programs unique circuits. 426 * programs unique circuits.
422 * 427 *
423 * @param user username for the proxy 428 * @param user username for the proxy
424 * @param pass password for the proxy 429 * @param pass password for the proxy
@@ -435,7 +440,7 @@ GNUNET_SOCKS_init_handshake (const char *user, const char *pass)
435 unsigned char * n = b++; 440 unsigned char * n = b++;
436 *n = 1; /* Number of authentication methods */ 441 *n = 1; /* Number of authentication methods */
437 /* We support no authentication even when requesting authentication, 442 /* We support no authentication even when requesting authentication,
438 * but this appears harmless, given the way that Tor uses authentication. 443 * but this appears harmless, given the way that Tor uses authentication.
439 * And some SOCKS5 servers might require this. */ 444 * And some SOCKS5 servers might require this. */
440 *(b++) = SOCKS5_AUTH_NOAUTH; 445 *(b++) = SOCKS5_AUTH_NOAUTH;
441 if (NULL != user) { 446 if (NULL != user) {
@@ -445,7 +450,7 @@ GNUNET_SOCKS_init_handshake (const char *user, const char *pass)
445 /* There is no apperent reason to support authentication methods beyond 450 /* There is no apperent reason to support authentication methods beyond
446 * username and password since afaik Tor does not support them. */ 451 * username and password since afaik Tor does not support them. */
447 452
448 /* We authenticate with an empty username and password if the server demands 453 /* We authenticate with an empty username and password if the server demands
449 * them but we do not have any. */ 454 * them but we do not have any. */
450 if (user == NULL) 455 if (user == NULL)
451 user = ""; 456 user = "";
@@ -466,7 +471,7 @@ GNUNET_SOCKS_init_handshake (const char *user, const char *pass)
466 471
467 472
468/** 473/**
469 * Initialize a SOCKS5 handshake without authentication, thereby possibly 474 * Initialize a SOCKS5 handshake without authentication, thereby possibly
470 * sharing a Tor circuit with another process. 475 * sharing a Tor circuit with another process.
471 * 476 *
472 * @return Valid SOCKS5 hanbdshake handle 477 * @return Valid SOCKS5 hanbdshake handle
@@ -480,11 +485,11 @@ GNUNET_SOCKS_init_handshake_noauth ()
480 485
481/** 486/**
482 * Build request that the SOCKS5 proxy open a TCP/IP stream to the given host 487 * Build request that the SOCKS5 proxy open a TCP/IP stream to the given host
483 * and port. 488 * and port.
484 * 489 *
485 * @param ih SOCKS5 handshake 490 * @param ih SOCKS5 handshake
486 * @param hostname 491 * @param hostname
487 * @param port 492 * @param port
488 */ 493 */
489void 494void
490GNUNET_SOCKS_set_handshake_destination (struct GNUNET_SOCKS_Handshake *ih, 495GNUNET_SOCKS_set_handshake_destination (struct GNUNET_SOCKS_Handshake *ih,
@@ -529,7 +534,7 @@ GNUNET_SOCKS_set_handshake_destination (struct GNUNET_SOCKS_Handshake *ih,
529 * @param c open unused connection, consumed here. 534 * @param c open unused connection, consumed here.
530 * @return Connection handle that becomes usable when the SOCKS5 handshake completes. 535 * @return Connection handle that becomes usable when the SOCKS5 handshake completes.
531 */ 536 */
532struct GNUNET_CONNECTION_Handle * 537struct GNUNET_CONNECTION_Handle *
533GNUNET_SOCKS_run_handshake(struct GNUNET_SOCKS_Handshake *ih, 538GNUNET_SOCKS_run_handshake(struct GNUNET_SOCKS_Handshake *ih,
534 struct GNUNET_CONNECTION_Handle *c) 539 struct GNUNET_CONNECTION_Handle *c)
535{ 540{
@@ -580,7 +585,7 @@ GNUNET_SOCKS_do_connect (const char *service_name,
580 if (GNUNET_OK != 585 if (GNUNET_OK !=
581 GNUNET_CONFIGURATION_get_value_number (cfg, service_name, "SOCKSPORT", &port0)) 586 GNUNET_CONFIGURATION_get_value_number (cfg, service_name, "SOCKSPORT", &port0))
582 port0 = 9050; 587 port0 = 9050;
583 /* A typical Tor client should usually try port 9150 for the TBB too, but 588 /* A typical Tor client should usually try port 9150 for the TBB too, but
584 * GUNNet can probably assume a system Tor instalation. */ 589 * GUNNet can probably assume a system Tor instalation. */
585 if (GNUNET_OK != 590 if (GNUNET_OK !=
586 GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "SOCKSHOST", &host0)) 591 GNUNET_CONFIGURATION_get_value_string (cfg, service_name, "SOCKSHOST", &host0))
diff --git a/src/util/speedup.c b/src/util/speedup.c
index a42ed7faf..6dce6a490 100644
--- a/src/util/speedup.c
+++ b/src/util/speedup.c
@@ -34,16 +34,17 @@ static struct GNUNET_TIME_Relative interval;
34 34
35static struct GNUNET_TIME_Relative delta; 35static struct GNUNET_TIME_Relative delta;
36 36
37static struct GNUNET_SCHEDULER_Task * speedup_task; 37static struct GNUNET_SCHEDULER_Task *speedup_task;
38 38
39 39
40static void 40static void
41do_speedup (void *cls, 41do_speedup (void *cls)
42 const struct GNUNET_SCHEDULER_TaskContext *tc)
43{ 42{
44 static long long current_offset; 43 static long long current_offset;
44 const struct GNUNET_SCHEDULER_TaskContext *tc;
45 45
46 speedup_task = NULL; 46 speedup_task = NULL;
47 tc = GNUNET_SCHEDULER_get_task_context ();
47 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 48 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
48 return; 49 return;
49 current_offset += delta.rel_value_us; 50 current_offset += delta.rel_value_us;
diff --git a/src/util/test_client.c b/src/util/test_client.c
index d8bf67ac6..dab985e5f 100644
--- a/src/util/test_client.c
+++ b/src/util/test_client.c
@@ -125,7 +125,7 @@ make_msg (void *cls, size_t size, void *buf)
125 125
126 126
127static void 127static void
128task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 128task (void *cls)
129{ 129{
130 struct sockaddr_in sa; 130 struct sockaddr_in sa;
131 struct sockaddr *sap[2]; 131 struct sockaddr *sap[2];
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c
index 6c33c2da1..21eb3c6c6 100644
--- a/src/util/test_common_logging_runtime_loglevels.c
+++ b/src/util/test_common_logging_runtime_loglevels.c
@@ -58,7 +58,7 @@ runone (void);
58 58
59 59
60static void 60static void
61end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 61end_task (void *cls)
62{ 62{
63 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending phase %d, ok is %d\n", phase, 63 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending phase %d, ok is %d\n", phase,
64 ok); 64 ok);
@@ -215,7 +215,7 @@ static int bytes;
215 215
216 216
217static void 217static void
218read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 218read_call (void *cls)
219{ 219{
220 const struct GNUNET_DISK_FileHandle *stdout_read_handle = cls; 220 const struct GNUNET_DISK_FileHandle *stdout_read_handle = cls;
221 char level[8]; 221 char level[8];
@@ -425,7 +425,7 @@ runone ()
425 425
426 426
427static void 427static void
428task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 428task (void *cls)
429{ 429{
430 phase = 0; 430 phase = 0;
431 runone (); 431 runone ();
diff --git a/src/util/test_connection.c b/src/util/test_connection.c
index c4987d27d..eaca75c2e 100644
--- a/src/util/test_connection.c
+++ b/src/util/test_connection.c
@@ -98,7 +98,7 @@ receive_check (void *cls, const void *buf, size_t available,
98 98
99 99
100static void 100static void
101run_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 101run_accept (void *cls)
102{ 102{
103 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test accepts connection\n"); 103 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Test accepts connection\n");
104 asock = GNUNET_CONNECTION_create_from_accept (NULL, NULL, ls); 104 asock = GNUNET_CONNECTION_create_from_accept (NULL, NULL, ls);
@@ -128,7 +128,7 @@ make_hello (void *cls, size_t size, void *buf)
128 128
129 129
130static void 130static void
131task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 131task (void *cls)
132{ 132{
133 ls = open_listen_socket (); 133 ls = open_listen_socket ();
134 lsock = GNUNET_CONNECTION_create_from_existing (ls); 134 lsock = GNUNET_CONNECTION_create_from_existing (ls);
diff --git a/src/util/test_connection_addressing.c b/src/util/test_connection_addressing.c
index 5d2766f5f..a6345b10a 100644
--- a/src/util/test_connection_addressing.c
+++ b/src/util/test_connection_addressing.c
@@ -102,7 +102,7 @@ receive_check (void *cls, const void *buf, size_t available,
102 102
103 103
104static void 104static void
105run_accept (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 105run_accept (void *cls)
106{ 106{
107 void *addr; 107 void *addr;
108 size_t alen; 108 size_t alen;
@@ -142,7 +142,7 @@ make_hello (void *cls, size_t size, void *buf)
142 142
143 143
144static void 144static void
145task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 145task (void *cls)
146{ 146{
147 struct sockaddr_in v4; 147 struct sockaddr_in v4;
148 148
diff --git a/src/util/test_connection_receive_cancel.c b/src/util/test_connection_receive_cancel.c
index 73a041bdf..9ec96d8a6 100644
--- a/src/util/test_connection_receive_cancel.c
+++ b/src/util/test_connection_receive_cancel.c
@@ -79,7 +79,7 @@ dead_receive (void *cls, const void *buf, size_t available,
79 79
80 80
81static void 81static void
82run_accept_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 82run_accept_cancel (void *cls)
83{ 83{
84 asock = GNUNET_CONNECTION_create_from_accept (NULL, NULL, ls); 84 asock = GNUNET_CONNECTION_create_from_accept (NULL, NULL, ls);
85 GNUNET_assert (asock != NULL); 85 GNUNET_assert (asock != NULL);
@@ -92,7 +92,7 @@ run_accept_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
92 92
93 93
94static void 94static void
95receive_cancel_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 95receive_cancel_task (void *cls)
96{ 96{
97 int *ok = cls; 97 int *ok = cls;
98 98
@@ -105,7 +105,7 @@ receive_cancel_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
105 105
106 106
107static void 107static void
108task_receive_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 108task_receive_cancel (void *cls)
109{ 109{
110 ls = open_listen_socket (); 110 ls = open_listen_socket ();
111 lsock = GNUNET_CONNECTION_create_from_existing (ls); 111 lsock = GNUNET_CONNECTION_create_from_existing (ls);
diff --git a/src/util/test_connection_timeout.c b/src/util/test_connection_timeout.c
index 5a649f5b0..e78cec669 100644
--- a/src/util/test_connection_timeout.c
+++ b/src/util/test_connection_timeout.c
@@ -93,7 +93,7 @@ send_kilo (void *cls, size_t size, void *buf)
93 93
94 94
95static void 95static void
96task_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 96task_timeout (void *cls)
97{ 97{
98 98
99 ls = open_listen_socket (); 99 ls = open_listen_socket ();
diff --git a/src/util/test_connection_timeout_no_connect.c b/src/util/test_connection_timeout_no_connect.c
index 1e3230d2f..ebcd4b71e 100644
--- a/src/util/test_connection_timeout_no_connect.c
+++ b/src/util/test_connection_timeout_no_connect.c
@@ -44,7 +44,7 @@ handle_timeout (void *cls, size_t size, void *buf)
44 44
45 45
46static void 46static void
47task_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 47task_timeout (void *cls)
48{ 48{
49 csock = GNUNET_CONNECTION_create_from_connect (cfg, "localhost", PORT); 49 csock = GNUNET_CONNECTION_create_from_connect (cfg, "localhost", PORT);
50 GNUNET_assert (csock != NULL); 50 GNUNET_assert (csock != NULL);
diff --git a/src/util/test_connection_transmit_cancel.c b/src/util/test_connection_transmit_cancel.c
index 8d016068c..9ef0720ed 100644
--- a/src/util/test_connection_transmit_cancel.c
+++ b/src/util/test_connection_transmit_cancel.c
@@ -38,7 +38,7 @@ not_run (void *cls, size_t size, void *buf)
38 38
39 39
40static void 40static void
41task_transmit_cancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 41task_transmit_cancel (void *cls)
42{ 42{
43 int *ok = cls; 43 int *ok = cls;
44 struct GNUNET_CONNECTION_TransmitHandle *th; 44 struct GNUNET_CONNECTION_TransmitHandle *th;
diff --git a/src/util/test_crypto_hash.c b/src/util/test_crypto_hash.c
index fa0013264..731205841 100644
--- a/src/util/test_crypto_hash.c
+++ b/src/util/test_crypto_hash.c
@@ -114,7 +114,7 @@ finished_task (void *cls, const struct GNUNET_HashCode * res)
114 114
115 115
116static void 116static void
117file_hasher (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 117file_hasher (void *cls)
118{ 118{
119 GNUNET_assert (NULL != 119 GNUNET_assert (NULL !=
120 GNUNET_CRYPTO_hash_file (GNUNET_SCHEDULER_PRIORITY_DEFAULT, 120 GNUNET_CRYPTO_hash_file (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
diff --git a/src/util/test_disk.c b/src/util/test_disk.c
index 560b6710e..86b96e16c 100644
--- a/src/util/test_disk.c
+++ b/src/util/test_disk.c
@@ -141,12 +141,13 @@ iter_callback (void *cls, struct GNUNET_DISK_DirectoryIterator *di,
141} 141}
142 142
143static void 143static void
144iter_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 144iter_task (void *cls)
145{ 145{
146 GNUNET_DISK_directory_iterator_start (GNUNET_SCHEDULER_PRIORITY_DEFAULT, 146 GNUNET_DISK_directory_iterator_start (GNUNET_SCHEDULER_PRIORITY_DEFAULT,
147 "test", &iter_callback, cls); 147 "test", &iter_callback, cls);
148} 148}
149 149
150
150static int 151static int
151testDirIter () 152testDirIter ()
152{ 153{
diff --git a/src/util/test_mq_client.c b/src/util/test_mq_client.c
index 0d2f3befe..f894c3912 100644
--- a/src/util/test_mq_client.c
+++ b/src/util/test_mq_client.c
@@ -62,7 +62,7 @@ recv_cb (void *cls, struct GNUNET_SERVER_Client *argclient,
62 62
63 63
64static void 64static void
65clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 65clean_up (void *cls)
66{ 66{
67 GNUNET_SERVER_destroy (server); 67 GNUNET_SERVER_destroy (server);
68 server = NULL; 68 server = NULL;
@@ -134,7 +134,7 @@ test_mq (struct GNUNET_CLIENT_Connection *client)
134 134
135 135
136static void 136static void
137task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 137task (void *cls)
138{ 138{
139 struct sockaddr_in sa; 139 struct sockaddr_in sa;
140 struct sockaddr *sap[2]; 140 struct sockaddr *sap[2];
@@ -181,4 +181,3 @@ main (int argc, char *argv[])
181 GNUNET_assert (GNUNET_YES == notify); 181 GNUNET_assert (GNUNET_YES == notify);
182 return ok; 182 return ok;
183} 183}
184
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c
index 3823beb3d..c617917cc 100644
--- a/src/util/test_os_start_process.c
+++ b/src/util/test_os_start_process.c
@@ -58,7 +58,7 @@ struct read_context
58struct read_context rc; 58struct read_context rc;
59 59
60static void 60static void
61end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 61end_task (void *cls)
62{ 62{
63 if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) 63 if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG))
64 { 64 {
@@ -73,7 +73,7 @@ end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
73 73
74 74
75static void 75static void
76read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 76read_call (void *cls)
77{ 77{
78 int bytes; 78 int bytes;
79 79
@@ -110,7 +110,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
110 110
111 111
112static void 112static void
113run_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 113run_task (void *cls)
114{ 114{
115 char *fn; 115 char *fn;
116 const struct GNUNET_DISK_FileHandle *stdout_read_handle; 116 const struct GNUNET_DISK_FileHandle *stdout_read_handle;
diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c
index 01d93febd..a246d75c5 100644
--- a/src/util/test_scheduler.c
+++ b/src/util/test_scheduler.c
@@ -31,7 +31,7 @@ static const struct GNUNET_DISK_FileHandle *fds[2];
31 31
32 32
33static void 33static void
34task2 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 34task2 (void *cls)
35{ 35{
36 int *ok = cls; 36 int *ok = cls;
37 37
@@ -44,7 +44,7 @@ task2 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
44 44
45 45
46static void 46static void
47task3 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 47task3 (void *cls)
48{ 48{
49 int *ok = cls; 49 int *ok = cls;
50 50
@@ -54,11 +54,13 @@ task3 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
54 54
55 55
56static void 56static void
57taskWrt (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 57taskWrt (void *cls)
58{ 58{
59 static char c; 59 static char c;
60 int *ok = cls; 60 int *ok = cls;
61 const struct GNUNET_SCHEDULER_TaskContext *tc;
61 62
63 tc = GNUNET_SCHEDULER_get_task_context ();
62 GNUNET_assert (6 == *ok); 64 GNUNET_assert (6 == *ok);
63 GNUNET_assert (GNUNET_NETWORK_fdset_handle_isset (tc->write_ready, fds[1])); 65 GNUNET_assert (GNUNET_NETWORK_fdset_handle_isset (tc->write_ready, fds[1]));
64 (*ok) = 7; 66 (*ok) = 7;
@@ -67,14 +69,14 @@ taskWrt (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
67 69
68 70
69static void 71static void
70taskNeverRun (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 72taskNeverRun (void *cls)
71{ 73{
72 GNUNET_assert (0); 74 GNUNET_assert (0);
73} 75}
74 76
75 77
76static void 78static void
77taskLast (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 79taskLast (void *cls)
78{ 80{
79 int *ok = cls; 81 int *ok = cls;
80 82
@@ -85,11 +87,13 @@ taskLast (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
85 87
86 88
87static void 89static void
88taskRd (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 90taskRd (void *cls)
89{ 91{
90 static char c; 92 static char c;
91 int *ok = cls; 93 int *ok = cls;
94 const struct GNUNET_SCHEDULER_TaskContext *tc;
92 95
96 tc = GNUNET_SCHEDULER_get_task_context ();
93 GNUNET_assert (7 == *ok); 97 GNUNET_assert (7 == *ok);
94 GNUNET_assert (GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, fds[0])); 98 GNUNET_assert (GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, fds[0]));
95 GNUNET_assert (1 == GNUNET_DISK_file_read (fds[0], &c, 1)); 99 GNUNET_assert (1 == GNUNET_DISK_file_read (fds[0], &c, 1));
@@ -101,7 +105,7 @@ taskRd (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
101 105
102 106
103static void 107static void
104task4 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 108task4 (void *cls)
105{ 109{
106 int *ok = cls; 110 int *ok = cls;
107 111
@@ -119,7 +123,7 @@ task4 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
119 123
120 124
121static void 125static void
122task1 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 126task1 (void *cls)
123{ 127{
124 int *ok = cls; 128 int *ok = cls;
125 129
@@ -148,7 +152,7 @@ check ()
148 152
149 153
150static void 154static void
151taskShutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 155taskShutdown (void *cls)
152{ 156{
153 int *ok = cls; 157 int *ok = cls;
154 158
@@ -176,7 +180,7 @@ checkShutdown ()
176 180
177#ifndef MINGW 181#ifndef MINGW
178static void 182static void
179taskSig (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 183taskSig (void *cls)
180{ 184{
181 int *ok = cls; 185 int *ok = cls;
182 186
@@ -204,7 +208,7 @@ checkSignal ()
204 208
205 209
206static void 210static void
207taskCancel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 211taskCancel (void *cls)
208{ 212{
209 int *ok = cls; 213 int *ok = cls;
210 214
diff --git a/src/util/test_scheduler_delay.c b/src/util/test_scheduler_delay.c
index c3821a173..c55f28e9b 100644
--- a/src/util/test_scheduler_delay.c
+++ b/src/util/test_scheduler_delay.c
@@ -41,11 +41,9 @@ static unsigned long long cumDelta;
41 * Signature of the main function of a task. 41 * Signature of the main function of a task.
42 * 42 *
43 * @param cls closure 43 * @param cls closure
44 * @param tc context
45 */ 44 */
46static void 45static void
47test_task (void *cls, 46test_task (void *cls)
48 const struct GNUNET_SCHEDULER_TaskContext *tc)
49{ 47{
50 struct GNUNET_TIME_Absolute now; 48 struct GNUNET_TIME_Absolute now;
51 49
diff --git a/src/util/test_server.c b/src/util/test_server.c
index fdf298128..189c13e18 100644
--- a/src/util/test_server.c
+++ b/src/util/test_server.c
@@ -74,11 +74,9 @@ static int ok;
74 * Final task invoked to clean up. 74 * Final task invoked to clean up.
75 * 75 *
76 * @param cls NULL 76 * @param cls NULL
77 * @param tc scheduler context
78 */ 77 */
79static void 78static void
80finish_up (void *cls, 79finish_up (void *cls)
81 const struct GNUNET_SCHEDULER_TaskContext *tc)
82{ 80{
83 GNUNET_assert (7 == ok); 81 GNUNET_assert (7 == ok);
84 ok = 0; 82 ok = 0;
@@ -262,11 +260,9 @@ static struct GNUNET_SERVER_MessageHandler handlers[] = {
262 * server. 260 * server.
263 * 261 *
264 * @param cls NULL 262 * @param cls NULL
265 * @param tc scheduler context
266 */ 263 */
267static void 264static void
268task (void *cls, 265task (void *cls)
269 const struct GNUNET_SCHEDULER_TaskContext *tc)
270{ 266{
271 struct sockaddr_in sa; 267 struct sockaddr_in sa;
272 struct sockaddr *sap[2]; 268 struct sockaddr *sap[2];
diff --git a/src/util/test_server_disconnect.c b/src/util/test_server_disconnect.c
index 4a6970fc3..21abf92bb 100644
--- a/src/util/test_server_disconnect.c
+++ b/src/util/test_server_disconnect.c
@@ -41,7 +41,7 @@ static int ok;
41 41
42 42
43static void 43static void
44finish_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 44finish_up (void *cls)
45{ 45{
46 GNUNET_assert (ok == 5); 46 GNUNET_assert (ok == 5);
47 ok = 0; 47 ok = 0;
@@ -52,9 +52,10 @@ finish_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
52 52
53 53
54static void 54static void
55notify_disconnect (void *cls, struct GNUNET_SERVER_Client *clientarg) 55notify_disconnect (void *cls,
56 struct GNUNET_SERVER_Client *clientarg)
56{ 57{
57 if (clientarg == NULL) 58 if (NULL == clientarg)
58 return; 59 return;
59 GNUNET_assert (ok == 4); 60 GNUNET_assert (ok == 4);
60 ok = 5; 61 ok = 5;
@@ -63,7 +64,7 @@ notify_disconnect (void *cls, struct GNUNET_SERVER_Client *clientarg)
63 64
64 65
65static void 66static void
66server_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 67server_disconnect (void *cls)
67{ 68{
68 struct GNUNET_SERVER_Client *argclient = cls; 69 struct GNUNET_SERVER_Client *argclient = cls;
69 70
@@ -110,7 +111,7 @@ transmit_initial_message (void *cls, size_t size, void *buf)
110 111
111 112
112static void 113static void
113task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 114task (void *cls)
114{ 115{
115 struct sockaddr_in sa; 116 struct sockaddr_in sa;
116 struct sockaddr *sap[2]; 117 struct sockaddr *sap[2];
diff --git a/src/util/test_server_with_client.c b/src/util/test_server_with_client.c
index 07bc88783..8a8f65474 100644
--- a/src/util/test_server_with_client.c
+++ b/src/util/test_server_with_client.c
@@ -40,7 +40,7 @@ static struct GNUNET_CONFIGURATION_Handle *cfg;
40static int ok; 40static int ok;
41 41
42static void 42static void
43send_done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 43send_done (void *cls)
44{ 44{
45 struct GNUNET_SERVER_Client *argclient = cls; 45 struct GNUNET_SERVER_Client *argclient = cls;
46 46
@@ -94,7 +94,7 @@ recv_cb (void *cls, struct GNUNET_SERVER_Client *argclient,
94 94
95 95
96static void 96static void
97clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 97clean_up (void *cls)
98{ 98{
99 GNUNET_SERVER_destroy (server); 99 GNUNET_SERVER_destroy (server);
100 server = NULL; 100 server = NULL;
@@ -146,7 +146,7 @@ static struct GNUNET_SERVER_MessageHandler handlers[] = {
146 146
147 147
148static void 148static void
149task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 149task (void *cls)
150{ 150{
151 struct sockaddr_in sa; 151 struct sockaddr_in sa;
152 struct sockaddr *sap[2]; 152 struct sockaddr *sap[2];
diff --git a/src/util/test_server_with_client_unix.c b/src/util/test_server_with_client_unix.c
index 1d6f5dbed..ec84b08f8 100644
--- a/src/util/test_server_with_client_unix.c
+++ b/src/util/test_server_with_client_unix.c
@@ -39,7 +39,7 @@ static int ok;
39 39
40 40
41static void 41static void
42send_done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 42send_done (void *cls)
43{ 43{
44 struct GNUNET_SERVER_Client *argclient = cls; 44 struct GNUNET_SERVER_Client *argclient = cls;
45 45
@@ -74,7 +74,7 @@ recv_cb (void *cls, struct GNUNET_SERVER_Client *argclient,
74 74
75 75
76static void 76static void
77clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 77clean_up (void *cls)
78{ 78{
79 GNUNET_SERVER_destroy (server); 79 GNUNET_SERVER_destroy (server);
80 server = NULL; 80 server = NULL;
@@ -126,7 +126,7 @@ static struct GNUNET_SERVER_MessageHandler handlers[] = {
126 126
127 127
128static void 128static void
129task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 129task (void *cls)
130{ 130{
131 struct sockaddr_un un; 131 struct sockaddr_un un;
132 const char *unixpath = "/tmp/testsock"; 132 const char *unixpath = "/tmp/testsock";
diff --git a/src/util/test_service.c b/src/util/test_service.c
index 88f99f95a..efc765438 100644
--- a/src/util/test_service.c
+++ b/src/util/test_service.c
@@ -41,7 +41,7 @@ static struct GNUNET_CLIENT_Connection *client;
41 41
42 42
43static void 43static void
44do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 44do_stop (void *cls)
45{ 45{
46 if (NULL != client) 46 if (NULL != client)
47 { 47 {
diff --git a/src/util/test_socks.c b/src/util/test_socks.c
index bb7d0031a..7f1140720 100644
--- a/src/util/test_socks.c
+++ b/src/util/test_socks.c
@@ -126,7 +126,7 @@ make_msg (void *cls, size_t size, void *buf)
126 126
127 127
128static void 128static void
129task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 129task (void *cls)
130{ 130{
131 struct sockaddr_in sa; 131 struct sockaddr_in sa;
132 struct sockaddr *sap[2]; 132 struct sockaddr *sap[2];
diff --git a/src/util/test_speedup.c b/src/util/test_speedup.c
index 3c4a9bfdc..5d46e3127 100644
--- a/src/util/test_speedup.c
+++ b/src/util/test_speedup.c
@@ -47,7 +47,7 @@ static unsigned int cycles;
47 * @param tc scheduler context, unused 47 * @param tc scheduler context, unused
48 */ 48 */
49static void 49static void
50run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 50run (void *cls)
51{ 51{
52 cycles++; 52 cycles++;
53 fprintf (stderr, "..%u", cycles); 53 fprintf (stderr, "..%u", cycles);
diff --git a/src/vpn/gnunet-service-vpn.c b/src/vpn/gnunet-service-vpn.c
index 8b202d7d4..58eda367f 100644
--- a/src/vpn/gnunet-service-vpn.c
+++ b/src/vpn/gnunet-service-vpn.c
@@ -2866,11 +2866,9 @@ cleanup_channel (void *cls,
2866 * Function scheduled as very last function, cleans up after us 2866 * Function scheduled as very last function, cleans up after us
2867 * 2867 *
2868 * @param cls unused 2868 * @param cls unused
2869 * @param tc unused
2870 */ 2869 */
2871static void 2870static void
2872cleanup (void *cls, 2871cleanup (void *cls)
2873 const struct GNUNET_SCHEDULER_TaskContext *tc)
2874{ 2872{
2875 unsigned int i; 2873 unsigned int i;
2876 2874
diff --git a/src/vpn/gnunet-vpn.c b/src/vpn/gnunet-vpn.c
index d6eb39bcb..d4acee49e 100644
--- a/src/vpn/gnunet-vpn.c
+++ b/src/vpn/gnunet-vpn.c
@@ -95,7 +95,7 @@ static struct GNUNET_TIME_Relative duration = { 5 * 60 * 1000} ;
95 * Shutdown. 95 * Shutdown.
96 */ 96 */
97static void 97static void
98do_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 98do_disconnect (void *cls)
99{ 99{
100 if (NULL != request) 100 if (NULL != request)
101 { 101 {
diff --git a/src/vpn/vpn_api.c b/src/vpn/vpn_api.c
index 208e56007..f3068f7c2 100644
--- a/src/vpn/vpn_api.c
+++ b/src/vpn/vpn_api.c
@@ -358,12 +358,10 @@ queue_request (struct GNUNET_VPN_RedirectionRequest *rr)
358/** 358/**
359 * Connect to the VPN service and start again to transmit our requests. 359 * Connect to the VPN service and start again to transmit our requests.
360 * 360 *
361 * @param cls the 'struct GNUNET_VPN_Handle *' 361 * @param cls the `struct GNUNET_VPN_Handle *`
362 * @param tc scheduler context
363 */ 362 */
364static void 363static void
365connect_task (void *cls, 364connect_task (void *cls)
366 const struct GNUNET_SCHEDULER_TaskContext *tc)
367{ 365{
368 struct GNUNET_VPN_Handle *vh = cls; 366 struct GNUNET_VPN_Handle *vh = cls;
369 367