aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/testbed_test.c4
-rw-r--r--src/arm/arm_api.c24
-rw-r--r--src/arm/arm_monitor_api.c34
-rw-r--r--src/arm/gnunet-service-arm.c34
-rw-r--r--src/arm/test_exponential_backoff.c2
-rw-r--r--src/ats-tests/ats-testing-experiment.c20
-rw-r--r--src/ats-tests/ats-testing-log.c8
-rw-r--r--src/ats-tests/ats-testing-preferences.c6
-rw-r--r--src/ats-tests/ats-testing-traffic.c6
-rw-r--r--src/ats-tests/ats-testing.c14
-rw-r--r--src/ats-tests/ats-testing.h14
-rw-r--r--src/ats-tests/gnunet-ats-sim.c6
-rw-r--r--src/ats-tests/gnunet-solver-eval.c20
-rw-r--r--src/ats-tests/perf_ats.c16
-rw-r--r--src/ats-tests/perf_ats.h2
-rw-r--r--src/ats-tests/perf_ats_logging.c8
-rw-r--r--src/ats-tool/gnunet-ats.c6
-rw-r--r--src/ats/ats_api_performance.c8
-rw-r--r--src/ats/ats_api_scheduling.c16
-rw-r--r--src/ats/gnunet-ats-solver-eval.c48
-rw-r--r--src/ats/gnunet-ats-solver-eval.h12
-rw-r--r--src/ats/gnunet-service-ats_normalization.c12
-rw-r--r--src/ats/plugin_ats_ril.c8
-rw-r--r--src/ats/test_ats_api_bandwidth_consumption.c20
-rw-r--r--src/ats/test_ats_api_performance_list_all_addresses.c8
-rw-r--r--src/ats/test_ats_api_performance_list_all_addresses_active.c8
-rw-r--r--src/ats/test_ats_api_performance_list_peer_addresses.c8
-rw-r--r--src/ats/test_ats_api_performance_monitor.c8
-rw-r--r--src/ats/test_ats_api_performance_monitor_initial_callback.c8
-rw-r--r--src/ats/test_ats_api_scheduling_add_address.c8
-rw-r--r--src/ats/test_ats_api_scheduling_add_address_duplicate.c16
-rw-r--r--src/ats/test_ats_api_scheduling_add_address_inbound.c8
-rw-r--r--src/ats/test_ats_api_scheduling_add_session.c8
-rw-r--r--src/ats/test_ats_api_scheduling_destroy_address.c8
-rw-r--r--src/ats/test_ats_api_scheduling_destroy_address_twice.c8
-rw-r--r--src/ats/test_ats_api_scheduling_destroy_session.c8
-rw-r--r--src/ats/test_ats_api_scheduling_init.c8
-rw-r--r--src/ats/test_ats_simplistic_pref_aging.c8
-rw-r--r--src/ats/test_ats_solver_add_address.c8
-rw-r--r--src/ats/test_ats_solver_add_address_and_request.c8
-rw-r--r--src/ats/test_ats_solver_alternative_after_delete_address.c12
-rw-r--r--src/ats/test_ats_solver_convergence.c6
-rw-r--r--src/ats/test_ats_solver_preferences.c8
-rw-r--r--src/ats/test_ats_solver_request_and_add_address.c8
-rw-r--r--src/ats/test_ats_solver_request_and_delete_address.c8
-rw-r--r--src/cadet/cadet_api.c22
-rw-r--r--src/cadet/cadet_path.c8
-rw-r--r--src/cadet/cadet_path.h2
-rw-r--r--src/cadet/gnunet-cadet-profiler.c30
-rw-r--r--src/cadet/gnunet-cadet.c4
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c26
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c52
-rw-r--r--src/cadet/gnunet-service-cadet_dht.c8
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c70
-rw-r--r--src/cadet/test_cadet.c28
-rw-r--r--src/cadet/test_cadet_local.c14
-rw-r--r--src/cadet/test_cadet_single.c14
-rw-r--r--src/consensus/gnunet-service-consensus.c14
-rw-r--r--src/conversation/gnunet-conversation-test.c8
-rw-r--r--src/conversation/gnunet-conversation.c6
-rw-r--r--src/conversation/test_conversation_api.c8
-rw-r--r--src/conversation/test_conversation_api_twocalls.c12
-rw-r--r--src/core/core_api.c54
-rw-r--r--src/core/gnunet-service-core_kx.c44
-rw-r--r--src/core/gnunet-service-core_neighbours.c6
-rw-r--r--src/core/gnunet-service-core_sessions.c22
-rw-r--r--src/core/test_core_api.c18
-rw-r--r--src/core/test_core_api_reliability.c8
-rw-r--r--src/core/test_core_api_send_to_self.c6
-rw-r--r--src/core/test_core_api_start_only.c2
-rw-r--r--src/core/test_core_quota_compliance.c28
-rw-r--r--src/datastore/datastore_api.c18
-rw-r--r--src/datastore/gnunet-service-datastore.c8
-rw-r--r--src/dht/dht_api.c18
-rw-r--r--src/dht/gnunet-service-dht_clients.c10
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c16
-rw-r--r--src/dht/gnunet-service-xdht_clients.c10
-rw-r--r--src/dht/gnunet-service-xdht_neighbours.c54
-rw-r--r--src/dht/gnunet_dht_profiler.c28
-rw-r--r--src/dht/test_dht_api.c8
-rw-r--r--src/dht/test_dht_monitor.c4
-rw-r--r--src/dht/test_dht_topo.c4
-rw-r--r--src/dns/dns_api.c8
-rw-r--r--src/dns/dnsstub.c12
-rw-r--r--src/dv/gnunet-service-dv.c18
-rw-r--r--src/dv/test_transport_dv.c4
-rw-r--r--src/exit/gnunet-daemon-exit.c8
-rw-r--r--src/fragmentation/defragmentation.c14
-rw-r--r--src/fragmentation/fragmentation.c14
-rw-r--r--src/fragmentation/test_fragmentation.c6
-rw-r--r--src/fs/fs_api.c12
-rw-r--r--src/fs/fs_api.h16
-rw-r--r--src/fs/fs_dirmetascan.c8
-rw-r--r--src/fs/fs_download.c22
-rw-r--r--src/fs/fs_list_indexed.c2
-rw-r--r--src/fs/fs_publish.c26
-rw-r--r--src/fs/fs_publish_ksk.c8
-rw-r--r--src/fs/fs_publish_ublock.c6
-rw-r--r--src/fs/fs_search.c50
-rw-r--r--src/fs/fs_test_lib.c16
-rw-r--r--src/fs/fs_test_lib.h2
-rw-r--r--src/fs/fs_tree.c4
-rw-r--r--src/fs/fs_tree.h2
-rw-r--r--src/fs/gnunet-auto-share.c16
-rw-r--r--src/fs/gnunet-daemon-fsprofiler.c20
-rw-r--r--src/fs/gnunet-fs-profiler.c4
-rw-r--r--src/fs/gnunet-publish.c16
-rw-r--r--src/fs/gnunet-service-fs.c6
-rw-r--r--src/fs/gnunet-service-fs_cadet_client.c18
-rw-r--r--src/fs/gnunet-service-fs_cadet_server.c12
-rw-r--r--src/fs/gnunet-service-fs_cp.c46
-rw-r--r--src/fs/gnunet-service-fs_lc.c10
-rw-r--r--src/fs/gnunet-service-fs_pe.c16
-rw-r--r--src/fs/gnunet-service-fs_pr.c18
-rw-r--r--src/fs/gnunet-service-fs_push.c10
-rw-r--r--src/fs/gnunet-service-fs_put.c10
-rw-r--r--src/fs/test_fs_download.c6
-rw-r--r--src/fs/test_fs_download_persistence.c6
-rw-r--r--src/fs/test_fs_namespace.c8
-rw-r--r--src/fs/test_fs_publish_persistence.c8
-rw-r--r--src/fs/test_fs_search.c8
-rw-r--r--src/fs/test_fs_search_persistence.c8
-rw-r--r--src/fs/test_fs_search_probes.c8
-rw-r--r--src/fs/test_fs_search_with_and.c8
-rw-r--r--src/gns/gns_api.c8
-rw-r--r--src/gns/gnunet-bcd.c14
-rw-r--r--src/gns/gnunet-dns2gns.c10
-rw-r--r--src/gns/gnunet-gns-proxy.c72
-rw-r--r--src/gns/gnunet-service-gns.c10
-rw-r--r--src/gns/gnunet-service-gns_resolver.c12
-rw-r--r--src/gns/gnunet-service-gns_shorten.c6
-rw-r--r--src/gns/test_gns_proxy.c18
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c21
-rw-r--r--src/hostlist/gnunet-daemon-hostlist_client.c104
-rw-r--r--src/hostlist/gnunet-daemon-hostlist_server.c22
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist.c8
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_learning.c16
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_reconnect.c8
-rw-r--r--src/identity/identity_api.c10
-rw-r--r--src/identity/test_identity.c6
-rw-r--r--src/identity/test_identity_defaults.c6
-rw-r--r--src/include/gnunet_bandwidth_lib.h2
-rw-r--r--src/include/gnunet_scheduler_lib.h121
-rw-r--r--src/include/gnunet_sensor_util_lib.h6
-rw-r--r--src/include/gnunet_transport_service.h2
-rw-r--r--src/multicast/test_multicast.c6
-rw-r--r--src/namecache/namecache_api.c8
-rw-r--r--src/namecache/test_namecache_api_cache_block.c8
-rw-r--r--src/namestore/gnunet-namestore-fcfsd.c12
-rw-r--r--src/namestore/gnunet-service-namestore.c8
-rw-r--r--src/namestore/namestore_api.c8
-rw-r--r--src/namestore/test_namestore_api_lookup_nick.c6
-rw-r--r--src/namestore/test_namestore_api_lookup_private.c4
-rw-r--r--src/namestore/test_namestore_api_lookup_public.c8
-rw-r--r--src/namestore/test_namestore_api_lookup_shadow.c8
-rw-r--r--src/namestore/test_namestore_api_lookup_shadow_filter.c16
-rw-r--r--src/namestore/test_namestore_api_monitoring.c6
-rw-r--r--src/namestore/test_namestore_api_monitoring_existing.c6
-rw-r--r--src/namestore/test_namestore_api_remove.c8
-rw-r--r--src/namestore/test_namestore_api_remove_not_existing_record.c6
-rw-r--r--src/namestore/test_namestore_api_store.c4
-rw-r--r--src/namestore/test_namestore_api_store_update.c6
-rw-r--r--src/namestore/test_namestore_api_zone_iteration.c14
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_nick.c14
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_specific_zone.c14
-rw-r--r--src/namestore/test_namestore_api_zone_iteration_stop.c18
-rw-r--r--src/namestore/test_namestore_api_zone_to_name.c6
-rw-r--r--src/nat/nat.c44
-rw-r--r--src/nat/nat_auto.c8
-rw-r--r--src/nat/nat_mini.c16
-rw-r--r--src/nat/nat_test.c20
-rw-r--r--src/nat/test_nat_test.c6
-rw-r--r--src/nse/gnunet-nse-profiler.c6
-rw-r--r--src/nse/gnunet-nse.c4
-rw-r--r--src/nse/gnunet-service-nse.c44
-rw-r--r--src/nse/nse_api.c10
-rw-r--r--src/nse/test_nse_api.c4
-rw-r--r--src/peerinfo-tool/gnunet-peerinfo.c8
-rw-r--r--src/peerinfo/peerinfo_api.c20
-rw-r--r--src/peerinfo/peerinfo_api_notify.c6
-rw-r--r--src/peerinfo/test_peerinfo_api_notify_friend_only.c8
-rw-r--r--src/peerstore/peerstore_api.c8
-rw-r--r--src/psyc/test_psyc.c6
-rw-r--r--src/psycstore/psycstore_api.c10
-rw-r--r--src/psycstore/test_psycstore.c6
-rw-r--r--src/pt/gnunet-daemon-pt.c2
-rw-r--r--src/pt/test_gns_vpn.c18
-rw-r--r--src/pt/test_gnunet_vpn.c26
-rw-r--r--src/regex/gnunet-daemon-regexprofiler.c6
-rw-r--r--src/regex/gnunet-regex-profiler.c36
-rw-r--r--src/regex/gnunet-regex-simulation-profiler.c14
-rw-r--r--src/regex/gnunet-service-regex.c6
-rw-r--r--src/regex/test_regex_api.c6
-rw-r--r--src/revocation/gnunet-service-revocation.c8
-rw-r--r--src/rps/gnunet-service-rps.c6
-rw-r--r--src/sensor/gnunet-sensor-profiler.c12
-rw-r--r--src/sensor/gnunet-service-sensor_monitoring.c2
-rw-r--r--src/sensor/gnunet-service-sensor_reporting.c18
-rw-r--r--src/sensor/gnunet-service-sensor_update.c8
-rw-r--r--src/sensor/perf_pow_sign.c2
-rw-r--r--src/sensor/sensor_api.c8
-rw-r--r--src/sensor/sensor_util_lib.c6
-rw-r--r--src/sensor/sensor_util_lib_crypto.c8
-rw-r--r--src/sensor/test_gnunet-service-sensor_reporting.c12
-rw-r--r--src/sensor/test_pow_sign.c2
-rw-r--r--src/set/gnunet-service-set.c12
-rw-r--r--src/set/gnunet-service-set.h2
-rw-r--r--src/set/set_api.c8
-rw-r--r--src/social/test_social.c6
-rw-r--r--src/statistics/statistics_api.c26
-rw-r--r--src/statistics/test_statistics_api_watch.c2
-rw-r--r--src/statistics/test_statistics_api_watch_zero_value.c2
-rw-r--r--src/testbed/gnunet-daemon-latency-logger.c4
-rw-r--r--src/testbed/gnunet-daemon-testbed-blacklist.c2
-rw-r--r--src/testbed/gnunet-daemon-testbed-underlay.c2
-rw-r--r--src/testbed/gnunet-helper-testbed.c30
-rw-r--r--src/testbed/gnunet-service-testbed-logger.c6
-rw-r--r--src/testbed/gnunet-service-testbed.c6
-rw-r--r--src/testbed/gnunet-service-testbed.h2
-rw-r--r--src/testbed/gnunet-service-testbed_barriers.c2
-rw-r--r--src/testbed/gnunet-service-testbed_connectionpool.c30
-rw-r--r--src/testbed/gnunet-service-testbed_cpustatus.c8
-rw-r--r--src/testbed/gnunet-service-testbed_links.c48
-rw-r--r--src/testbed/gnunet-service-testbed_oc.c70
-rw-r--r--src/testbed/gnunet-testbed-profiler.c18
-rw-r--r--src/testbed/gnunet_testbed_mpi_spawn.c12
-rw-r--r--src/testbed/test_gnunet_helper_testbed.c12
-rw-r--r--src/testbed/test_testbed_api.c10
-rw-r--r--src/testbed/test_testbed_api_2peers_1controller.c16
-rw-r--r--src/testbed/test_testbed_api_3peers_3controllers.c20
-rw-r--r--src/testbed/test_testbed_api_barriers.c4
-rw-r--r--src/testbed/test_testbed_api_controllerlink.c22
-rw-r--r--src/testbed/test_testbed_api_hosts.c2
-rw-r--r--src/testbed/test_testbed_api_operations.c20
-rw-r--r--src/testbed/test_testbed_api_peer_reconfiguration.c8
-rw-r--r--src/testbed/test_testbed_api_peers_manage_services.c8
-rw-r--r--src/testbed/test_testbed_api_statistics.c6
-rw-r--r--src/testbed/test_testbed_api_test.c18
-rw-r--r--src/testbed/test_testbed_api_testbed_run.c10
-rw-r--r--src/testbed/test_testbed_api_topology.c4
-rw-r--r--src/testbed/test_testbed_api_topology_clique.c4
-rw-r--r--src/testbed/test_testbed_logger_api.c12
-rw-r--r--src/testbed/testbed_api_hosts.c4
-rw-r--r--src/testbed/testbed_api_operations.c10
-rw-r--r--src/testbed/testbed_api_statistics.c14
-rw-r--r--src/testbed/testbed_api_testbed.c24
-rw-r--r--src/testbed/testbed_logger_api.c28
-rw-r--r--src/testing/gnunet-testing.c8
-rw-r--r--src/topology/gnunet-daemon-topology.c42
-rw-r--r--src/transport/gnunet-service-transport.c4
-rw-r--r--src/transport/gnunet-service-transport_blacklist.c14
-rw-r--r--src/transport/gnunet-service-transport_hello.c10
-rw-r--r--src/transport/gnunet-service-transport_manipulation.c24
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c36
-rw-r--r--src/transport/gnunet-service-transport_validation.c22
-rw-r--r--src/transport/gnunet-transport-profiler.c6
-rw-r--r--src/transport/gnunet-transport.c70
-rw-r--r--src/transport/plugin_transport_http.h12
-rw-r--r--src/transport/plugin_transport_http_client.c60
-rw-r--r--src/transport/plugin_transport_http_common.c2
-rw-r--r--src/transport/plugin_transport_http_server.c70
-rw-r--r--src/transport/plugin_transport_tcp.c36
-rw-r--r--src/transport/plugin_transport_udp.c28
-rw-r--r--src/transport/plugin_transport_udp.h4
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c10
-rw-r--r--src/transport/plugin_transport_unix.c36
-rw-r--r--src/transport/plugin_transport_wlan.c34
-rw-r--r--src/transport/test_plugin_transport.c28
-rw-r--r--src/transport/test_quota_compliance.c16
-rw-r--r--src/transport/test_transport_address_switch.c36
-rw-r--r--src/transport/test_transport_api.c20
-rw-r--r--src/transport/test_transport_api_bidirectional_connect.c28
-rw-r--r--src/transport/test_transport_api_blacklisting.c28
-rw-r--r--src/transport/test_transport_api_disconnect.c26
-rw-r--r--src/transport/test_transport_api_limited_sockets.c18
-rw-r--r--src/transport/test_transport_api_manipulation_cfg.c24
-rw-r--r--src/transport/test_transport_api_manipulation_recv_tcp.c20
-rw-r--r--src/transport/test_transport_api_manipulation_send_tcp.c20
-rw-r--r--src/transport/test_transport_api_monitor_peers.c22
-rw-r--r--src/transport/test_transport_api_monitor_validation.c22
-rw-r--r--src/transport/test_transport_api_reliability.c18
-rw-r--r--src/transport/test_transport_api_restart_1peer.c44
-rw-r--r--src/transport/test_transport_api_restart_2peers.c44
-rw-r--r--src/transport/test_transport_api_timeout.c26
-rw-r--r--src/transport/test_transport_api_unreliability_constant.c20
-rw-r--r--src/transport/test_transport_blacklisting.c34
-rw-r--r--src/transport/test_transport_startonly.c8
-rw-r--r--src/transport/test_transport_testing.c10
-rw-r--r--src/transport/test_transport_testing_restart.c8
-rw-r--r--src/transport/test_transport_testing_startstop.c8
-rw-r--r--src/transport/transport-testing.c6
-rw-r--r--src/transport/transport-testing.h2
-rw-r--r--src/transport/transport_api.c54
-rw-r--r--src/transport/transport_api_monitor_peers.c8
-rw-r--r--src/transport/transport_api_monitor_plugins.c8
-rw-r--r--src/transport/transport_api_monitor_validation.c8
-rw-r--r--src/util/Makefile.am2
-rw-r--r--src/util/bandwidth.c8
-rw-r--r--src/util/client.c32
-rw-r--r--src/util/client_manager.c10
-rw-r--r--src/util/connection.c82
-rw-r--r--src/util/crypto_hash.c4
-rw-r--r--src/util/gnunet-scrypt.c4
-rw-r--r--src/util/gnunet-uri.c2
-rw-r--r--src/util/helper.c44
-rw-r--r--src/util/mq.c10
-rw-r--r--src/util/os_priority.c6
-rw-r--r--src/util/resolver_api.c48
-rw-r--r--src/util/scheduler.c621
-rw-r--r--src/util/server.c46
-rw-r--r--src/util/service.c8
-rw-r--r--src/util/speedup.c8
-rw-r--r--src/util/test_common_logging_runtime_loglevels.c10
-rw-r--r--src/util/test_os_start_process.c2
-rw-r--r--src/vpn/vpn_api.c8
315 files changed, 2751 insertions, 2754 deletions
diff --git a/doc/testbed_test.c b/doc/testbed_test.c
index bdda338b0..e48bb28d8 100644
--- a/doc/testbed_test.c
+++ b/doc/testbed_test.c
@@ -11,7 +11,7 @@ static struct GNUNET_TESTBED_Operation *dht_op;
11 11
12static struct GNUNET_DHT_Handle *dht_handle; 12static struct GNUNET_DHT_Handle *dht_handle;
13 13
14static GNUNET_SCHEDULER_TaskIdentifier shutdown_tid; 14static struct GNUNET_SCHEDULER_Task * shutdown_tid;
15 15
16 16
17/** 17/**
@@ -39,7 +39,7 @@ static int result;
39static void 39static void
40shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 40shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
41{ 41{
42 shutdown_tid = GNUNET_SCHEDULER_NO_TASK; 42 shutdown_tid = NULL;
43 if (NULL != dht_op) 43 if (NULL != dht_op)
44 { 44 {
45 GNUNET_TESTBED_operation_done (dht_op); /* indirectly calls the dht_da() for closing 45 GNUNET_TESTBED_operation_done (dht_op); /* indirectly calls the dht_da() for closing
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index 1b83c3106..4b68f19de 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -91,7 +91,7 @@ struct GNUNET_ARM_Handle
91 /** 91 /**
92 * ID of the reconnect task (if any). 92 * ID of the reconnect task (if any).
93 */ 93 */
94 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 94 struct GNUNET_SCHEDULER_Task * reconnect_task;
95 95
96 /** 96 /**
97 * Current delay we use for re-trying to connect to core. 97 * Current delay we use for re-trying to connect to core.
@@ -166,7 +166,7 @@ struct ARMControlMessage
166 /** 166 /**
167 * Task to run when request times out. 167 * Task to run when request times out.
168 */ 168 */
169 GNUNET_SCHEDULER_TaskIdentifier timeout_task_id; 169 struct GNUNET_SCHEDULER_Task * timeout_task_id;
170 170
171 /** 171 /**
172 * Flags for passing std descriptors to ARM (when starting ARM). 172 * Flags for passing std descriptors to ARM (when starting ARM).
@@ -212,7 +212,7 @@ reconnect_arm_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
212{ 212{
213 struct GNUNET_ARM_Handle *h = cls; 213 struct GNUNET_ARM_Handle *h = cls;
214 214
215 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 215 h->reconnect_task = NULL;
216 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to ARM service after delay\n"); 216 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to ARM service after delay\n");
217 reconnect_arm (h); 217 reconnect_arm (h);
218} 218}
@@ -240,7 +240,7 @@ reconnect_arm_later (struct GNUNET_ARM_Handle *h)
240 h->client = NULL; 240 h->client = NULL;
241 } 241 }
242 h->currently_down = GNUNET_YES; 242 h->currently_down = GNUNET_YES;
243 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); 243 GNUNET_assert (NULL == h->reconnect_task);
244 h->reconnect_task = 244 h->reconnect_task =
245 GNUNET_SCHEDULER_add_delayed (h->retry_backoff, &reconnect_arm_task, h); 245 GNUNET_SCHEDULER_add_delayed (h->retry_backoff, &reconnect_arm_task, h);
246 /* Don't clear pending messages on disconnection, deliver them later 246 /* Don't clear pending messages on disconnection, deliver them later
@@ -408,7 +408,7 @@ client_notify_handler (void *cls,
408 fail = GNUNET_YES; 408 fail = GNUNET_YES;
409 break; 409 break;
410 } 410 }
411 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != cm->timeout_task_id); 411 GNUNET_assert (NULL != cm->timeout_task_id);
412 GNUNET_SCHEDULER_cancel (cm->timeout_task_id); 412 GNUNET_SCHEDULER_cancel (cm->timeout_task_id);
413 GNUNET_CONTAINER_DLL_remove (h->control_sent_head, 413 GNUNET_CONTAINER_DLL_remove (h->control_sent_head,
414 h->control_sent_tail, cm); 414 h->control_sent_tail, cm);
@@ -493,7 +493,7 @@ transmit_arm_message (void *cls, size_t size, void *buf)
493 LOG (GNUNET_ERROR_TYPE_DEBUG, 493 LOG (GNUNET_ERROR_TYPE_DEBUG,
494 "transmit_arm_message is running with %p buffer of size %lu. ARM is known to be %s\n", 494 "transmit_arm_message is running with %p buffer of size %lu. ARM is known to be %s\n",
495 buf, size, h->currently_down ? "unconnected" : "connected"); 495 buf, size, h->currently_down ? "unconnected" : "connected");
496 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); 496 GNUNET_assert (NULL == h->reconnect_task);
497 h->cth = NULL; 497 h->cth = NULL;
498 if ((GNUNET_YES == h->currently_down) && (NULL != buf)) 498 if ((GNUNET_YES == h->currently_down) && (NULL != buf))
499 { 499 {
@@ -643,7 +643,7 @@ GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
643 h = GNUNET_new (struct GNUNET_ARM_Handle); 643 h = GNUNET_new (struct GNUNET_ARM_Handle);
644 h->cfg = GNUNET_CONFIGURATION_dup (cfg); 644 h->cfg = GNUNET_CONFIGURATION_dup (cfg);
645 h->currently_down = GNUNET_YES; 645 h->currently_down = GNUNET_YES;
646 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 646 h->reconnect_task = NULL;
647 h->conn_status = conn_status; 647 h->conn_status = conn_status;
648 h->conn_status_cls = cls; 648 h->conn_status_cls = cls;
649 if (GNUNET_OK != reconnect_arm (h)) 649 if (GNUNET_OK != reconnect_arm (h))
@@ -680,7 +680,7 @@ GNUNET_ARM_disconnect_and_free (struct GNUNET_ARM_Handle *h)
680 else 680 else
681 GNUNET_CONTAINER_DLL_remove (h->control_sent_head, 681 GNUNET_CONTAINER_DLL_remove (h->control_sent_head,
682 h->control_sent_tail, cm); 682 h->control_sent_tail, cm);
683 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != cm->timeout_task_id); 683 GNUNET_assert (NULL != cm->timeout_task_id);
684 GNUNET_SCHEDULER_cancel (cm->timeout_task_id); 684 GNUNET_SCHEDULER_cancel (cm->timeout_task_id);
685 if (NULL != cm->result_cont) 685 if (NULL != cm->result_cont)
686 cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_DISCONNECTED, 686 cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_DISCONNECTED,
@@ -694,10 +694,10 @@ GNUNET_ARM_disconnect_and_free (struct GNUNET_ARM_Handle *h)
694 GNUNET_CLIENT_disconnect (h->client); 694 GNUNET_CLIENT_disconnect (h->client);
695 h->client = NULL; 695 h->client = NULL;
696 } 696 }
697 if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task) 697 if (NULL != h->reconnect_task)
698 { 698 {
699 GNUNET_SCHEDULER_cancel (h->reconnect_task); 699 GNUNET_SCHEDULER_cancel (h->reconnect_task);
700 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 700 h->reconnect_task = NULL;
701 } 701 }
702 if (GNUNET_NO == h->service_test_is_active) 702 if (GNUNET_NO == h->service_test_is_active)
703 { 703 {
@@ -984,10 +984,10 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
984 GNUNET_CLIENT_disconnect (h->client); 984 GNUNET_CLIENT_disconnect (h->client);
985 h->client = NULL; 985 h->client = NULL;
986 } 986 }
987 if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task) 987 if (NULL != h->reconnect_task)
988 { 988 {
989 GNUNET_SCHEDULER_cancel (h->reconnect_task); 989 GNUNET_SCHEDULER_cancel (h->reconnect_task);
990 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 990 h->reconnect_task = NULL;
991 } 991 }
992 992
993 LOG (GNUNET_ERROR_TYPE_DEBUG, 993 LOG (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/arm/arm_monitor_api.c b/src/arm/arm_monitor_api.c
index 676543f26..c03f5df0f 100644
--- a/src/arm/arm_monitor_api.c
+++ b/src/arm/arm_monitor_api.c
@@ -57,7 +57,7 @@ struct GNUNET_ARM_MonitorHandle
57 /** 57 /**
58 * ID of the reconnect task (if any). 58 * ID of the reconnect task (if any).
59 */ 59 */
60 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 60 struct GNUNET_SCHEDULER_Task * reconnect_task;
61 61
62 /** 62 /**
63 * Current delay we use for re-trying to connect to core. 63 * Current delay we use for re-trying to connect to core.
@@ -82,7 +82,7 @@ struct GNUNET_ARM_MonitorHandle
82 /** 82 /**
83 * ID of a task to run if we fail to get a reply to the init message in time. 83 * ID of a task to run if we fail to get a reply to the init message in time.
84 */ 84 */
85 GNUNET_SCHEDULER_TaskIdentifier init_timeout_task_id; 85 struct GNUNET_SCHEDULER_Task * init_timeout_task_id;
86}; 86};
87 87
88static void 88static void
@@ -102,7 +102,7 @@ reconnect_arm_monitor_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext
102{ 102{
103 struct GNUNET_ARM_MonitorHandle *h = cls; 103 struct GNUNET_ARM_MonitorHandle *h = cls;
104 104
105 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 105 h->reconnect_task = NULL;
106 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to ARM service for monitoring after delay\n"); 106 LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to ARM service for monitoring after delay\n");
107 reconnect_arm_monitor (h); 107 reconnect_arm_monitor (h);
108} 108}
@@ -129,13 +129,13 @@ reconnect_arm_monitor_later (struct GNUNET_ARM_MonitorHandle *h)
129 h->monitor = NULL; 129 h->monitor = NULL;
130 } 130 }
131 131
132 if (GNUNET_SCHEDULER_NO_TASK != h->init_timeout_task_id) 132 if (NULL != h->init_timeout_task_id)
133 { 133 {
134 GNUNET_SCHEDULER_cancel (h->init_timeout_task_id); 134 GNUNET_SCHEDULER_cancel (h->init_timeout_task_id);
135 h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK; 135 h->init_timeout_task_id = NULL;
136 } 136 }
137 137
138 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); 138 GNUNET_assert (NULL == h->reconnect_task);
139 h->reconnect_task = 139 h->reconnect_task =
140 GNUNET_SCHEDULER_add_delayed (h->retry_backoff, &reconnect_arm_monitor_task, h); 140 GNUNET_SCHEDULER_add_delayed (h->retry_backoff, &reconnect_arm_monitor_task, h);
141 141
@@ -156,7 +156,7 @@ init_timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
156 LOG (GNUNET_ERROR_TYPE_DEBUG, 156 LOG (GNUNET_ERROR_TYPE_DEBUG,
157 "Init message timed out\n"); 157 "Init message timed out\n");
158 158
159 h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK; 159 h->init_timeout_task_id = NULL;
160 reconnect_arm_monitor_later (h); 160 reconnect_arm_monitor_later (h);
161} 161}
162 162
@@ -176,8 +176,8 @@ transmit_monitoring_init_message (void *cls, size_t size, void *buf)
176 struct GNUNET_MessageHeader *msg; 176 struct GNUNET_MessageHeader *msg;
177 uint16_t msize; 177 uint16_t msize;
178 178
179 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); 179 GNUNET_assert (NULL == h->reconnect_task);
180 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->init_timeout_task_id); 180 GNUNET_assert (NULL == h->init_timeout_task_id);
181 h->cth = NULL; 181 h->cth = NULL;
182 if (NULL == buf) 182 if (NULL == buf)
183 { 183 {
@@ -254,8 +254,8 @@ GNUNET_ARM_monitor (const struct GNUNET_CONFIGURATION_Handle *cfg,
254 h = GNUNET_new (struct GNUNET_ARM_MonitorHandle); 254 h = GNUNET_new (struct GNUNET_ARM_MonitorHandle);
255 h->cfg = GNUNET_CONFIGURATION_dup (cfg); 255 h->cfg = GNUNET_CONFIGURATION_dup (cfg);
256 h->currently_down = GNUNET_YES; 256 h->currently_down = GNUNET_YES;
257 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 257 h->reconnect_task = NULL;
258 h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK; 258 h->init_timeout_task_id = NULL;
259 h->service_status = cont; 259 h->service_status = cont;
260 h->cls = cont_cls; 260 h->cls = cont_cls;
261 if (GNUNET_OK != reconnect_arm_monitor (h)) 261 if (GNUNET_OK != reconnect_arm_monitor (h))
@@ -281,20 +281,20 @@ GNUNET_ARM_monitor_disconnect_and_free (struct GNUNET_ARM_MonitorHandle *h)
281 GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth); 281 GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth);
282 h->cth = NULL; 282 h->cth = NULL;
283 } 283 }
284 if (GNUNET_SCHEDULER_NO_TASK != h->init_timeout_task_id) 284 if (NULL != h->init_timeout_task_id)
285 { 285 {
286 GNUNET_SCHEDULER_cancel (h->init_timeout_task_id); 286 GNUNET_SCHEDULER_cancel (h->init_timeout_task_id);
287 h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK; 287 h->init_timeout_task_id = NULL;
288 } 288 }
289 if (NULL != h->monitor) 289 if (NULL != h->monitor)
290 { 290 {
291 GNUNET_CLIENT_disconnect (h->monitor); 291 GNUNET_CLIENT_disconnect (h->monitor);
292 h->monitor = NULL; 292 h->monitor = NULL;
293 } 293 }
294 if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task) 294 if (NULL != h->reconnect_task)
295 { 295 {
296 GNUNET_SCHEDULER_cancel (h->reconnect_task); 296 GNUNET_SCHEDULER_cancel (h->reconnect_task);
297 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 297 h->reconnect_task = NULL;
298 } 298 }
299 GNUNET_CONFIGURATION_destroy (h->cfg); 299 GNUNET_CONFIGURATION_destroy (h->cfg);
300 GNUNET_free (h); 300 GNUNET_free (h);
@@ -335,10 +335,10 @@ monitor_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
335 reconnect_arm_monitor_later (h); 335 reconnect_arm_monitor_later (h);
336 return; 336 return;
337 } 337 }
338 if (GNUNET_SCHEDULER_NO_TASK != h->init_timeout_task_id) 338 if (NULL != h->init_timeout_task_id)
339 { 339 {
340 GNUNET_SCHEDULER_cancel (h->init_timeout_task_id); 340 GNUNET_SCHEDULER_cancel (h->init_timeout_task_id);
341 h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK; 341 h->init_timeout_task_id = NULL;
342 } 342 }
343 res = (const struct GNUNET_ARM_StatusMessage *) msg; 343 res = (const struct GNUNET_ARM_StatusMessage *) msg;
344 LOG (GNUNET_ERROR_TYPE_DEBUG, 344 LOG (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index c6259c273..630816d1d 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -81,7 +81,7 @@ struct ServiceListeningInfo
81 /** 81 /**
82 * Task doing the accepting. 82 * Task doing the accepting.
83 */ 83 */
84 GNUNET_SCHEDULER_TaskIdentifier accept_task; 84 struct GNUNET_SCHEDULER_Task * accept_task;
85 85
86}; 86};
87 87
@@ -200,13 +200,13 @@ static char *final_option;
200/** 200/**
201 * ID of task called whenever we get a SIGCHILD. 201 * ID of task called whenever we get a SIGCHILD.
202 */ 202 */
203static GNUNET_SCHEDULER_TaskIdentifier child_death_task; 203static struct GNUNET_SCHEDULER_Task * child_death_task;
204 204
205/** 205/**
206 * ID of task called whenever the timeout for restarting a child 206 * ID of task called whenever the timeout for restarting a child
207 * expires. 207 * expires.
208 */ 208 */
209static GNUNET_SCHEDULER_TaskIdentifier child_restart_task; 209static struct GNUNET_SCHEDULER_Task * child_restart_task;
210 210
211/** 211/**
212 * Pipe used to communicate shutdown via signal. 212 * Pipe used to communicate shutdown via signal.
@@ -421,10 +421,10 @@ start_process (struct ServiceList *sl,
421 { 421 {
422 GNUNET_array_append (lsocks, ls, 422 GNUNET_array_append (lsocks, ls,
423 GNUNET_NETWORK_get_fd (sli->listen_socket)); 423 GNUNET_NETWORK_get_fd (sli->listen_socket));
424 if (sli->accept_task != GNUNET_SCHEDULER_NO_TASK) 424 if (sli->accept_task != NULL)
425 { 425 {
426 GNUNET_SCHEDULER_cancel (sli->accept_task); 426 GNUNET_SCHEDULER_cancel (sli->accept_task);
427 sli->accept_task = GNUNET_SCHEDULER_NO_TASK; 427 sli->accept_task = NULL;
428 } 428 }
429 } 429 }
430#if WINDOWS 430#if WINDOWS
@@ -586,7 +586,7 @@ accept_connection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
586 struct ServiceListeningInfo *sli = cls; 586 struct ServiceListeningInfo *sli = cls;
587 struct ServiceList *sl = sli->sl; 587 struct ServiceList *sl = sli->sl;
588 588
589 sli->accept_task = GNUNET_SCHEDULER_NO_TASK; 589 sli->accept_task = NULL;
590 GNUNET_assert (GNUNET_NO == in_shutdown); 590 GNUNET_assert (GNUNET_NO == in_shutdown);
591 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 591 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
592 return; 592 return;
@@ -971,10 +971,10 @@ do_shutdown ()
971 GNUNET_SERVER_destroy (server); 971 GNUNET_SERVER_destroy (server);
972 server = NULL; 972 server = NULL;
973 } 973 }
974 if (GNUNET_SCHEDULER_NO_TASK != child_death_task) 974 if (NULL != child_death_task)
975 { 975 {
976 GNUNET_SCHEDULER_cancel (child_death_task); 976 GNUNET_SCHEDULER_cancel (child_death_task);
977 child_death_task = GNUNET_SCHEDULER_NO_TASK; 977 child_death_task = NULL;
978 } 978 }
979} 979}
980 980
@@ -1015,10 +1015,10 @@ shutdown_task (void *cls,
1015 1015
1016 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1016 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1017 "First shutdown phase\n"); 1017 "First shutdown phase\n");
1018 if (GNUNET_SCHEDULER_NO_TASK != child_restart_task) 1018 if (NULL != child_restart_task)
1019 { 1019 {
1020 GNUNET_SCHEDULER_cancel (child_restart_task); 1020 GNUNET_SCHEDULER_cancel (child_restart_task);
1021 child_restart_task = GNUNET_SCHEDULER_NO_TASK; 1021 child_restart_task = NULL;
1022 } 1022 }
1023 in_shutdown = GNUNET_YES; 1023 in_shutdown = GNUNET_YES;
1024 /* first, stop listening */ 1024 /* first, stop listening */
@@ -1028,10 +1028,10 @@ shutdown_task (void *cls,
1028 { 1028 {
1029 GNUNET_CONTAINER_DLL_remove (pos->listen_head, 1029 GNUNET_CONTAINER_DLL_remove (pos->listen_head,
1030 pos->listen_tail, sli); 1030 pos->listen_tail, sli);
1031 if (sli->accept_task != GNUNET_SCHEDULER_NO_TASK) 1031 if (sli->accept_task != NULL)
1032 { 1032 {
1033 GNUNET_SCHEDULER_cancel (sli->accept_task); 1033 GNUNET_SCHEDULER_cancel (sli->accept_task);
1034 sli->accept_task = GNUNET_SCHEDULER_NO_TASK; 1034 sli->accept_task = NULL;
1035 } 1035 }
1036 GNUNET_break (GNUNET_OK == 1036 GNUNET_break (GNUNET_OK ==
1037 GNUNET_NETWORK_socket_close (sli->listen_socket)); 1037 GNUNET_NETWORK_socket_close (sli->listen_socket));
@@ -1082,7 +1082,7 @@ delayed_restart_task (void *cls,
1082 struct GNUNET_TIME_Relative lowestRestartDelay; 1082 struct GNUNET_TIME_Relative lowestRestartDelay;
1083 struct ServiceListeningInfo *sli; 1083 struct ServiceListeningInfo *sli;
1084 1084
1085 child_restart_task = GNUNET_SCHEDULER_NO_TASK; 1085 child_restart_task = NULL;
1086 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1086 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1087 return; 1087 return;
1088 GNUNET_assert (GNUNET_NO == in_shutdown); 1088 GNUNET_assert (GNUNET_NO == in_shutdown);
@@ -1110,7 +1110,7 @@ delayed_restart_task (void *cls,
1110 { 1110 {
1111 /* process is run on-demand, ensure it is re-started if there is demand */ 1111 /* process is run on-demand, ensure it is re-started if there is demand */
1112 for (sli = sl->listen_head; NULL != sli; sli = sli->next) 1112 for (sli = sl->listen_head; NULL != sli; sli = sli->next)
1113 if (GNUNET_SCHEDULER_NO_TASK == sli->accept_task) 1113 if (NULL == sli->accept_task)
1114 { 1114 {
1115 /* accept was actually paused, so start it again */ 1115 /* accept was actually paused, so start it again */
1116 sli->accept_task = 1116 sli->accept_task =
@@ -1164,7 +1164,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1164 const struct GNUNET_DISK_FileHandle *pr; 1164 const struct GNUNET_DISK_FileHandle *pr;
1165 1165
1166 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ); 1166 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
1167 child_death_task = GNUNET_SCHEDULER_NO_TASK; 1167 child_death_task = NULL;
1168 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 1168 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
1169 { 1169 {
1170 /* shutdown scheduled us, ignore! */ 1170 /* shutdown scheduled us, ignore! */
@@ -1239,7 +1239,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1239 /* process can still be re-started on-demand, ensure it is re-started if there is demand */ 1239 /* process can still be re-started on-demand, ensure it is re-started if there is demand */
1240 for (sli = pos->listen_head; NULL != sli; sli = sli->next) 1240 for (sli = pos->listen_head; NULL != sli; sli = sli->next)
1241 { 1241 {
1242 GNUNET_break (GNUNET_SCHEDULER_NO_TASK == sli->accept_task); 1242 GNUNET_break (NULL == sli->accept_task);
1243 sli->accept_task = 1243 sli->accept_task =
1244 GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL, 1244 GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
1245 sli->listen_socket, &accept_connection, sli); 1245 sli->listen_socket, &accept_connection, sli);
@@ -1255,7 +1255,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1255 /* schedule restart */ 1255 /* schedule restart */
1256 pos->restart_at = GNUNET_TIME_relative_to_absolute (pos->backoff); 1256 pos->restart_at = GNUNET_TIME_relative_to_absolute (pos->backoff);
1257 pos->backoff = GNUNET_TIME_STD_BACKOFF (pos->backoff); 1257 pos->backoff = GNUNET_TIME_STD_BACKOFF (pos->backoff);
1258 if (GNUNET_SCHEDULER_NO_TASK != child_restart_task) 1258 if (NULL != child_restart_task)
1259 GNUNET_SCHEDULER_cancel (child_restart_task); 1259 GNUNET_SCHEDULER_cancel (child_restart_task);
1260 child_restart_task = GNUNET_SCHEDULER_add_with_priority ( 1260 child_restart_task = GNUNET_SCHEDULER_add_with_priority (
1261 GNUNET_SCHEDULER_PRIORITY_IDLE, &delayed_restart_task, NULL); 1261 GNUNET_SCHEDULER_PRIORITY_IDLE, &delayed_restart_task, NULL);
diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c
index 7a552cc7c..17aa8a04c 100644
--- a/src/arm/test_exponential_backoff.c
+++ b/src/arm/test_exponential_backoff.c
@@ -90,7 +90,7 @@ struct ShutdownContext
90 /** 90 /**
91 * Task set up to cancel the shutdown request on timeout. 91 * Task set up to cancel the shutdown request on timeout.
92 */ 92 */
93 GNUNET_SCHEDULER_TaskIdentifier cancel_task; 93 struct GNUNET_SCHEDULER_Task * cancel_task;
94 94
95 /** 95 /**
96 * Task to call once shutdown complete 96 * Task to call once shutdown complete
diff --git a/src/ats-tests/ats-testing-experiment.c b/src/ats-tests/ats-testing-experiment.c
index b07d8fdcd..05c27cbc4 100644
--- a/src/ats-tests/ats-testing-experiment.c
+++ b/src/ats-tests/ats-testing-experiment.c
@@ -420,13 +420,13 @@ static void
420timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 420timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
421{ 421{
422 struct Experiment *e = cls; 422 struct Experiment *e = cls;
423 e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK; 423 e->experiment_timeout_task = NULL;
424 fprintf (stderr, "Experiment timeout!\n"); 424 fprintf (stderr, "Experiment timeout!\n");
425 425
426 if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task) 426 if (NULL != e->episode_timeout_task)
427 { 427 {
428 GNUNET_SCHEDULER_cancel (e->episode_timeout_task); 428 GNUNET_SCHEDULER_cancel (e->episode_timeout_task);
429 e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK; 429 e->episode_timeout_task = NULL;
430 } 430 }
431 431
432 e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), 432 e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time),
@@ -578,7 +578,7 @@ static void
578timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 578timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
579{ 579{
580 struct Experiment *e = cls; 580 struct Experiment *e = cls;
581 e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK; 581 e->episode_timeout_task = NULL;
582 if (NULL != e->ep_done_cb) 582 if (NULL != e->ep_done_cb)
583 e->ep_done_cb (e->cur); 583 e->ep_done_cb (e->cur);
584 584
@@ -588,10 +588,10 @@ timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
588 { 588 {
589 /* done */ 589 /* done */
590 fprintf (stderr, "Last episode done!\n"); 590 fprintf (stderr, "Last episode done!\n");
591 if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task) 591 if (NULL != e->experiment_timeout_task)
592 { 592 {
593 GNUNET_SCHEDULER_cancel (e->experiment_timeout_task); 593 GNUNET_SCHEDULER_cancel (e->experiment_timeout_task);
594 e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK; 594 e->experiment_timeout_task = NULL;
595 } 595 }
596 e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), GNUNET_OK); 596 e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), GNUNET_OK);
597 return; 597 return;
@@ -728,15 +728,15 @@ GNUNET_ATS_TEST_experimentation_load (char *filename)
728void 728void
729GNUNET_ATS_TEST_experimentation_stop (struct Experiment *e) 729GNUNET_ATS_TEST_experimentation_stop (struct Experiment *e)
730{ 730{
731 if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task) 731 if (NULL != e->experiment_timeout_task)
732 { 732 {
733 GNUNET_SCHEDULER_cancel (e->experiment_timeout_task); 733 GNUNET_SCHEDULER_cancel (e->experiment_timeout_task);
734 e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK; 734 e->experiment_timeout_task = NULL;
735 } 735 }
736 if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task) 736 if (NULL != e->episode_timeout_task)
737 { 737 {
738 GNUNET_SCHEDULER_cancel (e->episode_timeout_task); 738 GNUNET_SCHEDULER_cancel (e->episode_timeout_task);
739 e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK; 739 e->episode_timeout_task = NULL;
740 } 740 }
741 free_experiment (e); 741 free_experiment (e);
742} 742}
diff --git a/src/ats-tests/ats-testing-log.c b/src/ats-tests/ats-testing-log.c
index e2367cc78..5b7a206b9 100644
--- a/src/ats-tests/ats-testing-log.c
+++ b/src/ats-tests/ats-testing-log.c
@@ -233,7 +233,7 @@ struct LoggingHandle
233 /** 233 /**
234 * Logging task 234 * Logging task
235 */ 235 */
236 GNUNET_SCHEDULER_TaskIdentifier log_task; 236 struct GNUNET_SCHEDULER_Task * log_task;
237 237
238 /** 238 /**
239 * Reference to perf_ats' masters 239 * Reference to perf_ats' masters
@@ -815,7 +815,7 @@ static void
815collect_log_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 815collect_log_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
816{ 816{
817 struct LoggingHandle *l = cls; 817 struct LoggingHandle *l = cls;
818 l->log_task = GNUNET_SCHEDULER_NO_TASK; 818 l->log_task = NULL;
819 819
820 GNUNET_ATS_TEST_logging_now (l); 820 GNUNET_ATS_TEST_logging_now (l);
821 821
@@ -837,9 +837,9 @@ GNUNET_ATS_TEST_logging_stop (struct LoggingHandle *l)
837 if (GNUNET_YES!= l->running) 837 if (GNUNET_YES!= l->running)
838 return; 838 return;
839 839
840 if (GNUNET_SCHEDULER_NO_TASK != l->log_task) 840 if (NULL != l->log_task)
841 GNUNET_SCHEDULER_cancel (l->log_task); 841 GNUNET_SCHEDULER_cancel (l->log_task);
842 l->log_task = GNUNET_SCHEDULER_NO_TASK; 842 l->log_task = NULL;
843 l->running = GNUNET_NO; 843 l->running = GNUNET_NO;
844 844
845 GNUNET_log(GNUNET_ERROR_TYPE_INFO, 845 GNUNET_log(GNUNET_ERROR_TYPE_INFO,
diff --git a/src/ats-tests/ats-testing-preferences.c b/src/ats-tests/ats-testing-preferences.c
index 1b11bd924..ba69ae8c5 100644
--- a/src/ats-tests/ats-testing-preferences.c
+++ b/src/ats-tests/ats-testing-preferences.c
@@ -96,7 +96,7 @@ set_pref_task (void *cls,
96{ 96{
97 struct BenchmarkPartner *p = cls; 97 struct BenchmarkPartner *p = cls;
98 double pref_value; 98 double pref_value;
99 p->pg->set_task = GNUNET_SCHEDULER_NO_TASK; 99 p->pg->set_task = NULL;
100 100
101 pref_value = get_preference (p->pg); 101 pref_value = get_preference (p->pg);
102 102
@@ -214,10 +214,10 @@ GNUNET_ATS_TEST_generate_preferences_stop (struct PreferenceGenerator *pg)
214 GNUNET_CONTAINER_DLL_remove (pg_head, pg_tail, pg); 214 GNUNET_CONTAINER_DLL_remove (pg_head, pg_tail, pg);
215 pg->dest->pg = NULL; 215 pg->dest->pg = NULL;
216 216
217 if (GNUNET_SCHEDULER_NO_TASK != pg->set_task) 217 if (NULL != pg->set_task)
218 { 218 {
219 GNUNET_SCHEDULER_cancel (pg->set_task); 219 GNUNET_SCHEDULER_cancel (pg->set_task);
220 pg->set_task = GNUNET_SCHEDULER_NO_TASK; 220 pg->set_task = NULL;
221 } 221 }
222 222
223 GNUNET_free (pg); 223 GNUNET_free (pg);
diff --git a/src/ats-tests/ats-testing-traffic.c b/src/ats-tests/ats-testing-traffic.c
index fca65b900..ffeaad126 100644
--- a/src/ats-tests/ats-testing-traffic.c
+++ b/src/ats-tests/ats-testing-traffic.c
@@ -171,7 +171,7 @@ comm_schedule_send (void *cls,
171{ 171{
172 struct BenchmarkPartner *p = cls; 172 struct BenchmarkPartner *p = cls;
173 173
174 p->tg->send_task = GNUNET_SCHEDULER_NO_TASK; 174 p->tg->send_task = NULL;
175 p->last_message_sent = GNUNET_TIME_absolute_get(); 175 p->last_message_sent = GNUNET_TIME_absolute_get();
176 if (GNUNET_YES == top->test_core) 176 if (GNUNET_YES == top->test_core)
177 { 177 {
@@ -389,10 +389,10 @@ GNUNET_ATS_TEST_generate_traffic_stop (struct TrafficGenerator *tg)
389 GNUNET_CONTAINER_DLL_remove (tg_head, tg_tail, tg); 389 GNUNET_CONTAINER_DLL_remove (tg_head, tg_tail, tg);
390 tg->dest->tg = NULL; 390 tg->dest->tg = NULL;
391 391
392 if (GNUNET_SCHEDULER_NO_TASK != tg->send_task) 392 if (NULL != tg->send_task)
393 { 393 {
394 GNUNET_SCHEDULER_cancel (tg->send_task); 394 GNUNET_SCHEDULER_cancel (tg->send_task);
395 tg->send_task = GNUNET_SCHEDULER_NO_TASK; 395 tg->send_task = NULL;
396 } 396 }
397 if (top->test_core) 397 if (top->test_core)
398 { 398 {
diff --git a/src/ats-tests/ats-testing.c b/src/ats-tests/ats-testing.c
index 23634974b..f64fa1822 100644
--- a/src/ats-tests/ats-testing.c
+++ b/src/ats-tests/ats-testing.c
@@ -66,7 +66,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
66 int c_op; 66 int c_op;
67 struct BenchmarkPeer *p; 67 struct BenchmarkPeer *p;
68 68
69 top->shutdown_task = GNUNET_SCHEDULER_NO_TASK; 69 top->shutdown_task = NULL;
70 top->state.benchmarking = GNUNET_NO; 70 top->state.benchmarking = GNUNET_NO;
71 71
72 GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Benchmarking done\n")); 72 GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Benchmarking done\n"));
@@ -82,9 +82,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
82 p->peer_id_op = NULL; 82 p->peer_id_op = NULL;
83 } 83 }
84 84
85 if (GNUNET_SCHEDULER_NO_TASK != p->ats_task) 85 if (NULL != p->ats_task)
86 GNUNET_SCHEDULER_cancel (p->ats_task); 86 GNUNET_SCHEDULER_cancel (p->ats_task);
87 p->ats_task = GNUNET_SCHEDULER_NO_TASK; 87 p->ats_task = NULL;
88 88
89 for (c_op = 0; c_op < p->num_partners; c_op++) 89 for (c_op = 0; c_op < p->num_partners; c_op++)
90 { 90 {
@@ -419,7 +419,7 @@ connect_completion_callback (void *cls, struct GNUNET_TESTBED_Operation *op,
419 _("Failed to connect master peer [%u] with slave [%u]\n"), 419 _("Failed to connect master peer [%u] with slave [%u]\n"),
420 cop->master->no, cop->slave->no); 420 cop->master->no, cop->slave->no);
421 GNUNET_break(0); 421 GNUNET_break(0);
422 if (GNUNET_SCHEDULER_NO_TASK != top->shutdown_task) 422 if (NULL != top->shutdown_task)
423 GNUNET_SCHEDULER_cancel (top->shutdown_task); 423 GNUNET_SCHEDULER_cancel (top->shutdown_task);
424 top->shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL ); 424 top->shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL );
425 } 425 }
@@ -470,7 +470,7 @@ do_connect_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
470 _("Could not connect master [%u] and slave [%u]\n"), p->no, 470 _("Could not connect master [%u] and slave [%u]\n"), p->no,
471 top->sps[c_s].no); 471 top->sps[c_s].no);
472 GNUNET_break(0); 472 GNUNET_break(0);
473 if (GNUNET_SCHEDULER_NO_TASK != top->shutdown_task) 473 if (NULL != top->shutdown_task)
474 GNUNET_SCHEDULER_cancel (top->shutdown_task); 474 GNUNET_SCHEDULER_cancel (top->shutdown_task);
475 top->shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL ); 475 top->shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL );
476 return; 476 return;
@@ -489,7 +489,7 @@ comm_connect_completion_cb (void *cls, struct GNUNET_TESTBED_Operation *op,
489 { 489 {
490 GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Initialization failed, shutdown\n")); 490 GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Initialization failed, shutdown\n"));
491 GNUNET_break(0); 491 GNUNET_break(0);
492 if (GNUNET_SCHEDULER_NO_TASK != top->shutdown_task) 492 if (NULL != top->shutdown_task)
493 GNUNET_SCHEDULER_cancel (top->shutdown_task); 493 GNUNET_SCHEDULER_cancel (top->shutdown_task);
494 top->shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL ); 494 top->shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL );
495 return; 495 return;
@@ -676,7 +676,7 @@ ats_connect_completion_cb (void *cls, struct GNUNET_TESTBED_Operation *op,
676 { 676 {
677 GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Initialization failed, shutdown\n")); 677 GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Initialization failed, shutdown\n"));
678 GNUNET_break(0); 678 GNUNET_break(0);
679 if (GNUNET_SCHEDULER_NO_TASK != top->shutdown_task) 679 if (NULL != top->shutdown_task)
680 GNUNET_SCHEDULER_cancel (top->shutdown_task); 680 GNUNET_SCHEDULER_cancel (top->shutdown_task);
681 top->shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL ); 681 top->shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL );
682 return; 682 return;
diff --git a/src/ats-tests/ats-testing.h b/src/ats-tests/ats-testing.h
index c74a460f0..0be6aa914 100644
--- a/src/ats-tests/ats-testing.h
+++ b/src/ats-tests/ats-testing.h
@@ -167,7 +167,7 @@ struct BenchmarkPeer
167 * Masters only 167 * Masters only
168 * Progress task 168 * Progress task
169 */ 169 */
170 GNUNET_SCHEDULER_TaskIdentifier ats_task; 170 struct GNUNET_SCHEDULER_Task * ats_task;
171 171
172 /** 172 /**
173 * Masters only 173 * Masters only
@@ -232,7 +232,7 @@ struct TrafficGenerator
232 long int max_rate; 232 long int max_rate;
233 struct GNUNET_TIME_Relative duration_period; 233 struct GNUNET_TIME_Relative duration_period;
234 234
235 GNUNET_SCHEDULER_TaskIdentifier send_task; 235 struct GNUNET_SCHEDULER_Task * send_task;
236 struct GNUNET_TIME_Absolute next_ping_transmission; 236 struct GNUNET_TIME_Absolute next_ping_transmission;
237 struct GNUNET_TIME_Absolute time_start; 237 struct GNUNET_TIME_Absolute time_start;
238}; 238};
@@ -255,7 +255,7 @@ struct PreferenceGenerator
255 struct GNUNET_TIME_Relative duration_period; 255 struct GNUNET_TIME_Relative duration_period;
256 struct GNUNET_TIME_Relative frequency; 256 struct GNUNET_TIME_Relative frequency;
257 257
258 GNUNET_SCHEDULER_TaskIdentifier set_task; 258 struct GNUNET_SCHEDULER_Task * set_task;
259 struct GNUNET_TIME_Absolute next_ping_transmission; 259 struct GNUNET_TIME_Absolute next_ping_transmission;
260 struct GNUNET_TIME_Absolute time_start; 260 struct GNUNET_TIME_Absolute time_start;
261}; 261};
@@ -381,12 +381,12 @@ struct GNUNET_ATS_TEST_Topology
381 /** 381 /**
382 * Shutdown task 382 * Shutdown task
383 */ 383 */
384 GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 384 struct GNUNET_SCHEDULER_Task * shutdown_task;
385 385
386 /** 386 /**
387 * Progress task 387 * Progress task
388 */ 388 */
389 GNUNET_SCHEDULER_TaskIdentifier progress_task; 389 struct GNUNET_SCHEDULER_Task * progress_task;
390 390
391 /** 391 /**
392 * Test result 392 * Test result
@@ -524,8 +524,8 @@ struct Experiment
524 unsigned int num_episodes; 524 unsigned int num_episodes;
525 struct Episode *start; 525 struct Episode *start;
526 526
527 GNUNET_SCHEDULER_TaskIdentifier experiment_timeout_task; 527 struct GNUNET_SCHEDULER_Task * experiment_timeout_task;
528 GNUNET_SCHEDULER_TaskIdentifier episode_timeout_task; 528 struct GNUNET_SCHEDULER_Task * episode_timeout_task;
529 struct Episode *cur; 529 struct Episode *cur;
530 530
531 GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb; 531 GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb;
diff --git a/src/ats-tests/gnunet-ats-sim.c b/src/ats-tests/gnunet-ats-sim.c
index 0659af05d..10a85702f 100644
--- a/src/ats-tests/gnunet-ats-sim.c
+++ b/src/ats-tests/gnunet-ats-sim.c
@@ -57,7 +57,7 @@ static int opt_plot;
57 */ 57 */
58static int opt_verbose; 58static int opt_verbose;
59 59
60GNUNET_SCHEDULER_TaskIdentifier timeout_task; 60struct GNUNET_SCHEDULER_Task * timeout_task;
61 61
62struct Experiment *e; 62struct Experiment *e;
63struct LoggingHandle *l; 63struct LoggingHandle *l;
@@ -183,10 +183,10 @@ experiment_done_cb (struct Experiment *e, struct GNUNET_TIME_Relative duration,i
183 GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES)); 183 GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
184 else 184 else
185 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Experiment failed \n"); 185 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Experiment failed \n");
186 if (GNUNET_SCHEDULER_NO_TASK != timeout_task) 186 if (NULL != timeout_task)
187 { 187 {
188 GNUNET_SCHEDULER_cancel (timeout_task); 188 GNUNET_SCHEDULER_cancel (timeout_task);
189 timeout_task = GNUNET_SCHEDULER_NO_TASK; 189 timeout_task = NULL;
190 } 190 }
191 /* Stop logging */ 191 /* Stop logging */
192 GNUNET_ATS_TEST_logging_stop (l); 192 GNUNET_ATS_TEST_logging_stop (l);
diff --git a/src/ats-tests/gnunet-solver-eval.c b/src/ats-tests/gnunet-solver-eval.c
index 9432f429d..91185f645 100644
--- a/src/ats-tests/gnunet-solver-eval.c
+++ b/src/ats-tests/gnunet-solver-eval.c
@@ -422,13 +422,13 @@ static void
422timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 422timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
423{ 423{
424 struct Experiment *e = cls; 424 struct Experiment *e = cls;
425 e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK; 425 e->experiment_timeout_task = NULL;
426 fprintf (stderr, "Experiment timeout!\n"); 426 fprintf (stderr, "Experiment timeout!\n");
427 427
428 if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task) 428 if (NULL != e->episode_timeout_task)
429 { 429 {
430 GNUNET_SCHEDULER_cancel (e->episode_timeout_task); 430 GNUNET_SCHEDULER_cancel (e->episode_timeout_task);
431 e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK; 431 e->episode_timeout_task = NULL;
432 } 432 }
433 433
434 e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), 434 e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time),
@@ -588,7 +588,7 @@ static void
588timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 588timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
589{ 589{
590 struct Experiment *e = cls; 590 struct Experiment *e = cls;
591 e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK; 591 e->episode_timeout_task = NULL;
592 if (NULL != e->ep_done_cb) 592 if (NULL != e->ep_done_cb)
593 e->ep_done_cb (e->cur); 593 e->ep_done_cb (e->cur);
594 594
@@ -598,10 +598,10 @@ timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
598 { 598 {
599 /* done */ 599 /* done */
600 fprintf (stderr, "Last episode done!\n"); 600 fprintf (stderr, "Last episode done!\n");
601 if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task) 601 if (NULL != e->experiment_timeout_task)
602 { 602 {
603 GNUNET_SCHEDULER_cancel (e->experiment_timeout_task); 603 GNUNET_SCHEDULER_cancel (e->experiment_timeout_task);
604 e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK; 604 e->experiment_timeout_task = NULL;
605 } 605 }
606 e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), GNUNET_OK); 606 e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), GNUNET_OK);
607 return; 607 return;
@@ -738,15 +738,15 @@ GNUNET_ATS_solvers_experimentation_load (char *filename)
738void 738void
739GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e) 739GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e)
740{ 740{
741 if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task) 741 if (NULL != e->experiment_timeout_task)
742 { 742 {
743 GNUNET_SCHEDULER_cancel (e->experiment_timeout_task); 743 GNUNET_SCHEDULER_cancel (e->experiment_timeout_task);
744 e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK; 744 e->experiment_timeout_task = NULL;
745 } 745 }
746 if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task) 746 if (NULL != e->episode_timeout_task)
747 { 747 {
748 GNUNET_SCHEDULER_cancel (e->episode_timeout_task); 748 GNUNET_SCHEDULER_cancel (e->episode_timeout_task);
749 e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK; 749 e->episode_timeout_task = NULL;
750 } 750 }
751 free_experiment (e); 751 free_experiment (e);
752} 752}
diff --git a/src/ats-tests/perf_ats.c b/src/ats-tests/perf_ats.c
index 7b5a903be..f57ac19f0 100644
--- a/src/ats-tests/perf_ats.c
+++ b/src/ats-tests/perf_ats.c
@@ -46,12 +46,12 @@
46/** 46/**
47 * Shutdown task 47 * Shutdown task
48 */ 48 */
49static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 49static struct GNUNET_SCHEDULER_Task * shutdown_task;
50 50
51/** 51/**
52 * Progress task 52 * Progress task
53 */ 53 */
54static GNUNET_SCHEDULER_TaskIdentifier progress_task; 54static struct GNUNET_SCHEDULER_Task * progress_task;
55 55
56/** 56/**
57 * Test result 57 * Test result
@@ -194,13 +194,13 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
194 if (GNUNET_YES == logging) 194 if (GNUNET_YES == logging)
195 GNUNET_ATS_TEST_logging_clean_up(l); 195 GNUNET_ATS_TEST_logging_clean_up(l);
196 196
197 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 197 shutdown_task = NULL;
198 if (GNUNET_SCHEDULER_NO_TASK != progress_task) 198 if (NULL != progress_task)
199 { 199 {
200 fprintf (stderr, "0\n"); 200 fprintf (stderr, "0\n");
201 GNUNET_SCHEDULER_cancel (progress_task); 201 GNUNET_SCHEDULER_cancel (progress_task);
202 } 202 }
203 progress_task = GNUNET_SCHEDULER_NO_TASK; 203 progress_task = NULL;
204 204
205 evaluate (); 205 evaluate ();
206 GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Benchmarking done\n")); 206 GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Benchmarking done\n"));
@@ -213,7 +213,7 @@ static void
213print_progress () 213print_progress ()
214{ 214{
215 static int calls; 215 static int calls;
216 progress_task = GNUNET_SCHEDULER_NO_TASK; 216 progress_task = NULL;
217 217
218 fprintf (stderr, "%llu..", 218 fprintf (stderr, "%llu..",
219 (long long unsigned) perf_duration.rel_value_us / (1000 * 1000) - calls); 219 (long long unsigned) perf_duration.rel_value_us / (1000 * 1000) - calls);
@@ -228,7 +228,7 @@ ats_pref_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
228{ 228{
229 struct BenchmarkPeer *me = cls; 229 struct BenchmarkPeer *me = cls;
230 230
231 me->ats_task = GNUNET_SCHEDULER_NO_TASK; 231 me->ats_task = NULL;
232 232
233 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, " Master [%u] set preference for slave [%u] to %f\n", 233 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, " Master [%u] set preference for slave [%u] to %f\n",
234 me->no, me->pref_partner->no, me->pref_value); 234 me->no, me->pref_partner->no, me->pref_value);
@@ -248,7 +248,7 @@ start_benchmark()
248 248
249 GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Benchmarking start\n")); 249 GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Benchmarking start\n"));
250 250
251 if (GNUNET_SCHEDULER_NO_TASK != shutdown_task) 251 if (NULL != shutdown_task)
252 GNUNET_SCHEDULER_cancel(shutdown_task); 252 GNUNET_SCHEDULER_cancel(shutdown_task);
253 shutdown_task = GNUNET_SCHEDULER_add_delayed(perf_duration, &do_shutdown, 253 shutdown_task = GNUNET_SCHEDULER_add_delayed(perf_duration, &do_shutdown,
254 NULL ); 254 NULL );
diff --git a/src/ats-tests/perf_ats.h b/src/ats-tests/perf_ats.h
index cad194313..4ea6af2cc 100644
--- a/src/ats-tests/perf_ats.h
+++ b/src/ats-tests/perf_ats.h
@@ -196,7 +196,7 @@ struct BenchmarkPeer
196 * Masters only 196 * Masters only
197 * Progress task 197 * Progress task
198 */ 198 */
199 GNUNET_SCHEDULER_TaskIdentifier ats_task; 199 struct GNUNET_SCHEDULER_Task * ats_task;
200 200
201 /** 201 /**
202 * Masters only 202 * Masters only
diff --git a/src/ats-tests/perf_ats_logging.c b/src/ats-tests/perf_ats_logging.c
index 823cfaf38..740a827fe 100644
--- a/src/ats-tests/perf_ats_logging.c
+++ b/src/ats-tests/perf_ats_logging.c
@@ -72,7 +72,7 @@
72/** 72/**
73 * Logging task 73 * Logging task
74 */ 74 */
75static GNUNET_SCHEDULER_TaskIdentifier log_task; 75static struct GNUNET_SCHEDULER_Task * log_task;
76 76
77/** 77/**
78 * Reference to perf_ats' masters 78 * Reference to perf_ats' masters
@@ -639,7 +639,7 @@ collect_log_now (void)
639static void 639static void
640collect_log_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 640collect_log_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
641{ 641{
642 log_task = GNUNET_SCHEDULER_NO_TASK; 642 log_task = NULL;
643 643
644 collect_log_now(); 644 collect_log_now();
645 645
@@ -661,9 +661,9 @@ perf_logging_stop ()
661 if (GNUNET_YES!= running) 661 if (GNUNET_YES!= running)
662 return; 662 return;
663 663
664 if (GNUNET_SCHEDULER_NO_TASK != log_task) 664 if (NULL != log_task)
665 GNUNET_SCHEDULER_cancel (log_task); 665 GNUNET_SCHEDULER_cancel (log_task);
666 log_task = GNUNET_SCHEDULER_NO_TASK; 666 log_task = NULL;
667 tc.reason = GNUNET_SCHEDULER_REASON_SHUTDOWN; 667 tc.reason = GNUNET_SCHEDULER_REASON_SHUTDOWN;
668 collect_log_task (NULL, &tc); 668 collect_log_task (NULL, &tc);
669 669
diff --git a/src/ats-tool/gnunet-ats.c b/src/ats-tool/gnunet-ats.c
index 69fbcf7a3..217c075b2 100644
--- a/src/ats-tool/gnunet-ats.c
+++ b/src/ats-tool/gnunet-ats.c
@@ -124,7 +124,7 @@ static struct GNUNET_CONFIGURATION_Handle *cfg;
124/** 124/**
125 * Shutdown task 125 * Shutdown task
126 */ 126 */
127static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 127static struct GNUNET_SCHEDULER_Task * shutdown_task;
128 128
129/** 129/**
130 * Hashmap to store addresses 130 * Hashmap to store addresses
@@ -345,7 +345,7 @@ transport_addr_to_str_cb (void *cls,
345 if ((GNUNET_YES == stat_receive_done) && (0 == stat_pending)) 345 if ((GNUNET_YES == stat_receive_done) && (0 == stat_pending))
346 { 346 {
347 /* All messages received and no resolutions pending*/ 347 /* All messages received and no resolutions pending*/
348 if (shutdown_task != GNUNET_SCHEDULER_NO_TASK) 348 if (shutdown_task != NULL)
349 GNUNET_SCHEDULER_cancel (shutdown_task); 349 GNUNET_SCHEDULER_cancel (shutdown_task);
350 shutdown_task = GNUNET_SCHEDULER_add_now (end, NULL); 350 shutdown_task = GNUNET_SCHEDULER_add_now (end, NULL);
351 } 351 }
@@ -637,7 +637,7 @@ ats_perf_cb (void *cls,
637 if (0 == stat_pending) 637 if (0 == stat_pending)
638 { 638 {
639 /* All messages received and no resolutions pending*/ 639 /* All messages received and no resolutions pending*/
640 if (shutdown_task != GNUNET_SCHEDULER_NO_TASK) 640 if (shutdown_task != NULL)
641 GNUNET_SCHEDULER_cancel (shutdown_task); 641 GNUNET_SCHEDULER_cancel (shutdown_task);
642 shutdown_task = GNUNET_SCHEDULER_add_now (end, NULL); 642 shutdown_task = GNUNET_SCHEDULER_add_now (end, NULL);
643 } 643 }
diff --git a/src/ats/ats_api_performance.c b/src/ats/ats_api_performance.c
index b1c48bdde..6d5992033 100644
--- a/src/ats/ats_api_performance.c
+++ b/src/ats/ats_api_performance.c
@@ -221,7 +221,7 @@ struct GNUNET_ATS_PerformanceHandle
221 /** 221 /**
222 * Task to trigger reconnect. 222 * Task to trigger reconnect.
223 */ 223 */
224 GNUNET_SCHEDULER_TaskIdentifier task; 224 struct GNUNET_SCHEDULER_Task * task;
225 225
226 /** 226 /**
227 * Monitor request multiplexing 227 * Monitor request multiplexing
@@ -255,7 +255,7 @@ reconnect_task (void *cls,
255{ 255{
256 struct GNUNET_ATS_PerformanceHandle *ph = cls; 256 struct GNUNET_ATS_PerformanceHandle *ph = cls;
257 257
258 ph->task = GNUNET_SCHEDULER_NO_TASK; 258 ph->task = NULL;
259 reconnect (ph); 259 reconnect (ph);
260} 260}
261 261
@@ -740,10 +740,10 @@ GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph)
740 GNUNET_free (rc); 740 GNUNET_free (rc);
741 } 741 }
742 742
743 if (GNUNET_SCHEDULER_NO_TASK != ph->task) 743 if (NULL != ph->task)
744 { 744 {
745 GNUNET_SCHEDULER_cancel (ph->task); 745 GNUNET_SCHEDULER_cancel (ph->task);
746 ph->task = GNUNET_SCHEDULER_NO_TASK; 746 ph->task = NULL;
747 } 747 }
748 if (NULL != ph->client) 748 if (NULL != ph->client)
749 { 749 {
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c
index b5bbf073d..6bb595391 100644
--- a/src/ats/ats_api_scheduling.c
+++ b/src/ats/ats_api_scheduling.c
@@ -177,12 +177,12 @@ struct GNUNET_ATS_SchedulingHandle
177 /** 177 /**
178 * Task to trigger reconnect. 178 * Task to trigger reconnect.
179 */ 179 */
180 GNUNET_SCHEDULER_TaskIdentifier task; 180 struct GNUNET_SCHEDULER_Task * task;
181 181
182 /** 182 /**
183 * Task retrieving interfaces from the system 183 * Task retrieving interfaces from the system
184 */ 184 */
185 GNUNET_SCHEDULER_TaskIdentifier interface_task; 185 struct GNUNET_SCHEDULER_Task * interface_task;
186 186
187 187
188 /** 188 /**
@@ -217,7 +217,7 @@ reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
217{ 217{
218 struct GNUNET_ATS_SchedulingHandle *sh = cls; 218 struct GNUNET_ATS_SchedulingHandle *sh = cls;
219 219
220 sh->task = GNUNET_SCHEDULER_NO_TASK; 220 sh->task = NULL;
221 reconnect (sh); 221 reconnect (sh);
222} 222}
223 223
@@ -825,7 +825,7 @@ static void
825get_addresses (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 825get_addresses (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
826{ 826{
827 struct GNUNET_ATS_SchedulingHandle * sh = cls; 827 struct GNUNET_ATS_SchedulingHandle * sh = cls;
828 sh->interface_task = GNUNET_SCHEDULER_NO_TASK; 828 sh->interface_task = NULL;
829 delete_networks (sh); 829 delete_networks (sh);
830 GNUNET_OS_network_interfaces_list(interface_proc, sh); 830 GNUNET_OS_network_interfaces_list(interface_proc, sh);
831 sh->interface_task = GNUNET_SCHEDULER_add_delayed (INTERFACE_PROCESSING_INTERVALL, 831 sh->interface_task = GNUNET_SCHEDULER_add_delayed (INTERFACE_PROCESSING_INTERVALL,
@@ -1005,10 +1005,10 @@ GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh)
1005 GNUNET_CLIENT_disconnect (sh->client); 1005 GNUNET_CLIENT_disconnect (sh->client);
1006 sh->client = NULL; 1006 sh->client = NULL;
1007 } 1007 }
1008 if (GNUNET_SCHEDULER_NO_TASK != sh->task) 1008 if (NULL != sh->task)
1009 { 1009 {
1010 GNUNET_SCHEDULER_cancel (sh->task); 1010 GNUNET_SCHEDULER_cancel (sh->task);
1011 sh->task = GNUNET_SCHEDULER_NO_TASK; 1011 sh->task = NULL;
1012 } 1012 }
1013 1013
1014 next = sh->sug_head; 1014 next = sh->sug_head;
@@ -1020,10 +1020,10 @@ GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh)
1020 } 1020 }
1021 1021
1022 delete_networks (sh); 1022 delete_networks (sh);
1023 if (sh->interface_task != GNUNET_SCHEDULER_NO_TASK) 1023 if (sh->interface_task != NULL)
1024 { 1024 {
1025 GNUNET_SCHEDULER_cancel(sh->interface_task); 1025 GNUNET_SCHEDULER_cancel(sh->interface_task);
1026 sh->interface_task = GNUNET_SCHEDULER_NO_TASK; 1026 sh->interface_task = NULL;
1027 } 1027 }
1028 GNUNET_array_grow (sh->session_array, sh->session_array_size, 0); 1028 GNUNET_array_grow (sh->session_array, sh->session_array_size, 0);
1029 GNUNET_free (sh); 1029 GNUNET_free (sh);
diff --git a/src/ats/gnunet-ats-solver-eval.c b/src/ats/gnunet-ats-solver-eval.c
index 86930d392..0fa83d741 100644
--- a/src/ats/gnunet-ats-solver-eval.c
+++ b/src/ats/gnunet-ats-solver-eval.c
@@ -244,7 +244,7 @@ static void
244logging_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 244logging_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
245{ 245{
246 struct LoggingHandle *l = cls; 246 struct LoggingHandle *l = cls;
247 l->logging_task = GNUNET_SCHEDULER_NO_TASK; 247 l->logging_task = NULL;
248 248
249 GNUNET_ATS_solver_logging_now (l); 249 GNUNET_ATS_solver_logging_now (l);
250 250
@@ -268,12 +268,12 @@ GNUNET_ATS_solver_logging_start (struct GNUNET_TIME_Relative freq)
268void 268void
269GNUNET_ATS_solver_logging_stop (struct LoggingHandle *l) 269GNUNET_ATS_solver_logging_stop (struct LoggingHandle *l)
270{ 270{
271 if (GNUNET_SCHEDULER_NO_TASK != l->logging_task) 271 if (NULL != l->logging_task)
272 GNUNET_SCHEDULER_cancel (l->logging_task); 272 GNUNET_SCHEDULER_cancel (l->logging_task);
273 273
274 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stop logging\n"); 274 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stop logging\n");
275 275
276 l->logging_task = GNUNET_SCHEDULER_NO_TASK; 276 l->logging_task = NULL;
277} 277}
278 278
279static struct LoggingFileHandle * 279static struct LoggingFileHandle *
@@ -513,9 +513,9 @@ GNUNET_ATS_solver_logging_free (struct LoggingHandle *l)
513 struct LoggingAddress *log_a_cur; 513 struct LoggingAddress *log_a_cur;
514 struct LoggingAddress *log_a_next; 514 struct LoggingAddress *log_a_next;
515 515
516 if (GNUNET_SCHEDULER_NO_TASK != l->logging_task) 516 if (NULL != l->logging_task)
517 GNUNET_SCHEDULER_cancel (l->logging_task); 517 GNUNET_SCHEDULER_cancel (l->logging_task);
518 l->logging_task = GNUNET_SCHEDULER_NO_TASK; 518 l->logging_task = NULL;
519 519
520 lts_next = l->head; 520 lts_next = l->head;
521 while (NULL != (lts_cur = lts_next)) 521 while (NULL != (lts_cur = lts_next))
@@ -621,7 +621,7 @@ set_prop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
621 double prop_value; 621 double prop_value;
622 struct GNUNET_ATS_Information atsi; 622 struct GNUNET_ATS_Information atsi;
623 623
624 pg->set_task = GNUNET_SCHEDULER_NO_TASK; 624 pg->set_task = NULL;
625 625
626 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains_value (sh->addresses, 626 if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains_value (sh->addresses,
627 &pg->test_peer->peer_id, pg->test_address->ats_addr)) 627 &pg->test_peer->peer_id, pg->test_address->ats_addr))
@@ -702,10 +702,10 @@ GNUNET_ATS_solver_generate_property_stop (struct PropertyGenerator *pg)
702{ 702{
703 GNUNET_CONTAINER_DLL_remove (prop_gen_head, prop_gen_tail, pg); 703 GNUNET_CONTAINER_DLL_remove (prop_gen_head, prop_gen_tail, pg);
704 704
705 if (GNUNET_SCHEDULER_NO_TASK != pg->set_task) 705 if (NULL != pg->set_task)
706 { 706 {
707 GNUNET_SCHEDULER_cancel (pg->set_task); 707 GNUNET_SCHEDULER_cancel (pg->set_task);
708 pg->set_task = GNUNET_SCHEDULER_NO_TASK; 708 pg->set_task = NULL;
709 } 709 }
710 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 710 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
711 "Removing old up preference generator peer [%u] address [%u] `%s'\n", 711 "Removing old up preference generator peer [%u] address [%u] `%s'\n",
@@ -897,7 +897,7 @@ set_feedback_task (void *cls,
897 struct GNUNET_TIME_Relative dur; 897 struct GNUNET_TIME_Relative dur;
898 double p_new; 898 double p_new;
899 899
900 pg->feedback_task = GNUNET_SCHEDULER_NO_TASK; 900 pg->feedback_task = NULL;
901 901
902 if (NULL == (p = find_peer_by_id (pg->peer))) 902 if (NULL == (p = find_peer_by_id (pg->peer)))
903 { 903 {
@@ -966,7 +966,7 @@ set_pref_task (void *cls,
966 struct PreferenceGenerator *pg = cls; 966 struct PreferenceGenerator *pg = cls;
967 struct TestPeer *p; 967 struct TestPeer *p;
968 double pref_value; 968 double pref_value;
969 pg->set_task = GNUNET_SCHEDULER_NO_TASK; 969 pg->set_task = NULL;
970 970
971 if (NULL == (p = find_peer_by_id (pg->peer))) 971 if (NULL == (p = find_peer_by_id (pg->peer)))
972 { 972 {
@@ -1030,16 +1030,16 @@ GNUNET_ATS_solver_generate_preferences_stop (struct PreferenceGenerator *pg)
1030{ 1030{
1031 GNUNET_CONTAINER_DLL_remove (pref_gen_head, pref_gen_tail, pg); 1031 GNUNET_CONTAINER_DLL_remove (pref_gen_head, pref_gen_tail, pg);
1032 1032
1033 if (GNUNET_SCHEDULER_NO_TASK != pg->feedback_task) 1033 if (NULL != pg->feedback_task)
1034 { 1034 {
1035 GNUNET_SCHEDULER_cancel (pg->feedback_task); 1035 GNUNET_SCHEDULER_cancel (pg->feedback_task);
1036 pg->feedback_task = GNUNET_SCHEDULER_NO_TASK; 1036 pg->feedback_task = NULL;
1037 } 1037 }
1038 1038
1039 if (GNUNET_SCHEDULER_NO_TASK != pg->set_task) 1039 if (NULL != pg->set_task)
1040 { 1040 {
1041 GNUNET_SCHEDULER_cancel (pg->set_task); 1041 GNUNET_SCHEDULER_cancel (pg->set_task);
1042 pg->set_task = GNUNET_SCHEDULER_NO_TASK; 1042 pg->set_task = NULL;
1043 } 1043 }
1044 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1044 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1045 "Removing old up preference generator peer [%u] `%s'\n", 1045 "Removing old up preference generator peer [%u] `%s'\n",
@@ -2146,13 +2146,13 @@ static void
2146timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 2146timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
2147{ 2147{
2148 struct Experiment *e = cls; 2148 struct Experiment *e = cls;
2149 e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK; 2149 e->experiment_timeout_task = NULL;
2150 fprintf (stderr, "Experiment timeout!\n"); 2150 fprintf (stderr, "Experiment timeout!\n");
2151 2151
2152 if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task) 2152 if (NULL != e->episode_timeout_task)
2153 { 2153 {
2154 GNUNET_SCHEDULER_cancel (e->episode_timeout_task); 2154 GNUNET_SCHEDULER_cancel (e->episode_timeout_task);
2155 e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK; 2155 e->episode_timeout_task = NULL;
2156 } 2156 }
2157 2157
2158 e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), 2158 e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time),
@@ -2524,7 +2524,7 @@ static void
2524timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc) 2524timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
2525{ 2525{
2526 struct Experiment *e = cls; 2526 struct Experiment *e = cls;
2527 e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK; 2527 e->episode_timeout_task = NULL;
2528 if (NULL != e->ep_done_cb) 2528 if (NULL != e->ep_done_cb)
2529 e->ep_done_cb (e->cur); 2529 e->ep_done_cb (e->cur);
2530 2530
@@ -2534,10 +2534,10 @@ timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
2534 { 2534 {
2535 /* done */ 2535 /* done */
2536 fprintf (stderr, "Last episode done!\n"); 2536 fprintf (stderr, "Last episode done!\n");
2537 if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task) 2537 if (NULL != e->experiment_timeout_task)
2538 { 2538 {
2539 GNUNET_SCHEDULER_cancel (e->experiment_timeout_task); 2539 GNUNET_SCHEDULER_cancel (e->experiment_timeout_task);
2540 e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK; 2540 e->experiment_timeout_task = NULL;
2541 } 2541 }
2542 e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), GNUNET_OK); 2542 e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), GNUNET_OK);
2543 return; 2543 return;
@@ -2589,15 +2589,15 @@ GNUNET_ATS_solvers_experimentation_run (struct Experiment *e,
2589void 2589void
2590GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e) 2590GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e)
2591{ 2591{
2592 if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task) 2592 if (NULL != e->experiment_timeout_task)
2593 { 2593 {
2594 GNUNET_SCHEDULER_cancel (e->experiment_timeout_task); 2594 GNUNET_SCHEDULER_cancel (e->experiment_timeout_task);
2595 e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK; 2595 e->experiment_timeout_task = NULL;
2596 } 2596 }
2597 if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task) 2597 if (NULL != e->episode_timeout_task)
2598 { 2598 {
2599 GNUNET_SCHEDULER_cancel (e->episode_timeout_task); 2599 GNUNET_SCHEDULER_cancel (e->episode_timeout_task);
2600 e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK; 2600 e->episode_timeout_task = NULL;
2601 } 2601 }
2602 if (NULL != e->cfg) 2602 if (NULL != e->cfg)
2603 { 2603 {
diff --git a/src/ats/gnunet-ats-solver-eval.h b/src/ats/gnunet-ats-solver-eval.h
index 9893dc9f1..808f524da 100644
--- a/src/ats/gnunet-ats-solver-eval.h
+++ b/src/ats/gnunet-ats-solver-eval.h
@@ -231,7 +231,7 @@ struct Episode
231 231
232struct LoggingHandle 232struct LoggingHandle
233{ 233{
234 GNUNET_SCHEDULER_TaskIdentifier logging_task; 234 struct GNUNET_SCHEDULER_Task * logging_task;
235 struct GNUNET_TIME_Relative log_freq; 235 struct GNUNET_TIME_Relative log_freq;
236 236
237 /* DLL list for logging time steps */ 237 /* DLL list for logging time steps */
@@ -256,8 +256,8 @@ struct Experiment
256 256
257 struct GNUNET_CONFIGURATION_Handle *cfg; 257 struct GNUNET_CONFIGURATION_Handle *cfg;
258 258
259 GNUNET_SCHEDULER_TaskIdentifier experiment_timeout_task; 259 struct GNUNET_SCHEDULER_Task * experiment_timeout_task;
260 GNUNET_SCHEDULER_TaskIdentifier episode_timeout_task; 260 struct GNUNET_SCHEDULER_Task * episode_timeout_task;
261 struct Episode *cur; 261 struct Episode *cur;
262 262
263 GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb; 263 GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb;
@@ -282,8 +282,8 @@ struct PreferenceGenerator
282 struct GNUNET_TIME_Relative frequency; 282 struct GNUNET_TIME_Relative frequency;
283 struct GNUNET_TIME_Relative feedback_frequency; 283 struct GNUNET_TIME_Relative feedback_frequency;
284 284
285 GNUNET_SCHEDULER_TaskIdentifier set_task; 285 struct GNUNET_SCHEDULER_Task * set_task;
286 GNUNET_SCHEDULER_TaskIdentifier feedback_task; 286 struct GNUNET_SCHEDULER_Task * feedback_task;
287 struct GNUNET_TIME_Absolute next_ping_transmission; 287 struct GNUNET_TIME_Absolute next_ping_transmission;
288 struct GNUNET_TIME_Absolute time_start; 288 struct GNUNET_TIME_Absolute time_start;
289 289
@@ -326,7 +326,7 @@ struct PropertyGenerator
326 struct GNUNET_TIME_Relative duration_period; 326 struct GNUNET_TIME_Relative duration_period;
327 struct GNUNET_TIME_Relative frequency; 327 struct GNUNET_TIME_Relative frequency;
328 328
329 GNUNET_SCHEDULER_TaskIdentifier set_task; 329 struct GNUNET_SCHEDULER_Task * set_task;
330 struct GNUNET_TIME_Absolute next_ping_transmission; 330 struct GNUNET_TIME_Absolute next_ping_transmission;
331 struct GNUNET_TIME_Absolute time_start; 331 struct GNUNET_TIME_Absolute time_start;
332}; 332};
diff --git a/src/ats/gnunet-service-ats_normalization.c b/src/ats/gnunet-service-ats_normalization.c
index 17edf282d..5e03edcdf 100644
--- a/src/ats/gnunet-service-ats_normalization.c
+++ b/src/ats/gnunet-service-ats_normalization.c
@@ -194,7 +194,7 @@ static struct PreferenceClient *pc_tail;
194 */ 194 */
195static struct PeerRelative defvalues; 195static struct PeerRelative defvalues;
196 196
197static GNUNET_SCHEDULER_TaskIdentifier aging_task; 197static struct GNUNET_SCHEDULER_Task * aging_task;
198 198
199/** 199/**
200 * Application Preference Normalization 200 * Application Preference Normalization
@@ -385,7 +385,7 @@ preference_aging (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
385 int values_to_update; 385 int values_to_update;
386 double backup; 386 double backup;
387 387
388 aging_task = GNUNET_SCHEDULER_NO_TASK; 388 aging_task = NULL;
389 values_to_update = 0; 389 values_to_update = 0;
390 cur_client = NULL; 390 cur_client = NULL;
391 391
@@ -542,7 +542,7 @@ GAS_normalization_normalize_preference (void *client,
542 run_preference_update (c_cur, p_cur, kind, score_abs); 542 run_preference_update (c_cur, p_cur, kind, score_abs);
543 543
544 /* Start aging task */ 544 /* Start aging task */
545 if (GNUNET_SCHEDULER_NO_TASK == aging_task) 545 if (NULL == aging_task)
546 aging_task = GNUNET_SCHEDULER_add_delayed (PREF_AGING_INTERVAL, 546 aging_task = GNUNET_SCHEDULER_add_delayed (PREF_AGING_INTERVAL,
547 &preference_aging, NULL ); 547 &preference_aging, NULL );
548 548
@@ -959,7 +959,7 @@ GAS_normalization_start (GAS_Normalization_preference_changed_cb pref_ch_cb,
959 959
960 for (i = 0; i < GNUNET_ATS_PreferenceCount; i++) 960 for (i = 0; i < GNUNET_ATS_PreferenceCount; i++)
961 defvalues.f_rel[i] = DEFAULT_REL_PREFERENCE; 961 defvalues.f_rel[i] = DEFAULT_REL_PREFERENCE;
962 aging_task = GNUNET_SCHEDULER_NO_TASK; 962 aging_task = NULL;
963 return; 963 return;
964} 964}
965 965
@@ -992,10 +992,10 @@ GAS_normalization_stop ()
992 struct PreferenceClient *pc; 992 struct PreferenceClient *pc;
993 struct PreferenceClient *next_pc; 993 struct PreferenceClient *next_pc;
994 994
995 if (GNUNET_SCHEDULER_NO_TASK != aging_task) 995 if (NULL != aging_task)
996 { 996 {
997 GNUNET_SCHEDULER_cancel (aging_task); 997 GNUNET_SCHEDULER_cancel (aging_task);
998 aging_task = GNUNET_SCHEDULER_NO_TASK; 998 aging_task = NULL;
999 } 999 }
1000 1000
1001 next_pc = pc_head; 1001 next_pc = pc_head;
diff --git a/src/ats/plugin_ats_ril.c b/src/ats/plugin_ats_ril.c
index 4feb0fd9a..c87876ea1 100644
--- a/src/ats/plugin_ats_ril.c
+++ b/src/ats/plugin_ats_ril.c
@@ -412,7 +412,7 @@ struct GAS_RIL_Handle
412 /** 412 /**
413 * Task identifier of the next time-step to be executed 413 * Task identifier of the next time-step to be executed
414 */ 414 */
415 GNUNET_SCHEDULER_TaskIdentifier step_next_task_id; 415 struct GNUNET_SCHEDULER_Task * step_next_task_id;
416 416
417 /** 417 /**
418 * Variable discount factor, dependent on time between steps 418 * Variable discount factor, dependent on time between steps
@@ -1546,7 +1546,7 @@ ril_step_scheduler_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *t
1546{ 1546{
1547 struct GAS_RIL_Handle *solver = cls; 1547 struct GAS_RIL_Handle *solver = cls;
1548 1548
1549 solver->step_next_task_id = GNUNET_SCHEDULER_NO_TASK; 1549 solver->step_next_task_id = NULL;
1550 ril_step (solver); 1550 ril_step (solver);
1551} 1551}
1552 1552
@@ -1875,7 +1875,7 @@ ril_step_schedule_next (struct GAS_RIL_Handle *solver)
1875 time_next = GNUNET_TIME_UNIT_ZERO; 1875 time_next = GNUNET_TIME_UNIT_ZERO;
1876 } 1876 }
1877 1877
1878 if ((GNUNET_SCHEDULER_NO_TASK == solver->step_next_task_id) && (GNUNET_NO == solver->done)) 1878 if ((NULL == solver->step_next_task_id) && (GNUNET_NO == solver->done))
1879 { 1879 {
1880 solver->step_next_task_id = GNUNET_SCHEDULER_add_delayed (time_next, &ril_step_scheduler_task, 1880 solver->step_next_task_id = GNUNET_SCHEDULER_add_delayed (time_next, &ril_step_scheduler_task,
1881 solver); 1881 solver);
@@ -2939,7 +2939,7 @@ libgnunet_plugin_ats_ril_done (void *cls)
2939 cur_agent = next_agent; 2939 cur_agent = next_agent;
2940 } 2940 }
2941 2941
2942 if (GNUNET_SCHEDULER_NO_TASK != s->step_next_task_id) 2942 if (NULL != s->step_next_task_id)
2943 { 2943 {
2944 GNUNET_SCHEDULER_cancel (s->step_next_task_id); 2944 GNUNET_SCHEDULER_cancel (s->step_next_task_id);
2945 } 2945 }
diff --git a/src/ats/test_ats_api_bandwidth_consumption.c b/src/ats/test_ats_api_bandwidth_consumption.c
index b05a7cf22..9ab0de7a9 100644
--- a/src/ats/test_ats_api_bandwidth_consumption.c
+++ b/src/ats/test_ats_api_bandwidth_consumption.c
@@ -31,9 +31,9 @@
31 31
32#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) 32#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
33 33
34static GNUNET_SCHEDULER_TaskIdentifier die_task; 34static struct GNUNET_SCHEDULER_Task * die_task;
35 35
36static GNUNET_SCHEDULER_TaskIdentifier consume_task; 36static struct GNUNET_SCHEDULER_Task * consume_task;
37 37
38static struct GNUNET_ATS_SchedulingHandle *ats; 38static struct GNUNET_ATS_SchedulingHandle *ats;
39 39
@@ -77,11 +77,11 @@ struct PeerContext
77static void 77static void
78end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 78end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
79{ 79{
80 die_task = GNUNET_SCHEDULER_NO_TASK; 80 die_task = NULL;
81 if (consume_task != GNUNET_SCHEDULER_NO_TASK) 81 if (consume_task != NULL)
82 { 82 {
83 GNUNET_SCHEDULER_cancel (consume_task); 83 GNUNET_SCHEDULER_cancel (consume_task);
84 consume_task = GNUNET_SCHEDULER_NO_TASK; 84 consume_task = NULL;
85 } 85 }
86 if (sh != NULL) 86 if (sh != NULL)
87 GNUNET_ATS_reserve_bandwidth_cancel (sh); 87 GNUNET_ATS_reserve_bandwidth_cancel (sh);
@@ -98,15 +98,15 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
98static void 98static void
99end () 99end ()
100{ 100{
101 if (die_task != GNUNET_SCHEDULER_NO_TASK) 101 if (die_task != NULL)
102 { 102 {
103 GNUNET_SCHEDULER_cancel (die_task); 103 GNUNET_SCHEDULER_cancel (die_task);
104 die_task = GNUNET_SCHEDULER_NO_TASK; 104 die_task = NULL;
105 } 105 }
106 if (consume_task != GNUNET_SCHEDULER_NO_TASK) 106 if (consume_task != NULL)
107 { 107 {
108 GNUNET_SCHEDULER_cancel (consume_task); 108 GNUNET_SCHEDULER_cancel (consume_task);
109 consume_task = GNUNET_SCHEDULER_NO_TASK; 109 consume_task = NULL;
110 } 110 }
111 GNUNET_ATS_scheduling_done (ats); 111 GNUNET_ATS_scheduling_done (ats);
112 GNUNET_ATS_performance_done (atp); 112 GNUNET_ATS_performance_done (atp);
@@ -142,7 +142,7 @@ reservation_cb (void *cls, const struct GNUNET_PeerIdentity *peer,
142static void 142static void
143consume_bandwidth (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 143consume_bandwidth (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
144{ 144{
145 consume_task = GNUNET_SCHEDULER_NO_TASK; 145 consume_task = NULL;
146 int32_t to_reserve = 500; 146 int32_t to_reserve = 500;
147 147
148 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 148 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/ats/test_ats_api_performance_list_all_addresses.c b/src/ats/test_ats_api_performance_list_all_addresses.c
index e846d0d43..253598d49 100644
--- a/src/ats/test_ats_api_performance_list_all_addresses.c
+++ b/src/ats/test_ats_api_performance_list_all_addresses.c
@@ -30,7 +30,7 @@
30 30
31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) 31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
32 32
33static GNUNET_SCHEDULER_TaskIdentifier die_task; 33static struct GNUNET_SCHEDULER_Task * die_task;
34 34
35/** 35/**
36 * Statistics handle 36 * Statistics handle
@@ -165,7 +165,7 @@ address_suggest_cb (void *cls,
165static void 165static void
166end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 166end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
167{ 167{
168 die_task = GNUNET_SCHEDULER_NO_TASK; 168 die_task = NULL;
169 end ( NULL, NULL); 169 end ( NULL, NULL);
170 ret = GNUNET_SYSERR; 170 ret = GNUNET_SYSERR;
171} 171}
@@ -174,10 +174,10 @@ static void
174end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 174end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
175{ 175{
176 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 176 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
177 if (die_task != GNUNET_SCHEDULER_NO_TASK ) 177 if (die_task != NULL )
178 { 178 {
179 GNUNET_SCHEDULER_cancel (die_task); 179 GNUNET_SCHEDULER_cancel (die_task);
180 die_task = GNUNET_SCHEDULER_NO_TASK; 180 die_task = NULL;
181 } 181 }
182 182
183 if (NULL != sched_ats) 183 if (NULL != sched_ats)
diff --git a/src/ats/test_ats_api_performance_list_all_addresses_active.c b/src/ats/test_ats_api_performance_list_all_addresses_active.c
index 5cc4d4c65..8385203c5 100644
--- a/src/ats/test_ats_api_performance_list_all_addresses_active.c
+++ b/src/ats/test_ats_api_performance_list_all_addresses_active.c
@@ -30,7 +30,7 @@
30 30
31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) 31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
32 32
33static GNUNET_SCHEDULER_TaskIdentifier die_task; 33static struct GNUNET_SCHEDULER_Task * die_task;
34 34
35/** 35/**
36 * Statistics handle 36 * Statistics handle
@@ -172,7 +172,7 @@ address_suggest_cb (void *cls,
172static void 172static void
173end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 173end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
174{ 174{
175 die_task = GNUNET_SCHEDULER_NO_TASK; 175 die_task = NULL;
176 end ( NULL, NULL); 176 end ( NULL, NULL);
177 ret = GNUNET_SYSERR; 177 ret = GNUNET_SYSERR;
178} 178}
@@ -181,10 +181,10 @@ static void
181end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 181end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
182{ 182{
183 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 183 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
184 if (die_task != GNUNET_SCHEDULER_NO_TASK ) 184 if (die_task != NULL )
185 { 185 {
186 GNUNET_SCHEDULER_cancel (die_task); 186 GNUNET_SCHEDULER_cancel (die_task);
187 die_task = GNUNET_SCHEDULER_NO_TASK; 187 die_task = NULL;
188 } 188 }
189 189
190 if (NULL != sched_ats) 190 if (NULL != sched_ats)
diff --git a/src/ats/test_ats_api_performance_list_peer_addresses.c b/src/ats/test_ats_api_performance_list_peer_addresses.c
index f19727b2d..3eb5b8e50 100644
--- a/src/ats/test_ats_api_performance_list_peer_addresses.c
+++ b/src/ats/test_ats_api_performance_list_peer_addresses.c
@@ -30,7 +30,7 @@
30 30
31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) 31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
32 32
33static GNUNET_SCHEDULER_TaskIdentifier die_task; 33static struct GNUNET_SCHEDULER_Task * die_task;
34 34
35/** 35/**
36 * Statistics handle 36 * Statistics handle
@@ -176,10 +176,10 @@ end (void *cls,
176{ 176{
177 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 177 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
178 "Shutting down\n"); 178 "Shutting down\n");
179 if (die_task != GNUNET_SCHEDULER_NO_TASK ) 179 if (die_task != NULL )
180 { 180 {
181 GNUNET_SCHEDULER_cancel (die_task); 181 GNUNET_SCHEDULER_cancel (die_task);
182 die_task = GNUNET_SCHEDULER_NO_TASK; 182 die_task = NULL;
183 } 183 }
184 if (NULL != sched_ats) 184 if (NULL != sched_ats)
185 { 185 {
@@ -216,7 +216,7 @@ static void
216end_badly (void *cls, 216end_badly (void *cls,
217 const struct GNUNET_SCHEDULER_TaskContext *tc) 217 const struct GNUNET_SCHEDULER_TaskContext *tc)
218{ 218{
219 die_task = GNUNET_SCHEDULER_NO_TASK; 219 die_task = NULL;
220 end (NULL, NULL); 220 end (NULL, NULL);
221 ret = GNUNET_SYSERR; 221 ret = GNUNET_SYSERR;
222} 222}
diff --git a/src/ats/test_ats_api_performance_monitor.c b/src/ats/test_ats_api_performance_monitor.c
index 4b6b08b74..0c17ded87 100644
--- a/src/ats/test_ats_api_performance_monitor.c
+++ b/src/ats/test_ats_api_performance_monitor.c
@@ -31,7 +31,7 @@
31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) 31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
32#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) 32#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
33 33
34static GNUNET_SCHEDULER_TaskIdentifier die_task; 34static struct GNUNET_SCHEDULER_Task * die_task;
35 35
36/** 36/**
37 * Statistics handle 37 * Statistics handle
@@ -167,7 +167,7 @@ address_suggest_cb (void *cls,
167static void 167static void
168end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 168end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
169{ 169{
170 die_task = GNUNET_SCHEDULER_NO_TASK; 170 die_task = NULL;
171 end ( NULL, NULL); 171 end ( NULL, NULL);
172 ret = GNUNET_SYSERR; 172 ret = GNUNET_SYSERR;
173} 173}
@@ -176,10 +176,10 @@ static void
176end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 176end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
177{ 177{
178 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 178 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
179 if (die_task != GNUNET_SCHEDULER_NO_TASK ) 179 if (die_task != NULL )
180 { 180 {
181 GNUNET_SCHEDULER_cancel (die_task); 181 GNUNET_SCHEDULER_cancel (die_task);
182 die_task = GNUNET_SCHEDULER_NO_TASK; 182 die_task = NULL;
183 } 183 }
184 184
185 if (NULL != sched_ats) 185 if (NULL != sched_ats)
diff --git a/src/ats/test_ats_api_performance_monitor_initial_callback.c b/src/ats/test_ats_api_performance_monitor_initial_callback.c
index 377686673..42d2951f7 100644
--- a/src/ats/test_ats_api_performance_monitor_initial_callback.c
+++ b/src/ats/test_ats_api_performance_monitor_initial_callback.c
@@ -31,7 +31,7 @@
31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10) 31#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
32#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) 32#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
33 33
34static GNUNET_SCHEDULER_TaskIdentifier die_task; 34static struct GNUNET_SCHEDULER_Task * die_task;
35 35
36/** 36/**
37 * Statistics handle 37 * Statistics handle
@@ -174,7 +174,7 @@ address_suggest_cb (void *cls,
174static void 174static void
175end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 175end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
176{ 176{
177 die_task = GNUNET_SCHEDULER_NO_TASK; 177 die_task = NULL;
178 end ( NULL, NULL); 178 end ( NULL, NULL);
179 ret = GNUNET_SYSERR; 179 ret = GNUNET_SYSERR;
180} 180}
@@ -183,10 +183,10 @@ static void
183end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 183end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
184{ 184{
185 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 185 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
186 if (die_task != GNUNET_SCHEDULER_NO_TASK ) 186 if (die_task != NULL )
187 { 187 {
188 GNUNET_SCHEDULER_cancel (die_task); 188 GNUNET_SCHEDULER_cancel (die_task);
189 die_task = GNUNET_SCHEDULER_NO_TASK; 189 die_task = NULL;
190 } 190 }
191 191
192 if (NULL != sched_ats) 192 if (NULL != sched_ats)
diff --git a/src/ats/test_ats_api_scheduling_add_address.c b/src/ats/test_ats_api_scheduling_add_address.c
index 332e46d19..92bd049f4 100644
--- a/src/ats/test_ats_api_scheduling_add_address.c
+++ b/src/ats/test_ats_api_scheduling_add_address.c
@@ -32,7 +32,7 @@
32/** 32/**
33 * Timeout task 33 * Timeout task
34 */ 34 */
35static GNUNET_SCHEDULER_TaskIdentifier die_task; 35static struct GNUNET_SCHEDULER_Task * die_task;
36 36
37/** 37/**
38 * Statistics handle 38 * Statistics handle
@@ -103,10 +103,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
103{ 103{
104 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 104 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
105 105
106 if (die_task != GNUNET_SCHEDULER_NO_TASK) 106 if (die_task != NULL)
107 { 107 {
108 GNUNET_SCHEDULER_cancel (die_task); 108 GNUNET_SCHEDULER_cancel (die_task);
109 die_task = GNUNET_SCHEDULER_NO_TASK; 109 die_task = NULL;
110 } 110 }
111 111
112 if (NULL != sched_ats) 112 if (NULL != sched_ats)
@@ -130,7 +130,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
130static void 130static void
131end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 131end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
132{ 132{
133 die_task = GNUNET_SCHEDULER_NO_TASK; 133 die_task = NULL;
134 end ( NULL, NULL); 134 end ( NULL, NULL);
135 ret = GNUNET_SYSERR; 135 ret = GNUNET_SYSERR;
136} 136}
diff --git a/src/ats/test_ats_api_scheduling_add_address_duplicate.c b/src/ats/test_ats_api_scheduling_add_address_duplicate.c
index f2c2b4fd6..6130c0f7e 100644
--- a/src/ats/test_ats_api_scheduling_add_address_duplicate.c
+++ b/src/ats/test_ats_api_scheduling_add_address_duplicate.c
@@ -32,9 +32,9 @@
32/** 32/**
33 * Timeout task 33 * Timeout task
34 */ 34 */
35static GNUNET_SCHEDULER_TaskIdentifier die_task; 35static struct GNUNET_SCHEDULER_Task * die_task;
36 36
37static GNUNET_SCHEDULER_TaskIdentifier wait_task; 37static struct GNUNET_SCHEDULER_Task * wait_task;
38 38
39/** 39/**
40 * Statistics handle 40 * Statistics handle
@@ -95,13 +95,13 @@ stat_cb(void *cls, const char *subsystem,
95 subsystem,name, value); 95 subsystem,name, value);
96 if (1 < value) 96 if (1 < value)
97 { 97 {
98 if (GNUNET_SCHEDULER_NO_TASK != wait_task) 98 if (NULL != wait_task)
99 GNUNET_SCHEDULER_cancel (wait_task); 99 GNUNET_SCHEDULER_cancel (wait_task);
100 GNUNET_SCHEDULER_add_now (&end_badly, NULL); 100 GNUNET_SCHEDULER_add_now (&end_badly, NULL);
101 } 101 }
102 if (1 == value) 102 if (1 == value)
103 { 103 {
104 if (GNUNET_SCHEDULER_NO_TASK == wait_task) 104 if (NULL == wait_task)
105 wait_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &end, NULL); 105 wait_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &end, NULL);
106 } 106 }
107 return GNUNET_OK; 107 return GNUNET_OK;
@@ -112,12 +112,12 @@ static void
112end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 112end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
113{ 113{
114 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 114 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
115 wait_task = GNUNET_SCHEDULER_NO_TASK; 115 wait_task = NULL;
116 116
117 if (die_task != GNUNET_SCHEDULER_NO_TASK) 117 if (die_task != NULL)
118 { 118 {
119 GNUNET_SCHEDULER_cancel (die_task); 119 GNUNET_SCHEDULER_cancel (die_task);
120 die_task = GNUNET_SCHEDULER_NO_TASK; 120 die_task = NULL;
121 } 121 }
122 122
123 if (NULL != sched_ats) 123 if (NULL != sched_ats)
@@ -141,7 +141,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
141static void 141static void
142end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 142end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
143{ 143{
144 die_task = GNUNET_SCHEDULER_NO_TASK; 144 die_task = NULL;
145 end ( NULL, NULL); 145 end ( NULL, NULL);
146 ret = GNUNET_SYSERR; 146 ret = GNUNET_SYSERR;
147} 147}
diff --git a/src/ats/test_ats_api_scheduling_add_address_inbound.c b/src/ats/test_ats_api_scheduling_add_address_inbound.c
index fb4ddd2da..2c3ab9c02 100644
--- a/src/ats/test_ats_api_scheduling_add_address_inbound.c
+++ b/src/ats/test_ats_api_scheduling_add_address_inbound.c
@@ -32,7 +32,7 @@
32/** 32/**
33 * Timeout task 33 * Timeout task
34 */ 34 */
35static GNUNET_SCHEDULER_TaskIdentifier die_task; 35static struct GNUNET_SCHEDULER_Task * die_task;
36 36
37/** 37/**
38 * Statistics handle 38 * Statistics handle
@@ -109,10 +109,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
109{ 109{
110 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 110 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
111 111
112 if (die_task != GNUNET_SCHEDULER_NO_TASK) 112 if (die_task != NULL)
113 { 113 {
114 GNUNET_SCHEDULER_cancel (die_task); 114 GNUNET_SCHEDULER_cancel (die_task);
115 die_task = GNUNET_SCHEDULER_NO_TASK; 115 die_task = NULL;
116 } 116 }
117 117
118 if (NULL != sched_ats) 118 if (NULL != sched_ats)
@@ -136,7 +136,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
136static void 136static void
137end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 137end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
138{ 138{
139 die_task = GNUNET_SCHEDULER_NO_TASK; 139 die_task = NULL;
140 end ( NULL, NULL); 140 end ( NULL, NULL);
141 ret = GNUNET_SYSERR; 141 ret = GNUNET_SYSERR;
142} 142}
diff --git a/src/ats/test_ats_api_scheduling_add_session.c b/src/ats/test_ats_api_scheduling_add_session.c
index 9d7fd99d1..243ecd22e 100644
--- a/src/ats/test_ats_api_scheduling_add_session.c
+++ b/src/ats/test_ats_api_scheduling_add_session.c
@@ -32,7 +32,7 @@
32/** 32/**
33 * Timeout task 33 * Timeout task
34 */ 34 */
35static GNUNET_SCHEDULER_TaskIdentifier die_task; 35static struct GNUNET_SCHEDULER_Task * die_task;
36 36
37/** 37/**
38 * Statistics handle 38 * Statistics handle
@@ -116,10 +116,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
116{ 116{
117 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 117 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
118 118
119 if (die_task != GNUNET_SCHEDULER_NO_TASK) 119 if (die_task != NULL)
120 { 120 {
121 GNUNET_SCHEDULER_cancel (die_task); 121 GNUNET_SCHEDULER_cancel (die_task);
122 die_task = GNUNET_SCHEDULER_NO_TASK; 122 die_task = NULL;
123 } 123 }
124 124
125 if (NULL != sched_ats) 125 if (NULL != sched_ats)
@@ -143,7 +143,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
143static void 143static void
144end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 144end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
145{ 145{
146 die_task = GNUNET_SCHEDULER_NO_TASK; 146 die_task = NULL;
147 end ( NULL, NULL); 147 end ( NULL, NULL);
148 ret = GNUNET_SYSERR; 148 ret = GNUNET_SYSERR;
149} 149}
diff --git a/src/ats/test_ats_api_scheduling_destroy_address.c b/src/ats/test_ats_api_scheduling_destroy_address.c
index bc1b7bd83..5cc2094c2 100644
--- a/src/ats/test_ats_api_scheduling_destroy_address.c
+++ b/src/ats/test_ats_api_scheduling_destroy_address.c
@@ -33,7 +33,7 @@
33/** 33/**
34 * Timeout task 34 * Timeout task
35 */ 35 */
36static GNUNET_SCHEDULER_TaskIdentifier die_task; 36static struct GNUNET_SCHEDULER_Task * die_task;
37 37
38/** 38/**
39 * Statistics handle 39 * Statistics handle
@@ -114,10 +114,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
114{ 114{
115 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 115 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
116 116
117 if (die_task != GNUNET_SCHEDULER_NO_TASK) 117 if (die_task != NULL)
118 { 118 {
119 GNUNET_SCHEDULER_cancel (die_task); 119 GNUNET_SCHEDULER_cancel (die_task);
120 die_task = GNUNET_SCHEDULER_NO_TASK; 120 die_task = NULL;
121 } 121 }
122 122
123 if (NULL != sched_ats) 123 if (NULL != sched_ats)
@@ -141,7 +141,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
141static void 141static void
142end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 142end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
143{ 143{
144 die_task = GNUNET_SCHEDULER_NO_TASK; 144 die_task = NULL;
145 end ( NULL, NULL); 145 end ( NULL, NULL);
146 ret = GNUNET_SYSERR; 146 ret = GNUNET_SYSERR;
147} 147}
diff --git a/src/ats/test_ats_api_scheduling_destroy_address_twice.c b/src/ats/test_ats_api_scheduling_destroy_address_twice.c
index 9b34effd1..1991199ab 100644
--- a/src/ats/test_ats_api_scheduling_destroy_address_twice.c
+++ b/src/ats/test_ats_api_scheduling_destroy_address_twice.c
@@ -33,7 +33,7 @@
33/** 33/**
34 * Timeout task 34 * Timeout task
35 */ 35 */
36static GNUNET_SCHEDULER_TaskIdentifier die_task; 36static struct GNUNET_SCHEDULER_Task * die_task;
37 37
38/** 38/**
39 * Statistics handle 39 * Statistics handle
@@ -116,10 +116,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
116{ 116{
117 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 117 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
118 118
119 if (die_task != GNUNET_SCHEDULER_NO_TASK) 119 if (die_task != NULL)
120 { 120 {
121 GNUNET_SCHEDULER_cancel (die_task); 121 GNUNET_SCHEDULER_cancel (die_task);
122 die_task = GNUNET_SCHEDULER_NO_TASK; 122 die_task = NULL;
123 } 123 }
124 124
125 if (NULL != sched_ats) 125 if (NULL != sched_ats)
@@ -143,7 +143,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
143static void 143static void
144end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 144end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
145{ 145{
146 die_task = GNUNET_SCHEDULER_NO_TASK; 146 die_task = NULL;
147 end ( NULL, NULL); 147 end ( NULL, NULL);
148 ret = GNUNET_SYSERR; 148 ret = GNUNET_SYSERR;
149} 149}
diff --git a/src/ats/test_ats_api_scheduling_destroy_session.c b/src/ats/test_ats_api_scheduling_destroy_session.c
index ae236ea32..0c6cf156d 100644
--- a/src/ats/test_ats_api_scheduling_destroy_session.c
+++ b/src/ats/test_ats_api_scheduling_destroy_session.c
@@ -36,7 +36,7 @@
36/** 36/**
37 * Timeout task 37 * Timeout task
38 */ 38 */
39static GNUNET_SCHEDULER_TaskIdentifier die_task; 39static struct GNUNET_SCHEDULER_Task * die_task;
40 40
41/** 41/**
42 * Statistics handle 42 * Statistics handle
@@ -120,10 +120,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
120{ 120{
121 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 121 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
122 122
123 if (die_task != GNUNET_SCHEDULER_NO_TASK) 123 if (die_task != NULL)
124 { 124 {
125 GNUNET_SCHEDULER_cancel (die_task); 125 GNUNET_SCHEDULER_cancel (die_task);
126 die_task = GNUNET_SCHEDULER_NO_TASK; 126 die_task = NULL;
127 } 127 }
128 128
129 if (NULL != sched_ats) 129 if (NULL != sched_ats)
@@ -147,7 +147,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
147static void 147static void
148end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 148end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
149{ 149{
150 die_task = GNUNET_SCHEDULER_NO_TASK; 150 die_task = NULL;
151 end ( NULL, NULL); 151 end ( NULL, NULL);
152 ret = GNUNET_SYSERR; 152 ret = GNUNET_SYSERR;
153} 153}
diff --git a/src/ats/test_ats_api_scheduling_init.c b/src/ats/test_ats_api_scheduling_init.c
index a7914d5c6..d6e823a56 100644
--- a/src/ats/test_ats_api_scheduling_init.c
+++ b/src/ats/test_ats_api_scheduling_init.c
@@ -32,7 +32,7 @@
32/** 32/**
33 * Timeout task 33 * Timeout task
34 */ 34 */
35static GNUNET_SCHEDULER_TaskIdentifier die_task; 35static struct GNUNET_SCHEDULER_Task * die_task;
36 36
37/** 37/**
38 * Initial statistics get request handle 38 * Initial statistics get request handle
@@ -86,10 +86,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
86{ 86{
87 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 87 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
88 88
89 if (die_task != GNUNET_SCHEDULER_NO_TASK) 89 if (die_task != NULL)
90 { 90 {
91 GNUNET_SCHEDULER_cancel (die_task); 91 GNUNET_SCHEDULER_cancel (die_task);
92 die_task = GNUNET_SCHEDULER_NO_TASK; 92 die_task = NULL;
93 } 93 }
94 94
95 if (NULL != sched_ats) 95 if (NULL != sched_ats)
@@ -110,7 +110,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
110static void 110static void
111end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 111end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
112{ 112{
113 die_task = GNUNET_SCHEDULER_NO_TASK; 113 die_task = NULL;
114 end ( NULL, NULL); 114 end ( NULL, NULL);
115 ret = GNUNET_SYSERR; 115 ret = GNUNET_SYSERR;
116} 116}
diff --git a/src/ats/test_ats_simplistic_pref_aging.c b/src/ats/test_ats_simplistic_pref_aging.c
index c8485856c..855e22fbf 100644
--- a/src/ats/test_ats_simplistic_pref_aging.c
+++ b/src/ats/test_ats_simplistic_pref_aging.c
@@ -40,7 +40,7 @@
40 40
41#define DEBUG_ATS_INFO GNUNET_NO 41#define DEBUG_ATS_INFO GNUNET_NO
42 42
43static GNUNET_SCHEDULER_TaskIdentifier die_task; 43static struct GNUNET_SCHEDULER_Task * die_task;
44 44
45/** 45/**
46 * Scheduling handle 46 * Scheduling handle
@@ -102,7 +102,7 @@ unsigned long long wan_quota_in;
102static void 102static void
103end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 103end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
104{ 104{
105 die_task = GNUNET_SCHEDULER_NO_TASK; 105 die_task = NULL;
106 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error! Shutting down\n"); 106 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error! Shutting down\n");
107 if (sched_ats != NULL) 107 if (sched_ats != NULL)
108 { 108 {
@@ -123,10 +123,10 @@ static void
123end () 123end ()
124{ 124{
125 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n"); 125 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
126 if (die_task != GNUNET_SCHEDULER_NO_TASK) 126 if (die_task != NULL)
127 { 127 {
128 GNUNET_SCHEDULER_cancel (die_task); 128 GNUNET_SCHEDULER_cancel (die_task);
129 die_task = GNUNET_SCHEDULER_NO_TASK; 129 die_task = NULL;
130 } 130 }
131 131
132 GNUNET_ATS_suggest_address_cancel (sched_ats, &p[0].id); 132 GNUNET_ATS_suggest_address_cancel (sched_ats, &p[0].id);
diff --git a/src/ats/test_ats_solver_add_address.c b/src/ats/test_ats_solver_add_address.c
index 0c62d5197..37c37cc84 100644
--- a/src/ats/test_ats_solver_add_address.c
+++ b/src/ats/test_ats_solver_add_address.c
@@ -32,7 +32,7 @@
32/** 32/**
33 * Timeout task 33 * Timeout task
34 */ 34 */
35static GNUNET_SCHEDULER_TaskIdentifier die_task; 35static struct GNUNET_SCHEDULER_Task * die_task;
36 36
37/** 37/**
38 * Statistics handle 38 * Statistics handle
@@ -89,10 +89,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
89{ 89{
90 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n"); 90 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n");
91 91
92 if (die_task != GNUNET_SCHEDULER_NO_TASK) 92 if (die_task != NULL)
93 { 93 {
94 GNUNET_SCHEDULER_cancel (die_task); 94 GNUNET_SCHEDULER_cancel (die_task);
95 die_task = GNUNET_SCHEDULER_NO_TASK; 95 die_task = NULL;
96 } 96 }
97 97
98 if (NULL != sched_ats) 98 if (NULL != sched_ats)
@@ -117,7 +117,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
117static void 117static void
118end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 118end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
119{ 119{
120 die_task = GNUNET_SCHEDULER_NO_TASK; 120 die_task = NULL;
121 end ( NULL, NULL); 121 end ( NULL, NULL);
122 ret = GNUNET_SYSERR; 122 ret = GNUNET_SYSERR;
123} 123}
diff --git a/src/ats/test_ats_solver_add_address_and_request.c b/src/ats/test_ats_solver_add_address_and_request.c
index 55a7469e7..1f07f46af 100644
--- a/src/ats/test_ats_solver_add_address_and_request.c
+++ b/src/ats/test_ats_solver_add_address_and_request.c
@@ -38,7 +38,7 @@
38/** 38/**
39 * Timeout task 39 * Timeout task
40 */ 40 */
41static GNUNET_SCHEDULER_TaskIdentifier die_task; 41static struct GNUNET_SCHEDULER_Task * die_task;
42 42
43/** 43/**
44 * Statistics handle 44 * Statistics handle
@@ -94,10 +94,10 @@ static void
94end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 94end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
95{ 95{
96 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n"); 96 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n");
97 if (die_task != GNUNET_SCHEDULER_NO_TASK) 97 if (die_task != NULL)
98 { 98 {
99 GNUNET_SCHEDULER_cancel (die_task); 99 GNUNET_SCHEDULER_cancel (die_task);
100 die_task = GNUNET_SCHEDULER_NO_TASK; 100 die_task = NULL;
101 } 101 }
102 102
103 if (NULL != sched_ats) 103 if (NULL != sched_ats)
@@ -122,7 +122,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
122static void 122static void
123end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 123end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
124{ 124{
125 die_task = GNUNET_SCHEDULER_NO_TASK; 125 die_task = NULL;
126 end ( NULL, NULL); 126 end ( NULL, NULL);
127 ret = GNUNET_SYSERR; 127 ret = GNUNET_SYSERR;
128} 128}
diff --git a/src/ats/test_ats_solver_alternative_after_delete_address.c b/src/ats/test_ats_solver_alternative_after_delete_address.c
index 27f34217e..1f713801f 100644
--- a/src/ats/test_ats_solver_alternative_after_delete_address.c
+++ b/src/ats/test_ats_solver_alternative_after_delete_address.c
@@ -32,7 +32,7 @@
32/** 32/**
33 * Timeout task 33 * Timeout task
34 */ 34 */
35static GNUNET_SCHEDULER_TaskIdentifier die_task; 35static struct GNUNET_SCHEDULER_Task * die_task;
36 36
37/** 37/**
38 * Statistics handle 38 * Statistics handle
@@ -114,10 +114,10 @@ stat_cb(void *cls, const char *subsystem, const char *name, uint64_t value,
114static void 114static void
115end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 115end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
116{ 116{
117 if (die_task != GNUNET_SCHEDULER_NO_TASK) 117 if (die_task != NULL)
118 { 118 {
119 GNUNET_SCHEDULER_cancel (die_task); 119 GNUNET_SCHEDULER_cancel (die_task);
120 die_task = GNUNET_SCHEDULER_NO_TASK; 120 die_task = NULL;
121 } 121 }
122 122
123 if (NULL != sched_ats) 123 if (NULL != sched_ats)
@@ -144,7 +144,7 @@ static void
144end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 144end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
145{ 145{
146 146
147 die_task = GNUNET_SCHEDULER_NO_TASK; 147 die_task = NULL;
148 end ( NULL, NULL); 148 end ( NULL, NULL);
149 ret = GNUNET_SYSERR; 149 ret = GNUNET_SYSERR;
150} 150}
@@ -152,10 +152,10 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
152static void 152static void
153end_badly_now () 153end_badly_now ()
154{ 154{
155 if (GNUNET_SCHEDULER_NO_TASK != die_task) 155 if (NULL != die_task)
156 { 156 {
157 GNUNET_SCHEDULER_cancel (die_task); 157 GNUNET_SCHEDULER_cancel (die_task);
158 die_task = GNUNET_SCHEDULER_NO_TASK; 158 die_task = NULL;
159 } 159 }
160 GNUNET_SCHEDULER_add_now (&end_badly, NULL); 160 GNUNET_SCHEDULER_add_now (&end_badly, NULL);
161} 161}
diff --git a/src/ats/test_ats_solver_convergence.c b/src/ats/test_ats_solver_convergence.c
index b99cab809..aa8704ccf 100644
--- a/src/ats/test_ats_solver_convergence.c
+++ b/src/ats/test_ats_solver_convergence.c
@@ -33,7 +33,7 @@
33/** 33/**
34 * Timeout task 34 * Timeout task
35 */ 35 */
36static GNUNET_SCHEDULER_TaskIdentifier end_task; 36static struct GNUNET_SCHEDULER_Task * end_task;
37 37
38/** 38/**
39 * Statistics handle 39 * Statistics handle
@@ -113,10 +113,10 @@ static void
113end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 113end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
114{ 114{
115 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n"); 115 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n");
116 if (end_task == GNUNET_SCHEDULER_NO_TASK) 116 if (end_task == NULL)
117 { 117 {
118 GNUNET_SCHEDULER_cancel (end_task); 118 GNUNET_SCHEDULER_cancel (end_task);
119 end_task = GNUNET_SCHEDULER_NO_TASK; 119 end_task = NULL;
120 } 120 }
121 121
122 if (NULL != sched_ats) 122 if (NULL != sched_ats)
diff --git a/src/ats/test_ats_solver_preferences.c b/src/ats/test_ats_solver_preferences.c
index 4de3d9a5b..946cb5476 100644
--- a/src/ats/test_ats_solver_preferences.c
+++ b/src/ats/test_ats_solver_preferences.c
@@ -38,7 +38,7 @@
38/** 38/**
39 * Timeout task 39 * Timeout task
40 */ 40 */
41static GNUNET_SCHEDULER_TaskIdentifier die_task; 41static struct GNUNET_SCHEDULER_Task * die_task;
42 42
43/** 43/**
44 * Statistics handle 44 * Statistics handle
@@ -99,10 +99,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
99{ 99{
100 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Done!\n"); 100 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Done!\n");
101 101
102 if (die_task != GNUNET_SCHEDULER_NO_TASK ) 102 if (die_task != NULL )
103 { 103 {
104 GNUNET_SCHEDULER_cancel (die_task); 104 GNUNET_SCHEDULER_cancel (die_task);
105 die_task = GNUNET_SCHEDULER_NO_TASK; 105 die_task = NULL;
106 } 106 }
107 107
108 if (NULL != sched_ats) 108 if (NULL != sched_ats)
@@ -132,7 +132,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
132static void 132static void
133end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 133end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
134{ 134{
135 die_task = GNUNET_SCHEDULER_NO_TASK; 135 die_task = NULL;
136 end (NULL, NULL ); 136 end (NULL, NULL );
137 ret = GNUNET_SYSERR; 137 ret = GNUNET_SYSERR;
138} 138}
diff --git a/src/ats/test_ats_solver_request_and_add_address.c b/src/ats/test_ats_solver_request_and_add_address.c
index 1eced520d..3c7b8a522 100644
--- a/src/ats/test_ats_solver_request_and_add_address.c
+++ b/src/ats/test_ats_solver_request_and_add_address.c
@@ -38,7 +38,7 @@
38/** 38/**
39 * Timeout task 39 * Timeout task
40 */ 40 */
41static GNUNET_SCHEDULER_TaskIdentifier die_task; 41static struct GNUNET_SCHEDULER_Task * die_task;
42 42
43/** 43/**
44 * Statistics handle 44 * Statistics handle
@@ -94,10 +94,10 @@ static void
94end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 94end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
95{ 95{
96 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n"); 96 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n");
97 if (die_task != GNUNET_SCHEDULER_NO_TASK) 97 if (die_task != NULL)
98 { 98 {
99 GNUNET_SCHEDULER_cancel (die_task); 99 GNUNET_SCHEDULER_cancel (die_task);
100 die_task = GNUNET_SCHEDULER_NO_TASK; 100 die_task = NULL;
101 } 101 }
102 102
103 if (NULL != sched_ats) 103 if (NULL != sched_ats)
@@ -122,7 +122,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
122static void 122static void
123end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 123end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
124{ 124{
125 die_task = GNUNET_SCHEDULER_NO_TASK; 125 die_task = NULL;
126 end ( NULL, NULL); 126 end ( NULL, NULL);
127 ret = GNUNET_SYSERR; 127 ret = GNUNET_SYSERR;
128} 128}
diff --git a/src/ats/test_ats_solver_request_and_delete_address.c b/src/ats/test_ats_solver_request_and_delete_address.c
index 05a045e3b..1e4644b2c 100644
--- a/src/ats/test_ats_solver_request_and_delete_address.c
+++ b/src/ats/test_ats_solver_request_and_delete_address.c
@@ -38,7 +38,7 @@
38/** 38/**
39 * Timeout task 39 * Timeout task
40 */ 40 */
41static GNUNET_SCHEDULER_TaskIdentifier die_task; 41static struct GNUNET_SCHEDULER_Task * die_task;
42 42
43/** 43/**
44 * Statistics handle 44 * Statistics handle
@@ -96,10 +96,10 @@ static void
96end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 96end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
97{ 97{
98 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n"); 98 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n");
99 if (die_task != GNUNET_SCHEDULER_NO_TASK) 99 if (die_task != NULL)
100 { 100 {
101 GNUNET_SCHEDULER_cancel (die_task); 101 GNUNET_SCHEDULER_cancel (die_task);
102 die_task = GNUNET_SCHEDULER_NO_TASK; 102 die_task = NULL;
103 } 103 }
104 104
105 if (NULL != sched_ats) 105 if (NULL != sched_ats)
@@ -124,7 +124,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
124static void 124static void
125end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 125end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
126{ 126{
127 die_task = GNUNET_SCHEDULER_NO_TASK; 127 die_task = NULL;
128 128
129 end ( NULL, NULL); 129 end ( NULL, NULL);
130 ret = GNUNET_SYSERR; 130 ret = GNUNET_SYSERR;
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index ddd1755cc..43fe3535f 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -78,7 +78,7 @@ struct GNUNET_CADET_TransmitHandle
78 /** 78 /**
79 * Task triggering a timeout, can be NO_TASK if the timeout is FOREVER. 79 * Task triggering a timeout, can be NO_TASK if the timeout is FOREVER.
80 */ 80 */
81 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 81 struct GNUNET_SCHEDULER_Task * timeout_task;
82 82
83 /** 83 /**
84 * Size of 'data' -- or the desired size of 'notify' if 'data' is NULL. 84 * Size of 'data' -- or the desired size of 'notify' if 'data' is NULL.
@@ -210,7 +210,7 @@ struct GNUNET_CADET_Handle
210 /** 210 /**
211 * Task for trying to reconnect. 211 * Task for trying to reconnect.
212 */ 212 */
213 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 213 struct GNUNET_SCHEDULER_Task * reconnect_task;
214 214
215 /** 215 /**
216 * Callback for an info task (only one active at a time). 216 * Callback for an info task (only one active at a time).
@@ -496,7 +496,7 @@ destroy_channel (struct GNUNET_CADET_Channel *ch, int call_cleaner)
496 GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th); 496 GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th);
497 497
498 /* clean up request */ 498 /* clean up request */
499 if (GNUNET_SCHEDULER_NO_TASK != th->timeout_task) 499 if (NULL != th->timeout_task)
500 GNUNET_SCHEDULER_cancel (th->timeout_task); 500 GNUNET_SCHEDULER_cancel (th->timeout_task);
501 GNUNET_free (th); 501 GNUNET_free (th);
502 } 502 }
@@ -528,7 +528,7 @@ timeout_transmission (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
528 struct GNUNET_CADET_TransmitHandle *th = cls; 528 struct GNUNET_CADET_TransmitHandle *th = cls;
529 struct GNUNET_CADET_Handle *cadet = th->channel->cadet; 529 struct GNUNET_CADET_Handle *cadet = th->channel->cadet;
530 530
531 th->timeout_task = GNUNET_SCHEDULER_NO_TASK; 531 th->timeout_task = NULL;
532 th->channel->packet_size = 0; 532 th->channel->packet_size = 0;
533 GNUNET_CONTAINER_DLL_remove (cadet->th_head, cadet->th_tail, th); 533 GNUNET_CONTAINER_DLL_remove (cadet->th_head, cadet->th_tail, th);
534 if (GNUNET_YES == th_is_payload (th)) 534 if (GNUNET_YES == th_is_payload (th))
@@ -711,7 +711,7 @@ reconnect_cbk (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
711{ 711{
712 struct GNUNET_CADET_Handle *h = cls; 712 struct GNUNET_CADET_Handle *h = cls;
713 713
714 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 714 h->reconnect_task = NULL;
715 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 715 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
716 return; 716 return;
717 do_reconnect (h); 717 do_reconnect (h);
@@ -740,7 +740,7 @@ reconnect (struct GNUNET_CADET_Handle *h)
740 next = ch->next; 740 next = ch->next;
741 destroy_channel (ch, GNUNET_YES); 741 destroy_channel (ch, GNUNET_YES);
742 } 742 }
743 if (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task) 743 if (NULL == h->reconnect_task)
744 h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->reconnect_time, 744 h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->reconnect_time,
745 &reconnect_cbk, h); 745 &reconnect_cbk, h);
746} 746}
@@ -1382,7 +1382,7 @@ send_callback (void *cls, size_t size, void *buf)
1382 psize = th->size; 1382 psize = th->size;
1383 } 1383 }
1384 GNUNET_assert (GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE >= psize); 1384 GNUNET_assert (GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE >= psize);
1385 if (th->timeout_task != GNUNET_SCHEDULER_NO_TASK) 1385 if (th->timeout_task != NULL)
1386 GNUNET_SCHEDULER_cancel (th->timeout_task); 1386 GNUNET_SCHEDULER_cancel (th->timeout_task);
1387 GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th); 1387 GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th);
1388 GNUNET_free (th); 1388 GNUNET_free (th);
@@ -1487,7 +1487,7 @@ GNUNET_CADET_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls,
1487 h->ports = ports; 1487 h->ports = ports;
1488 h->next_chid = GNUNET_CADET_LOCAL_CHANNEL_ID_CLI; 1488 h->next_chid = GNUNET_CADET_LOCAL_CHANNEL_ID_CLI;
1489 h->reconnect_time = GNUNET_TIME_UNIT_MILLISECONDS; 1489 h->reconnect_time = GNUNET_TIME_UNIT_MILLISECONDS;
1490 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1490 h->reconnect_task = NULL;
1491 1491
1492 if (NULL != ports && ports[0] != 0 && NULL == new_channel) 1492 if (NULL != ports && ports[0] != 0 && NULL == new_channel)
1493 { 1493 {
@@ -1576,10 +1576,10 @@ GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle)
1576 GNUNET_CLIENT_disconnect (handle->client); 1576 GNUNET_CLIENT_disconnect (handle->client);
1577 handle->client = NULL; 1577 handle->client = NULL;
1578 } 1578 }
1579 if (GNUNET_SCHEDULER_NO_TASK != handle->reconnect_task) 1579 if (NULL != handle->reconnect_task)
1580 { 1580 {
1581 GNUNET_SCHEDULER_cancel(handle->reconnect_task); 1581 GNUNET_SCHEDULER_cancel(handle->reconnect_task);
1582 handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1582 handle->reconnect_task = NULL;
1583 } 1583 }
1584 GNUNET_free (handle); 1584 GNUNET_free (handle);
1585} 1585}
@@ -1761,7 +1761,7 @@ GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle *t
1761 1761
1762 th->channel->packet_size = 0; 1762 th->channel->packet_size = 0;
1763 cadet = th->channel->cadet; 1763 cadet = th->channel->cadet;
1764 if (th->timeout_task != GNUNET_SCHEDULER_NO_TASK) 1764 if (th->timeout_task != NULL)
1765 GNUNET_SCHEDULER_cancel (th->timeout_task); 1765 GNUNET_SCHEDULER_cancel (th->timeout_task);
1766 GNUNET_CONTAINER_DLL_remove (cadet->th_head, cadet->th_tail, th); 1766 GNUNET_CONTAINER_DLL_remove (cadet->th_head, cadet->th_tail, th);
1767 GNUNET_free (th); 1767 GNUNET_free (th);
diff --git a/src/cadet/cadet_path.c b/src/cadet/cadet_path.c
index d1aa9dcf2..c00e417b1 100644
--- a/src/cadet/cadet_path.c
+++ b/src/cadet/cadet_path.c
@@ -48,7 +48,7 @@ path_destroy_delayed (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
48 struct CadetPeer *peer; 48 struct CadetPeer *peer;
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 = GNUNET_SCHEDULER_NO_TASK; 51 path->path_delete = NULL;
52 peer = GCP_get_short (path->peers[path->length - 1]); 52 peer = GCP_get_short (path->peers[path->length - 1]);
53 if (2 < path->length) 53 if (2 < path->length)
54 GCP_remove_path (peer, path); 54 GCP_remove_path (peer, path);
@@ -150,7 +150,7 @@ path_get_length (struct CadetPeerPath *path)
150void 150void
151path_invalidate (struct CadetPeerPath *p) 151path_invalidate (struct CadetPeerPath *p)
152{ 152{
153 if (GNUNET_SCHEDULER_NO_TASK != p->path_delete) 153 if (NULL != p->path_delete)
154 return; 154 return;
155 155
156 LOG (GNUNET_ERROR_TYPE_INFO, "Invalidating path %p (%u)\n", p, p->length); 156 LOG (GNUNET_ERROR_TYPE_INFO, "Invalidating path %p (%u)\n", p, p->length);
@@ -267,7 +267,7 @@ path_equivalent (const struct CadetPeerPath *p1,
267int 267int
268path_is_valid (const struct CadetPeerPath *path) 268path_is_valid (const struct CadetPeerPath *path)
269{ 269{
270 return (GNUNET_SCHEDULER_NO_TASK == path->path_delete); 270 return (NULL == path->path_delete);
271} 271}
272 272
273 273
@@ -287,7 +287,7 @@ path_destroy (struct CadetPeerPath *p)
287 LOG (GNUNET_ERROR_TYPE_INFO, "destroying path %p (%u)\n", p, p->length); 287 LOG (GNUNET_ERROR_TYPE_INFO, "destroying path %p (%u)\n", p, p->length);
288 GNUNET_PEER_decrement_rcs (p->peers, p->length); 288 GNUNET_PEER_decrement_rcs (p->peers, p->length);
289 GNUNET_free_non_null (p->peers); 289 GNUNET_free_non_null (p->peers);
290 if (GNUNET_SCHEDULER_NO_TASK != p->path_delete) 290 if (NULL != p->path_delete)
291 GNUNET_SCHEDULER_cancel (p->path_delete); 291 GNUNET_SCHEDULER_cancel (p->path_delete);
292 GNUNET_free (p); 292 GNUNET_free (p);
293 return GNUNET_OK; 293 return GNUNET_OK;
diff --git a/src/cadet/cadet_path.h b/src/cadet/cadet_path.h
index 761e51156..326626f9d 100644
--- a/src/cadet/cadet_path.h
+++ b/src/cadet/cadet_path.h
@@ -78,7 +78,7 @@ struct CadetPeerPath
78 * Task to delete the path. 78 * Task to delete the path.
79 * We tried it, it didn't work, don't try again in a while. 79 * We tried it, it didn't work, don't try again in a while.
80 */ 80 */
81 GNUNET_SCHEDULER_TaskIdentifier path_delete; 81 struct GNUNET_SCHEDULER_Task * path_delete;
82 82
83}; 83};
84 84
diff --git a/src/cadet/gnunet-cadet-profiler.c b/src/cadet/gnunet-cadet-profiler.c
index c944caa75..2cfbfdaa4 100644
--- a/src/cadet/gnunet-cadet-profiler.c
+++ b/src/cadet/gnunet-cadet-profiler.c
@@ -147,7 +147,7 @@ struct CadetPeer
147 /** 147 /**
148 * Task to do the next ping. 148 * Task to do the next ping.
149 */ 149 */
150 GNUNET_SCHEDULER_TaskIdentifier ping_task; 150 struct GNUNET_SCHEDULER_Task * ping_task;
151 151
152 float mean[number_rounds]; 152 float mean[number_rounds];
153 float var[number_rounds]; 153 float var[number_rounds];
@@ -209,17 +209,17 @@ static struct GNUNET_CADET_TEST_Context *test_ctx;
209/** 209/**
210 * Task called to shutdown test. 210 * Task called to shutdown test.
211 */ 211 */
212static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle; 212static struct GNUNET_SCHEDULER_Task * shutdown_handle;
213 213
214/** 214/**
215 * Task called to disconnect peers, before shutdown. 215 * Task called to disconnect peers, before shutdown.
216 */ 216 */
217static GNUNET_SCHEDULER_TaskIdentifier disconnect_task; 217static struct GNUNET_SCHEDULER_Task * disconnect_task;
218 218
219/** 219/**
220 * Task to perform tests 220 * Task to perform tests
221 */ 221 */
222static GNUNET_SCHEDULER_TaskIdentifier test_task; 222static struct GNUNET_SCHEDULER_Task * test_task;
223 223
224/** 224/**
225 * Round number. 225 * Round number.
@@ -320,7 +320,7 @@ static void
320shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 320shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
321{ 321{
322 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Ending test.\n"); 322 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Ending test.\n");
323 shutdown_handle = GNUNET_SCHEDULER_NO_TASK; 323 shutdown_handle = NULL;
324} 324}
325 325
326 326
@@ -338,7 +338,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
338 338
339 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 339 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
340 "disconnecting cadet service, called from line %ld\n", line); 340 "disconnecting cadet service, called from line %ld\n", line);
341 disconnect_task = GNUNET_SCHEDULER_NO_TASK; 341 disconnect_task = NULL;
342 for (i = 0; i < peers_total; i++) 342 for (i = 0; i < peers_total; i++)
343 { 343 {
344 if (NULL != peers[i].op) 344 if (NULL != peers[i].op)
@@ -366,7 +366,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
366 } 366 }
367 } 367 }
368 GNUNET_CADET_TEST_cleanup (test_ctx); 368 GNUNET_CADET_TEST_cleanup (test_ctx);
369 if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle) 369 if (NULL != shutdown_handle)
370 { 370 {
371 GNUNET_SCHEDULER_cancel (shutdown_handle); 371 GNUNET_SCHEDULER_cancel (shutdown_handle);
372 } 372 }
@@ -382,7 +382,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
382static void 382static void
383abort_test (long line) 383abort_test (long line)
384{ 384{
385 if (disconnect_task != GNUNET_SCHEDULER_NO_TASK) 385 if (disconnect_task != NULL)
386 { 386 {
387 GNUNET_SCHEDULER_cancel (disconnect_task); 387 GNUNET_SCHEDULER_cancel (disconnect_task);
388 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers, 388 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
@@ -405,7 +405,7 @@ stats_cont (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg)
405 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "... collecting statistics done.\n"); 405 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "... collecting statistics done.\n");
406 GNUNET_TESTBED_operation_done (stats_op); 406 GNUNET_TESTBED_operation_done (stats_op);
407 407
408 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) 408 if (NULL != disconnect_task)
409 GNUNET_SCHEDULER_cancel (disconnect_task); 409 GNUNET_SCHEDULER_cancel (disconnect_task);
410 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers, 410 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
411 (void *) __LINE__); 411 (void *) __LINE__);
@@ -513,9 +513,9 @@ adjust_running_peers (unsigned int target)
513 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "St%s peer %u: %s\n", 513 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "St%s peer %u: %s\n",
514 run ? "arting" : "opping", r, GNUNET_i2s (&peers[r].id)); 514 run ? "arting" : "opping", r, GNUNET_i2s (&peers[r].id));
515 515
516 if (GNUNET_SCHEDULER_NO_TASK != peers[r].ping_task) 516 if (NULL != peers[r].ping_task)
517 GNUNET_SCHEDULER_cancel (peers[r].ping_task); 517 GNUNET_SCHEDULER_cancel (peers[r].ping_task);
518 peers[r].ping_task = GNUNET_SCHEDULER_NO_TASK; 518 peers[r].ping_task = NULL;
519 519
520 peers[r].up = run; 520 peers[r].up = run;
521 521
@@ -615,7 +615,7 @@ ping (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
615{ 615{
616 struct CadetPeer *peer = (struct CadetPeer *) cls; 616 struct CadetPeer *peer = (struct CadetPeer *) cls;
617 617
618 peer->ping_task = GNUNET_SCHEDULER_NO_TASK; 618 peer->ping_task = NULL;
619 619
620 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0 620 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0
621 || GNUNET_YES == test_finished) 621 || GNUNET_YES == test_finished)
@@ -797,7 +797,7 @@ incoming_channel (void *cls, struct GNUNET_CADET_Channel *channel,
797 peers_warmup++; 797 peers_warmup++;
798 if (peers_warmup < peers_total) 798 if (peers_warmup < peers_total)
799 return NULL; 799 return NULL;
800 if (GNUNET_SCHEDULER_NO_TASK != test_task) 800 if (NULL != test_task)
801 { 801 {
802 GNUNET_SCHEDULER_cancel (test_task); 802 GNUNET_SCHEDULER_cancel (test_task);
803 test_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, 803 test_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
@@ -873,7 +873,7 @@ start_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
873 enum GNUNET_CADET_ChannelOption flags; 873 enum GNUNET_CADET_ChannelOption flags;
874 unsigned long i; 874 unsigned long i;
875 875
876 test_task = GNUNET_SCHEDULER_NO_TASK; 876 test_task = NULL;
877 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 877 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
878 return; 878 return;
879 879
@@ -898,7 +898,7 @@ start_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
898 &ping, &peers[i]); 898 &ping, &peers[i]);
899 } 899 }
900 peers_running = peers_total; 900 peers_running = peers_total;
901 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) 901 if (NULL != disconnect_task)
902 GNUNET_SCHEDULER_cancel (disconnect_task); 902 GNUNET_SCHEDULER_cancel (disconnect_task);
903 disconnect_task = 903 disconnect_task =
904 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(round_time, 904 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(round_time,
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c
index d6ae66331..2b28685c9 100644
--- a/src/cadet/gnunet-cadet.c
+++ b/src/cadet/gnunet-cadet.c
@@ -87,7 +87,7 @@ struct GNUNET_TIME_Absolute echo_time;
87/** 87/**
88 * Task for next echo request. 88 * Task for next echo request.
89 */ 89 */
90GNUNET_SCHEDULER_TaskIdentifier echo_task; 90struct GNUNET_SCHEDULER_Task * echo_task;
91 91
92/** 92/**
93 * Peer to connect to. 93 * Peer to connect to.
@@ -118,7 +118,7 @@ static struct GNUNET_CADET_Channel *ch;
118/** 118/**
119 * Shutdown task handle. 119 * Shutdown task handle.
120 */ 120 */
121GNUNET_SCHEDULER_TaskIdentifier sd; 121struct GNUNET_SCHEDULER_Task * sd;
122 122
123 123
124 124
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index cc9cc699a..bb9fa6060 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -183,7 +183,7 @@ struct CadetChannelReliability
183 /** 183 /**
184 * Task to resend/poll in case no ACK is received. 184 * Task to resend/poll in case no ACK is received.
185 */ 185 */
186 GNUNET_SCHEDULER_TaskIdentifier retry_task; 186 struct GNUNET_SCHEDULER_Task * retry_task;
187 187
188 /** 188 /**
189 * Counter for exponential backoff. 189 * Counter for exponential backoff.
@@ -729,7 +729,7 @@ channel_retransmit_message (void *cls,
729 struct GNUNET_CADET_Data *payload; 729 struct GNUNET_CADET_Data *payload;
730 int fwd; 730 int fwd;
731 731
732 rel->retry_task = GNUNET_SCHEDULER_NO_TASK; 732 rel->retry_task = NULL;
733 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 733 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
734 return; 734 return;
735 735
@@ -763,7 +763,7 @@ channel_recreate (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
763{ 763{
764 struct CadetChannelReliability *rel = cls; 764 struct CadetChannelReliability *rel = cls;
765 765
766 rel->retry_task = GNUNET_SCHEDULER_NO_TASK; 766 rel->retry_task = NULL;
767 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 767 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
768 return; 768 return;
769 769
@@ -815,7 +815,7 @@ ch_message_sent (void *cls,
815 GNUNET_assert (chq == copy->chq); 815 GNUNET_assert (chq == copy->chq);
816 copy->timestamp = GNUNET_TIME_absolute_get (); 816 copy->timestamp = GNUNET_TIME_absolute_get ();
817 rel = copy->rel; 817 rel = copy->rel;
818 if (GNUNET_SCHEDULER_NO_TASK == rel->retry_task) 818 if (NULL == rel->retry_task)
819 { 819 {
820 LOG (GNUNET_ERROR_TYPE_DEBUG, "!! scheduling retry in 4 * %s\n", 820 LOG (GNUNET_ERROR_TYPE_DEBUG, "!! scheduling retry in 4 * %s\n",
821 GNUNET_STRINGS_relative_time_to_string (rel->expected_delay, 821 GNUNET_STRINGS_relative_time_to_string (rel->expected_delay,
@@ -859,7 +859,7 @@ ch_message_sent (void *cls,
859 && GNUNET_MESSAGE_TYPE_CADET_DATA_ACK != type 859 && GNUNET_MESSAGE_TYPE_CADET_DATA_ACK != type
860 && GNUNET_NO == rel->ch->destroy) 860 && GNUNET_NO == rel->ch->destroy)
861 { 861 {
862 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rel->retry_task); 862 GNUNET_assert (NULL == rel->retry_task);
863 LOG (GNUNET_ERROR_TYPE_DEBUG, "!!! STD BACKOFF %s\n", 863 LOG (GNUNET_ERROR_TYPE_DEBUG, "!!! STD BACKOFF %s\n",
864 GNUNET_STRINGS_relative_time_to_string (rel->retry_timer, 864 GNUNET_STRINGS_relative_time_to_string (rel->retry_timer,
865 GNUNET_NO)); 865 GNUNET_NO));
@@ -1006,10 +1006,10 @@ channel_rel_free_all (struct CadetChannelReliability *rel)
1006 GCT_cancel (rel->uniq->tq); 1006 GCT_cancel (rel->uniq->tq);
1007 /* ch_message_sent is called freeing uniq */ 1007 /* ch_message_sent is called freeing uniq */
1008 } 1008 }
1009 if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task) 1009 if (NULL != rel->retry_task)
1010 { 1010 {
1011 GNUNET_SCHEDULER_cancel (rel->retry_task); 1011 GNUNET_SCHEDULER_cancel (rel->retry_task);
1012 rel->retry_task = GNUNET_SCHEDULER_NO_TASK; 1012 rel->retry_task = NULL;
1013 } 1013 }
1014 GNUNET_free (rel); 1014 GNUNET_free (rel);
1015} 1015}
@@ -1174,10 +1174,10 @@ channel_confirm (struct CadetChannel *ch, int fwd)
1174 if (GCT_get_connections_buffer (ch->t) > 0 || GCT_is_loopback (ch->t)) 1174 if (GCT_get_connections_buffer (ch->t) > 0 || GCT_is_loopback (ch->t))
1175 send_client_ack (ch, fwd); 1175 send_client_ack (ch, fwd);
1176 1176
1177 if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task) 1177 if (NULL != rel->retry_task)
1178 { 1178 {
1179 GNUNET_SCHEDULER_cancel (rel->retry_task); 1179 GNUNET_SCHEDULER_cancel (rel->retry_task);
1180 rel->retry_task = GNUNET_SCHEDULER_NO_TASK; 1180 rel->retry_task = NULL;
1181 } 1181 }
1182 else if (NULL != rel->uniq) 1182 else if (NULL != rel->uniq)
1183 { 1183 {
@@ -2079,10 +2079,10 @@ GCCH_handle_data_ack (struct CadetChannel *ch,
2079 /* If some message was free'd, update the retransmission delay */ 2079 /* If some message was free'd, update the retransmission delay */
2080 if (GNUNET_YES == work) 2080 if (GNUNET_YES == work)
2081 { 2081 {
2082 if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task) 2082 if (NULL != rel->retry_task)
2083 { 2083 {
2084 GNUNET_SCHEDULER_cancel (rel->retry_task); 2084 GNUNET_SCHEDULER_cancel (rel->retry_task);
2085 rel->retry_task = GNUNET_SCHEDULER_NO_TASK; 2085 rel->retry_task = NULL;
2086 if (NULL != rel->head_sent && NULL == rel->head_sent->chq) 2086 if (NULL != rel->head_sent && NULL == rel->head_sent->chq)
2087 { 2087 {
2088 struct GNUNET_TIME_Absolute new_target; 2088 struct GNUNET_TIME_Absolute new_target;
@@ -2179,12 +2179,12 @@ GCCH_handle_create (struct CadetTunnel *t,
2179 else 2179 else
2180 { 2180 {
2181 LOG (GNUNET_ERROR_TYPE_DEBUG, " duplicate create channel\n"); 2181 LOG (GNUNET_ERROR_TYPE_DEBUG, " duplicate create channel\n");
2182 if (GNUNET_SCHEDULER_NO_TASK != ch->dest_rel->retry_task) 2182 if (NULL != ch->dest_rel->retry_task)
2183 { 2183 {
2184 LOG (GNUNET_ERROR_TYPE_DEBUG, " clearing retry task\n"); 2184 LOG (GNUNET_ERROR_TYPE_DEBUG, " clearing retry task\n");
2185 /* we were waiting to re-send our 'SYNACK', wait no more! */ 2185 /* we were waiting to re-send our 'SYNACK', wait no more! */
2186 GNUNET_SCHEDULER_cancel (ch->dest_rel->retry_task); 2186 GNUNET_SCHEDULER_cancel (ch->dest_rel->retry_task);
2187 ch->dest_rel->retry_task = GNUNET_SCHEDULER_NO_TASK; 2187 ch->dest_rel->retry_task = NULL;
2188 } 2188 }
2189 else if (NULL != ch->dest_rel->uniq) 2189 else if (NULL != ch->dest_rel->uniq)
2190 { 2190 {
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 50768d413..548eeb9b3 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -95,7 +95,7 @@ struct CadetFlowControl
95 /** 95 /**
96 * Task to poll the peer in case of a lost ACK causes stall. 96 * Task to poll the peer in case of a lost ACK causes stall.
97 */ 97 */
98 GNUNET_SCHEDULER_TaskIdentifier poll_task; 98 struct GNUNET_SCHEDULER_Task * poll_task;
99 99
100 /** 100 /**
101 * How frequently to poll for ACKs. 101 * How frequently to poll for ACKs.
@@ -190,13 +190,13 @@ struct CadetConnection
190 * Task to keep the used paths alive at the owner, 190 * Task to keep the used paths alive at the owner,
191 * time tunnel out on all the other peers. 191 * time tunnel out on all the other peers.
192 */ 192 */
193 GNUNET_SCHEDULER_TaskIdentifier fwd_maintenance_task; 193 struct GNUNET_SCHEDULER_Task * fwd_maintenance_task;
194 194
195 /** 195 /**
196 * Task to keep the used paths alive at the destination, 196 * Task to keep the used paths alive at the destination,
197 * time tunnel out on all the other peers. 197 * time tunnel out on all the other peers.
198 */ 198 */
199 GNUNET_SCHEDULER_TaskIdentifier bck_maintenance_task; 199 struct GNUNET_SCHEDULER_Task * bck_maintenance_task;
200 200
201 /** 201 /**
202 * Queue handle for maintainance traffic. One handle for FWD and BCK since 202 * Queue handle for maintainance traffic. One handle for FWD and BCK since
@@ -400,7 +400,7 @@ fc_init (struct CadetFlowControl *fc)
400 fc->last_pid_recv = (uint32_t) -1; 400 fc->last_pid_recv = (uint32_t) -1;
401 fc->last_ack_sent = (uint32_t) 0; 401 fc->last_ack_sent = (uint32_t) 0;
402 fc->last_ack_recv = (uint32_t) 0; 402 fc->last_ack_recv = (uint32_t) 0;
403 fc->poll_task = GNUNET_SCHEDULER_NO_TASK; 403 fc->poll_task = NULL;
404 fc->poll_time = GNUNET_TIME_UNIT_SECONDS; 404 fc->poll_time = GNUNET_TIME_UNIT_SECONDS;
405 fc->queue_n = 0; 405 fc->queue_n = 0;
406 fc->queue_max = (max_msgs_queue / max_connections) + 1; 406 fc->queue_max = (max_msgs_queue / max_connections) + 1;
@@ -1008,9 +1008,9 @@ connection_keepalive (struct CadetConnection *c, int fwd, int shutdown)
1008 GC_f2s (fwd), GCC_2s (c)); 1008 GC_f2s (fwd), GCC_2s (c));
1009 1009
1010 if (fwd) 1010 if (fwd)
1011 c->fwd_maintenance_task = GNUNET_SCHEDULER_NO_TASK; 1011 c->fwd_maintenance_task = NULL;
1012 else 1012 else
1013 c->bck_maintenance_task = GNUNET_SCHEDULER_NO_TASK; 1013 c->bck_maintenance_task = NULL;
1014 1014
1015 if (GNUNET_NO != shutdown) 1015 if (GNUNET_NO != shutdown)
1016 return; 1016 return;
@@ -1066,8 +1066,8 @@ static void
1066schedule_next_keepalive (struct CadetConnection *c, int fwd) 1066schedule_next_keepalive (struct CadetConnection *c, int fwd)
1067{ 1067{
1068 struct GNUNET_TIME_Relative delay; 1068 struct GNUNET_TIME_Relative delay;
1069 GNUNET_SCHEDULER_TaskIdentifier *task_id; 1069 struct GNUNET_SCHEDULER_Task * *task_id;
1070 GNUNET_SCHEDULER_Task keepalive_task; 1070 GNUNET_SCHEDULER_TaskCallback keepalive_task;
1071 1071
1072 if (GNUNET_NO == GCC_is_origin (c, fwd)) 1072 if (GNUNET_NO == GCC_is_origin (c, fwd))
1073 return; 1073 return;
@@ -1100,7 +1100,7 @@ schedule_next_keepalive (struct CadetConnection *c, int fwd)
1100 } 1100 }
1101 1101
1102 /* Check that no one scheduled it before us */ 1102 /* Check that no one scheduled it before us */
1103 if (GNUNET_SCHEDULER_NO_TASK != *task_id) 1103 if (NULL != *task_id)
1104 { 1104 {
1105 /* No need for a _break. It can happen for instance when sending a SYNACK 1105 /* No need for a _break. It can happen for instance when sending a SYNACK
1106 * for a duplicate SYN: the first SYNACK scheduled the task. */ 1106 * for a duplicate SYN: the first SYNACK scheduled the task. */
@@ -1168,10 +1168,10 @@ connection_cancel_queues (struct CadetConnection *c, int fwd)
1168 } 1168 }
1169 1169
1170 fc = fwd ? &c->fwd_fc : &c->bck_fc; 1170 fc = fwd ? &c->fwd_fc : &c->bck_fc;
1171 if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task) 1171 if (NULL != fc->poll_task)
1172 { 1172 {
1173 GNUNET_SCHEDULER_cancel (fc->poll_task); 1173 GNUNET_SCHEDULER_cancel (fc->poll_task);
1174 fc->poll_task = GNUNET_SCHEDULER_NO_TASK; 1174 fc->poll_task = NULL;
1175 LOG (GNUNET_ERROR_TYPE_DEBUG, " *** Cancel POLL in ccq for fc %p\n", fc); 1175 LOG (GNUNET_ERROR_TYPE_DEBUG, " *** Cancel POLL in ccq for fc %p\n", fc);
1176 } 1176 }
1177 peer = get_hop (c, fwd); 1177 peer = get_hop (c, fwd);
@@ -1236,7 +1236,7 @@ connection_poll (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1236 struct GNUNET_CADET_Poll msg; 1236 struct GNUNET_CADET_Poll msg;
1237 struct CadetConnection *c; 1237 struct CadetConnection *c;
1238 1238
1239 fc->poll_task = GNUNET_SCHEDULER_NO_TASK; 1239 fc->poll_task = NULL;
1240 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1240 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1241 { 1241 {
1242 return; 1242 return;
@@ -1316,7 +1316,7 @@ connection_fwd_timeout (void *cls,
1316{ 1316{
1317 struct CadetConnection *c = cls; 1317 struct CadetConnection *c = cls;
1318 1318
1319 c->fwd_maintenance_task = GNUNET_SCHEDULER_NO_TASK; 1319 c->fwd_maintenance_task = NULL;
1320 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1320 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1321 return; 1321 return;
1322 1322
@@ -1358,7 +1358,7 @@ connection_bck_timeout (void *cls,
1358{ 1358{
1359 struct CadetConnection *c = cls; 1359 struct CadetConnection *c = cls;
1360 1360
1361 c->bck_maintenance_task = GNUNET_SCHEDULER_NO_TASK; 1361 c->bck_maintenance_task = NULL;
1362 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1362 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1363 return; 1363 return;
1364 1364
@@ -1410,12 +1410,12 @@ connection_reset_timeout (struct CadetConnection *c, int fwd)
1410 else /* Relay, endpoint. */ 1410 else /* Relay, endpoint. */
1411 { 1411 {
1412 struct GNUNET_TIME_Relative delay; 1412 struct GNUNET_TIME_Relative delay;
1413 GNUNET_SCHEDULER_TaskIdentifier *ti; 1413 struct GNUNET_SCHEDULER_Task * *ti;
1414 GNUNET_SCHEDULER_Task f; 1414 GNUNET_SCHEDULER_TaskCallback f;
1415 1415
1416 ti = fwd ? &c->fwd_maintenance_task : &c->bck_maintenance_task; 1416 ti = fwd ? &c->fwd_maintenance_task : &c->bck_maintenance_task;
1417 1417
1418 if (GNUNET_SCHEDULER_NO_TASK != *ti) 1418 if (NULL != *ti)
1419 GNUNET_SCHEDULER_cancel (*ti); 1419 GNUNET_SCHEDULER_cancel (*ti);
1420 delay = GNUNET_TIME_relative_multiply (refresh_connection_time, 4); 1420 delay = GNUNET_TIME_relative_multiply (refresh_connection_time, 4);
1421 LOG (GNUNET_ERROR_TYPE_DEBUG, " timing out in %s\n", 1421 LOG (GNUNET_ERROR_TYPE_DEBUG, " timing out in %s\n",
@@ -2376,12 +2376,12 @@ GCC_handle_ack (void *cls, const struct GNUNET_PeerIdentity *peer,
2376 fc->last_ack_recv = ack; 2376 fc->last_ack_recv = ack;
2377 2377
2378 /* Cancel polling if the ACK is big enough. */ 2378 /* Cancel polling if the ACK is big enough. */
2379 if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task && 2379 if (NULL != fc->poll_task &&
2380 GC_is_pid_bigger (fc->last_ack_recv, fc->last_pid_sent)) 2380 GC_is_pid_bigger (fc->last_ack_recv, fc->last_pid_sent))
2381 { 2381 {
2382 LOG (GNUNET_ERROR_TYPE_DEBUG, " Cancel poll\n"); 2382 LOG (GNUNET_ERROR_TYPE_DEBUG, " Cancel poll\n");
2383 GNUNET_SCHEDULER_cancel (fc->poll_task); 2383 GNUNET_SCHEDULER_cancel (fc->poll_task);
2384 fc->poll_task = GNUNET_SCHEDULER_NO_TASK; 2384 fc->poll_task = NULL;
2385 fc->poll_time = GNUNET_TIME_UNIT_SECONDS; 2385 fc->poll_time = GNUNET_TIME_UNIT_SECONDS;
2386 } 2386 }
2387 2387
@@ -2690,16 +2690,16 @@ GCC_destroy (struct CadetConnection *c)
2690 2690
2691 if (GNUNET_NO == GCC_is_origin (c, GNUNET_YES) && NULL != c->path) 2691 if (GNUNET_NO == GCC_is_origin (c, GNUNET_YES) && NULL != c->path)
2692 path_destroy (c->path); 2692 path_destroy (c->path);
2693 if (GNUNET_SCHEDULER_NO_TASK != c->fwd_maintenance_task) 2693 if (NULL != c->fwd_maintenance_task)
2694 GNUNET_SCHEDULER_cancel (c->fwd_maintenance_task); 2694 GNUNET_SCHEDULER_cancel (c->fwd_maintenance_task);
2695 if (GNUNET_SCHEDULER_NO_TASK != c->bck_maintenance_task) 2695 if (NULL != c->bck_maintenance_task)
2696 GNUNET_SCHEDULER_cancel (c->bck_maintenance_task); 2696 GNUNET_SCHEDULER_cancel (c->bck_maintenance_task);
2697 if (GNUNET_SCHEDULER_NO_TASK != c->fwd_fc.poll_task) 2697 if (NULL != c->fwd_fc.poll_task)
2698 { 2698 {
2699 GNUNET_SCHEDULER_cancel (c->fwd_fc.poll_task); 2699 GNUNET_SCHEDULER_cancel (c->fwd_fc.poll_task);
2700 LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL FWD canceled\n"); 2700 LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL FWD canceled\n");
2701 } 2701 }
2702 if (GNUNET_SCHEDULER_NO_TASK != c->bck_fc.poll_task) 2702 if (NULL != c->bck_fc.poll_task)
2703 { 2703 {
2704 GNUNET_SCHEDULER_cancel (c->bck_fc.poll_task); 2704 GNUNET_SCHEDULER_cancel (c->bck_fc.poll_task);
2705 LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL BCK canceled\n"); 2705 LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL BCK canceled\n");
@@ -3268,7 +3268,7 @@ GCC_start_poll (struct CadetConnection *c, int fwd)
3268 fc = fwd ? &c->fwd_fc : &c->bck_fc; 3268 fc = fwd ? &c->fwd_fc : &c->bck_fc;
3269 LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL %s requested\n", 3269 LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL %s requested\n",
3270 GC_f2s (fwd)); 3270 GC_f2s (fwd));
3271 if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task || NULL != fc->poll_msg) 3271 if (NULL != fc->poll_task || NULL != fc->poll_msg)
3272 { 3272 {
3273 LOG (GNUNET_ERROR_TYPE_DEBUG, " *** not needed (%u, %p)\n", 3273 LOG (GNUNET_ERROR_TYPE_DEBUG, " *** not needed (%u, %p)\n",
3274 fc->poll_task, fc->poll_msg); 3274 fc->poll_task, fc->poll_msg);
@@ -3295,10 +3295,10 @@ GCC_stop_poll (struct CadetConnection *c, int fwd)
3295 struct CadetFlowControl *fc; 3295 struct CadetFlowControl *fc;
3296 3296
3297 fc = fwd ? &c->fwd_fc : &c->bck_fc; 3297 fc = fwd ? &c->fwd_fc : &c->bck_fc;
3298 if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task) 3298 if (NULL != fc->poll_task)
3299 { 3299 {
3300 GNUNET_SCHEDULER_cancel (fc->poll_task); 3300 GNUNET_SCHEDULER_cancel (fc->poll_task);
3301 fc->poll_task = GNUNET_SCHEDULER_NO_TASK; 3301 fc->poll_task = NULL;
3302 } 3302 }
3303} 3303}
3304 3304
diff --git a/src/cadet/gnunet-service-cadet_dht.c b/src/cadet/gnunet-service-cadet_dht.c
index a44938484..7307ba001 100644
--- a/src/cadet/gnunet-service-cadet_dht.c
+++ b/src/cadet/gnunet-service-cadet_dht.c
@@ -93,7 +93,7 @@ static unsigned long long dht_replication_level;
93/** 93/**
94 * Task to periodically announce itself in the network. 94 * Task to periodically announce itself in the network.
95 */ 95 */
96static GNUNET_SCHEDULER_TaskIdentifier announce_id_task; 96static struct GNUNET_SCHEDULER_Task * announce_id_task;
97 97
98/** 98/**
99 * GET requests to stop on shutdown. 99 * GET requests to stop on shutdown.
@@ -214,7 +214,7 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
214 214
215 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 215 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
216 { 216 {
217 announce_id_task = GNUNET_SCHEDULER_NO_TASK; 217 announce_id_task = NULL;
218 return; 218 return;
219 } 219 }
220 LOG (GNUNET_ERROR_TYPE_DEBUG, "Announce ID\n"); 220 LOG (GNUNET_ERROR_TYPE_DEBUG, "Announce ID\n");
@@ -332,10 +332,10 @@ GCD_shutdown (void)
332 GNUNET_DHT_disconnect (dht_handle); 332 GNUNET_DHT_disconnect (dht_handle);
333 dht_handle = NULL; 333 dht_handle = NULL;
334 } 334 }
335 if (GNUNET_SCHEDULER_NO_TASK != announce_id_task) 335 if (NULL != announce_id_task)
336 { 336 {
337 GNUNET_SCHEDULER_cancel (announce_id_task); 337 GNUNET_SCHEDULER_cancel (announce_id_task);
338 announce_id_task = GNUNET_SCHEDULER_NO_TASK; 338 announce_id_task = NULL;
339 } 339 }
340} 340}
341 341
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index e19a60961..9740e41d9 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -117,7 +117,7 @@ struct CadetTunnelKXCtx
117 * Task for delayed destruction of the Key eXchange context, to allow delayed 117 * Task for delayed destruction of the Key eXchange context, to allow delayed
118 * messages with the old key to be decrypted successfully. 118 * messages with the old key to be decrypted successfully.
119 */ 119 */
120 GNUNET_SCHEDULER_TaskIdentifier finish_task; 120 struct GNUNET_SCHEDULER_Task * finish_task;
121}; 121};
122 122
123/** 123/**
@@ -164,7 +164,7 @@ struct CadetTunnel
164 /** 164 /**
165 * Task to start the rekey process. 165 * Task to start the rekey process.
166 */ 166 */
167 GNUNET_SCHEDULER_TaskIdentifier rekey_task; 167 struct GNUNET_SCHEDULER_Task * rekey_task;
168 168
169 /** 169 /**
170 * Paths that are actively used to reach the destination peer. 170 * Paths that are actively used to reach the destination peer.
@@ -191,7 +191,7 @@ struct CadetTunnel
191 /** 191 /**
192 * Destroy flag: if true, destroy on last message. 192 * Destroy flag: if true, destroy on last message.
193 */ 193 */
194 GNUNET_SCHEDULER_TaskIdentifier destroy_task; 194 struct GNUNET_SCHEDULER_Task * destroy_task;
195 195
196 /** 196 /**
197 * Queued messages, to transmit once tunnel gets connected. 197 * Queued messages, to transmit once tunnel gets connected.
@@ -202,7 +202,7 @@ struct CadetTunnel
202 /** 202 /**
203 * Task to trim connections if too many are present. 203 * Task to trim connections if too many are present.
204 */ 204 */
205 GNUNET_SCHEDULER_TaskIdentifier trim_connections_task; 205 struct GNUNET_SCHEDULER_Task * trim_connections_task;
206 206
207 /** 207 /**
208 * Ephemeral message in the queue (to avoid queueing more than one). 208 * Ephemeral message in the queue (to avoid queueing more than one).
@@ -326,7 +326,7 @@ static struct GNUNET_CADET_KX_Ephemeral kx_msg;
326/** 326/**
327 * Task to generate a new ephemeral key. 327 * Task to generate a new ephemeral key.
328 */ 328 */
329static GNUNET_SCHEDULER_TaskIdentifier rekey_task; 329static struct GNUNET_SCHEDULER_Task * rekey_task;
330 330
331/** 331/**
332 * Rekey period. 332 * Rekey period.
@@ -604,7 +604,7 @@ select_key (const struct CadetTunnel *t)
604 const struct GNUNET_CRYPTO_SymmetricSessionKey *key; 604 const struct GNUNET_CRYPTO_SymmetricSessionKey *key;
605 605
606 if (NULL != t->kx_ctx 606 if (NULL != t->kx_ctx
607 && GNUNET_SCHEDULER_NO_TASK == t->kx_ctx->finish_task) 607 && NULL == t->kx_ctx->finish_task)
608 { 608 {
609 struct GNUNET_TIME_Relative age; 609 struct GNUNET_TIME_Relative age;
610 610
@@ -912,11 +912,11 @@ create_kx_ctx (struct CadetTunnel *t)
912 912
913 if (NULL != t->kx_ctx) 913 if (NULL != t->kx_ctx)
914 { 914 {
915 if (GNUNET_SCHEDULER_NO_TASK != t->kx_ctx->finish_task) 915 if (NULL != t->kx_ctx->finish_task)
916 { 916 {
917 LOG (GNUNET_ERROR_TYPE_INFO, " resetting exisiting finish task\n"); 917 LOG (GNUNET_ERROR_TYPE_INFO, " resetting exisiting finish task\n");
918 GNUNET_SCHEDULER_cancel (t->kx_ctx->finish_task); 918 GNUNET_SCHEDULER_cancel (t->kx_ctx->finish_task);
919 t->kx_ctx->finish_task = GNUNET_SCHEDULER_NO_TASK; 919 t->kx_ctx->finish_task = NULL;
920 } 920 }
921 } 921 }
922 else 922 else
@@ -975,7 +975,7 @@ destroy_kx_ctx (struct CadetTunnel *t)
975{ 975{
976 struct GNUNET_TIME_Relative delay; 976 struct GNUNET_TIME_Relative delay;
977 977
978 if (NULL == t->kx_ctx || GNUNET_SCHEDULER_NO_TASK != t->kx_ctx->finish_task) 978 if (NULL == t->kx_ctx || NULL != t->kx_ctx->finish_task)
979 return; 979 return;
980 980
981 if (is_key_null (&t->kx_ctx->e_key_old)) 981 if (is_key_null (&t->kx_ctx->e_key_old))
@@ -1182,7 +1182,7 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message,
1182 if (NULL == c) 1182 if (NULL == c)
1183 { 1183 {
1184 /* Why is tunnel 'ready'? Should have been queued! */ 1184 /* Why is tunnel 'ready'? Should have been queued! */
1185 if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task) 1185 if (NULL != t->destroy_task)
1186 { 1186 {
1187 GNUNET_break (0); 1187 GNUNET_break (0);
1188 GCT_debug (t, GNUNET_ERROR_TYPE_WARNING); 1188 GCT_debug (t, GNUNET_ERROR_TYPE_WARNING);
@@ -1387,7 +1387,7 @@ send_kx (struct CadetTunnel *t,
1387 c = tunnel_get_connection (t); 1387 c = tunnel_get_connection (t);
1388 if (NULL == c) 1388 if (NULL == c)
1389 { 1389 {
1390 if (GNUNET_SCHEDULER_NO_TASK == t->destroy_task 1390 if (NULL == t->destroy_task
1391 && CADET_TUNNEL_READY == t->cstate) 1391 && CADET_TUNNEL_READY == t->cstate)
1392 { 1392 {
1393 GNUNET_break (0); 1393 GNUNET_break (0);
@@ -1488,7 +1488,7 @@ rekey_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1488{ 1488{
1489 struct CadetTunnel *t = cls; 1489 struct CadetTunnel *t = cls;
1490 1490
1491 t->rekey_task = GNUNET_SCHEDULER_NO_TASK; 1491 t->rekey_task = NULL;
1492 1492
1493 LOG (GNUNET_ERROR_TYPE_INFO, "Re-key Tunnel %s\n", GCT_2s (t)); 1493 LOG (GNUNET_ERROR_TYPE_INFO, "Re-key Tunnel %s\n", GCT_2s (t));
1494 if (NULL != tc && 0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 1494 if (NULL != tc && 0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
@@ -1571,7 +1571,7 @@ rekey_iterator (void *cls,
1571 long n = (long) cls; 1571 long n = (long) cls;
1572 uint32_t r; 1572 uint32_t r;
1573 1573
1574 if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task) 1574 if (NULL != t->rekey_task)
1575 return GNUNET_YES; 1575 return GNUNET_YES;
1576 1576
1577 if (GNUNET_YES == GCT_is_loopback (t)) 1577 if (GNUNET_YES == GCT_is_loopback (t))
@@ -1599,7 +1599,7 @@ rekey (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1599 struct GNUNET_TIME_Absolute time; 1599 struct GNUNET_TIME_Absolute time;
1600 long n; 1600 long n;
1601 1601
1602 rekey_task = GNUNET_SCHEDULER_NO_TASK; 1602 rekey_task = NULL;
1603 1603
1604 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 1604 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
1605 return; 1605 return;
@@ -1949,7 +1949,7 @@ handle_ephemeral (struct CadetTunnel *t,
1949 { 1949 {
1950 GCT_change_estate (t, CADET_TUNNEL_KEY_REKEY); 1950 GCT_change_estate (t, CADET_TUNNEL_KEY_REKEY);
1951 } 1951 }
1952 if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task) 1952 if (NULL != t->rekey_task)
1953 GNUNET_SCHEDULER_cancel (t->rekey_task); 1953 GNUNET_SCHEDULER_cancel (t->rekey_task);
1954 t->rekey_task = GNUNET_SCHEDULER_add_now (rekey_tunnel, t); 1954 t->rekey_task = GNUNET_SCHEDULER_add_now (rekey_tunnel, t);
1955 } 1955 }
@@ -1987,7 +1987,7 @@ handle_pong (struct CadetTunnel *t,
1987 uint32_t challenge; 1987 uint32_t challenge;
1988 1988
1989 LOG (GNUNET_ERROR_TYPE_INFO, "<=== PONG for %s\n", GCT_2s (t)); 1989 LOG (GNUNET_ERROR_TYPE_INFO, "<=== PONG for %s\n", GCT_2s (t));
1990 if (GNUNET_SCHEDULER_NO_TASK == t->rekey_task) 1990 if (NULL == t->rekey_task)
1991 { 1991 {
1992 GNUNET_STATISTICS_update (stats, "# duplicate PONG messages", 1, GNUNET_NO); 1992 GNUNET_STATISTICS_update (stats, "# duplicate PONG messages", 1, GNUNET_NO);
1993 return; 1993 return;
@@ -2008,7 +2008,7 @@ handle_pong (struct CadetTunnel *t,
2008 return; 2008 return;
2009 } 2009 }
2010 GNUNET_SCHEDULER_cancel (t->rekey_task); 2010 GNUNET_SCHEDULER_cancel (t->rekey_task);
2011 t->rekey_task = GNUNET_SCHEDULER_NO_TASK; 2011 t->rekey_task = NULL;
2012 2012
2013 /* Don't free the old keys right away, but after a delay. 2013 /* Don't free the old keys right away, but after a delay.
2014 * Rationale: the KX could have happened over a very fast connection, 2014 * Rationale: the KX could have happened over a very fast connection,
@@ -2223,10 +2223,10 @@ GCT_init (const struct GNUNET_CONFIGURATION_Handle *c,
2223void 2223void
2224GCT_shutdown (void) 2224GCT_shutdown (void)
2225{ 2225{
2226 if (GNUNET_SCHEDULER_NO_TASK != rekey_task) 2226 if (NULL != rekey_task)
2227 { 2227 {
2228 GNUNET_SCHEDULER_cancel (rekey_task); 2228 GNUNET_SCHEDULER_cancel (rekey_task);
2229 rekey_task = GNUNET_SCHEDULER_NO_TASK; 2229 rekey_task = NULL;
2230 } 2230 }
2231 GNUNET_CONTAINER_multipeermap_iterate (tunnels, &destroy_iterator, NULL); 2231 GNUNET_CONTAINER_multipeermap_iterate (tunnels, &destroy_iterator, NULL);
2232 GNUNET_CONTAINER_multipeermap_destroy (tunnels); 2232 GNUNET_CONTAINER_multipeermap_destroy (tunnels);
@@ -2285,7 +2285,7 @@ GCT_change_cstate (struct CadetTunnel* t, enum CadetTunnelCState cstate)
2285 else if (CADET_TUNNEL_KEY_UNINITIALIZED == t->estate) 2285 else if (CADET_TUNNEL_KEY_UNINITIALIZED == t->estate)
2286 { 2286 {
2287 LOG (GNUNET_ERROR_TYPE_DEBUG, " cstate triggered rekey\n"); 2287 LOG (GNUNET_ERROR_TYPE_DEBUG, " cstate triggered rekey\n");
2288 if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task) 2288 if (NULL != t->rekey_task)
2289 GNUNET_SCHEDULER_cancel (t->rekey_task); 2289 GNUNET_SCHEDULER_cancel (t->rekey_task);
2290 create_kx_ctx (t); 2290 create_kx_ctx (t);
2291 rekey_tunnel (t, NULL); 2291 rekey_tunnel (t, NULL);
@@ -2347,7 +2347,7 @@ trim_connections (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
2347{ 2347{
2348 struct CadetTunnel *t = cls; 2348 struct CadetTunnel *t = cls;
2349 2349
2350 t->trim_connections_task = GNUNET_SCHEDULER_NO_TASK; 2350 t->trim_connections_task = NULL;
2351 2351
2352 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 2352 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
2353 return; 2353 return;
@@ -2409,7 +2409,7 @@ GCT_add_connection (struct CadetTunnel *t, struct CadetConnection *c)
2409 if (CADET_TUNNEL_SEARCHING == t->cstate) 2409 if (CADET_TUNNEL_SEARCHING == t->cstate)
2410 GCT_change_estate (t, CADET_TUNNEL_WAITING); 2410 GCT_change_estate (t, CADET_TUNNEL_WAITING);
2411 2411
2412 if (GNUNET_SCHEDULER_NO_TASK != t->trim_connections_task) 2412 if (NULL != t->trim_connections_task)
2413 t->trim_connections_task = GNUNET_SCHEDULER_add_now (&trim_connections, t); 2413 t->trim_connections_task = GNUNET_SCHEDULER_add_now (&trim_connections, t);
2414} 2414}
2415 2415
@@ -2442,7 +2442,7 @@ GCT_remove_connection (struct CadetTunnel *t,
2442 2442
2443 conns = GCT_count_connections (t); 2443 conns = GCT_count_connections (t);
2444 if (0 == conns 2444 if (0 == conns
2445 && GNUNET_SCHEDULER_NO_TASK == t->destroy_task 2445 && NULL == t->destroy_task
2446 && CADET_TUNNEL_SHUTDOWN != t->cstate 2446 && CADET_TUNNEL_SHUTDOWN != t->cstate
2447 && GNUNET_NO == shutting_down) 2447 && GNUNET_NO == shutting_down)
2448 { 2448 {
@@ -2454,7 +2454,7 @@ GCT_remove_connection (struct CadetTunnel *t,
2454 2454
2455 /* Start new connections if needed */ 2455 /* Start new connections if needed */
2456 if (CONNECTIONS_PER_TUNNEL > conns 2456 if (CONNECTIONS_PER_TUNNEL > conns
2457 && GNUNET_SCHEDULER_NO_TASK == t->destroy_task 2457 && NULL == t->destroy_task
2458 && CADET_TUNNEL_SHUTDOWN != t->cstate 2458 && CADET_TUNNEL_SHUTDOWN != t->cstate
2459 && GNUNET_NO == shutting_down) 2459 && GNUNET_NO == shutting_down)
2460 { 2460 {
@@ -2501,10 +2501,10 @@ GCT_add_channel (struct CadetTunnel *t, struct CadetChannel *ch)
2501 LOG (GNUNET_ERROR_TYPE_DEBUG, " adding %p to %p\n", aux, t->channel_head); 2501 LOG (GNUNET_ERROR_TYPE_DEBUG, " adding %p to %p\n", aux, t->channel_head);
2502 GNUNET_CONTAINER_DLL_insert_tail (t->channel_head, t->channel_tail, aux); 2502 GNUNET_CONTAINER_DLL_insert_tail (t->channel_head, t->channel_tail, aux);
2503 2503
2504 if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task) 2504 if (NULL != t->destroy_task)
2505 { 2505 {
2506 GNUNET_SCHEDULER_cancel (t->destroy_task); 2506 GNUNET_SCHEDULER_cancel (t->destroy_task);
2507 t->destroy_task = GNUNET_SCHEDULER_NO_TASK; 2507 t->destroy_task = NULL;
2508 LOG (GNUNET_ERROR_TYPE_DEBUG, " undo destroy!\n"); 2508 LOG (GNUNET_ERROR_TYPE_DEBUG, " undo destroy!\n");
2509 } 2509 }
2510} 2510}
@@ -2585,7 +2585,7 @@ delayed_destroy (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
2585 "Tunnel at %p should have been freed by GCT_shutdown\n", t); 2585 "Tunnel at %p should have been freed by GCT_shutdown\n", t);
2586 return; 2586 return;
2587 } 2587 }
2588 t->destroy_task = GNUNET_SCHEDULER_NO_TASK; 2588 t->destroy_task = NULL;
2589 t->cstate = CADET_TUNNEL_SHUTDOWN; 2589 t->cstate = CADET_TUNNEL_SHUTDOWN;
2590 2590
2591 for (iter = t->connection_head; NULL != iter; iter = iter->next) 2591 for (iter = t->connection_head; NULL != iter; iter = iter->next)
@@ -2609,7 +2609,7 @@ GCT_destroy_empty (struct CadetTunnel *t)
2609 if (GNUNET_YES == shutting_down) 2609 if (GNUNET_YES == shutting_down)
2610 return; /* Will be destroyed immediately anyway */ 2610 return; /* Will be destroyed immediately anyway */
2611 2611
2612 if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task) 2612 if (NULL != t->destroy_task)
2613 { 2613 {
2614 LOG (GNUNET_ERROR_TYPE_WARNING, 2614 LOG (GNUNET_ERROR_TYPE_WARNING,
2615 "Tunnel %s is already scheduled for destruction. Tunnel debug dump:\n", 2615 "Tunnel %s is already scheduled for destruction. Tunnel debug dump:\n",
@@ -2690,32 +2690,32 @@ GCT_destroy (struct CadetTunnel *t)
2690 /* Should only happen on shutdown, but it's ok. */ 2690 /* Should only happen on shutdown, but it's ok. */
2691 } 2691 }
2692 2692
2693 if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task) 2693 if (NULL != t->destroy_task)
2694 { 2694 {
2695 LOG (GNUNET_ERROR_TYPE_DEBUG, "cancelling dest: %llX\n", t->destroy_task); 2695 LOG (GNUNET_ERROR_TYPE_DEBUG, "cancelling dest: %llX\n", t->destroy_task);
2696 GNUNET_SCHEDULER_cancel (t->destroy_task); 2696 GNUNET_SCHEDULER_cancel (t->destroy_task);
2697 t->destroy_task = GNUNET_SCHEDULER_NO_TASK; 2697 t->destroy_task = NULL;
2698 } 2698 }
2699 2699
2700 if (GNUNET_SCHEDULER_NO_TASK != t->trim_connections_task) 2700 if (NULL != t->trim_connections_task)
2701 { 2701 {
2702 LOG (GNUNET_ERROR_TYPE_DEBUG, "cancelling trim: %llX\n", 2702 LOG (GNUNET_ERROR_TYPE_DEBUG, "cancelling trim: %llX\n",
2703 t->trim_connections_task); 2703 t->trim_connections_task);
2704 GNUNET_SCHEDULER_cancel (t->trim_connections_task); 2704 GNUNET_SCHEDULER_cancel (t->trim_connections_task);
2705 t->trim_connections_task = GNUNET_SCHEDULER_NO_TASK; 2705 t->trim_connections_task = NULL;
2706 } 2706 }
2707 2707
2708 GNUNET_STATISTICS_update (stats, "# tunnels", -1, GNUNET_NO); 2708 GNUNET_STATISTICS_update (stats, "# tunnels", -1, GNUNET_NO);
2709 GCP_set_tunnel (t->peer, NULL); 2709 GCP_set_tunnel (t->peer, NULL);
2710 2710
2711 if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task) 2711 if (NULL != t->rekey_task)
2712 { 2712 {
2713 GNUNET_SCHEDULER_cancel (t->rekey_task); 2713 GNUNET_SCHEDULER_cancel (t->rekey_task);
2714 t->rekey_task = GNUNET_SCHEDULER_NO_TASK; 2714 t->rekey_task = NULL;
2715 } 2715 }
2716 if (NULL != t->kx_ctx) 2716 if (NULL != t->kx_ctx)
2717 { 2717 {
2718 if (GNUNET_SCHEDULER_NO_TASK != t->kx_ctx->finish_task) 2718 if (NULL != t->kx_ctx->finish_task)
2719 GNUNET_SCHEDULER_cancel (t->kx_ctx->finish_task); 2719 GNUNET_SCHEDULER_cancel (t->kx_ctx->finish_task);
2720 GNUNET_free (t->kx_ctx); 2720 GNUNET_free (t->kx_ctx);
2721 } 2721 }
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c
index b9661a9b7..df605d0a9 100644
--- a/src/cadet/test_cadet.c
+++ b/src/cadet/test_cadet.c
@@ -144,17 +144,17 @@ struct GNUNET_CADET_TEST_Context *test_ctx;
144/** 144/**
145 * Task called to disconnect peers. 145 * Task called to disconnect peers.
146 */ 146 */
147static GNUNET_SCHEDULER_TaskIdentifier disconnect_task; 147static struct GNUNET_SCHEDULER_Task * disconnect_task;
148 148
149/** 149/**
150 * Task To perform tests 150 * Task To perform tests
151 */ 151 */
152static GNUNET_SCHEDULER_TaskIdentifier test_task; 152static struct GNUNET_SCHEDULER_Task * test_task;
153 153
154/** 154/**
155 * Task called to shutdown test. 155 * Task called to shutdown test.
156 */ 156 */
157static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle; 157static struct GNUNET_SCHEDULER_Task * shutdown_handle;
158 158
159/** 159/**
160 * Cadet handle for the root peer 160 * Cadet handle for the root peer
@@ -254,7 +254,7 @@ static void
254shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 254shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
255{ 255{
256 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending test.\n"); 256 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending test.\n");
257 shutdown_handle = GNUNET_SCHEDULER_NO_TASK; 257 shutdown_handle = NULL;
258} 258}
259 259
260 260
@@ -278,7 +278,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
278 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 278 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
279 "disconnecting cadet service of peers, called from line %ld\n", 279 "disconnecting cadet service of peers, called from line %ld\n",
280 line); 280 line);
281 disconnect_task = GNUNET_SCHEDULER_NO_TASK; 281 disconnect_task = NULL;
282 for (i = 0; i < 2; i++) 282 for (i = 0; i < 2; i++)
283 { 283 {
284 GNUNET_TESTBED_operation_done (t_op[i]); 284 GNUNET_TESTBED_operation_done (t_op[i]);
@@ -294,7 +294,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
294 incoming_ch = NULL; 294 incoming_ch = NULL;
295 } 295 }
296 GNUNET_CADET_TEST_cleanup (test_ctx); 296 GNUNET_CADET_TEST_cleanup (test_ctx);
297 if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle) 297 if (NULL != shutdown_handle)
298 { 298 {
299 GNUNET_SCHEDULER_cancel (shutdown_handle); 299 GNUNET_SCHEDULER_cancel (shutdown_handle);
300 } 300 }
@@ -310,7 +310,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
310static void 310static void
311abort_test (long line) 311abort_test (long line)
312{ 312{
313 if (disconnect_task != GNUNET_SCHEDULER_NO_TASK) 313 if (disconnect_task != NULL)
314 { 314 {
315 GNUNET_SCHEDULER_cancel (disconnect_task); 315 GNUNET_SCHEDULER_cancel (disconnect_task);
316 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers, 316 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
@@ -474,7 +474,7 @@ data_callback (void *cls, struct GNUNET_CADET_Channel *channel,
474 474
475 if ((ok % 20) == 0) 475 if ((ok % 20) == 0)
476 { 476 {
477 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) 477 if (NULL != disconnect_task)
478 { 478 {
479 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " reschedule timeout\n"); 479 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " reschedule timeout\n");
480 GNUNET_SCHEDULER_cancel (disconnect_task); 480 GNUNET_SCHEDULER_cancel (disconnect_task);
@@ -573,7 +573,7 @@ data_callback (void *cls, struct GNUNET_CADET_Channel *channel,
573 } 573 }
574 } 574 }
575 575
576 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) 576 if (NULL != disconnect_task)
577 { 577 {
578 GNUNET_SCHEDULER_cancel (disconnect_task); 578 GNUNET_SCHEDULER_cancel (disconnect_task);
579 disconnect_task = GNUNET_SCHEDULER_add_delayed (SHORT_TIME, 579 disconnect_task = GNUNET_SCHEDULER_add_delayed (SHORT_TIME,
@@ -604,7 +604,7 @@ stats_cont (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg)
604 ok--; 604 ok--;
605 GNUNET_TESTBED_operation_done (stats_op); 605 GNUNET_TESTBED_operation_done (stats_op);
606 606
607 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) 607 if (NULL != disconnect_task)
608 GNUNET_SCHEDULER_cancel (disconnect_task); 608 GNUNET_SCHEDULER_cancel (disconnect_task);
609 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers, 609 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
610 (void *) __LINE__); 610 (void *) __LINE__);
@@ -657,7 +657,7 @@ check_keepalives (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
657 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0) 657 if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
658 return; 658 return;
659 659
660 disconnect_task = GNUNET_SCHEDULER_NO_TASK; 660 disconnect_task = NULL;
661 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "check keepalives\n"); 661 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "check keepalives\n");
662 GNUNET_CADET_channel_destroy (ch); 662 GNUNET_CADET_channel_destroy (ch);
663 stats_op = GNUNET_TESTBED_get_statistics (peers_running, testbed_peers, 663 stats_op = GNUNET_TESTBED_get_statistics (peers_running, testbed_peers,
@@ -705,7 +705,7 @@ incoming_channel (void *cls, struct GNUNET_CADET_Channel *channel,
705 "Incoming channel for unknown client %lu\n", (long) cls); 705 "Incoming channel for unknown client %lu\n", (long) cls);
706 GNUNET_break(0); 706 GNUNET_break(0);
707 } 707 }
708 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) 708 if (NULL != disconnect_task)
709 { 709 {
710 GNUNET_SCHEDULER_cancel (disconnect_task); 710 GNUNET_SCHEDULER_cancel (disconnect_task);
711 if (KEEPALIVE == test) 711 if (KEEPALIVE == test)
@@ -761,7 +761,7 @@ channel_cleaner (void *cls, const struct GNUNET_CADET_Channel *channel,
761 "Unknown peer! %d\n", i); 761 "Unknown peer! %d\n", i);
762 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok); 762 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
763 763
764 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) 764 if (NULL != disconnect_task)
765 { 765 {
766 GNUNET_SCHEDULER_cancel (disconnect_task); 766 GNUNET_SCHEDULER_cancel (disconnect_task);
767 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers, 767 disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
@@ -791,7 +791,7 @@ do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
791 791
792 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test_task\n"); 792 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test_task\n");
793 793
794 if (GNUNET_SCHEDULER_NO_TASK != disconnect_task) 794 if (NULL != disconnect_task)
795 { 795 {
796 GNUNET_SCHEDULER_cancel (disconnect_task); 796 GNUNET_SCHEDULER_cancel (disconnect_task);
797 } 797 }
diff --git a/src/cadet/test_cadet_local.c b/src/cadet/test_cadet_local.c
index 0796aaf12..d66f0a3d4 100644
--- a/src/cadet/test_cadet_local.c
+++ b/src/cadet/test_cadet_local.c
@@ -42,9 +42,9 @@ static int result = GNUNET_OK;
42 42
43static int got_data = GNUNET_NO; 43static int got_data = GNUNET_NO;
44 44
45static GNUNET_SCHEDULER_TaskIdentifier abort_task; 45static struct GNUNET_SCHEDULER_Task * abort_task;
46 46
47static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 47static struct GNUNET_SCHEDULER_Task * shutdown_task;
48 48
49static struct GNUNET_CADET_TransmitHandle *mth; 49static struct GNUNET_CADET_TransmitHandle *mth;
50 50
@@ -66,7 +66,7 @@ static void
66do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 66do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
67{ 67{
68 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n"); 68 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n");
69 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 69 if (NULL != abort_task)
70 { 70 {
71 GNUNET_SCHEDULER_cancel (abort_task); 71 GNUNET_SCHEDULER_cancel (abort_task);
72 } 72 }
@@ -95,11 +95,11 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
95{ 95{
96 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ABORT\n"); 96 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ABORT\n");
97 result = GNUNET_SYSERR; 97 result = GNUNET_SYSERR;
98 abort_task = GNUNET_SCHEDULER_NO_TASK; 98 abort_task = NULL;
99 if (GNUNET_SCHEDULER_NO_TASK != shutdown_task) 99 if (NULL != shutdown_task)
100 { 100 {
101 GNUNET_SCHEDULER_cancel (shutdown_task); 101 GNUNET_SCHEDULER_cancel (shutdown_task);
102 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 102 shutdown_task = NULL;
103 } 103 }
104 do_shutdown (cls, tc); 104 do_shutdown (cls, tc);
105} 105}
@@ -123,7 +123,7 @@ data_callback (void *cls, struct GNUNET_CADET_Channel *channel,
123{ 123{
124 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Data callback! Shutting down.\n"); 124 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Data callback! Shutting down.\n");
125 got_data = GNUNET_YES; 125 got_data = GNUNET_YES;
126 if (GNUNET_SCHEDULER_NO_TASK != shutdown_task) 126 if (NULL != shutdown_task)
127 GNUNET_SCHEDULER_cancel (shutdown_task); 127 GNUNET_SCHEDULER_cancel (shutdown_task);
128 shutdown_task = 128 shutdown_task =
129 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_shutdown, 129 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_shutdown,
diff --git a/src/cadet/test_cadet_single.c b/src/cadet/test_cadet_single.c
index 3780c745c..29f2bf76f 100644
--- a/src/cadet/test_cadet_single.c
+++ b/src/cadet/test_cadet_single.c
@@ -43,9 +43,9 @@ static struct GNUNET_CADET_Channel *ch2;
43 43
44static int result; 44static int result;
45 45
46static GNUNET_SCHEDULER_TaskIdentifier abort_task; 46static struct GNUNET_SCHEDULER_Task * abort_task;
47 47
48static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 48static struct GNUNET_SCHEDULER_Task * shutdown_task;
49 49
50static unsigned int repetition; 50static unsigned int repetition;
51 51
@@ -62,7 +62,7 @@ static void
62do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 62do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
63{ 63{
64 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n"); 64 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n");
65 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 65 if (NULL != abort_task)
66 { 66 {
67 GNUNET_SCHEDULER_cancel (abort_task); 67 GNUNET_SCHEDULER_cancel (abort_task);
68 } 68 }
@@ -92,11 +92,11 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
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;
95 abort_task = GNUNET_SCHEDULER_NO_TASK; 95 abort_task = NULL;
96 if (GNUNET_SCHEDULER_NO_TASK != shutdown_task) 96 if (NULL != shutdown_task)
97 { 97 {
98 GNUNET_SCHEDULER_cancel (shutdown_task); 98 GNUNET_SCHEDULER_cancel (shutdown_task);
99 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 99 shutdown_task = NULL;
100 } 100 }
101 do_shutdown (cls, tc); 101 do_shutdown (cls, tc);
102} 102}
@@ -105,7 +105,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
105static void 105static void
106finish (void) 106finish (void)
107{ 107{
108 if (GNUNET_SCHEDULER_NO_TASK != shutdown_task) 108 if (NULL != shutdown_task)
109 GNUNET_SCHEDULER_cancel (shutdown_task); 109 GNUNET_SCHEDULER_cancel (shutdown_task);
110 shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, 110 shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
111 &do_shutdown, NULL); 111 &do_shutdown, NULL);
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c
index 2659b939d..c6bf179c5 100644
--- a/src/consensus/gnunet-service-consensus.c
+++ b/src/consensus/gnunet-service-consensus.c
@@ -154,7 +154,7 @@ struct ConsensusSession
154 /** 154 /**
155 * Timeout task identifier for the current round or subround. 155 * Timeout task identifier for the current round or subround.
156 */ 156 */
157 GNUNET_SCHEDULER_TaskIdentifier round_timeout_tid; 157 struct GNUNET_SCHEDULER_Task * round_timeout_tid;
158 158
159 /** 159 /**
160 * Number of other peers in the consensus. 160 * Number of other peers in the consensus.
@@ -440,12 +440,12 @@ round_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
440 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "P%d: round over\n", session->local_peer_idx); 440 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "P%d: round over\n", session->local_peer_idx);
441 441
442 if (tc != NULL) 442 if (tc != NULL)
443 session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK; 443 session->round_timeout_tid = NULL;
444 444
445 if (session->round_timeout_tid != GNUNET_SCHEDULER_NO_TASK) 445 if (session->round_timeout_tid != NULL)
446 { 446 {
447 GNUNET_SCHEDULER_cancel (session->round_timeout_tid); 447 GNUNET_SCHEDULER_cancel (session->round_timeout_tid);
448 session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK; 448 session->round_timeout_tid = NULL;
449 } 449 }
450 450
451 for (i = 0; i < session->num_peers; i++) 451 for (i = 0; i < session->num_peers; i++)
@@ -726,16 +726,16 @@ subround_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
726 726
727 if (tc != NULL) 727 if (tc != NULL)
728 { 728 {
729 session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK; 729 session->round_timeout_tid = NULL;
730 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "P%u: consensus subround timed out\n", 730 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "P%u: consensus subround timed out\n",
731 session->local_peer_idx); 731 session->local_peer_idx);
732 } 732 }
733 733
734 /* cancel timeout */ 734 /* cancel timeout */
735 if (session->round_timeout_tid != GNUNET_SCHEDULER_NO_TASK) 735 if (session->round_timeout_tid != NULL)
736 { 736 {
737 GNUNET_SCHEDULER_cancel (session->round_timeout_tid); 737 GNUNET_SCHEDULER_cancel (session->round_timeout_tid);
738 session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK; 738 session->round_timeout_tid = NULL;
739 } 739 }
740 740
741 for (i = 0; i < session->num_peers; i++) 741 for (i = 0; i < session->num_peers; i++)
diff --git a/src/conversation/gnunet-conversation-test.c b/src/conversation/gnunet-conversation-test.c
index cc831a3ab..108ca7b5a 100644
--- a/src/conversation/gnunet-conversation-test.c
+++ b/src/conversation/gnunet-conversation-test.c
@@ -74,12 +74,12 @@ static struct GNUNET_SPEAKER_Handle *speaker;
74/** 74/**
75 * Task scheduled to switch from recording to playback. 75 * Task scheduled to switch from recording to playback.
76 */ 76 */
77static GNUNET_SCHEDULER_TaskIdentifier switch_task; 77static struct GNUNET_SCHEDULER_Task * switch_task;
78 78
79/** 79/**
80 * The shutdown task. 80 * The shutdown task.
81 */ 81 */
82static GNUNET_SCHEDULER_TaskIdentifier st; 82static struct GNUNET_SCHEDULER_Task * st;
83 83
84/** 84/**
85 * Head of DLL with recorded frames. 85 * Head of DLL with recorded frames.
@@ -104,7 +104,7 @@ do_shutdown (void *cls,
104{ 104{
105 struct Recording *rec; 105 struct Recording *rec;
106 106
107 if (GNUNET_SCHEDULER_NO_TASK != switch_task) 107 if (NULL != switch_task)
108 GNUNET_SCHEDULER_cancel (switch_task); 108 GNUNET_SCHEDULER_cancel (switch_task);
109 if (NULL != microphone) 109 if (NULL != microphone)
110 GNUNET_MICROPHONE_destroy (microphone); 110 GNUNET_MICROPHONE_destroy (microphone);
@@ -134,7 +134,7 @@ switch_to_speaker (void *cls,
134{ 134{
135 struct Recording *rec; 135 struct Recording *rec;
136 136
137 switch_task = GNUNET_SCHEDULER_NO_TASK; 137 switch_task = NULL;
138 microphone->disable_microphone (microphone->cls); 138 microphone->disable_microphone (microphone->cls);
139 if (GNUNET_OK != 139 if (GNUNET_OK !=
140 speaker->enable_speaker (speaker->cls)) 140 speaker->enable_speaker (speaker->cls))
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c
index 4b4c5f5da..7d5cb990a 100644
--- a/src/conversation/gnunet-conversation.c
+++ b/src/conversation/gnunet-conversation.c
@@ -173,7 +173,7 @@ static unsigned int line;
173/** 173/**
174 * Task which handles the commands 174 * Task which handles the commands
175 */ 175 */
176static GNUNET_SCHEDULER_TaskIdentifier handle_cmd_task; 176static struct GNUNET_SCHEDULER_Task * handle_cmd_task;
177 177
178/** 178/**
179 * Our speaker. 179 * Our speaker.
@@ -1036,10 +1036,10 @@ do_stop_task (void *cls,
1036 GNUNET_CONVERSATION_phone_destroy (phone); 1036 GNUNET_CONVERSATION_phone_destroy (phone);
1037 phone = NULL; 1037 phone = NULL;
1038 } 1038 }
1039 if (GNUNET_SCHEDULER_NO_TASK != handle_cmd_task) 1039 if (NULL != handle_cmd_task)
1040 { 1040 {
1041 GNUNET_SCHEDULER_cancel (handle_cmd_task); 1041 GNUNET_SCHEDULER_cancel (handle_cmd_task);
1042 handle_cmd_task = GNUNET_SCHEDULER_NO_TASK; 1042 handle_cmd_task = NULL;
1043 } 1043 }
1044 if (NULL != id) 1044 if (NULL != id)
1045 { 1045 {
diff --git a/src/conversation/test_conversation_api.c b/src/conversation/test_conversation_api.c
index 7a5537144..91ece5c11 100644
--- a/src/conversation/test_conversation_api.c
+++ b/src/conversation/test_conversation_api.c
@@ -67,9 +67,9 @@ static GNUNET_MICROPHONE_RecordedDataCallback call_rdc;
67 67
68static void *call_rdc_cls; 68static void *call_rdc_cls;
69 69
70static GNUNET_SCHEDULER_TaskIdentifier phone_task; 70static struct GNUNET_SCHEDULER_Task * phone_task;
71 71
72static GNUNET_SCHEDULER_TaskIdentifier call_task; 72static struct GNUNET_SCHEDULER_Task * call_task;
73 73
74 74
75static void 75static void
@@ -229,14 +229,14 @@ disable_mic (void *cls)
229 phone_rdc = NULL; 229 phone_rdc = NULL;
230 phone_rdc_cls = NULL; 230 phone_rdc_cls = NULL;
231 GNUNET_SCHEDULER_cancel (phone_task); 231 GNUNET_SCHEDULER_cancel (phone_task);
232 phone_task = GNUNET_SCHEDULER_NO_TASK; 232 phone_task = NULL;
233 } 233 }
234 else 234 else
235 { 235 {
236 call_rdc = NULL; 236 call_rdc = NULL;
237 call_rdc_cls = NULL; 237 call_rdc_cls = NULL;
238 GNUNET_SCHEDULER_cancel (call_task); 238 GNUNET_SCHEDULER_cancel (call_task);
239 call_task = GNUNET_SCHEDULER_NO_TASK; 239 call_task = NULL;
240 } 240 }
241} 241}
242 242
diff --git a/src/conversation/test_conversation_api_twocalls.c b/src/conversation/test_conversation_api_twocalls.c
index 500f0858c..7226ffba1 100644
--- a/src/conversation/test_conversation_api_twocalls.c
+++ b/src/conversation/test_conversation_api_twocalls.c
@@ -73,7 +73,7 @@ static GNUNET_MICROPHONE_RecordedDataCallback phone_rdc;
73 73
74static void *phone_rdc_cls; 74static void *phone_rdc_cls;
75 75
76static GNUNET_SCHEDULER_TaskIdentifier phone_task; 76static struct GNUNET_SCHEDULER_Task * phone_task;
77 77
78/** 78/**
79 * Variable for recognizing caller1 79 * Variable for recognizing caller1
@@ -114,7 +114,7 @@ struct MicContext
114 114
115 void *rdc_cls; 115 void *rdc_cls;
116 116
117 GNUNET_SCHEDULER_TaskIdentifier call_task; 117 struct GNUNET_SCHEDULER_Task * call_task;
118 118
119}; 119};
120 120
@@ -268,14 +268,14 @@ enable_mic (void *cls,
268 { 268 {
269 phone_rdc = rdc; 269 phone_rdc = rdc;
270 phone_rdc_cls = rdc_cls; 270 phone_rdc_cls = rdc_cls;
271 GNUNET_break (GNUNET_SCHEDULER_NO_TASK == phone_task); 271 GNUNET_break (NULL == phone_task);
272 phone_task = GNUNET_SCHEDULER_add_now (&phone_send, NULL); 272 phone_task = GNUNET_SCHEDULER_add_now (&phone_send, NULL);
273 return GNUNET_OK; 273 return GNUNET_OK;
274 } 274 }
275 mc = (CALLER1 == cls) ? &call1_mic_ctx : &call2_mic_ctx; 275 mc = (CALLER1 == cls) ? &call1_mic_ctx : &call2_mic_ctx;
276 mc->rdc = rdc; 276 mc->rdc = rdc;
277 mc->rdc_cls = rdc_cls; 277 mc->rdc_cls = rdc_cls;
278 GNUNET_break (GNUNET_SCHEDULER_NO_TASK == mc->call_task); 278 GNUNET_break (NULL == mc->call_task);
279 mc->call_task = GNUNET_SCHEDULER_add_now (&call_send, mc); 279 mc->call_task = GNUNET_SCHEDULER_add_now (&call_send, mc);
280 return GNUNET_OK; 280 return GNUNET_OK;
281} 281}
@@ -294,14 +294,14 @@ disable_mic (void *cls)
294 phone_rdc = NULL; 294 phone_rdc = NULL;
295 phone_rdc_cls = NULL; 295 phone_rdc_cls = NULL;
296 GNUNET_SCHEDULER_cancel (phone_task); 296 GNUNET_SCHEDULER_cancel (phone_task);
297 phone_task = GNUNET_SCHEDULER_NO_TASK; 297 phone_task = NULL;
298 return; 298 return;
299 } 299 }
300 mc = (CALLER1 == cls) ? &call1_mic_ctx : &call2_mic_ctx; 300 mc = (CALLER1 == cls) ? &call1_mic_ctx : &call2_mic_ctx;
301 mc->rdc = NULL; 301 mc->rdc = NULL;
302 mc->rdc_cls = NULL; 302 mc->rdc_cls = NULL;
303 GNUNET_SCHEDULER_cancel (mc->call_task); 303 GNUNET_SCHEDULER_cancel (mc->call_task);
304 mc->call_task = GNUNET_SCHEDULER_NO_TASK; 304 mc->call_task = NULL;
305} 305}
306 306
307 307
diff --git a/src/core/core_api.c b/src/core/core_api.c
index d2a8b5651..1d287bbc6 100644
--- a/src/core/core_api.c
+++ b/src/core/core_api.c
@@ -130,12 +130,12 @@ struct PeerRecord
130 * ID of timeout task for the 'pending_head' handle 130 * ID of timeout task for the 'pending_head' handle
131 * which is the one with the smallest timeout. 131 * which is the one with the smallest timeout.
132 */ 132 */
133 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 133 struct GNUNET_SCHEDULER_Task * timeout_task;
134 134
135 /** 135 /**
136 * ID of task to run 'next_request_transmission'. 136 * ID of task to run 'next_request_transmission'.
137 */ 137 */
138 GNUNET_SCHEDULER_TaskIdentifier ntr_task; 138 struct GNUNET_SCHEDULER_Task * ntr_task;
139 139
140 /** 140 /**
141 * SendMessageRequest ID generator for this peer. 141 * SendMessageRequest ID generator for this peer.
@@ -289,7 +289,7 @@ struct GNUNET_CORE_Handle
289 /** 289 /**
290 * ID of reconnect task (if any). 290 * ID of reconnect task (if any).
291 */ 291 */
292 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 292 struct GNUNET_SCHEDULER_Task * reconnect_task;
293 293
294 /** 294 /**
295 * Current delay we use for re-trying to connect to core. 295 * Current delay we use for re-trying to connect to core.
@@ -344,7 +344,7 @@ reconnect_task (void *cls,
344{ 344{
345 struct GNUNET_CORE_Handle *h = cls; 345 struct GNUNET_CORE_Handle *h = cls;
346 346
347 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 347 h->reconnect_task = NULL;
348 LOG (GNUNET_ERROR_TYPE_DEBUG, 348 LOG (GNUNET_ERROR_TYPE_DEBUG,
349 "Connecting to CORE service after delay\n"); 349 "Connecting to CORE service after delay\n");
350 reconnect (h); 350 reconnect (h);
@@ -369,15 +369,15 @@ disconnect_and_free_peer_entry (void *cls,
369 struct GNUNET_CORE_TransmitHandle *th; 369 struct GNUNET_CORE_TransmitHandle *th;
370 struct PeerRecord *pr = value; 370 struct PeerRecord *pr = value;
371 371
372 if (GNUNET_SCHEDULER_NO_TASK != pr->timeout_task) 372 if (NULL != pr->timeout_task)
373 { 373 {
374 GNUNET_SCHEDULER_cancel (pr->timeout_task); 374 GNUNET_SCHEDULER_cancel (pr->timeout_task);
375 pr->timeout_task = GNUNET_SCHEDULER_NO_TASK; 375 pr->timeout_task = NULL;
376 } 376 }
377 if (GNUNET_SCHEDULER_NO_TASK != pr->ntr_task) 377 if (NULL != pr->ntr_task)
378 { 378 {
379 GNUNET_SCHEDULER_cancel (pr->ntr_task); 379 GNUNET_SCHEDULER_cancel (pr->ntr_task);
380 pr->ntr_task = GNUNET_SCHEDULER_NO_TASK; 380 pr->ntr_task = NULL;
381 } 381 }
382 if ( (NULL != pr->prev) || 382 if ( (NULL != pr->prev) ||
383 (NULL != pr->next) || 383 (NULL != pr->next) ||
@@ -401,8 +401,8 @@ disconnect_and_free_peer_entry (void *cls,
401 GNUNET_assert (GNUNET_YES == 401 GNUNET_assert (GNUNET_YES ==
402 GNUNET_CONTAINER_multipeermap_remove (h->peers, key, pr)); 402 GNUNET_CONTAINER_multipeermap_remove (h->peers, key, pr));
403 GNUNET_assert (pr->ch == h); 403 GNUNET_assert (pr->ch == h);
404 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pr->timeout_task); 404 GNUNET_assert (NULL == pr->timeout_task);
405 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pr->ntr_task); 405 GNUNET_assert (NULL == pr->ntr_task);
406 GNUNET_free (pr); 406 GNUNET_free (pr);
407 return GNUNET_YES; 407 return GNUNET_YES;
408} 408}
@@ -420,7 +420,7 @@ reconnect_later (struct GNUNET_CORE_Handle *h)
420 struct ControlMessage *cm; 420 struct ControlMessage *cm;
421 struct PeerRecord *pr; 421 struct PeerRecord *pr;
422 422
423 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); 423 GNUNET_assert (NULL == h->reconnect_task);
424 if (NULL != h->cth) 424 if (NULL != h->cth)
425 { 425 {
426 GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth); 426 GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth);
@@ -432,7 +432,7 @@ reconnect_later (struct GNUNET_CORE_Handle *h)
432 h->client = NULL; 432 h->client = NULL;
433 } 433 }
434 h->currently_down = GNUNET_YES; 434 h->currently_down = GNUNET_YES;
435 GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); 435 GNUNET_assert (h->reconnect_task == NULL);
436 h->reconnect_task = 436 h->reconnect_task =
437 GNUNET_SCHEDULER_add_delayed (h->retry_backoff, 437 GNUNET_SCHEDULER_add_delayed (h->retry_backoff,
438 &reconnect_task, h); 438 &reconnect_task, h);
@@ -496,10 +496,10 @@ request_next_transmission (struct PeerRecord *pr)
496 struct SendMessageRequest *smr; 496 struct SendMessageRequest *smr;
497 struct GNUNET_CORE_TransmitHandle *th; 497 struct GNUNET_CORE_TransmitHandle *th;
498 498
499 if (pr->timeout_task != GNUNET_SCHEDULER_NO_TASK) 499 if (pr->timeout_task != NULL)
500 { 500 {
501 GNUNET_SCHEDULER_cancel (pr->timeout_task); 501 GNUNET_SCHEDULER_cancel (pr->timeout_task);
502 pr->timeout_task = GNUNET_SCHEDULER_NO_TASK; 502 pr->timeout_task = NULL;
503 } 503 }
504 th = &pr->th; 504 th = &pr->th;
505 if (NULL == th->peer) 505 if (NULL == th->peer)
@@ -552,11 +552,11 @@ transmission_timeout (void *cls,
552 struct GNUNET_CORE_Handle *h = pr->ch; 552 struct GNUNET_CORE_Handle *h = pr->ch;
553 struct GNUNET_CORE_TransmitHandle *th; 553 struct GNUNET_CORE_TransmitHandle *th;
554 554
555 pr->timeout_task = GNUNET_SCHEDULER_NO_TASK; 555 pr->timeout_task = NULL;
556 if (GNUNET_SCHEDULER_NO_TASK != pr->ntr_task) 556 if (NULL != pr->ntr_task)
557 { 557 {
558 GNUNET_SCHEDULER_cancel (pr->ntr_task); 558 GNUNET_SCHEDULER_cancel (pr->ntr_task);
559 pr->ntr_task = GNUNET_SCHEDULER_NO_TASK; 559 pr->ntr_task = NULL;
560 } 560 }
561 th = &pr->th; 561 th = &pr->th;
562 th->peer = NULL; 562 th->peer = NULL;
@@ -609,7 +609,7 @@ transmit_message (void *cls,
609 uint16_t msize; 609 uint16_t msize;
610 size_t ret; 610 size_t ret;
611 611
612 GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); 612 GNUNET_assert (h->reconnect_task == NULL);
613 h->cth = NULL; 613 h->cth = NULL;
614 if (NULL == buf) 614 if (NULL == buf)
615 { 615 {
@@ -657,10 +657,10 @@ transmit_message (void *cls,
657 h->ready_peer_tail, 657 h->ready_peer_tail,
658 pr); 658 pr);
659 th->peer = NULL; 659 th->peer = NULL;
660 if (GNUNET_SCHEDULER_NO_TASK != pr->timeout_task) 660 if (NULL != pr->timeout_task)
661 { 661 {
662 GNUNET_SCHEDULER_cancel (pr->timeout_task); 662 GNUNET_SCHEDULER_cancel (pr->timeout_task);
663 pr->timeout_task = GNUNET_SCHEDULER_NO_TASK; 663 pr->timeout_task = NULL;
664 } 664 }
665 LOG (GNUNET_ERROR_TYPE_DEBUG, 665 LOG (GNUNET_ERROR_TYPE_DEBUG,
666 "Transmitting SEND request to `%s' with %u bytes.\n", 666 "Transmitting SEND request to `%s' with %u bytes.\n",
@@ -1083,7 +1083,7 @@ init_done_task (void *cls, int success)
1083 { 1083 {
1084 LOG (GNUNET_ERROR_TYPE_DEBUG, 1084 LOG (GNUNET_ERROR_TYPE_DEBUG,
1085 "Failed to exchange INIT with core, retrying\n"); 1085 "Failed to exchange INIT with core, retrying\n");
1086 if (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK) 1086 if (h->reconnect_task == NULL)
1087 reconnect_later (h); 1087 reconnect_later (h);
1088 return; 1088 return;
1089 } 1089 }
@@ -1259,10 +1259,10 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle)
1259 GNUNET_CONTAINER_multipeermap_iterate (handle->peers, 1259 GNUNET_CONTAINER_multipeermap_iterate (handle->peers,
1260 &disconnect_and_free_peer_entry, 1260 &disconnect_and_free_peer_entry,
1261 handle); 1261 handle);
1262 if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK) 1262 if (handle->reconnect_task != NULL)
1263 { 1263 {
1264 GNUNET_SCHEDULER_cancel (handle->reconnect_task); 1264 GNUNET_SCHEDULER_cancel (handle->reconnect_task);
1265 handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1265 handle->reconnect_task = NULL;
1266 } 1266 }
1267 GNUNET_CONTAINER_multipeermap_destroy (handle->peers); 1267 GNUNET_CONTAINER_multipeermap_destroy (handle->peers);
1268 handle->peers = NULL; 1268 handle->peers = NULL;
@@ -1283,7 +1283,7 @@ run_request_next_transmission (void *cls,
1283{ 1283{
1284 struct PeerRecord *pr = cls; 1284 struct PeerRecord *pr = cls;
1285 1285
1286 pr->ntr_task = GNUNET_SCHEDULER_NO_TASK; 1286 pr->ntr_task = NULL;
1287 request_next_transmission (pr); 1287 request_next_transmission (pr);
1288} 1288}
1289 1289
@@ -1361,7 +1361,7 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle,
1361 th->priority = priority; 1361 th->priority = priority;
1362 th->msize = notify_size; 1362 th->msize = notify_size;
1363 th->cork = cork; 1363 th->cork = cork;
1364 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pr->ntr_task); 1364 GNUNET_assert (NULL == pr->ntr_task);
1365 pr->ntr_task = 1365 pr->ntr_task =
1366 GNUNET_SCHEDULER_add_now (&run_request_next_transmission, pr); 1366 GNUNET_SCHEDULER_add_now (&run_request_next_transmission, pr);
1367 LOG (GNUNET_ERROR_TYPE_DEBUG, 1367 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1409,10 +1409,10 @@ GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle *th)
1409 h->ready_peer_tail, 1409 h->ready_peer_tail,
1410 pr); 1410 pr);
1411 } 1411 }
1412 if (GNUNET_SCHEDULER_NO_TASK != pr->ntr_task) 1412 if (NULL != pr->ntr_task)
1413 { 1413 {
1414 GNUNET_SCHEDULER_cancel (pr->ntr_task); 1414 GNUNET_SCHEDULER_cancel (pr->ntr_task);
1415 pr->ntr_task = GNUNET_SCHEDULER_NO_TASK; 1415 pr->ntr_task = NULL;
1416 } 1416 }
1417} 1417}
1418 1418
diff --git a/src/core/gnunet-service-core_kx.c b/src/core/gnunet-service-core_kx.c
index a4e964312..94f3f5c87 100644
--- a/src/core/gnunet-service-core_kx.c
+++ b/src/core/gnunet-service-core_kx.c
@@ -302,12 +302,12 @@ struct GSC_KeyExchangeInfo
302 /** 302 /**
303 * ID of task used for re-trying SET_KEY and PING message. 303 * ID of task used for re-trying SET_KEY and PING message.
304 */ 304 */
305 GNUNET_SCHEDULER_TaskIdentifier retry_set_key_task; 305 struct GNUNET_SCHEDULER_Task * retry_set_key_task;
306 306
307 /** 307 /**
308 * ID of task used for sending keep-alive pings. 308 * ID of task used for sending keep-alive pings.
309 */ 309 */
310 GNUNET_SCHEDULER_TaskIdentifier keep_alive_task; 310 struct GNUNET_SCHEDULER_Task * keep_alive_task;
311 311
312 /** 312 /**
313 * Bit map indicating which of the 32 sequence numbers before the last 313 * Bit map indicating which of the 32 sequence numbers before the last
@@ -373,7 +373,7 @@ static struct GSC_KeyExchangeInfo *kx_tail;
373 * Task scheduled for periodic re-generation (and thus rekeying) of our 373 * Task scheduled for periodic re-generation (and thus rekeying) of our
374 * ephemeral key. 374 * ephemeral key.
375 */ 375 */
376static GNUNET_SCHEDULER_TaskIdentifier rekey_task; 376static struct GNUNET_SCHEDULER_Task * rekey_task;
377 377
378/** 378/**
379 * Notification context for all monitors. 379 * Notification context for all monitors.
@@ -651,7 +651,7 @@ set_key_retry_task (void *cls,
651{ 651{
652 struct GSC_KeyExchangeInfo *kx = cls; 652 struct GSC_KeyExchangeInfo *kx = cls;
653 653
654 kx->retry_set_key_task = GNUNET_SCHEDULER_NO_TASK; 654 kx->retry_set_key_task = NULL;
655 kx->set_key_retry_frequency = GNUNET_TIME_STD_BACKOFF (kx->set_key_retry_frequency); 655 kx->set_key_retry_frequency = GNUNET_TIME_STD_BACKOFF (kx->set_key_retry_frequency);
656 GNUNET_assert (GNUNET_CORE_KX_STATE_DOWN != kx->status); 656 GNUNET_assert (GNUNET_CORE_KX_STATE_DOWN != kx->status);
657 send_key (kx); 657 send_key (kx);
@@ -746,15 +746,15 @@ GSC_KX_stop (struct GSC_KeyExchangeInfo *kx)
746 GSC_SESSIONS_end (&kx->peer); 746 GSC_SESSIONS_end (&kx->peer);
747 GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# key exchanges stopped"), 747 GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# key exchanges stopped"),
748 1, GNUNET_NO); 748 1, GNUNET_NO);
749 if (kx->retry_set_key_task != GNUNET_SCHEDULER_NO_TASK) 749 if (kx->retry_set_key_task != NULL)
750 { 750 {
751 GNUNET_SCHEDULER_cancel (kx->retry_set_key_task); 751 GNUNET_SCHEDULER_cancel (kx->retry_set_key_task);
752 kx->retry_set_key_task = GNUNET_SCHEDULER_NO_TASK; 752 kx->retry_set_key_task = NULL;
753 } 753 }
754 if (kx->keep_alive_task != GNUNET_SCHEDULER_NO_TASK) 754 if (kx->keep_alive_task != NULL)
755 { 755 {
756 GNUNET_SCHEDULER_cancel (kx->keep_alive_task); 756 GNUNET_SCHEDULER_cancel (kx->keep_alive_task);
757 kx->keep_alive_task = GNUNET_SCHEDULER_NO_TASK; 757 kx->keep_alive_task = NULL;
758 } 758 }
759 kx->status = GNUNET_CORE_KX_PEER_DISCONNECT; 759 kx->status = GNUNET_CORE_KX_PEER_DISCONNECT;
760 monitor_notify_all (kx); 760 monitor_notify_all (kx);
@@ -929,7 +929,7 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx,
929 switch (kx->status) 929 switch (kx->status)
930 { 930 {
931 case GNUNET_CORE_KX_STATE_DOWN: 931 case GNUNET_CORE_KX_STATE_DOWN:
932 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == kx->keep_alive_task); 932 GNUNET_assert (NULL == kx->keep_alive_task);
933 kx->status = GNUNET_CORE_KX_STATE_KEY_RECEIVED; 933 kx->status = GNUNET_CORE_KX_STATE_KEY_RECEIVED;
934 monitor_notify_all (kx); 934 monitor_notify_all (kx);
935 if (GNUNET_CORE_KX_STATE_KEY_SENT == sender_status) 935 if (GNUNET_CORE_KX_STATE_KEY_SENT == sender_status)
@@ -937,7 +937,7 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx,
937 send_ping (kx); 937 send_ping (kx);
938 break; 938 break;
939 case GNUNET_CORE_KX_STATE_KEY_SENT: 939 case GNUNET_CORE_KX_STATE_KEY_SENT:
940 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == kx->keep_alive_task); 940 GNUNET_assert (NULL == kx->keep_alive_task);
941 kx->status = GNUNET_CORE_KX_STATE_KEY_RECEIVED; 941 kx->status = GNUNET_CORE_KX_STATE_KEY_RECEIVED;
942 monitor_notify_all (kx); 942 monitor_notify_all (kx);
943 if (GNUNET_CORE_KX_STATE_KEY_SENT == sender_status) 943 if (GNUNET_CORE_KX_STATE_KEY_SENT == sender_status)
@@ -945,7 +945,7 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx,
945 send_ping (kx); 945 send_ping (kx);
946 break; 946 break;
947 case GNUNET_CORE_KX_STATE_KEY_RECEIVED: 947 case GNUNET_CORE_KX_STATE_KEY_RECEIVED:
948 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == kx->keep_alive_task); 948 GNUNET_assert (NULL == kx->keep_alive_task);
949 if (GNUNET_CORE_KX_STATE_KEY_SENT == sender_status) 949 if (GNUNET_CORE_KX_STATE_KEY_SENT == sender_status)
950 send_key (kx); 950 send_key (kx);
951 send_ping (kx); 951 send_ping (kx);
@@ -1069,7 +1069,7 @@ send_keep_alive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1069 struct GNUNET_TIME_Relative retry; 1069 struct GNUNET_TIME_Relative retry;
1070 struct GNUNET_TIME_Relative left; 1070 struct GNUNET_TIME_Relative left;
1071 1071
1072 kx->keep_alive_task = GNUNET_SCHEDULER_NO_TASK; 1072 kx->keep_alive_task = NULL;
1073 left = GNUNET_TIME_absolute_get_remaining (kx->timeout); 1073 left = GNUNET_TIME_absolute_get_remaining (kx->timeout);
1074 if (0 == left.rel_value_us) 1074 if (0 == left.rel_value_us)
1075 { 1075 {
@@ -1122,7 +1122,7 @@ update_timeout (struct GSC_KeyExchangeInfo *kx)
1122 are bigger than the threshold (5s) */ 1122 are bigger than the threshold (5s) */
1123 monitor_notify_all (kx); 1123 monitor_notify_all (kx);
1124 } 1124 }
1125 if (kx->keep_alive_task != GNUNET_SCHEDULER_NO_TASK) 1125 if (kx->keep_alive_task != NULL)
1126 GNUNET_SCHEDULER_cancel (kx->keep_alive_task); 1126 GNUNET_SCHEDULER_cancel (kx->keep_alive_task);
1127 kx->keep_alive_task = 1127 kx->keep_alive_task =
1128 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide 1128 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide
@@ -1213,10 +1213,10 @@ GSC_KX_handle_pong (struct GSC_KeyExchangeInfo *kx,
1213 "Received PONG from `%s'\n", 1213 "Received PONG from `%s'\n",
1214 GNUNET_i2s (&kx->peer)); 1214 GNUNET_i2s (&kx->peer));
1215 /* no need to resend key any longer */ 1215 /* no need to resend key any longer */
1216 if (GNUNET_SCHEDULER_NO_TASK != kx->retry_set_key_task) 1216 if (NULL != kx->retry_set_key_task)
1217 { 1217 {
1218 GNUNET_SCHEDULER_cancel (kx->retry_set_key_task); 1218 GNUNET_SCHEDULER_cancel (kx->retry_set_key_task);
1219 kx->retry_set_key_task = GNUNET_SCHEDULER_NO_TASK; 1219 kx->retry_set_key_task = NULL;
1220 } 1220 }
1221 switch (kx->status) 1221 switch (kx->status)
1222 { 1222 {
@@ -1234,7 +1234,7 @@ GSC_KX_handle_pong (struct GSC_KeyExchangeInfo *kx,
1234 kx->status = GNUNET_CORE_KX_STATE_UP; 1234 kx->status = GNUNET_CORE_KX_STATE_UP;
1235 monitor_notify_all (kx); 1235 monitor_notify_all (kx);
1236 GSC_SESSIONS_create (&kx->peer, kx); 1236 GSC_SESSIONS_create (&kx->peer, kx);
1237 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == kx->keep_alive_task); 1237 GNUNET_assert (NULL == kx->keep_alive_task);
1238 update_timeout (kx); 1238 update_timeout (kx);
1239 break; 1239 break;
1240 case GNUNET_CORE_KX_STATE_UP: 1240 case GNUNET_CORE_KX_STATE_UP:
@@ -1269,10 +1269,10 @@ static void
1269send_key (struct GSC_KeyExchangeInfo *kx) 1269send_key (struct GSC_KeyExchangeInfo *kx)
1270{ 1270{
1271 GNUNET_assert (GNUNET_CORE_KX_STATE_DOWN != kx->status); 1271 GNUNET_assert (GNUNET_CORE_KX_STATE_DOWN != kx->status);
1272 if (GNUNET_SCHEDULER_NO_TASK != kx->retry_set_key_task) 1272 if (NULL != kx->retry_set_key_task)
1273 { 1273 {
1274 GNUNET_SCHEDULER_cancel (kx->retry_set_key_task); 1274 GNUNET_SCHEDULER_cancel (kx->retry_set_key_task);
1275 kx->retry_set_key_task = GNUNET_SCHEDULER_NO_TASK; 1275 kx->retry_set_key_task = NULL;
1276 } 1276 }
1277 /* always update sender status in SET KEY message */ 1277 /* always update sender status in SET KEY message */
1278 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1278 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1402,10 +1402,10 @@ GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx,
1402 gettext_noop ("# sessions terminated by key expiration"), 1402 gettext_noop ("# sessions terminated by key expiration"),
1403 1, GNUNET_NO); 1403 1, GNUNET_NO);
1404 GSC_SESSIONS_end (&kx->peer); 1404 GSC_SESSIONS_end (&kx->peer);
1405 if (GNUNET_SCHEDULER_NO_TASK != kx->keep_alive_task) 1405 if (NULL != kx->keep_alive_task)
1406 { 1406 {
1407 GNUNET_SCHEDULER_cancel (kx->keep_alive_task); 1407 GNUNET_SCHEDULER_cancel (kx->keep_alive_task);
1408 kx->keep_alive_task = GNUNET_SCHEDULER_NO_TASK; 1408 kx->keep_alive_task = NULL;
1409 } 1409 }
1410 kx->status = GNUNET_CORE_KX_STATE_KEY_SENT; 1410 kx->status = GNUNET_CORE_KX_STATE_KEY_SENT;
1411 monitor_notify_all (kx); 1411 monitor_notify_all (kx);
@@ -1684,10 +1684,10 @@ GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk,
1684void 1684void
1685GSC_KX_done () 1685GSC_KX_done ()
1686{ 1686{
1687 if (GNUNET_SCHEDULER_NO_TASK != rekey_task) 1687 if (NULL != rekey_task)
1688 { 1688 {
1689 GNUNET_SCHEDULER_cancel (rekey_task); 1689 GNUNET_SCHEDULER_cancel (rekey_task);
1690 rekey_task = GNUNET_SCHEDULER_NO_TASK; 1690 rekey_task = NULL;
1691 } 1691 }
1692 if (NULL != my_ephemeral_key) 1692 if (NULL != my_ephemeral_key)
1693 { 1693 {
diff --git a/src/core/gnunet-service-core_neighbours.c b/src/core/gnunet-service-core_neighbours.c
index 20055081b..4fbe72074 100644
--- a/src/core/gnunet-service-core_neighbours.c
+++ b/src/core/gnunet-service-core_neighbours.c
@@ -103,7 +103,7 @@ struct Neighbour
103 /** 103 /**
104 * ID of task used for re-trying plaintext scheduling. 104 * ID of task used for re-trying plaintext scheduling.
105 */ 105 */
106 GNUNET_SCHEDULER_TaskIdentifier retry_plaintext_task; 106 struct GNUNET_SCHEDULER_Task * retry_plaintext_task;
107 107
108 /** 108 /**
109 * #GNUNET_YES if this peer currently has excess bandwidth. 109 * #GNUNET_YES if this peer currently has excess bandwidth.
@@ -172,10 +172,10 @@ free_neighbour (struct Neighbour *n)
172 GSC_KX_stop (n->kxinfo); 172 GSC_KX_stop (n->kxinfo);
173 n->kxinfo = NULL; 173 n->kxinfo = NULL;
174 } 174 }
175 if (n->retry_plaintext_task != GNUNET_SCHEDULER_NO_TASK) 175 if (n->retry_plaintext_task != NULL)
176 { 176 {
177 GNUNET_SCHEDULER_cancel (n->retry_plaintext_task); 177 GNUNET_SCHEDULER_cancel (n->retry_plaintext_task);
178 n->retry_plaintext_task = GNUNET_SCHEDULER_NO_TASK; 178 n->retry_plaintext_task = NULL;
179 } 179 }
180 GNUNET_assert (GNUNET_OK == 180 GNUNET_assert (GNUNET_OK ==
181 GNUNET_CONTAINER_multipeermap_remove (neighbours, 181 GNUNET_CONTAINER_multipeermap_remove (neighbours,
diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c
index 83b1147b8..a168eeed3 100644
--- a/src/core/gnunet-service-core_sessions.c
+++ b/src/core/gnunet-service-core_sessions.c
@@ -118,12 +118,12 @@ struct Session
118 /** 118 /**
119 * Task to transmit corked messages with a delay. 119 * Task to transmit corked messages with a delay.
120 */ 120 */
121 GNUNET_SCHEDULER_TaskIdentifier cork_task; 121 struct GNUNET_SCHEDULER_Task * cork_task;
122 122
123 /** 123 /**
124 * Task to transmit our type map. 124 * Task to transmit our type map.
125 */ 125 */
126 GNUNET_SCHEDULER_TaskIdentifier typemap_task; 126 struct GNUNET_SCHEDULER_Task * typemap_task;
127 127
128 /** 128 /**
129 * Retransmission delay we currently use for the typemap 129 * Retransmission delay we currently use for the typemap
@@ -213,10 +213,10 @@ GSC_SESSIONS_end (const struct GNUNET_PeerIdentity *pid)
213 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 213 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
214 "Destroying session for peer `%4s'\n", 214 "Destroying session for peer `%4s'\n",
215 GNUNET_i2s (&session->peer)); 215 GNUNET_i2s (&session->peer));
216 if (GNUNET_SCHEDULER_NO_TASK != session->cork_task) 216 if (NULL != session->cork_task)
217 { 217 {
218 GNUNET_SCHEDULER_cancel (session->cork_task); 218 GNUNET_SCHEDULER_cancel (session->cork_task);
219 session->cork_task = GNUNET_SCHEDULER_NO_TASK; 219 session->cork_task = NULL;
220 } 220 }
221 while (NULL != (car = session->active_client_request_head)) 221 while (NULL != (car = session->active_client_request_head))
222 { 222 {
@@ -231,10 +231,10 @@ GSC_SESSIONS_end (const struct GNUNET_PeerIdentity *pid)
231 sme); 231 sme);
232 GNUNET_free (sme); 232 GNUNET_free (sme);
233 } 233 }
234 if (GNUNET_SCHEDULER_NO_TASK != session->typemap_task) 234 if (NULL != session->typemap_task)
235 { 235 {
236 GNUNET_SCHEDULER_cancel (session->typemap_task); 236 GNUNET_SCHEDULER_cancel (session->typemap_task);
237 session->typemap_task = GNUNET_SCHEDULER_NO_TASK; 237 session->typemap_task = NULL;
238 } 238 }
239 GSC_CLIENTS_notify_clients_about_neighbour (&session->peer, 239 GSC_CLIENTS_notify_clients_about_neighbour (&session->peer,
240 session->tmap, NULL); 240 session->tmap, NULL);
@@ -291,7 +291,7 @@ transmit_typemap_task (void *cls,
291static void 291static void
292start_typemap_task (struct Session *session) 292start_typemap_task (struct Session *session)
293{ 293{
294 if (GNUNET_SCHEDULER_NO_TASK != session->typemap_task) 294 if (NULL != session->typemap_task)
295 GNUNET_SCHEDULER_cancel (session->typemap_task); 295 GNUNET_SCHEDULER_cancel (session->typemap_task);
296 session->typemap_delay = GNUNET_TIME_UNIT_SECONDS; 296 session->typemap_delay = GNUNET_TIME_UNIT_SECONDS;
297 session->typemap_task = 297 session->typemap_task =
@@ -395,10 +395,10 @@ GSC_SESSIONS_confirm_typemap (const struct GNUNET_PeerIdentity *peer,
395 1, GNUNET_NO); 395 1, GNUNET_NO);
396 return; 396 return;
397 } 397 }
398 if (GNUNET_SCHEDULER_NO_TASK != session->typemap_task) 398 if (NULL != session->typemap_task)
399 { 399 {
400 GNUNET_SCHEDULER_cancel (session->typemap_task); 400 GNUNET_SCHEDULER_cancel (session->typemap_task);
401 session->typemap_task = GNUNET_SCHEDULER_NO_TASK; 401 session->typemap_task = NULL;
402 } 402 }
403 GNUNET_STATISTICS_update (GSC_stats, 403 GNUNET_STATISTICS_update (GSC_stats,
404 gettext_noop 404 gettext_noop
@@ -606,7 +606,7 @@ pop_cork_task (void *cls,
606{ 606{
607 struct Session *session = cls; 607 struct Session *session = cls;
608 608
609 session->cork_task = GNUNET_SCHEDULER_NO_TASK; 609 session->cork_task = NULL;
610 try_transmission (session); 610 try_transmission (session);
611} 611}
612 612
@@ -720,7 +720,7 @@ try_transmission (struct Session *session)
720 "Corking until %s\n", 720 "Corking until %s\n",
721 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (min_deadline), 721 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (min_deadline),
722 GNUNET_YES)); 722 GNUNET_YES));
723 if (GNUNET_SCHEDULER_NO_TASK != session->cork_task) 723 if (NULL != session->cork_task)
724 GNUNET_SCHEDULER_cancel (session->cork_task); 724 GNUNET_SCHEDULER_cancel (session->cork_task);
725 session->cork_task = 725 session->cork_task =
726 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining (min_deadline), 726 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining (min_deadline),
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c
index c570def84..cc7c93176 100644
--- a/src/core/test_core_api.c
+++ b/src/core/test_core_api.c
@@ -48,9 +48,9 @@ static struct PeerContext p1;
48 48
49static struct PeerContext p2; 49static struct PeerContext p2;
50 50
51static GNUNET_SCHEDULER_TaskIdentifier err_task; 51static struct GNUNET_SCHEDULER_Task * err_task;
52 52
53static GNUNET_SCHEDULER_TaskIdentifier con_task; 53static struct GNUNET_SCHEDULER_Task * con_task;
54 54
55static int ok; 55static int ok;
56 56
@@ -88,10 +88,10 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
88 p1.th = NULL; 88 p1.th = NULL;
89 GNUNET_TRANSPORT_disconnect (p2.th); 89 GNUNET_TRANSPORT_disconnect (p2.th);
90 p2.th = NULL; 90 p2.th = NULL;
91 if (GNUNET_SCHEDULER_NO_TASK != con_task) 91 if (NULL != con_task)
92 { 92 {
93 GNUNET_SCHEDULER_cancel (con_task); 93 GNUNET_SCHEDULER_cancel (con_task);
94 con_task = GNUNET_SCHEDULER_NO_TASK; 94 con_task = NULL;
95 } 95 }
96 ok = 0; 96 ok = 0;
97} 97}
@@ -125,10 +125,10 @@ terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
125 GNUNET_TRANSPORT_disconnect (p2.th); 125 GNUNET_TRANSPORT_disconnect (p2.th);
126 p2.th = NULL; 126 p2.th = NULL;
127 } 127 }
128 if (GNUNET_SCHEDULER_NO_TASK != con_task) 128 if (NULL != con_task)
129 { 129 {
130 GNUNET_SCHEDULER_cancel (con_task); 130 GNUNET_SCHEDULER_cancel (con_task);
131 con_task = GNUNET_SCHEDULER_NO_TASK; 131 con_task = NULL;
132 } 132 }
133 ok = 42; 133 ok = 42;
134} 134}
@@ -162,10 +162,10 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
162 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 162 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
163 "Encrypted connection established to peer `%4s'\n", 163 "Encrypted connection established to peer `%4s'\n",
164 GNUNET_i2s (peer)); 164 GNUNET_i2s (peer));
165 if (GNUNET_SCHEDULER_NO_TASK != con_task) 165 if (NULL != con_task)
166 { 166 {
167 GNUNET_SCHEDULER_cancel (con_task); 167 GNUNET_SCHEDULER_cancel (con_task);
168 con_task = GNUNET_SCHEDULER_NO_TASK; 168 con_task = NULL;
169 } 169 }
170 pc->connect_status = 1; 170 pc->connect_status = 1;
171 if (pc == &p1) 171 if (pc == &p1)
@@ -250,7 +250,7 @@ connect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
250{ 250{
251 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 251 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
252 { 252 {
253 con_task = GNUNET_SCHEDULER_NO_TASK; 253 con_task = NULL;
254 return; 254 return;
255 } 255 }
256 con_task = 256 con_task =
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c
index fba153ade..55d1978ac 100644
--- a/src/core/test_core_api_reliability.c
+++ b/src/core/test_core_api_reliability.c
@@ -55,9 +55,9 @@ static unsigned long long total_bytes;
55 55
56static struct GNUNET_TIME_Absolute start_time; 56static struct GNUNET_TIME_Absolute start_time;
57 57
58static GNUNET_SCHEDULER_TaskIdentifier err_task; 58static struct GNUNET_SCHEDULER_Task * err_task;
59 59
60static GNUNET_SCHEDULER_TaskIdentifier connect_task; 60static struct GNUNET_SCHEDULER_Task * connect_task;
61 61
62 62
63struct PeerContext 63struct PeerContext
@@ -119,7 +119,7 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
119 GNUNET_CORE_disconnect (p2.ch); 119 GNUNET_CORE_disconnect (p2.ch);
120 p2.ch = NULL; 120 p2.ch = NULL;
121 GNUNET_free_non_null (p2.hello); 121 GNUNET_free_non_null (p2.hello);
122 if (connect_task != GNUNET_SCHEDULER_NO_TASK) 122 if (connect_task != NULL)
123 GNUNET_SCHEDULER_cancel (connect_task); 123 GNUNET_SCHEDULER_cancel (connect_task);
124 GNUNET_TRANSPORT_disconnect (p1.th); 124 GNUNET_TRANSPORT_disconnect (p1.th);
125 p1.th = NULL; 125 p1.th = NULL;
@@ -148,7 +148,7 @@ terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
148 GNUNET_CORE_disconnect (p2.ch); 148 GNUNET_CORE_disconnect (p2.ch);
149 p2.ch = NULL; 149 p2.ch = NULL;
150 } 150 }
151 if (connect_task != GNUNET_SCHEDULER_NO_TASK) 151 if (connect_task != NULL)
152 GNUNET_SCHEDULER_cancel (connect_task); 152 GNUNET_SCHEDULER_cancel (connect_task);
153 if (p1.th != NULL) 153 if (p1.th != NULL)
154 { 154 {
diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c
index 913ae3848..f5ed7453c 100644
--- a/src/core/test_core_api_send_to_self.c
+++ b/src/core/test_core_api_send_to_self.c
@@ -38,7 +38,7 @@ static int ret;
38/** 38/**
39 * Handle to the cleanup task. 39 * Handle to the cleanup task.
40 */ 40 */
41GNUNET_SCHEDULER_TaskIdentifier die_task; 41struct GNUNET_SCHEDULER_Task * die_task;
42 42
43/** 43/**
44 * Identity of this peer. 44 * Identity of this peer.
@@ -57,7 +57,7 @@ struct GNUNET_CORE_Handle *core;
57static void 57static void
58cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tskctx) 58cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tskctx)
59{ 59{
60 die_task = GNUNET_SCHEDULER_NO_TASK; 60 die_task = NULL;
61 61
62 if (core != NULL) 62 if (core != NULL)
63 { 63 {
@@ -73,7 +73,7 @@ static int
73receive (void *cls, const struct GNUNET_PeerIdentity *other, 73receive (void *cls, const struct GNUNET_PeerIdentity *other,
74 const struct GNUNET_MessageHeader *message) 74 const struct GNUNET_MessageHeader *message)
75{ 75{
76 if (die_task != GNUNET_SCHEDULER_NO_TASK) 76 if (die_task != NULL)
77 GNUNET_SCHEDULER_cancel (die_task); 77 GNUNET_SCHEDULER_cancel (die_task);
78 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from peer %s\n", 78 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from peer %s\n",
79 GNUNET_i2s (other)); 79 GNUNET_i2s (other));
diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c
index 3c14b01eb..8d46c176b 100644
--- a/src/core/test_core_api_start_only.c
+++ b/src/core/test_core_api_start_only.c
@@ -46,7 +46,7 @@ static struct PeerContext p1;
46 46
47static struct PeerContext p2; 47static struct PeerContext p2;
48 48
49static GNUNET_SCHEDULER_TaskIdentifier timeout_task_id; 49static struct GNUNET_SCHEDULER_Task * timeout_task_id;
50 50
51static int ok; 51static int ok;
52 52
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c
index bf9197f0c..a20a6c7d0 100644
--- a/src/core/test_core_quota_compliance.c
+++ b/src/core/test_core_quota_compliance.c
@@ -62,11 +62,11 @@ static unsigned long long total_bytes_recv;
62 62
63static struct GNUNET_TIME_Absolute start_time; 63static struct GNUNET_TIME_Absolute start_time;
64 64
65static GNUNET_SCHEDULER_TaskIdentifier err_task; 65static struct GNUNET_SCHEDULER_Task * err_task;
66 66
67static GNUNET_SCHEDULER_TaskIdentifier measure_task; 67static struct GNUNET_SCHEDULER_Task * measure_task;
68 68
69static GNUNET_SCHEDULER_TaskIdentifier connect_task; 69static struct GNUNET_SCHEDULER_Task * connect_task;
70 70
71 71
72struct PeerContext 72struct PeerContext
@@ -118,7 +118,7 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
118{ 118{
119 struct GNUNET_CORE_Handle *ch; 119 struct GNUNET_CORE_Handle *ch;
120 120
121 err_task = GNUNET_SCHEDULER_NO_TASK; 121 err_task = NULL;
122 GNUNET_STATISTICS_destroy (p1.stats, GNUNET_NO); 122 GNUNET_STATISTICS_destroy (p1.stats, GNUNET_NO);
123 GNUNET_STATISTICS_destroy (p2.stats, GNUNET_NO); 123 GNUNET_STATISTICS_destroy (p2.stats, GNUNET_NO);
124 GNUNET_TRANSPORT_get_hello_cancel (p2.ghh); 124 GNUNET_TRANSPORT_get_hello_cancel (p2.ghh);
@@ -128,10 +128,10 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
128 GNUNET_CORE_notify_transmit_ready_cancel (p1.nth); 128 GNUNET_CORE_notify_transmit_ready_cancel (p1.nth);
129 p1.nth = NULL; 129 p1.nth = NULL;
130 } 130 }
131 if (connect_task != GNUNET_SCHEDULER_NO_TASK) 131 if (connect_task != NULL)
132 { 132 {
133 GNUNET_SCHEDULER_cancel (connect_task); 133 GNUNET_SCHEDULER_cancel (connect_task);
134 connect_task = GNUNET_SCHEDULER_NO_TASK; 134 connect_task = NULL;
135 } 135 }
136 ch = p1.ch; 136 ch = p1.ch;
137 p1.ch = NULL; 137 p1.ch = NULL;
@@ -151,7 +151,7 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
151static void 151static void
152terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 152terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
153{ 153{
154 err_task = GNUNET_SCHEDULER_NO_TASK; 154 err_task = NULL;
155 155
156 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 156 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
157 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Testcase failed!\n"); 157 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Testcase failed!\n");
@@ -161,12 +161,12 @@ terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
161 GNUNET_CORE_notify_transmit_ready_cancel (p1.nth); 161 GNUNET_CORE_notify_transmit_ready_cancel (p1.nth);
162 p1.nth = NULL; 162 p1.nth = NULL;
163 } 163 }
164 if (measure_task != GNUNET_SCHEDULER_NO_TASK) 164 if (measure_task != NULL)
165 GNUNET_SCHEDULER_cancel (measure_task); 165 GNUNET_SCHEDULER_cancel (measure_task);
166 if (connect_task != GNUNET_SCHEDULER_NO_TASK) 166 if (connect_task != NULL)
167 { 167 {
168 GNUNET_SCHEDULER_cancel (connect_task); 168 GNUNET_SCHEDULER_cancel (connect_task);
169 connect_task = GNUNET_SCHEDULER_NO_TASK; 169 connect_task = NULL;
170 } 170 }
171 171
172 GNUNET_TRANSPORT_get_hello_cancel (p1.ghh); 172 GNUNET_TRANSPORT_get_hello_cancel (p1.ghh);
@@ -231,7 +231,7 @@ measurement_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
231 unsigned long long quota_delta; 231 unsigned long long quota_delta;
232 enum GNUNET_ErrorType kind = GNUNET_ERROR_TYPE_DEBUG; 232 enum GNUNET_ErrorType kind = GNUNET_ERROR_TYPE_DEBUG;
233 233
234 measure_task = GNUNET_SCHEDULER_NO_TASK; 234 measure_task = NULL;
235 FPRINTF (stdout, "%s", "\n"); 235 FPRINTF (stdout, "%s", "\n");
236 running = GNUNET_NO; 236 running = GNUNET_NO;
237 237
@@ -381,7 +381,7 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
381 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 381 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
382 "Asking core (1) for transmission to peer `%4s'\n", 382 "Asking core (1) for transmission to peer `%4s'\n",
383 GNUNET_i2s (&p2.id)); 383 GNUNET_i2s (&p2.id));
384 if (err_task != GNUNET_SCHEDULER_NO_TASK) 384 if (err_task != NULL)
385 GNUNET_SCHEDULER_cancel (err_task); 385 GNUNET_SCHEDULER_cancel (err_task);
386 err_task = 386 err_task =
387 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &terminate_task_error, NULL); 387 GNUNET_SCHEDULER_add_delayed (TIMEOUT, &terminate_task_error, NULL);
@@ -410,12 +410,12 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
410 if (0 == memcmp (&pc->id, peer, sizeof (struct GNUNET_PeerIdentity))) 410 if (0 == memcmp (&pc->id, peer, sizeof (struct GNUNET_PeerIdentity)))
411 return; /* loopback */ 411 return; /* loopback */
412 pc->connect_status = 0; 412 pc->connect_status = 0;
413 if (GNUNET_SCHEDULER_NO_TASK != measure_task) 413 if (NULL != measure_task)
414 { 414 {
415 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 415 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
416 "Measurement aborted due to disconnect!\n"); 416 "Measurement aborted due to disconnect!\n");
417 GNUNET_SCHEDULER_cancel (measure_task); 417 GNUNET_SCHEDULER_cancel (measure_task);
418 measure_task = GNUNET_SCHEDULER_NO_TASK; 418 measure_task = NULL;
419 } 419 }
420 if (pc->nth != NULL) 420 if (pc->nth != NULL)
421 { 421 {
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c
index 6a994fbb0..497e654b2 100644
--- a/src/datastore/datastore_api.c
+++ b/src/datastore/datastore_api.c
@@ -142,7 +142,7 @@ struct GNUNET_DATASTORE_QueueEntry
142 /** 142 /**
143 * Task for timeout signalling. 143 * Task for timeout signalling.
144 */ 144 */
145 GNUNET_SCHEDULER_TaskIdentifier task; 145 struct GNUNET_SCHEDULER_Task * task;
146 146
147 /** 147 /**
148 * Timeout for the current operation. 148 * Timeout for the current operation.
@@ -216,7 +216,7 @@ struct GNUNET_DATASTORE_Handle
216 /** 216 /**
217 * Task for trying to reconnect. 217 * Task for trying to reconnect.
218 */ 218 */
219 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 219 struct GNUNET_SCHEDULER_Task * reconnect_task;
220 220
221 /** 221 /**
222 * How quickly should we retry? Used for exponential back-off on 222 * How quickly should we retry? Used for exponential back-off on
@@ -345,10 +345,10 @@ GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop)
345 GNUNET_CLIENT_disconnect (h->client); 345 GNUNET_CLIENT_disconnect (h->client);
346 h->client = NULL; 346 h->client = NULL;
347 } 347 }
348 if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK) 348 if (h->reconnect_task != NULL)
349 { 349 {
350 GNUNET_SCHEDULER_cancel (h->reconnect_task); 350 GNUNET_SCHEDULER_cancel (h->reconnect_task);
351 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 351 h->reconnect_task = NULL;
352 } 352 }
353 while (NULL != (qe = h->queue_head)) 353 while (NULL != (qe = h->queue_head))
354 { 354 {
@@ -393,7 +393,7 @@ timeout_queue_entry (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
393 GNUNET_STATISTICS_update (h->stats, 393 GNUNET_STATISTICS_update (h->stats,
394 gettext_noop ("# queue entry timeouts"), 1, 394 gettext_noop ("# queue entry timeouts"), 1,
395 GNUNET_NO); 395 GNUNET_NO);
396 qe->task = GNUNET_SCHEDULER_NO_TASK; 396 qe->task = NULL;
397 GNUNET_assert (GNUNET_NO == qe->was_transmitted); 397 GNUNET_assert (GNUNET_NO == qe->was_transmitted);
398 LOG (GNUNET_ERROR_TYPE_DEBUG, 398 LOG (GNUNET_ERROR_TYPE_DEBUG,
399 "Timeout of request in datastore queue\n"); 399 "Timeout of request in datastore queue\n");
@@ -521,7 +521,7 @@ try_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
521 struct GNUNET_DATASTORE_Handle *h = cls; 521 struct GNUNET_DATASTORE_Handle *h = cls;
522 522
523 h->retry_time = GNUNET_TIME_STD_BACKOFF (h->retry_time); 523 h->retry_time = GNUNET_TIME_STD_BACKOFF (h->retry_time);
524 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 524 h->reconnect_task = NULL;
525 h->client = GNUNET_CLIENT_connect ("datastore", h->cfg); 525 h->client = GNUNET_CLIENT_connect ("datastore", h->cfg);
526 if (h->client == NULL) 526 if (h->client == NULL)
527 { 527 {
@@ -628,7 +628,7 @@ transmit_request (void *cls, size_t size, void *buf)
628 memcpy (buf, &qe[1], msize); 628 memcpy (buf, &qe[1], msize);
629 qe->was_transmitted = GNUNET_YES; 629 qe->was_transmitted = GNUNET_YES;
630 GNUNET_SCHEDULER_cancel (qe->task); 630 GNUNET_SCHEDULER_cancel (qe->task);
631 qe->task = GNUNET_SCHEDULER_NO_TASK; 631 qe->task = NULL;
632 GNUNET_assert (GNUNET_NO == h->in_receive); 632 GNUNET_assert (GNUNET_NO == h->in_receive);
633 h->in_receive = GNUNET_YES; 633 h->in_receive = GNUNET_YES;
634 GNUNET_CLIENT_receive (h->client, &receive_cb, h, 634 GNUNET_CLIENT_receive (h->client, &receive_cb, h,
@@ -720,10 +720,10 @@ free_queue_entry (struct GNUNET_DATASTORE_QueueEntry *qe)
720 struct GNUNET_DATASTORE_Handle *h = qe->h; 720 struct GNUNET_DATASTORE_Handle *h = qe->h;
721 721
722 GNUNET_CONTAINER_DLL_remove (h->queue_head, h->queue_tail, qe); 722 GNUNET_CONTAINER_DLL_remove (h->queue_head, h->queue_tail, qe);
723 if (qe->task != GNUNET_SCHEDULER_NO_TASK) 723 if (qe->task != NULL)
724 { 724 {
725 GNUNET_SCHEDULER_cancel (qe->task); 725 GNUNET_SCHEDULER_cancel (qe->task);
726 qe->task = GNUNET_SCHEDULER_NO_TASK; 726 qe->task = NULL;
727 } 727 }
728 h->queue_size--; 728 h->queue_size--;
729 qe->was_transmitted = GNUNET_SYSERR; /* use-after-free warning */ 729 qe->was_transmitted = GNUNET_SYSERR; /* use-after-free warning */
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index 0aa2273b5..ac0b5c0db 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -179,7 +179,7 @@ static unsigned long long payload;
179 * Identity of the task that is used to delete 179 * Identity of the task that is used to delete
180 * expired content. 180 * expired content.
181 */ 181 */
182static GNUNET_SCHEDULER_TaskIdentifier expired_kill_task; 182static struct GNUNET_SCHEDULER_Task * expired_kill_task;
183 183
184/** 184/**
185 * Minimum time that content should have to not be discarded instantly 185 * Minimum time that content should have to not be discarded instantly
@@ -381,7 +381,7 @@ expired_processor (void *cls,
381static void 381static void
382delete_expired (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 382delete_expired (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
383{ 383{
384 expired_kill_task = GNUNET_SCHEDULER_NO_TASK; 384 expired_kill_task = NULL;
385 plugin->api->get_expiration (plugin->api->cls, &expired_processor, NULL); 385 plugin->api->get_expiration (plugin->api->cls, &expired_processor, NULL);
386} 386}
387 387
@@ -1423,10 +1423,10 @@ cleaning_task (void *cls,
1423 GNUNET_free (tcc->msg); 1423 GNUNET_free (tcc->msg);
1424 GNUNET_free (tcc); 1424 GNUNET_free (tcc);
1425 } 1425 }
1426 if (expired_kill_task != GNUNET_SCHEDULER_NO_TASK) 1426 if (expired_kill_task != NULL)
1427 { 1427 {
1428 GNUNET_SCHEDULER_cancel (expired_kill_task); 1428 GNUNET_SCHEDULER_cancel (expired_kill_task);
1429 expired_kill_task = GNUNET_SCHEDULER_NO_TASK; 1429 expired_kill_task = NULL;
1430 } 1430 }
1431 if (GNUNET_YES == do_drop) 1431 if (GNUNET_YES == do_drop)
1432 plugin->api->drop (plugin->api->cls); 1432 plugin->api->drop (plugin->api->cls);
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c
index be699e65e..5822702e0 100644
--- a/src/dht/dht_api.c
+++ b/src/dht/dht_api.c
@@ -66,7 +66,7 @@ struct PendingMessage
66 * Continuation to call when the request has been 66 * Continuation to call when the request has been
67 * transmitted (for the first time) to the service; can be NULL. 67 * transmitted (for the first time) to the service; can be NULL.
68 */ 68 */
69 GNUNET_SCHEDULER_Task cont; 69 GNUNET_SCHEDULER_TaskCallback cont;
70 70
71 /** 71 /**
72 * Closure for 'cont'. 72 * Closure for 'cont'.
@@ -155,7 +155,7 @@ struct GNUNET_DHT_PutHandle
155 /** 155 /**
156 * Timeout task for this operation. 156 * Timeout task for this operation.
157 */ 157 */
158 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 158 struct GNUNET_SCHEDULER_Task * timeout_task;
159 159
160 /** 160 /**
161 * Unique ID for the PUT operation. 161 * Unique ID for the PUT operation.
@@ -345,7 +345,7 @@ struct GNUNET_DHT_Handle
345 /** 345 /**
346 * Task for trying to reconnect. 346 * Task for trying to reconnect.
347 */ 347 */
348 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 348 struct GNUNET_SCHEDULER_Task * reconnect_task;
349 349
350 /** 350 /**
351 * How quickly should we retry? Used for exponential back-off on 351 * How quickly should we retry? Used for exponential back-off on
@@ -506,7 +506,7 @@ try_reconnect (void *cls,
506 506
507 LOG (GNUNET_ERROR_TYPE_DEBUG, "Reconnecting with DHT %p\n", handle); 507 LOG (GNUNET_ERROR_TYPE_DEBUG, "Reconnecting with DHT %p\n", handle);
508 handle->retry_time = GNUNET_TIME_STD_BACKOFF (handle->retry_time); 508 handle->retry_time = GNUNET_TIME_STD_BACKOFF (handle->retry_time);
509 handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 509 handle->reconnect_task = NULL;
510 if (GNUNET_YES != try_connect (handle)) 510 if (GNUNET_YES != try_connect (handle))
511 { 511 {
512 LOG (GNUNET_ERROR_TYPE_DEBUG, "dht reconnect failed(!)\n"); 512 LOG (GNUNET_ERROR_TYPE_DEBUG, "dht reconnect failed(!)\n");
@@ -531,7 +531,7 @@ do_disconnect (struct GNUNET_DHT_Handle *handle)
531 531
532 if (NULL == handle->client) 532 if (NULL == handle->client)
533 return; 533 return;
534 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == handle->reconnect_task); 534 GNUNET_assert (NULL == handle->reconnect_task);
535 if (NULL != handle->th) 535 if (NULL != handle->th)
536 GNUNET_CLIENT_notify_transmit_ready_cancel (handle->th); 536 GNUNET_CLIENT_notify_transmit_ready_cancel (handle->th);
537 handle->th = NULL; 537 handle->th = NULL;
@@ -1126,7 +1126,7 @@ GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle)
1126 GNUNET_CLIENT_disconnect (handle->client); 1126 GNUNET_CLIENT_disconnect (handle->client);
1127 handle->client = NULL; 1127 handle->client = NULL;
1128 } 1128 }
1129 if (GNUNET_SCHEDULER_NO_TASK != handle->reconnect_task) 1129 if (NULL != handle->reconnect_task)
1130 GNUNET_SCHEDULER_cancel (handle->reconnect_task); 1130 GNUNET_SCHEDULER_cancel (handle->reconnect_task);
1131 GNUNET_CONTAINER_multihashmap_destroy (handle->active_requests); 1131 GNUNET_CONTAINER_multihashmap_destroy (handle->active_requests);
1132 GNUNET_free (handle); 1132 GNUNET_free (handle);
@@ -1146,7 +1146,7 @@ timeout_put_request (void *cls,
1146 struct GNUNET_DHT_PutHandle *ph = cls; 1146 struct GNUNET_DHT_PutHandle *ph = cls;
1147 struct GNUNET_DHT_Handle *handle = ph->dht_handle; 1147 struct GNUNET_DHT_Handle *handle = ph->dht_handle;
1148 1148
1149 ph->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1149 ph->timeout_task = NULL;
1150 if (NULL != ph->pending) 1150 if (NULL != ph->pending)
1151 { 1151 {
1152 GNUNET_CONTAINER_DLL_remove (handle->pending_head, handle->pending_tail, 1152 GNUNET_CONTAINER_DLL_remove (handle->pending_head, handle->pending_tail,
@@ -1283,10 +1283,10 @@ GNUNET_DHT_put_cancel (struct GNUNET_DHT_PutHandle *ph)
1283 GNUNET_free (ph->pending); 1283 GNUNET_free (ph->pending);
1284 ph->pending = NULL; 1284 ph->pending = NULL;
1285 } 1285 }
1286 if (ph->timeout_task != GNUNET_SCHEDULER_NO_TASK) 1286 if (ph->timeout_task != NULL)
1287 { 1287 {
1288 GNUNET_SCHEDULER_cancel (ph->timeout_task); 1288 GNUNET_SCHEDULER_cancel (ph->timeout_task);
1289 ph->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1289 ph->timeout_task = NULL;
1290 } 1290 }
1291 GNUNET_CONTAINER_DLL_remove (handle->put_head, 1291 GNUNET_CONTAINER_DLL_remove (handle->put_head,
1292 handle->put_tail, 1292 handle->put_tail,
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index b9058dc3b..09e563245 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -265,7 +265,7 @@ static struct GNUNET_CONTAINER_Heap *retry_heap;
265/** 265/**
266 * Task that re-transmits requests (using retry_heap). 266 * Task that re-transmits requests (using retry_heap).
267 */ 267 */
268static GNUNET_SCHEDULER_TaskIdentifier retry_task; 268static struct GNUNET_SCHEDULER_Task * retry_task;
269 269
270 270
271/** 271/**
@@ -459,7 +459,7 @@ transmit_next_request_task (void *cls,
459 struct ClientQueryRecord *cqr; 459 struct ClientQueryRecord *cqr;
460 struct GNUNET_TIME_Relative delay; 460 struct GNUNET_TIME_Relative delay;
461 461
462 retry_task = GNUNET_SCHEDULER_NO_TASK; 462 retry_task = NULL;
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)))
@@ -628,7 +628,7 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client,
628 GDS_NEIGHBOURS_get_id(), 628 GDS_NEIGHBOURS_get_id(),
629 &get->key); 629 &get->key);
630 /* start remote requests */ 630 /* start remote requests */
631 if (GNUNET_SCHEDULER_NO_TASK != retry_task) 631 if (NULL != retry_task)
632 GNUNET_SCHEDULER_cancel (retry_task); 632 GNUNET_SCHEDULER_cancel (retry_task);
633 retry_task = GNUNET_SCHEDULER_add_now (&transmit_next_request_task, NULL); 633 retry_task = GNUNET_SCHEDULER_add_now (&transmit_next_request_task, NULL);
634 /* perform local lookup */ 634 /* perform local lookup */
@@ -1496,10 +1496,10 @@ GDS_CLIENTS_done ()
1496{ 1496{
1497 GNUNET_assert (client_head == NULL); 1497 GNUNET_assert (client_head == NULL);
1498 GNUNET_assert (client_tail == NULL); 1498 GNUNET_assert (client_tail == NULL);
1499 if (GNUNET_SCHEDULER_NO_TASK != retry_task) 1499 if (NULL != retry_task)
1500 { 1500 {
1501 GNUNET_SCHEDULER_cancel (retry_task); 1501 GNUNET_SCHEDULER_cancel (retry_task);
1502 retry_task = GNUNET_SCHEDULER_NO_TASK; 1502 retry_task = NULL;
1503 } 1503 }
1504 if (NULL != retry_heap) 1504 if (NULL != retry_heap)
1505 { 1505 {
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 38a9c45ad..9608405ef 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -334,7 +334,7 @@ struct PeerInfo
334 /** 334 /**
335 * Task for scheduling preference updates 335 * Task for scheduling preference updates
336 */ 336 */
337 GNUNET_SCHEDULER_TaskIdentifier preference_task; 337 struct GNUNET_SCHEDULER_Task * preference_task;
338 338
339 /** 339 /**
340 * What is the identity of the peer? 340 * What is the identity of the peer?
@@ -422,7 +422,7 @@ static unsigned int bucket_size = DEFAULT_BUCKET_SIZE;
422/** 422/**
423 * Task that sends FIND PEER requests. 423 * Task that sends FIND PEER requests.
424 */ 424 */
425static GNUNET_SCHEDULER_TaskIdentifier find_peer_task; 425static struct GNUNET_SCHEDULER_Task * find_peer_task;
426 426
427/** 427/**
428 * Identity of this peer. 428 * Identity of this peer.
@@ -485,7 +485,7 @@ update_core_preference (void *cls,
485 int bucket; 485 int bucket;
486 struct GNUNET_HashCode phash; 486 struct GNUNET_HashCode phash;
487 487
488 peer->preference_task = GNUNET_SCHEDULER_NO_TASK; 488 peer->preference_task = NULL;
489 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 489 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
490 return; 490 return;
491 GNUNET_CRYPTO_hash (&peer->id, 491 GNUNET_CRYPTO_hash (&peer->id,
@@ -586,7 +586,7 @@ send_find_peer_message (void *cls,
586 struct BloomConstructorContext bcc; 586 struct BloomConstructorContext bcc;
587 struct GNUNET_CONTAINER_BloomFilter *peer_bf; 587 struct GNUNET_CONTAINER_BloomFilter *peer_bf;
588 588
589 find_peer_task = GNUNET_SCHEDULER_NO_TASK; 589 find_peer_task = NULL;
590 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 590 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
591 return; 591 return;
592 if (newly_found_peers > bucket_size) 592 if (newly_found_peers > bucket_size)
@@ -729,10 +729,10 @@ handle_core_disconnect (void *cls,
729 GNUNET_CONTAINER_multipeermap_remove (all_known_peers, 729 GNUNET_CONTAINER_multipeermap_remove (all_known_peers,
730 peer, 730 peer,
731 to_remove)); 731 to_remove));
732 if (GNUNET_SCHEDULER_NO_TASK != to_remove->preference_task) 732 if (NULL != to_remove->preference_task)
733 { 733 {
734 GNUNET_SCHEDULER_cancel (to_remove->preference_task); 734 GNUNET_SCHEDULER_cancel (to_remove->preference_task);
735 to_remove->preference_task = GNUNET_SCHEDULER_NO_TASK; 735 to_remove->preference_task = NULL;
736 } 736 }
737 GNUNET_CRYPTO_hash (peer, 737 GNUNET_CRYPTO_hash (peer,
738 sizeof (struct GNUNET_PeerIdentity), 738 sizeof (struct GNUNET_PeerIdentity),
@@ -2240,10 +2240,10 @@ GDS_NEIGHBOURS_done ()
2240 GNUNET_assert (0 == GNUNET_CONTAINER_multipeermap_size (all_known_peers)); 2240 GNUNET_assert (0 == GNUNET_CONTAINER_multipeermap_size (all_known_peers));
2241 GNUNET_CONTAINER_multipeermap_destroy (all_known_peers); 2241 GNUNET_CONTAINER_multipeermap_destroy (all_known_peers);
2242 all_known_peers = NULL; 2242 all_known_peers = NULL;
2243 if (GNUNET_SCHEDULER_NO_TASK != find_peer_task) 2243 if (NULL != find_peer_task)
2244 { 2244 {
2245 GNUNET_SCHEDULER_cancel (find_peer_task); 2245 GNUNET_SCHEDULER_cancel (find_peer_task);
2246 find_peer_task = GNUNET_SCHEDULER_NO_TASK; 2246 find_peer_task = NULL;
2247 } 2247 }
2248} 2248}
2249 2249
diff --git a/src/dht/gnunet-service-xdht_clients.c b/src/dht/gnunet-service-xdht_clients.c
index 3ddb62be1..1c6b5d1bd 100644
--- a/src/dht/gnunet-service-xdht_clients.c
+++ b/src/dht/gnunet-service-xdht_clients.c
@@ -268,7 +268,7 @@ static struct GNUNET_CONTAINER_Heap *retry_heap;
268/** 268/**
269 * Task that re-transmits requests (using retry_heap). 269 * Task that re-transmits requests (using retry_heap).
270 */ 270 */
271static GNUNET_SCHEDULER_TaskIdentifier retry_task; 271static struct GNUNET_SCHEDULER_Task * retry_task;
272 272
273 273
274/** 274/**
@@ -875,7 +875,7 @@ transmit_next_request_task (void *cls,
875 struct ClientQueryRecord *cqr; 875 struct ClientQueryRecord *cqr;
876 struct GNUNET_TIME_Relative delay; 876 struct GNUNET_TIME_Relative delay;
877 877
878 retry_task = GNUNET_SCHEDULER_NO_TASK; 878 retry_task = NULL;
879 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 879 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
880 return; 880 return;
881 while (NULL != (cqr = GNUNET_CONTAINER_heap_remove_root (retry_heap))) 881 while (NULL != (cqr = GNUNET_CONTAINER_heap_remove_root (retry_heap)))
@@ -1028,7 +1028,7 @@ handle_dht_local_get (void *cls, struct GNUNET_SERVER_Client *client,
1028 &my_identity, 1028 &my_identity,
1029 &get->key); 1029 &get->key);
1030 /* start remote requests */ 1030 /* start remote requests */
1031 if (GNUNET_SCHEDULER_NO_TASK != retry_task) 1031 if (NULL != retry_task)
1032 GNUNET_SCHEDULER_cancel (retry_task); 1032 GNUNET_SCHEDULER_cancel (retry_task);
1033 retry_task = GNUNET_SCHEDULER_add_now (&transmit_next_request_task, NULL); 1033 retry_task = GNUNET_SCHEDULER_add_now (&transmit_next_request_task, NULL);
1034 GNUNET_SERVER_receive_done (client, GNUNET_OK); 1034 GNUNET_SERVER_receive_done (client, GNUNET_OK);
@@ -1422,10 +1422,10 @@ GDS_CLIENTS_done ()
1422{ 1422{
1423 GNUNET_assert (client_head == NULL); 1423 GNUNET_assert (client_head == NULL);
1424 GNUNET_assert (client_tail == NULL); 1424 GNUNET_assert (client_tail == NULL);
1425 if (GNUNET_SCHEDULER_NO_TASK != retry_task) 1425 if (NULL != retry_task)
1426 { 1426 {
1427 GNUNET_SCHEDULER_cancel (retry_task); 1427 GNUNET_SCHEDULER_cancel (retry_task);
1428 retry_task = GNUNET_SCHEDULER_NO_TASK; 1428 retry_task = NULL;
1429 } 1429 }
1430 if (NULL != retry_heap) 1430 if (NULL != retry_heap)
1431 { 1431 {
diff --git a/src/dht/gnunet-service-xdht_neighbours.c b/src/dht/gnunet-service-xdht_neighbours.c
index 8684ada0e..00bc69424 100644
--- a/src/dht/gnunet-service-xdht_neighbours.c
+++ b/src/dht/gnunet-service-xdht_neighbours.c
@@ -854,25 +854,25 @@ struct VerifySuccessorContext
854 * Task that sends FIND FINGER TRAIL requests. This task is started when we have 854 * Task that sends FIND FINGER TRAIL requests. This task is started when we have
855 * get our first friend. 855 * get our first friend.
856 */ 856 */
857static GNUNET_SCHEDULER_TaskIdentifier find_finger_trail_task; 857static struct GNUNET_SCHEDULER_Task * find_finger_trail_task;
858 858
859/** 859/**
860 * Task that sends verify successor message. This task is started when we get 860 * Task that sends verify successor message. This task is started when we get
861 * our successor for the first time. 861 * our successor for the first time.
862 */ 862 */
863static GNUNET_SCHEDULER_TaskIdentifier send_verify_successor_task; 863static struct GNUNET_SCHEDULER_Task * send_verify_successor_task;
864 864
865/** 865/**
866 * Task that sends verify successor message. This task is started when we get 866 * Task that sends verify successor message. This task is started when we get
867 * our successor for the first time. 867 * our successor for the first time.
868 */ 868 */
869static GNUNET_SCHEDULER_TaskIdentifier send_verify_successor_retry_task; 869static struct GNUNET_SCHEDULER_Task * send_verify_successor_retry_task;
870 870
871/** 871/**
872 * Task that sends verify successor message. This task is started when we get 872 * Task that sends verify successor message. This task is started when we get
873 * our successor for the first time. 873 * our successor for the first time.
874 */ 874 */
875static GNUNET_SCHEDULER_TaskIdentifier send_notify_new_successor_retry_task; 875static struct GNUNET_SCHEDULER_Task * send_notify_new_successor_retry_task;
876 876
877/** 877/**
878 * Identity of this peer. 878 * Identity of this peer.
@@ -3238,7 +3238,7 @@ send_verify_successor_message (void *cls,
3238 successor = &finger_table[0]; 3238 successor = &finger_table[0];
3239 3239
3240 /* This task will be scheduled when the result for Verify Successor is received. */ 3240 /* This task will be scheduled when the result for Verify Successor is received. */
3241 send_verify_successor_task = GNUNET_SCHEDULER_NO_TASK; 3241 send_verify_successor_task = NULL;
3242 3242
3243 /* When verify successor is being called for first time *for current context* 3243 /* When verify successor is being called for first time *for current context*
3244 * cls will be NULL. If send_verify_successor_retry_task is not NO_TASK, we 3244 * cls will be NULL. If send_verify_successor_retry_task is not NO_TASK, we
@@ -3259,7 +3259,7 @@ send_verify_successor_message (void *cls,
3259 * --> Waiting for notify confirmation. again don't wait for it. notify 3259 * --> Waiting for notify confirmation. again don't wait for it. notify
3260 * confirmation will not succeded. 3260 * confirmation will not succeded.
3261 */ 3261 */
3262 if (send_verify_successor_retry_task != GNUNET_SCHEDULER_NO_TASK) 3262 if (send_verify_successor_retry_task != NULL)
3263 { 3263 {
3264 /* FIXME: Are we scheduling retry task as soon as we send verify message. 3264 /* FIXME: Are we scheduling retry task as soon as we send verify message.
3265 If yes then here before making this task, first check if the message 3265 If yes then here before making this task, first check if the message
@@ -3374,7 +3374,7 @@ update_current_search_finger_index (unsigned int finger_table_index)
3374 current_search_finger_index = PREDECESSOR_FINGER_ID; 3374 current_search_finger_index = PREDECESSOR_FINGER_ID;
3375 if (0 != GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &successor->finger_identity)) 3375 if (0 != GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &successor->finger_identity))
3376 { 3376 {
3377 if (GNUNET_SCHEDULER_NO_TASK == send_verify_successor_task) 3377 if (NULL == send_verify_successor_task)
3378 { 3378 {
3379 send_verify_successor_task = 3379 send_verify_successor_task =
3380 GNUNET_SCHEDULER_add_now (&send_verify_successor_message, NULL); 3380 GNUNET_SCHEDULER_add_now (&send_verify_successor_message, NULL);
@@ -5133,7 +5133,7 @@ compare_and_update_successor (struct GNUNET_PeerIdentity curr_succ,
5133 GNUNET_STATISTICS_set (GDS_stats, key, succ, 0); 5133 GNUNET_STATISTICS_set (GDS_stats, key, succ, 0);
5134 GNUNET_free (key); 5134 GNUNET_free (key);
5135 } 5135 }
5136 if (send_verify_successor_task == GNUNET_SCHEDULER_NO_TASK) 5136 if (send_verify_successor_task == NULL)
5137 send_verify_successor_task = 5137 send_verify_successor_task =
5138 GNUNET_SCHEDULER_add_delayed(verify_successor_next_send_time, 5138 GNUNET_SCHEDULER_add_delayed(verify_successor_next_send_time,
5139 &send_verify_successor_message, 5139 &send_verify_successor_message,
@@ -5173,7 +5173,7 @@ compare_and_update_successor (struct GNUNET_PeerIdentity curr_succ,
5173 successor_times--; 5173 successor_times--;
5174 5174
5175 5175
5176 if (send_verify_successor_task == GNUNET_SCHEDULER_NO_TASK) 5176 if (send_verify_successor_task == NULL)
5177 send_verify_successor_task = 5177 send_verify_successor_task =
5178 GNUNET_SCHEDULER_add_delayed(verify_successor_next_send_time, 5178 GNUNET_SCHEDULER_add_delayed(verify_successor_next_send_time,
5179 &send_verify_successor_message, 5179 &send_verify_successor_message,
@@ -5262,7 +5262,7 @@ send_notify_new_successor (void *cls,
5262 ctx->target_friend); 5262 ctx->target_friend);
5263 5263
5264 if (0 == ctx->num_retries_scheduled && 5264 if (0 == ctx->num_retries_scheduled &&
5265 send_notify_new_successor_retry_task != GNUNET_SCHEDULER_NO_TASK) 5265 send_notify_new_successor_retry_task != NULL)
5266 { 5266 {
5267 // Result from previous notify successos hasn't arrived, so the retry task 5267 // Result from previous notify successos hasn't arrived, so the retry task
5268 // hasn't been cancelled! Already a new notify successor must be called. 5268 // hasn't been cancelled! Already a new notify successor must be called.
@@ -5271,7 +5271,7 @@ send_notify_new_successor (void *cls,
5271 old_notify_ctx = GNUNET_SCHEDULER_cancel(send_notify_new_successor_retry_task); 5271 old_notify_ctx = GNUNET_SCHEDULER_cancel(send_notify_new_successor_retry_task);
5272 GNUNET_free (old_notify_ctx->successor_trail); 5272 GNUNET_free (old_notify_ctx->successor_trail);
5273 GNUNET_free (old_notify_ctx); 5273 GNUNET_free (old_notify_ctx);
5274 send_notify_new_successor_retry_task = GNUNET_SCHEDULER_NO_TASK; 5274 send_notify_new_successor_retry_task = NULL;
5275 } 5275 }
5276 5276
5277 ctx->num_retries_scheduled++; 5277 ctx->num_retries_scheduled++;
@@ -5337,12 +5337,12 @@ handle_dht_p2p_verify_successor_result(void *cls,
5337 if(0 == (GNUNET_CRYPTO_cmp_peer_identity (&querying_peer, &my_identity))) 5337 if(0 == (GNUNET_CRYPTO_cmp_peer_identity (&querying_peer, &my_identity)))
5338 { 5338 {
5339 /* Cancel Retry Task */ 5339 /* Cancel Retry Task */
5340 if (GNUNET_SCHEDULER_NO_TASK != send_verify_successor_retry_task) 5340 if (NULL != send_verify_successor_retry_task)
5341 { 5341 {
5342 struct VerifySuccessorContext *ctx; 5342 struct VerifySuccessorContext *ctx;
5343 ctx = GNUNET_SCHEDULER_cancel(send_verify_successor_retry_task); 5343 ctx = GNUNET_SCHEDULER_cancel(send_verify_successor_retry_task);
5344 GNUNET_free(ctx); 5344 GNUNET_free(ctx);
5345 send_verify_successor_retry_task = GNUNET_SCHEDULER_NO_TASK; 5345 send_verify_successor_retry_task = NULL;
5346 } 5346 }
5347 compare_and_update_successor (current_successor, 5347 compare_and_update_successor (current_successor,
5348 probable_successor, trail, trail_length); 5348 probable_successor, trail, trail_length);
@@ -5533,15 +5533,15 @@ handle_dht_p2p_notify_succ_confirmation (void *cls,
5533 */ 5533 */
5534 5534
5535 // TODO: cancel schedule of notify_successor_retry_task 5535 // TODO: cancel schedule of notify_successor_retry_task
5536 if (send_notify_new_successor_retry_task != GNUNET_SCHEDULER_NO_TASK) 5536 if (send_notify_new_successor_retry_task != NULL)
5537 { 5537 {
5538 struct SendNotifyContext *notify_ctx; 5538 struct SendNotifyContext *notify_ctx;
5539 notify_ctx = GNUNET_SCHEDULER_cancel(send_notify_new_successor_retry_task); 5539 notify_ctx = GNUNET_SCHEDULER_cancel(send_notify_new_successor_retry_task);
5540 GNUNET_free (notify_ctx->successor_trail); 5540 GNUNET_free (notify_ctx->successor_trail);
5541 GNUNET_free (notify_ctx); 5541 GNUNET_free (notify_ctx);
5542 send_notify_new_successor_retry_task = GNUNET_SCHEDULER_NO_TASK; 5542 send_notify_new_successor_retry_task = NULL;
5543 } 5543 }
5544 if (send_verify_successor_task == GNUNET_SCHEDULER_NO_TASK) 5544 if (send_verify_successor_task == NULL)
5545 { 5545 {
5546 verify_successor_next_send_time.rel_value_us = 5546 verify_successor_next_send_time.rel_value_us =
5547 DHT_SEND_VERIFY_SUCCESSOR_INTERVAL.rel_value_us + 5547 DHT_SEND_VERIFY_SUCCESSOR_INTERVAL.rel_value_us +
@@ -6063,10 +6063,10 @@ handle_core_disconnect (void *cls,
6063 if (0 != GNUNET_CONTAINER_multipeermap_size (friend_peermap)) 6063 if (0 != GNUNET_CONTAINER_multipeermap_size (friend_peermap))
6064 return; 6064 return;
6065 6065
6066 if (GNUNET_SCHEDULER_NO_TASK != find_finger_trail_task) 6066 if (NULL != find_finger_trail_task)
6067 { 6067 {
6068 GNUNET_SCHEDULER_cancel (find_finger_trail_task); 6068 GNUNET_SCHEDULER_cancel (find_finger_trail_task);
6069 find_finger_trail_task = GNUNET_SCHEDULER_NO_TASK; 6069 find_finger_trail_task = NULL;
6070 } 6070 }
6071 else 6071 else
6072 GNUNET_break (0); 6072 GNUNET_break (0);
@@ -6109,7 +6109,7 @@ handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer_identity)
6109 * selected after some time out. This is to ensure that both peers have added 6109 * selected after some time out. This is to ensure that both peers have added
6110 * each other as their friend. */ 6110 * each other as their friend. */
6111 /* Got a first connection, good time to start with FIND FINGER TRAIL requests...*/ 6111 /* Got a first connection, good time to start with FIND FINGER TRAIL requests...*/
6112 if (GNUNET_SCHEDULER_NO_TASK == find_finger_trail_task) 6112 if (NULL == find_finger_trail_task)
6113 { 6113 {
6114 find_finger_trail_task = GNUNET_SCHEDULER_add_now (&send_find_finger_trail_message, NULL); 6114 find_finger_trail_task = GNUNET_SCHEDULER_add_now (&send_find_finger_trail_message, NULL);
6115 } 6115 }
@@ -6244,33 +6244,33 @@ GDS_NEIGHBOURS_done (void)
6244 GNUNET_CONTAINER_multipeermap_destroy (friend_peermap); 6244 GNUNET_CONTAINER_multipeermap_destroy (friend_peermap);
6245 friend_peermap = NULL; 6245 friend_peermap = NULL;
6246 6246
6247 if (GNUNET_SCHEDULER_NO_TASK != find_finger_trail_task) 6247 if (NULL != find_finger_trail_task)
6248 { 6248 {
6249 GNUNET_SCHEDULER_cancel (find_finger_trail_task); 6249 GNUNET_SCHEDULER_cancel (find_finger_trail_task);
6250 find_finger_trail_task = GNUNET_SCHEDULER_NO_TASK; 6250 find_finger_trail_task = NULL;
6251 } 6251 }
6252 6252
6253 if (GNUNET_SCHEDULER_NO_TASK != send_verify_successor_task) 6253 if (NULL != send_verify_successor_task)
6254 { 6254 {
6255 GNUNET_SCHEDULER_cancel (send_verify_successor_task); 6255 GNUNET_SCHEDULER_cancel (send_verify_successor_task);
6256 send_verify_successor_task = GNUNET_SCHEDULER_NO_TASK; 6256 send_verify_successor_task = NULL;
6257 } 6257 }
6258 6258
6259 if (GNUNET_SCHEDULER_NO_TASK != send_verify_successor_retry_task) 6259 if (NULL != send_verify_successor_retry_task)
6260 { 6260 {
6261 struct VerifySuccessorContext *ctx; 6261 struct VerifySuccessorContext *ctx;
6262 ctx = GNUNET_SCHEDULER_cancel (send_verify_successor_retry_task); 6262 ctx = GNUNET_SCHEDULER_cancel (send_verify_successor_retry_task);
6263 GNUNET_free(ctx); 6263 GNUNET_free(ctx);
6264 send_verify_successor_retry_task = GNUNET_SCHEDULER_NO_TASK; 6264 send_verify_successor_retry_task = NULL;
6265 } 6265 }
6266 6266
6267 if (send_notify_new_successor_retry_task != GNUNET_SCHEDULER_NO_TASK) 6267 if (send_notify_new_successor_retry_task != NULL)
6268 { 6268 {
6269 struct SendNotifyContext *notify_ctx; 6269 struct SendNotifyContext *notify_ctx;
6270 notify_ctx = GNUNET_SCHEDULER_cancel(send_notify_new_successor_retry_task); 6270 notify_ctx = GNUNET_SCHEDULER_cancel(send_notify_new_successor_retry_task);
6271 GNUNET_free (notify_ctx->successor_trail); 6271 GNUNET_free (notify_ctx->successor_trail);
6272 GNUNET_free (notify_ctx); 6272 GNUNET_free (notify_ctx);
6273 send_notify_new_successor_retry_task = GNUNET_SCHEDULER_NO_TASK; 6273 send_notify_new_successor_retry_task = NULL;
6274 } 6274 }
6275} 6275}
6276 6276
diff --git a/src/dht/gnunet_dht_profiler.c b/src/dht/gnunet_dht_profiler.c
index f6223b3dd..668f61aef 100644
--- a/src/dht/gnunet_dht_profiler.c
+++ b/src/dht/gnunet_dht_profiler.c
@@ -195,7 +195,7 @@ struct ActiveContext
195 /** 195 /**
196 * Delay task 196 * Delay task
197 */ 197 */
198 GNUNET_SCHEDULER_TaskIdentifier delay_task; 198 struct GNUNET_SCHEDULER_Task * delay_task;
199 199
200 /** 200 /**
201 * The size of the @e put_data 201 * The size of the @e put_data
@@ -357,7 +357,7 @@ static int flag = 0;
357/** 357/**
358 * Task to collect peer and its current successor statistics. 358 * Task to collect peer and its current successor statistics.
359 */ 359 */
360static GNUNET_SCHEDULER_TaskIdentifier successor_stats_task; 360static struct GNUNET_SCHEDULER_Task * successor_stats_task;
361 361
362/** 362/**
363 * Closure for successor_stats_task. 363 * Closure for successor_stats_task.
@@ -441,7 +441,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
441 ac = a_ctx[cnt].ac; 441 ac = a_ctx[cnt].ac;
442 if (NULL != ac) 442 if (NULL != ac)
443 { 443 {
444 if (GNUNET_SCHEDULER_NO_TASK != ac->delay_task) 444 if (NULL != ac->delay_task)
445 GNUNET_SCHEDULER_cancel (ac->delay_task); 445 GNUNET_SCHEDULER_cancel (ac->delay_task);
446 if (NULL != ac->put_data) 446 if (NULL != ac->put_data)
447 GNUNET_free (ac->put_data); 447 GNUNET_free (ac->put_data);
@@ -554,7 +554,7 @@ cancel_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
554 struct ActiveContext *ac = cls; 554 struct ActiveContext *ac = cls;
555 struct Context *ctx = ac->ctx; 555 struct Context *ctx = ac->ctx;
556 556
557 ac->delay_task = GNUNET_SCHEDULER_NO_TASK; 557 ac->delay_task = NULL;
558 GNUNET_assert (NULL != ac->dht_get); 558 GNUNET_assert (NULL != ac->dht_get);
559 GNUNET_DHT_get_stop (ac->dht_get); 559 GNUNET_DHT_get_stop (ac->dht_get);
560 ac->dht_get = NULL; 560 ac->dht_get = NULL;
@@ -613,9 +613,9 @@ get_iter (void *cls,
613 get_ac->nrefs--; 613 get_ac->nrefs--;
614 GNUNET_DHT_get_stop (ac->dht_get); 614 GNUNET_DHT_get_stop (ac->dht_get);
615 ac->dht_get = NULL; 615 ac->dht_get = NULL;
616 if (ac->delay_task != GNUNET_SCHEDULER_NO_TASK) 616 if (ac->delay_task != NULL)
617 GNUNET_SCHEDULER_cancel (ac->delay_task); 617 GNUNET_SCHEDULER_cancel (ac->delay_task);
618 ac->delay_task = GNUNET_SCHEDULER_NO_TASK; 618 ac->delay_task = NULL;
619 GNUNET_assert (NULL != ctx->op); 619 GNUNET_assert (NULL != ctx->op);
620 GNUNET_TESTBED_operation_done (ctx->op); 620 GNUNET_TESTBED_operation_done (ctx->op);
621 ctx->op = NULL; 621 ctx->op = NULL;
@@ -646,7 +646,7 @@ delayed_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
646 struct ActiveContext *get_ac; 646 struct ActiveContext *get_ac;
647 unsigned int r; 647 unsigned int r;
648 648
649 ac->delay_task = GNUNET_SCHEDULER_NO_TASK; 649 ac->delay_task = NULL;
650 get_ac = NULL; 650 get_ac = NULL;
651 while (1) 651 while (1)
652 { 652 {
@@ -735,7 +735,7 @@ delayed_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
735{ 735{
736 struct ActiveContext *ac = cls; 736 struct ActiveContext *ac = cls;
737 737
738 ac->delay_task = GNUNET_SCHEDULER_NO_TASK; 738 ac->delay_task = NULL;
739 /* Generate and DHT PUT some random data */ 739 /* Generate and DHT PUT some random data */
740 ac->put_data_size = 16; /* minimum */ 740 ac->put_data_size = 16; /* minimum */
741 ac->put_data_size += GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 741 ac->put_data_size += GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
@@ -1065,7 +1065,7 @@ successor_stats_cont (void *cls,
1065 int count; 1065 int count;
1066 1066
1067 /* Don't schedule the task till we are looking for circle here. */ 1067 /* Don't schedule the task till we are looking for circle here. */
1068 successor_stats_task = GNUNET_SCHEDULER_NO_TASK; 1068 successor_stats_task = NULL;
1069 GNUNET_TESTBED_operation_done (successor_stats_op); 1069 GNUNET_TESTBED_operation_done (successor_stats_op);
1070 successor_stats_op = NULL; 1070 successor_stats_op = NULL;
1071 if (0 == max_searches) 1071 if (0 == max_searches)
@@ -1109,7 +1109,7 @@ successor_stats_cont (void *cls,
1109 if ((start_val == val) && (count == num_peers)) 1109 if ((start_val == val) && (count == num_peers))
1110 { 1110 {
1111 DEBUG("CIRCLE COMPLETED after %u tries", tries); 1111 DEBUG("CIRCLE COMPLETED after %u tries", tries);
1112 if(GNUNET_SCHEDULER_NO_TASK == successor_stats_task) 1112 if(NULL == successor_stats_task)
1113 { 1113 {
1114 start_func(); 1114 start_func();
1115 } 1115 }
@@ -1123,11 +1123,11 @@ successor_stats_cont (void *cls,
1123 "Maximum tries %u exceeded while checking successor TOTAL TRIES %u" 1123 "Maximum tries %u exceeded while checking successor TOTAL TRIES %u"
1124 " circle formation. Exiting\n", 1124 " circle formation. Exiting\n",
1125 max_searches,tries); 1125 max_searches,tries);
1126 if (GNUNET_SCHEDULER_NO_TASK != successor_stats_task) 1126 if (NULL != successor_stats_task)
1127 { 1127 {
1128 successor_stats_task = GNUNET_SCHEDULER_NO_TASK; 1128 successor_stats_task = NULL;
1129 } 1129 }
1130 if(GNUNET_SCHEDULER_NO_TASK == successor_stats_task) 1130 if(NULL == successor_stats_task)
1131 { 1131 {
1132 start_func(); 1132 start_func();
1133 } 1133 }
@@ -1255,7 +1255,7 @@ service_started (void *cls,
1255 ctx->op = NULL; 1255 ctx->op = NULL;
1256 peers_started++; 1256 peers_started++;
1257 DEBUG("Peers Started = %d; num_peers = %d \n", peers_started, num_peers); 1257 DEBUG("Peers Started = %d; num_peers = %d \n", peers_started, num_peers);
1258 if (GNUNET_SCHEDULER_NO_TASK == successor_stats_task && peers_started == num_peers) 1258 if (NULL == successor_stats_task && peers_started == num_peers)
1259 { 1259 {
1260 DEBUG("successor_stats_task \n"); 1260 DEBUG("successor_stats_task \n");
1261 struct Collect_Stat_Context *collect_stat_cls = GNUNET_new(struct Collect_Stat_Context); 1261 struct Collect_Stat_Context *collect_stat_cls = GNUNET_new(struct Collect_Stat_Context);
diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c
index 5c6913740..e4f6e5b56 100644
--- a/src/dht/test_dht_api.c
+++ b/src/dht/test_dht_api.c
@@ -59,7 +59,7 @@ struct RetryContext
59 /** 59 /**
60 * The task identifier of the retry task, so it can be cancelled. 60 * The task identifier of the retry task, so it can be cancelled.
61 */ 61 */
62 GNUNET_SCHEDULER_TaskIdentifier retry_task; 62 struct GNUNET_SCHEDULER_Task * retry_task;
63 63
64}; 64};
65 65
@@ -72,7 +72,7 @@ struct RetryContext retry_context;
72 72
73static int ok = 1; 73static int ok = 1;
74 74
75static GNUNET_SCHEDULER_TaskIdentifier die_task; 75static struct GNUNET_SCHEDULER_Task * die_task;
76 76
77 77
78#if VERBOSE 78#if VERBOSE
@@ -86,7 +86,7 @@ static void
86end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 86end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
87{ 87{
88 GNUNET_SCHEDULER_cancel (die_task); 88 GNUNET_SCHEDULER_cancel (die_task);
89 die_task = GNUNET_SCHEDULER_NO_TASK; 89 die_task = NULL;
90 GNUNET_DHT_disconnect (dht_handle); 90 GNUNET_DHT_disconnect (dht_handle);
91 dht_handle = NULL; 91 dht_handle = NULL;
92 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 92 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -105,7 +105,7 @@ end_badly ()
105 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping get request!\n"); 105 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping get request!\n");
106 GNUNET_DHT_get_stop (get_handle); 106 GNUNET_DHT_get_stop (get_handle);
107 } 107 }
108 if (retry_context.retry_task != GNUNET_SCHEDULER_NO_TASK) 108 if (retry_context.retry_task != NULL)
109 GNUNET_SCHEDULER_cancel (retry_context.retry_task); 109 GNUNET_SCHEDULER_cancel (retry_context.retry_task);
110 GNUNET_DHT_disconnect (dht_handle); 110 GNUNET_DHT_disconnect (dht_handle);
111 dht_handle = NULL; 111 dht_handle = NULL;
diff --git a/src/dht/test_dht_monitor.c b/src/dht/test_dht_monitor.c
index 98791d28f..6fc4498d1 100644
--- a/src/dht/test_dht_monitor.c
+++ b/src/dht/test_dht_monitor.c
@@ -90,12 +90,12 @@ static unsigned int NUM_PEERS = 3;
90/** 90/**
91 * Task called to disconnect peers. 91 * Task called to disconnect peers.
92 */ 92 */
93static GNUNET_SCHEDULER_TaskIdentifier timeout_task; 93static struct GNUNET_SCHEDULER_Task * timeout_task;
94 94
95/** 95/**
96 * Task to do DHT_puts 96 * Task to do DHT_puts
97 */ 97 */
98static GNUNET_SCHEDULER_TaskIdentifier put_task; 98static struct GNUNET_SCHEDULER_Task * put_task;
99 99
100static struct GNUNET_DHT_MonitorHandle **monitors; 100static struct GNUNET_DHT_MonitorHandle **monitors;
101 101
diff --git a/src/dht/test_dht_topo.c b/src/dht/test_dht_topo.c
index 311bb5597..9bd87b21e 100644
--- a/src/dht/test_dht_topo.c
+++ b/src/dht/test_dht_topo.c
@@ -71,12 +71,12 @@ static int ok = 1;
71/** 71/**
72 * Task to do DHT_puts 72 * Task to do DHT_puts
73 */ 73 */
74static GNUNET_SCHEDULER_TaskIdentifier put_task; 74static struct GNUNET_SCHEDULER_Task * put_task;
75 75
76/** 76/**
77 * Task to time out / regular shutdown. 77 * Task to time out / regular shutdown.
78 */ 78 */
79static GNUNET_SCHEDULER_TaskIdentifier timeout_task; 79static struct GNUNET_SCHEDULER_Task * timeout_task;
80 80
81/** 81/**
82 * Head of list of active GET operations. 82 * Head of list of active GET operations.
diff --git a/src/dns/dns_api.c b/src/dns/dns_api.c
index 288b421c6..916a860f1 100644
--- a/src/dns/dns_api.c
+++ b/src/dns/dns_api.c
@@ -119,7 +119,7 @@ struct GNUNET_DNS_Handle
119 /** 119 /**
120 * Task to reconnect to the service. 120 * Task to reconnect to the service.
121 */ 121 */
122 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 122 struct GNUNET_SCHEDULER_Task * reconnect_task;
123 123
124 /** 124 /**
125 * Re-connect counter, to make sure we did not reconnect in the meantime. 125 * Re-connect counter, to make sure we did not reconnect in the meantime.
@@ -169,7 +169,7 @@ reconnect (void *cls,
169 struct ReplyQueueEntry *qe; 169 struct ReplyQueueEntry *qe;
170 struct GNUNET_DNS_Register *msg; 170 struct GNUNET_DNS_Register *msg;
171 171
172 dh->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 172 dh->reconnect_task = NULL;
173 dh->dns_connection = GNUNET_CLIENT_connect ("dns", dh->cfg); 173 dh->dns_connection = GNUNET_CLIENT_connect ("dns", dh->cfg);
174 if (NULL == dh->dns_connection) 174 if (NULL == dh->dns_connection)
175 return; 175 return;
@@ -508,10 +508,10 @@ GNUNET_DNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
508void 508void
509GNUNET_DNS_disconnect (struct GNUNET_DNS_Handle *dh) 509GNUNET_DNS_disconnect (struct GNUNET_DNS_Handle *dh)
510{ 510{
511 if (GNUNET_SCHEDULER_NO_TASK != dh->reconnect_task) 511 if (NULL != dh->reconnect_task)
512 { 512 {
513 GNUNET_SCHEDULER_cancel (dh->reconnect_task); 513 GNUNET_SCHEDULER_cancel (dh->reconnect_task);
514 dh->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 514 dh->reconnect_task = NULL;
515 } 515 }
516 disconnect (dh); 516 disconnect (dh);
517 /* make sure client has no pending requests left over! */ 517 /* make sure client has no pending requests left over! */
diff --git a/src/dns/dnsstub.c b/src/dns/dnsstub.c
index 2e57a8877..6e4f7c799 100644
--- a/src/dns/dnsstub.c
+++ b/src/dns/dnsstub.c
@@ -67,7 +67,7 @@ struct GNUNET_DNSSTUB_RequestSocket
67 /** 67 /**
68 * Task for reading from dnsout4 and dnsout6. 68 * Task for reading from dnsout4 and dnsout6.
69 */ 69 */
70 GNUNET_SCHEDULER_TaskIdentifier read_task; 70 struct GNUNET_SCHEDULER_Task * read_task;
71 71
72 /** 72 /**
73 * When should this request time out? 73 * When should this request time out?
@@ -125,10 +125,10 @@ cleanup_rs (struct GNUNET_DNSSTUB_RequestSocket *rs)
125 GNUNET_NETWORK_socket_close (rs->dnsout6); 125 GNUNET_NETWORK_socket_close (rs->dnsout6);
126 rs->dnsout6 = NULL; 126 rs->dnsout6 = NULL;
127 } 127 }
128 if (GNUNET_SCHEDULER_NO_TASK != rs->read_task) 128 if (NULL != rs->read_task)
129 { 129 {
130 GNUNET_SCHEDULER_cancel (rs->read_task); 130 GNUNET_SCHEDULER_cancel (rs->read_task);
131 rs->read_task = GNUNET_SCHEDULER_NO_TASK; 131 rs->read_task = NULL;
132 } 132 }
133} 133}
134 134
@@ -223,10 +223,10 @@ get_request_socket (struct GNUNET_DNSSTUB_Context *ctx,
223 default: 223 default:
224 return NULL; 224 return NULL;
225 } 225 }
226 if (GNUNET_SCHEDULER_NO_TASK != rs->read_task) 226 if (NULL != rs->read_task)
227 { 227 {
228 GNUNET_SCHEDULER_cancel (rs->read_task); 228 GNUNET_SCHEDULER_cancel (rs->read_task);
229 rs->read_task = GNUNET_SCHEDULER_NO_TASK; 229 rs->read_task = NULL;
230 } 230 }
231 if ( (NULL == rs->dnsout4) && 231 if ( (NULL == rs->dnsout4) &&
232 (NULL == rs->dnsout6) ) 232 (NULL == rs->dnsout6) )
@@ -475,7 +475,7 @@ read_response (void *cls,
475 struct GNUNET_DNSSTUB_RequestSocket *rs = cls; 475 struct GNUNET_DNSSTUB_RequestSocket *rs = cls;
476 struct GNUNET_NETWORK_FDSet *rset; 476 struct GNUNET_NETWORK_FDSet *rset;
477 477
478 rs->read_task = GNUNET_SCHEDULER_NO_TASK; 478 rs->read_task = NULL;
479 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 479 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
480 { 480 {
481 /* timeout or shutdown */ 481 /* timeout or shutdown */
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c
index e0bb89ccf..d134d88f4 100644
--- a/src/dv/gnunet-service-dv.c
+++ b/src/dv/gnunet-service-dv.c
@@ -230,7 +230,7 @@ struct DirectNeighbor
230 * ID of the task we use to (periodically) update our consensus 230 * ID of the task we use to (periodically) update our consensus
231 * with this peer. Used if we are the initiating peer. 231 * with this peer. Used if we are the initiating peer.
232 */ 232 */
233 GNUNET_SCHEDULER_TaskIdentifier initiate_task; 233 struct GNUNET_SCHEDULER_Task * initiate_task;
234 234
235 /** 235 /**
236 * At what offset are we, with respect to inserting our own routes 236 * At what offset are we, with respect to inserting our own routes
@@ -386,7 +386,7 @@ static struct GNUNET_ATS_PerformanceHandle *ats;
386/** 386/**
387 * Task scheduled to refresh routes based on direct neighbours. 387 * Task scheduled to refresh routes based on direct neighbours.
388 */ 388 */
389static GNUNET_SCHEDULER_TaskIdentifier rr_task; 389static struct GNUNET_SCHEDULER_Task * rr_task;
390 390
391/** 391/**
392 * #GNUNET_YES if we are shutting down. 392 * #GNUNET_YES if we are shutting down.
@@ -1138,7 +1138,7 @@ static void
1138refresh_routes_task (void *cls, 1138refresh_routes_task (void *cls,
1139 const struct GNUNET_SCHEDULER_TaskContext *tc) 1139 const struct GNUNET_SCHEDULER_TaskContext *tc)
1140{ 1140{
1141 rr_task = GNUNET_SCHEDULER_NO_TASK; 1141 rr_task = NULL;
1142 GNUNET_CONTAINER_multipeermap_iterate (direct_neighbors, 1142 GNUNET_CONTAINER_multipeermap_iterate (direct_neighbors,
1143 &refresh_routes, 1143 &refresh_routes,
1144 NULL); 1144 NULL);
@@ -1152,7 +1152,7 @@ refresh_routes_task (void *cls,
1152static void 1152static void
1153schedule_refresh_routes () 1153schedule_refresh_routes ()
1154{ 1154{
1155 if (GNUNET_SCHEDULER_NO_TASK == rr_task) 1155 if (NULL == rr_task)
1156 rr_task = GNUNET_SCHEDULER_add_now (&refresh_routes_task, 1156 rr_task = GNUNET_SCHEDULER_add_now (&refresh_routes_task,
1157 NULL); 1157 NULL);
1158} 1158}
@@ -1288,10 +1288,10 @@ handle_direct_disconnect (struct DirectNeighbor *neighbor)
1288 GNUNET_SET_listen_cancel (neighbor->listen_handle); 1288 GNUNET_SET_listen_cancel (neighbor->listen_handle);
1289 neighbor->listen_handle = NULL; 1289 neighbor->listen_handle = NULL;
1290 } 1290 }
1291 if (GNUNET_SCHEDULER_NO_TASK != neighbor->initiate_task) 1291 if (NULL != neighbor->initiate_task)
1292 { 1292 {
1293 GNUNET_SCHEDULER_cancel (neighbor->initiate_task); 1293 GNUNET_SCHEDULER_cancel (neighbor->initiate_task);
1294 neighbor->initiate_task = GNUNET_SCHEDULER_NO_TASK; 1294 neighbor->initiate_task = NULL;
1295 } 1295 }
1296} 1296}
1297 1297
@@ -1745,7 +1745,7 @@ initiate_set_union (void *cls,
1745 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1745 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1746 "Initiating SET union with peer `%s'\n", 1746 "Initiating SET union with peer `%s'\n",
1747 GNUNET_i2s (&neighbor->peer)); 1747 GNUNET_i2s (&neighbor->peer));
1748 neighbor->initiate_task = GNUNET_SCHEDULER_NO_TASK; 1748 neighbor->initiate_task = NULL;
1749 neighbor->my_set = GNUNET_SET_create (cfg, 1749 neighbor->my_set = GNUNET_SET_create (cfg,
1750 GNUNET_SET_OPERATION_UNION); 1750 GNUNET_SET_OPERATION_UNION);
1751 neighbor->set_op = GNUNET_SET_prepare (&neighbor->peer, 1751 neighbor->set_op = GNUNET_SET_prepare (&neighbor->peer,
@@ -2154,10 +2154,10 @@ shutdown_task (void *cls,
2154 consensi[i].array_length, 2154 consensi[i].array_length,
2155 0); 2155 0);
2156 } 2156 }
2157 if (GNUNET_SCHEDULER_NO_TASK != rr_task) 2157 if (NULL != rr_task)
2158 { 2158 {
2159 GNUNET_SCHEDULER_cancel (rr_task); 2159 GNUNET_SCHEDULER_cancel (rr_task);
2160 rr_task = GNUNET_SCHEDULER_NO_TASK; 2160 rr_task = NULL;
2161 } 2161 }
2162} 2162}
2163 2163
diff --git a/src/dv/test_transport_dv.c b/src/dv/test_transport_dv.c
index 6a2cbde94..eec7d3171 100644
--- a/src/dv/test_transport_dv.c
+++ b/src/dv/test_transport_dv.c
@@ -32,14 +32,14 @@ static int ok;
32 32
33struct GNUNET_TESTBED_Operation *topology_op; 33struct GNUNET_TESTBED_Operation *topology_op;
34 34
35static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 35static 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) 40 const struct GNUNET_SCHEDULER_TaskContext *tc)
41{ 41{
42 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 42 shutdown_task = NULL;
43 if (NULL != topology_op) 43 if (NULL != topology_op)
44 { 44 {
45 GNUNET_TESTBED_operation_done (topology_op); 45 GNUNET_TESTBED_operation_done (topology_op);
diff --git a/src/exit/gnunet-daemon-exit.c b/src/exit/gnunet-daemon-exit.c
index a76f506ee..1f8014ce2 100644
--- a/src/exit/gnunet-daemon-exit.c
+++ b/src/exit/gnunet-daemon-exit.c
@@ -422,7 +422,7 @@ static struct GNUNET_DHT_Handle *dht;
422/** 422/**
423 * Task for doing DHT PUTs to advertise exit service. 423 * Task for doing DHT PUTs to advertise exit service.
424 */ 424 */
425static GNUNET_SCHEDULER_TaskIdentifier dht_task; 425static struct GNUNET_SCHEDULER_Task * dht_task;
426 426
427/** 427/**
428 * Advertisement message we put into the DHT to advertise us 428 * Advertisement message we put into the DHT to advertise us
@@ -3198,10 +3198,10 @@ cleanup (void *cls,
3198 GNUNET_free (peer_key); 3198 GNUNET_free (peer_key);
3199 peer_key = NULL; 3199 peer_key = NULL;
3200 } 3200 }
3201 if (GNUNET_SCHEDULER_NO_TASK != dht_task) 3201 if (NULL != dht_task)
3202 { 3202 {
3203 GNUNET_SCHEDULER_cancel (dht_task); 3203 GNUNET_SCHEDULER_cancel (dht_task);
3204 dht_task = GNUNET_SCHEDULER_NO_TASK; 3204 dht_task = NULL;
3205 } 3205 }
3206 if (NULL != dht_put) 3206 if (NULL != dht_put)
3207 { 3207 {
@@ -3445,7 +3445,7 @@ do_dht_put (void *cls,
3445{ 3445{
3446 struct GNUNET_TIME_Absolute expiration; 3446 struct GNUNET_TIME_Absolute expiration;
3447 3447
3448 dht_task = GNUNET_SCHEDULER_NO_TASK; 3448 dht_task = NULL;
3449 expiration = GNUNET_TIME_absolute_ntoh (dns_advertisement.expiration_time); 3449 expiration = GNUNET_TIME_absolute_ntoh (dns_advertisement.expiration_time);
3450 if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value_us < 3450 if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value_us <
3451 GNUNET_TIME_UNIT_HOURS.rel_value_us) 3451 GNUNET_TIME_UNIT_HOURS.rel_value_us)
diff --git a/src/fragmentation/defragmentation.c b/src/fragmentation/defragmentation.c
index 478a9c658..e3cf2298b 100644
--- a/src/fragmentation/defragmentation.c
+++ b/src/fragmentation/defragmentation.c
@@ -83,7 +83,7 @@ struct MessageContext
83 * Task scheduled for transmitting the next ACK to the 83 * Task scheduled for transmitting the next ACK to the
84 * other peer. 84 * other peer.
85 */ 85 */
86 GNUNET_SCHEDULER_TaskIdentifier ack_task; 86 struct GNUNET_SCHEDULER_Task * ack_task;
87 87
88 /** 88 /**
89 * When did we receive which fragment? Used to calculate 89 * When did we receive which fragment? Used to calculate
@@ -236,10 +236,10 @@ GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc)
236 { 236 {
237 GNUNET_CONTAINER_DLL_remove (dc->head, dc->tail, mc); 237 GNUNET_CONTAINER_DLL_remove (dc->head, dc->tail, mc);
238 dc->list_size--; 238 dc->list_size--;
239 if (GNUNET_SCHEDULER_NO_TASK != mc->ack_task) 239 if (NULL != mc->ack_task)
240 { 240 {
241 GNUNET_SCHEDULER_cancel (mc->ack_task); 241 GNUNET_SCHEDULER_cancel (mc->ack_task);
242 mc->ack_task = GNUNET_SCHEDULER_NO_TASK; 242 mc->ack_task = NULL;
243 } 243 }
244 GNUNET_free (mc); 244 GNUNET_free (mc);
245 } 245 }
@@ -261,7 +261,7 @@ send_ack (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
261 struct GNUNET_DEFRAGMENT_Context *dc = mc->dc; 261 struct GNUNET_DEFRAGMENT_Context *dc = mc->dc;
262 struct FragmentAcknowledgement fa; 262 struct FragmentAcknowledgement fa;
263 263
264 mc->ack_task = GNUNET_SCHEDULER_NO_TASK; 264 mc->ack_task = NULL;
265 fa.header.size = htons (sizeof (struct FragmentAcknowledgement)); 265 fa.header.size = htons (sizeof (struct FragmentAcknowledgement));
266 fa.header.type = htons (GNUNET_MESSAGE_TYPE_FRAGMENT_ACK); 266 fa.header.type = htons (GNUNET_MESSAGE_TYPE_FRAGMENT_ACK);
267 fa.fragment_id = htonl (mc->fragment_id); 267 fa.fragment_id = htonl (mc->fragment_id);
@@ -388,10 +388,10 @@ discard_oldest_mc (struct GNUNET_DEFRAGMENT_Context *dc)
388 GNUNET_assert (NULL != old); 388 GNUNET_assert (NULL != old);
389 GNUNET_CONTAINER_DLL_remove (dc->head, dc->tail, old); 389 GNUNET_CONTAINER_DLL_remove (dc->head, dc->tail, old);
390 dc->list_size--; 390 dc->list_size--;
391 if (GNUNET_SCHEDULER_NO_TASK != old->ack_task) 391 if (NULL != old->ack_task)
392 { 392 {
393 GNUNET_SCHEDULER_cancel (old->ack_task); 393 GNUNET_SCHEDULER_cancel (old->ack_task);
394 old->ack_task = GNUNET_SCHEDULER_NO_TASK; 394 old->ack_task = NULL;
395 } 395 }
396 GNUNET_free (old); 396 GNUNET_free (old);
397} 397}
@@ -550,7 +550,7 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
550 linear sequence; ACK now! */ 550 linear sequence; ACK now! */
551 delay = GNUNET_TIME_UNIT_ZERO; 551 delay = GNUNET_TIME_UNIT_ZERO;
552 } 552 }
553 if (GNUNET_SCHEDULER_NO_TASK != mc->ack_task) 553 if (NULL != mc->ack_task)
554 GNUNET_SCHEDULER_cancel (mc->ack_task); 554 GNUNET_SCHEDULER_cancel (mc->ack_task);
555 mc->ack_task = GNUNET_SCHEDULER_add_delayed (delay, &send_ack, mc); 555 mc->ack_task = GNUNET_SCHEDULER_add_delayed (delay, &send_ack, mc);
556 if (duplicate == GNUNET_YES) 556 if (duplicate == GNUNET_YES)
diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c
index bf7491815..a72bda4ce 100644
--- a/src/fragmentation/fragmentation.c
+++ b/src/fragmentation/fragmentation.c
@@ -98,7 +98,7 @@ struct GNUNET_FRAGMENT_Context
98 /** 98 /**
99 * Task performing work for the fragmenter. 99 * Task performing work for the fragmenter.
100 */ 100 */
101 GNUNET_SCHEDULER_TaskIdentifier task; 101 struct GNUNET_SCHEDULER_Task * task;
102 102
103 /** 103 /**
104 * Our fragmentation ID. (chosen at random) 104 * Our fragmentation ID. (chosen at random)
@@ -157,7 +157,7 @@ transmit_next (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
157 size_t fsize; 157 size_t fsize;
158 int wrap; 158 int wrap;
159 159
160 fc->task = GNUNET_SCHEDULER_NO_TASK; 160 fc->task = NULL;
161 GNUNET_assert (GNUNET_NO == fc->proc_busy); 161 GNUNET_assert (GNUNET_NO == fc->proc_busy);
162 if (0 == fc->acks) 162 if (0 == fc->acks)
163 return; /* all done */ 163 return; /* all done */
@@ -323,7 +323,7 @@ GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context *fc)
323{ 323{
324 GNUNET_assert (fc->proc_busy == GNUNET_YES); 324 GNUNET_assert (fc->proc_busy == GNUNET_YES);
325 fc->proc_busy = GNUNET_NO; 325 fc->proc_busy = GNUNET_NO;
326 GNUNET_assert (fc->task == GNUNET_SCHEDULER_NO_TASK); 326 GNUNET_assert (fc->task == NULL);
327 fc->task = 327 fc->task =
328 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining 328 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
329 (fc->delay_until), &transmit_next, fc); 329 (fc->delay_until), &transmit_next, fc);
@@ -415,7 +415,7 @@ GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc,
415 if (0 != fc->acks) 415 if (0 != fc->acks)
416 { 416 {
417 /* more to transmit, do so right now (if tracker permits...) */ 417 /* more to transmit, do so right now (if tracker permits...) */
418 if (fc->task != GNUNET_SCHEDULER_NO_TASK) 418 if (fc->task != NULL)
419 { 419 {
420 /* schedule next transmission now, no point in waiting... */ 420 /* schedule next transmission now, no point in waiting... */
421 GNUNET_SCHEDULER_cancel (fc->task); 421 GNUNET_SCHEDULER_cancel (fc->task);
@@ -434,10 +434,10 @@ GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc,
434 GNUNET_STATISTICS_update (fc->stats, 434 GNUNET_STATISTICS_update (fc->stats,
435 _("# fragmentation transmissions completed"), 1, 435 _("# fragmentation transmissions completed"), 1,
436 GNUNET_NO); 436 GNUNET_NO);
437 if (fc->task != GNUNET_SCHEDULER_NO_TASK) 437 if (fc->task != NULL)
438 { 438 {
439 GNUNET_SCHEDULER_cancel (fc->task); 439 GNUNET_SCHEDULER_cancel (fc->task);
440 fc->task = GNUNET_SCHEDULER_NO_TASK; 440 fc->task = NULL;
441 } 441 }
442 return GNUNET_OK; 442 return GNUNET_OK;
443} 443}
@@ -458,7 +458,7 @@ GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *fc,
458 struct GNUNET_TIME_Relative *msg_delay, 458 struct GNUNET_TIME_Relative *msg_delay,
459 struct GNUNET_TIME_Relative *ack_delay) 459 struct GNUNET_TIME_Relative *ack_delay)
460{ 460{
461 if (fc->task != GNUNET_SCHEDULER_NO_TASK) 461 if (fc->task != NULL)
462 GNUNET_SCHEDULER_cancel (fc->task); 462 GNUNET_SCHEDULER_cancel (fc->task);
463 if (NULL != ack_delay) 463 if (NULL != ack_delay)
464 *ack_delay = fc->ack_delay; 464 *ack_delay = fc->ack_delay;
diff --git a/src/fragmentation/test_fragmentation.c b/src/fragmentation/test_fragmentation.c
index 5f102f439..50779c98b 100644
--- a/src/fragmentation/test_fragmentation.c
+++ b/src/fragmentation/test_fragmentation.c
@@ -60,7 +60,7 @@ 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 GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 63static struct GNUNET_SCHEDULER_Task * shutdown_task;
64 64
65static void 65static void
66do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 66do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
@@ -68,7 +68,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
68 unsigned int i; 68 unsigned int i;
69 69
70 ret = 0; 70 ret = 0;
71 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 71 shutdown_task = NULL;
72 GNUNET_DEFRAGMENT_context_destroy (defrag); 72 GNUNET_DEFRAGMENT_context_destroy (defrag);
73 defrag = NULL; 73 defrag = NULL;
74 for (i = 0; i < NUM_MSGS; i++) 74 for (i = 0; i < NUM_MSGS; i++)
@@ -102,7 +102,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr)
102 /* tolerate 10% loss, i.e. due to duplicate fragment IDs */ 102 /* tolerate 10% loss, i.e. due to duplicate fragment IDs */
103 if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0)) 103 if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0))
104 { 104 {
105 if (GNUNET_SCHEDULER_NO_TASK == shutdown_task) 105 if (NULL == shutdown_task)
106 shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 106 shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
107 } 107 }
108} 108}
diff --git a/src/fs/fs_api.c b/src/fs/fs_api.c
index 302020d7d..6c534ff32 100644
--- a/src/fs/fs_api.c
+++ b/src/fs/fs_api.c
@@ -131,7 +131,7 @@ process_job_queue (void *cls,
131 int num_downloads_change; 131 int num_downloads_change;
132 int block_limit_hit; 132 int block_limit_hit;
133 133
134 h->queue_job = GNUNET_SCHEDULER_NO_TASK; 134 h->queue_job = NULL;
135 /* restart_at will be set to the time when it makes sense to 135 /* restart_at will be set to the time when it makes sense to
136 re-evaluate the job queue (unless, of course, jobs complete 136 re-evaluate the job queue (unless, of course, jobs complete
137 or are added, then we'll be triggered immediately */ 137 or are added, then we'll be triggered immediately */
@@ -336,7 +336,7 @@ GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h,
336 qe->priority = priority; 336 qe->priority = priority;
337 GNUNET_CONTAINER_DLL_insert_after (h->pending_head, h->pending_tail, 337 GNUNET_CONTAINER_DLL_insert_after (h->pending_head, h->pending_tail,
338 h->pending_tail, qe); 338 h->pending_tail, qe);
339 if (h->queue_job != GNUNET_SCHEDULER_NO_TASK) 339 if (h->queue_job != NULL)
340 GNUNET_SCHEDULER_cancel (h->queue_job); 340 GNUNET_SCHEDULER_cancel (h->queue_job);
341 h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h); 341 h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h);
342 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 342 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -364,7 +364,7 @@ GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qe)
364 stop_job (qe); 364 stop_job (qe);
365 GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, qe); 365 GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, qe);
366 GNUNET_free (qe); 366 GNUNET_free (qe);
367 if (h->queue_job != GNUNET_SCHEDULER_NO_TASK) 367 if (h->queue_job != NULL)
368 GNUNET_SCHEDULER_cancel (h->queue_job); 368 GNUNET_SCHEDULER_cancel (h->queue_job);
369 h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h); 369 h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h);
370} 370}
@@ -1619,7 +1619,7 @@ deserialize_publish_file (void *cls,
1619 /* re-start publishing (if needed)... */ 1619 /* re-start publishing (if needed)... */
1620 if (GNUNET_YES != pc->all_done) 1620 if (GNUNET_YES != pc->all_done)
1621 { 1621 {
1622 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task); 1622 GNUNET_assert (NULL == pc->upload_task);
1623 pc->upload_task = 1623 pc->upload_task =
1624 GNUNET_SCHEDULER_add_with_priority 1624 GNUNET_SCHEDULER_add_with_priority
1625 (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, 1625 (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
@@ -2140,7 +2140,7 @@ GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc)
2140 GNUNET_assert ((GNUNET_YES == GNUNET_FS_uri_test_ksk (sc->uri)) || 2140 GNUNET_assert ((GNUNET_YES == GNUNET_FS_uri_test_ksk (sc->uri)) ||
2141 (GNUNET_YES == GNUNET_FS_uri_test_sks (sc->uri))); 2141 (GNUNET_YES == GNUNET_FS_uri_test_sks (sc->uri)));
2142 uris = GNUNET_FS_uri_to_string (sc->uri); 2142 uris = GNUNET_FS_uri_to_string (sc->uri);
2143 in_pause = (sc->task != GNUNET_SCHEDULER_NO_TASK) ? 'r' : '\0'; 2143 in_pause = (sc->task != NULL) ? 'r' : '\0';
2144 if ((GNUNET_OK != GNUNET_BIO_write_string (wh, uris)) || 2144 if ((GNUNET_OK != GNUNET_BIO_write_string (wh, uris)) ||
2145 (GNUNET_OK != write_start_time (wh, sc->start_time)) || 2145 (GNUNET_OK != write_start_time (wh, sc->start_time)) ||
2146 (GNUNET_OK != GNUNET_BIO_write_string (wh, sc->emsg)) || 2146 (GNUNET_OK != GNUNET_BIO_write_string (wh, sc->emsg)) ||
@@ -3130,7 +3130,7 @@ GNUNET_FS_stop (struct GNUNET_FS_Handle *h)
3130{ 3130{
3131 while (h->top_head != NULL) 3131 while (h->top_head != NULL)
3132 h->top_head->ssf (h->top_head->ssf_cls); 3132 h->top_head->ssf (h->top_head->ssf_cls);
3133 if (h->queue_job != GNUNET_SCHEDULER_NO_TASK) 3133 if (h->queue_job != NULL)
3134 GNUNET_SCHEDULER_cancel (h->queue_job); 3134 GNUNET_SCHEDULER_cancel (h->queue_job);
3135 GNUNET_free (h->client_name); 3135 GNUNET_free (h->client_name);
3136 GNUNET_free (h); 3136 GNUNET_free (h);
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h
index 157662a65..5fbdef6c2 100644
--- a/src/fs/fs_api.h
+++ b/src/fs/fs_api.h
@@ -601,7 +601,7 @@ struct GNUNET_FS_SearchResult
601 * complete on time (and that will need to be cancelled if we clean 601 * complete on time (and that will need to be cancelled if we clean
602 * up the search result before then). 602 * up the search result before then).
603 */ 603 */
604 GNUNET_SCHEDULER_TaskIdentifier probe_cancel_task; 604 struct GNUNET_SCHEDULER_Task * probe_cancel_task;
605 605
606 /** 606 /**
607 * When did the current probe become active? 607 * When did the current probe become active?
@@ -1170,13 +1170,13 @@ struct GNUNET_FS_Handle
1170 * Task that processes the jobs in the running and pending queues 1170 * Task that processes the jobs in the running and pending queues
1171 * (and moves jobs around as needed). 1171 * (and moves jobs around as needed).
1172 */ 1172 */
1173 GNUNET_SCHEDULER_TaskIdentifier queue_job; 1173 struct GNUNET_SCHEDULER_Task * queue_job;
1174 1174
1175 /** 1175 /**
1176 * Task we use to report periodically to the application that 1176 * Task we use to report periodically to the application that
1177 * certain search probes (from @e probes_head) are still running. 1177 * certain search probes (from @e probes_head) are still running.
1178 */ 1178 */
1179 GNUNET_SCHEDULER_TaskIdentifier probe_ping_task; 1179 struct GNUNET_SCHEDULER_Task * probe_ping_task;
1180 1180
1181 /** 1181 /**
1182 * Average time we take for a single request to be satisfied. 1182 * Average time we take for a single request to be satisfied.
@@ -1300,7 +1300,7 @@ struct GNUNET_FS_PublishContext
1300 * ID of the task performing the upload. NO_TASK if the upload has 1300 * ID of the task performing the upload. NO_TASK if the upload has
1301 * completed. 1301 * completed.
1302 */ 1302 */
1303 GNUNET_SCHEDULER_TaskIdentifier upload_task; 1303 struct GNUNET_SCHEDULER_Task * upload_task;
1304 1304
1305 /** 1305 /**
1306 * Storage space to reserve for the operation. 1306 * Storage space to reserve for the operation.
@@ -1629,10 +1629,10 @@ struct GNUNET_FS_SearchContext
1629 /** 1629 /**
1630 * ID of a task that is using this struct and that must be cancelled 1630 * ID of a task that is using this struct and that must be cancelled
1631 * when the search is being stopped (if not 1631 * when the search is being stopped (if not
1632 * #GNUNET_SCHEDULER_NO_TASK). Used for the task that adds some 1632 * #NULL). Used for the task that adds some
1633 * artificial delay when trying to reconnect to the FS service. 1633 * artificial delay when trying to reconnect to the FS service.
1634 */ 1634 */
1635 GNUNET_SCHEDULER_TaskIdentifier task; 1635 struct GNUNET_SCHEDULER_Task * task;
1636 1636
1637 /** 1637 /**
1638 * How many of the entries in the search request 1638 * How many of the entries in the search request
@@ -1961,12 +1961,12 @@ struct GNUNET_FS_DownloadContext
1961 /** 1961 /**
1962 * ID of a task that is using this struct and that must be cancelled 1962 * ID of a task that is using this struct and that must be cancelled
1963 * when the download is being stopped (if not 1963 * when the download is being stopped (if not
1964 * #GNUNET_SCHEDULER_NO_TASK). Used for the task that adds some 1964 * #NULL). Used for the task that adds some
1965 * artificial delay when trying to reconnect to the FS service or 1965 * artificial delay when trying to reconnect to the FS service or
1966 * the task processing incrementally the data on disk, or the 1966 * the task processing incrementally the data on disk, or the
1967 * task requesting blocks, etc. 1967 * task requesting blocks, etc.
1968 */ 1968 */
1969 GNUNET_SCHEDULER_TaskIdentifier task; 1969 struct GNUNET_SCHEDULER_Task * task;
1970 1970
1971 /** 1971 /**
1972 * What is the first offset that we're interested 1972 * What is the first offset that we're interested
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c
index 83e436b16..2477aab4b 100644
--- a/src/fs/fs_dirmetascan.c
+++ b/src/fs/fs_dirmetascan.c
@@ -80,7 +80,7 @@ struct GNUNET_FS_DirScanner
80 /** 80 /**
81 * Task scheduled when we are done. 81 * Task scheduled when we are done.
82 */ 82 */
83 GNUNET_SCHEDULER_TaskIdentifier stop_task; 83 struct GNUNET_SCHEDULER_Task * stop_task;
84 84
85 /** 85 /**
86 * Arguments for helper. 86 * Arguments for helper.
@@ -106,7 +106,7 @@ GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds)
106 /* free resources */ 106 /* free resources */
107 if (NULL != ds->toplevel) 107 if (NULL != ds->toplevel)
108 GNUNET_FS_share_tree_free (ds->toplevel); 108 GNUNET_FS_share_tree_free (ds->toplevel);
109 if (GNUNET_SCHEDULER_NO_TASK != ds->stop_task) 109 if (NULL != ds->stop_task)
110 GNUNET_SCHEDULER_cancel (ds->stop_task); 110 GNUNET_SCHEDULER_cancel (ds->stop_task);
111 GNUNET_free_non_null (ds->ex_arg); 111 GNUNET_free_non_null (ds->ex_arg);
112 GNUNET_free (ds->filename_expanded); 112 GNUNET_free (ds->filename_expanded);
@@ -230,7 +230,7 @@ finish_scan (void *cls,
230{ 230{
231 struct GNUNET_FS_DirScanner *ds = cls; 231 struct GNUNET_FS_DirScanner *ds = cls;
232 232
233 ds->stop_task = GNUNET_SCHEDULER_NO_TASK; 233 ds->stop_task = NULL;
234 if (NULL != ds->helper) 234 if (NULL != ds->helper)
235 { 235 {
236 GNUNET_HELPER_stop (ds->helper, GNUNET_NO); 236 GNUNET_HELPER_stop (ds->helper, GNUNET_NO);
@@ -427,7 +427,7 @@ helper_died_cb (void *cls)
427 struct GNUNET_FS_DirScanner *ds = cls; 427 struct GNUNET_FS_DirScanner *ds = cls;
428 428
429 ds->helper = NULL; 429 ds->helper = NULL;
430 if (GNUNET_SCHEDULER_NO_TASK != ds->stop_task) 430 if (NULL != ds->stop_task)
431 return; /* normal death, was finished */ 431 return; /* normal death, was finished */
432 ds->progress_callback (ds->progress_callback_cls, 432 ds->progress_callback (ds->progress_callback_cls,
433 NULL, GNUNET_SYSERR, 433 NULL, GNUNET_SYSERR,
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index 348a0bc17..3a6072d8b 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -393,10 +393,10 @@ check_completed (struct GNUNET_FS_DownloadContext *dc)
393 GNUNET_FS_dequeue_ (dc->job_queue); 393 GNUNET_FS_dequeue_ (dc->job_queue);
394 dc->job_queue = NULL; 394 dc->job_queue = NULL;
395 } 395 }
396 if (GNUNET_SCHEDULER_NO_TASK != dc->task) 396 if (NULL != dc->task)
397 { 397 {
398 GNUNET_SCHEDULER_cancel (dc->task); 398 GNUNET_SCHEDULER_cancel (dc->task);
399 dc->task = GNUNET_SCHEDULER_NO_TASK; 399 dc->task = NULL;
400 } 400 }
401 if (NULL != dc->rfh) 401 if (NULL != dc->rfh)
402 { 402 {
@@ -1380,7 +1380,7 @@ do_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1380 struct GNUNET_FS_DownloadContext *dc = cls; 1380 struct GNUNET_FS_DownloadContext *dc = cls;
1381 struct GNUNET_CLIENT_Connection *client; 1381 struct GNUNET_CLIENT_Connection *client;
1382 1382
1383 dc->task = GNUNET_SCHEDULER_NO_TASK; 1383 dc->task = NULL;
1384 client = GNUNET_CLIENT_connect ("fs", dc->h->cfg); 1384 client = GNUNET_CLIENT_connect ("fs", dc->h->cfg);
1385 if (NULL == client) 1385 if (NULL == client)
1386 { 1386 {
@@ -1633,10 +1633,10 @@ reconstruct_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1633 struct GNUNET_FS_DownloadContext *dc = cls; 1633 struct GNUNET_FS_DownloadContext *dc = cls;
1634 1634
1635 /* clean up state from tree encoder */ 1635 /* clean up state from tree encoder */
1636 if (dc->task != GNUNET_SCHEDULER_NO_TASK) 1636 if (dc->task != NULL)
1637 { 1637 {
1638 GNUNET_SCHEDULER_cancel (dc->task); 1638 GNUNET_SCHEDULER_cancel (dc->task);
1639 dc->task = GNUNET_SCHEDULER_NO_TASK; 1639 dc->task = NULL;
1640 } 1640 }
1641 if (NULL != dc->rfh) 1641 if (NULL != dc->rfh)
1642 { 1642 {
@@ -1662,7 +1662,7 @@ get_next_block (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1662{ 1662{
1663 struct GNUNET_FS_DownloadContext *dc = cls; 1663 struct GNUNET_FS_DownloadContext *dc = cls;
1664 1664
1665 dc->task = GNUNET_SCHEDULER_NO_TASK; 1665 dc->task = NULL;
1666 GNUNET_FS_tree_encoder_next (dc->te); 1666 GNUNET_FS_tree_encoder_next (dc->te);
1667} 1667}
1668 1668
@@ -1866,7 +1866,7 @@ GNUNET_FS_download_start_task_ (void *cls,
1866 struct GNUNET_DISK_FileHandle *fh; 1866 struct GNUNET_DISK_FileHandle *fh;
1867 1867
1868 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start task running...\n"); 1868 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start task running...\n");
1869 dc->task = GNUNET_SCHEDULER_NO_TASK; 1869 dc->task = NULL;
1870 if (0 == dc->length) 1870 if (0 == dc->length)
1871 { 1871 {
1872 /* no bytes required! */ 1872 /* no bytes required! */
@@ -2028,10 +2028,10 @@ GNUNET_FS_download_signal_suspend_ (void *cls)
2028 if (NULL != dc->parent) 2028 if (NULL != dc->parent)
2029 GNUNET_CONTAINER_DLL_remove (dc->parent->child_head, dc->parent->child_tail, 2029 GNUNET_CONTAINER_DLL_remove (dc->parent->child_head, dc->parent->child_tail,
2030 dc); 2030 dc);
2031 if (GNUNET_SCHEDULER_NO_TASK != dc->task) 2031 if (NULL != dc->task)
2032 { 2032 {
2033 GNUNET_SCHEDULER_cancel (dc->task); 2033 GNUNET_SCHEDULER_cancel (dc->task);
2034 dc->task = GNUNET_SCHEDULER_NO_TASK; 2034 dc->task = NULL;
2035 } 2035 }
2036 pi.status = GNUNET_FS_STATUS_DOWNLOAD_SUSPEND; 2036 pi.status = GNUNET_FS_STATUS_DOWNLOAD_SUSPEND;
2037 GNUNET_FS_download_make_status_ (&pi, dc); 2037 GNUNET_FS_download_make_status_ (&pi, dc);
@@ -2336,10 +2336,10 @@ GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete)
2336 2336
2337 if (NULL != dc->top) 2337 if (NULL != dc->top)
2338 GNUNET_FS_end_top (dc->h, dc->top); 2338 GNUNET_FS_end_top (dc->h, dc->top);
2339 if (GNUNET_SCHEDULER_NO_TASK != dc->task) 2339 if (NULL != dc->task)
2340 { 2340 {
2341 GNUNET_SCHEDULER_cancel (dc->task); 2341 GNUNET_SCHEDULER_cancel (dc->task);
2342 dc->task = GNUNET_SCHEDULER_NO_TASK; 2342 dc->task = NULL;
2343 } 2343 }
2344 search_was_null = (NULL == dc->search); 2344 search_was_null = (NULL == dc->search);
2345 if (NULL != dc->search) 2345 if (NULL != dc->search)
diff --git a/src/fs/fs_list_indexed.c b/src/fs/fs_list_indexed.c
index 7a891155e..8c2558745 100644
--- a/src/fs/fs_list_indexed.c
+++ b/src/fs/fs_list_indexed.c
@@ -59,7 +59,7 @@ struct GNUNET_FS_GetIndexedContext
59 /** 59 /**
60 * Continuation to trigger at the end. 60 * Continuation to trigger at the end.
61 */ 61 */
62 GNUNET_SCHEDULER_Task cont; 62 GNUNET_SCHEDULER_TaskCallback cont;
63 63
64 /** 64 /**
65 * Closure for cont. 65 * Closure for cont.
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index a8a9a220f..175e453c6 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -97,7 +97,7 @@ publish_cleanup (struct GNUNET_FS_PublishContext *pc)
97 GNUNET_CLIENT_disconnect (pc->client); 97 GNUNET_CLIENT_disconnect (pc->client);
98 pc->client = NULL; 98 pc->client = NULL;
99 } 99 }
100 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task); 100 GNUNET_assert (NULL == pc->upload_task);
101 GNUNET_free (pc); 101 GNUNET_free (pc);
102} 102}
103 103
@@ -138,7 +138,7 @@ ds_put_cont (void *cls, int success,
138 GNUNET_FS_unindex_start (pc->h, pc->fi_pos->filename, NULL); 138 GNUNET_FS_unindex_start (pc->h, pc->fi_pos->filename, NULL);
139 } 139 }
140 } 140 }
141 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task); 141 GNUNET_assert (NULL == pc->upload_task);
142 pc->upload_task = 142 pc->upload_task =
143 GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, 143 GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
144 &GNUNET_FS_publish_main_, pc); 144 &GNUNET_FS_publish_main_, pc);
@@ -316,7 +316,7 @@ publish_kblocks_cont (void *cls,
316 signal_publish_error (p, pc, emsg); 316 signal_publish_error (p, pc, emsg);
317 GNUNET_FS_file_information_sync_ (p); 317 GNUNET_FS_file_information_sync_ (p);
318 GNUNET_FS_publish_sync_ (pc); 318 GNUNET_FS_publish_sync_ (pc);
319 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task); 319 GNUNET_assert (NULL == pc->upload_task);
320 pc->upload_task = 320 pc->upload_task =
321 GNUNET_SCHEDULER_add_with_priority 321 GNUNET_SCHEDULER_add_with_priority
322 (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, 322 (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
@@ -334,7 +334,7 @@ publish_kblocks_cont (void *cls,
334 else 334 else
335 pc->fi_pos = p->dir; 335 pc->fi_pos = p->dir;
336 GNUNET_FS_publish_sync_ (pc); 336 GNUNET_FS_publish_sync_ (pc);
337 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task); 337 GNUNET_assert (NULL == pc->upload_task);
338 pc->upload_task = 338 pc->upload_task =
339 GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, 339 GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
340 &GNUNET_FS_publish_main_, pc); 340 &GNUNET_FS_publish_main_, pc);
@@ -449,7 +449,7 @@ encode_cont (void *cls,
449 p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, flen); 449 p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, flen);
450 } 450 }
451 /* continue with main */ /* continue with main */ 451 /* continue with main */ /* continue with main */
452 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task); 452 GNUNET_assert (NULL == pc->upload_task);
453 pc->upload_task = 453 pc->upload_task =
454 GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, 454 GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
455 &GNUNET_FS_publish_main_, pc); 455 &GNUNET_FS_publish_main_, pc);
@@ -487,7 +487,7 @@ block_proc (void *cls,
487 if (NULL == pc->dsh) 487 if (NULL == pc->dsh)
488 { 488 {
489 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Waiting for datastore connection\n"); 489 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Waiting for datastore connection\n");
490 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task); 490 GNUNET_assert (NULL == pc->upload_task);
491 pc->upload_task = 491 pc->upload_task =
492 GNUNET_SCHEDULER_add_with_priority 492 GNUNET_SCHEDULER_add_with_priority
493 (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, &GNUNET_FS_publish_main_, pc); 493 (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, &GNUNET_FS_publish_main_, pc);
@@ -947,7 +947,7 @@ GNUNET_FS_publish_main_ (void *cls,
947 struct GNUNET_FS_FileInformation *p; 947 struct GNUNET_FS_FileInformation *p;
948 char *fn; 948 char *fn;
949 949
950 pc->upload_task = GNUNET_SCHEDULER_NO_TASK; 950 pc->upload_task = NULL;
951 p = pc->fi_pos; 951 p = pc->fi_pos;
952 if (NULL == p) 952 if (NULL == p)
953 { 953 {
@@ -1234,10 +1234,10 @@ GNUNET_FS_publish_signal_suspend_ (void *cls)
1234{ 1234{
1235 struct GNUNET_FS_PublishContext *pc = cls; 1235 struct GNUNET_FS_PublishContext *pc = cls;
1236 1236
1237 if (GNUNET_SCHEDULER_NO_TASK != pc->upload_task) 1237 if (NULL != pc->upload_task)
1238 { 1238 {
1239 GNUNET_SCHEDULER_cancel (pc->upload_task); 1239 GNUNET_SCHEDULER_cancel (pc->upload_task);
1240 pc->upload_task = GNUNET_SCHEDULER_NO_TASK; 1240 pc->upload_task = NULL;
1241 } 1241 }
1242 pc->skip_next_fi_callback = GNUNET_YES; 1242 pc->skip_next_fi_callback = GNUNET_YES;
1243 GNUNET_FS_file_information_inspect (pc->fi, &fip_signal_suspend, pc); 1243 GNUNET_FS_file_information_inspect (pc->fi, &fip_signal_suspend, pc);
@@ -1275,7 +1275,7 @@ finish_reserve (void *cls, int success,
1275 return; 1275 return;
1276 } 1276 }
1277 pc->rid = success; 1277 pc->rid = success;
1278 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task); 1278 GNUNET_assert (NULL == pc->upload_task);
1279 pc->upload_task = 1279 pc->upload_task =
1280 GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, 1280 GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
1281 &GNUNET_FS_publish_main_, pc); 1281 &GNUNET_FS_publish_main_, pc);
@@ -1373,7 +1373,7 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
1373 } 1373 }
1374 else 1374 else
1375 { 1375 {
1376 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == ret->upload_task); 1376 GNUNET_assert (NULL == ret->upload_task);
1377 ret->upload_task = 1377 ret->upload_task =
1378 GNUNET_SCHEDULER_add_with_priority 1378 GNUNET_SCHEDULER_add_with_priority
1379 (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, &GNUNET_FS_publish_main_, ret); 1379 (GNUNET_SCHEDULER_PRIORITY_BACKGROUND, &GNUNET_FS_publish_main_, ret);
@@ -1462,10 +1462,10 @@ GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc)
1462 GNUNET_FS_publish_sks_cancel (pc->sks_pc); 1462 GNUNET_FS_publish_sks_cancel (pc->sks_pc);
1463 pc->sks_pc = NULL; 1463 pc->sks_pc = NULL;
1464 } 1464 }
1465 if (GNUNET_SCHEDULER_NO_TASK != pc->upload_task) 1465 if (NULL != pc->upload_task)
1466 { 1466 {
1467 GNUNET_SCHEDULER_cancel (pc->upload_task); 1467 GNUNET_SCHEDULER_cancel (pc->upload_task);
1468 pc->upload_task = GNUNET_SCHEDULER_NO_TASK; 1468 pc->upload_task = NULL;
1469 } 1469 }
1470 pc->skip_next_fi_callback = GNUNET_YES; 1470 pc->skip_next_fi_callback = GNUNET_YES;
1471 GNUNET_FS_file_information_inspect (pc->fi, &fip_signal_stop, pc); 1471 GNUNET_FS_file_information_inspect (pc->fi, &fip_signal_stop, pc);
diff --git a/src/fs/fs_publish_ksk.c b/src/fs/fs_publish_ksk.c
index 67157f408..436bac633 100644
--- a/src/fs/fs_publish_ksk.c
+++ b/src/fs/fs_publish_ksk.c
@@ -74,7 +74,7 @@ struct GNUNET_FS_PublishKskContext
74 /** 74 /**
75 * Current task. 75 * Current task.
76 */ 76 */
77 GNUNET_SCHEDULER_TaskIdentifier ksk_task; 77 struct GNUNET_SCHEDULER_Task * ksk_task;
78 78
79 /** 79 /**
80 * Function to call once we're done. 80 * Function to call once we're done.
@@ -156,7 +156,7 @@ publish_ksk_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
156 struct GNUNET_FS_PublishKskContext *pkc = cls; 156 struct GNUNET_FS_PublishKskContext *pkc = cls;
157 const char *keyword; 157 const char *keyword;
158 158
159 pkc->ksk_task = GNUNET_SCHEDULER_NO_TASK; 159 pkc->ksk_task = NULL;
160 if ( (pkc->i == pkc->ksk_uri->data.ksk.keywordCount) || 160 if ( (pkc->i == pkc->ksk_uri->data.ksk.keywordCount) ||
161 (NULL == pkc->dsh) ) 161 (NULL == pkc->dsh) )
162 { 162 {
@@ -236,10 +236,10 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
236void 236void
237GNUNET_FS_publish_ksk_cancel (struct GNUNET_FS_PublishKskContext *pkc) 237GNUNET_FS_publish_ksk_cancel (struct GNUNET_FS_PublishKskContext *pkc)
238{ 238{
239 if (GNUNET_SCHEDULER_NO_TASK != pkc->ksk_task) 239 if (NULL != pkc->ksk_task)
240 { 240 {
241 GNUNET_SCHEDULER_cancel (pkc->ksk_task); 241 GNUNET_SCHEDULER_cancel (pkc->ksk_task);
242 pkc->ksk_task = GNUNET_SCHEDULER_NO_TASK; 242 pkc->ksk_task = NULL;
243 } 243 }
244 if (NULL != pkc->uc) 244 if (NULL != pkc->uc)
245 { 245 {
diff --git a/src/fs/fs_publish_ublock.c b/src/fs/fs_publish_ublock.c
index 4399b8c8e..1cba7a4fc 100644
--- a/src/fs/fs_publish_ublock.c
+++ b/src/fs/fs_publish_ublock.c
@@ -112,7 +112,7 @@ struct GNUNET_FS_PublishUblockContext
112 /** 112 /**
113 * Task to run continuation asynchronously. 113 * Task to run continuation asynchronously.
114 */ 114 */
115 GNUNET_SCHEDULER_TaskIdentifier task; 115 struct GNUNET_SCHEDULER_Task * task;
116 116
117}; 117};
118 118
@@ -155,7 +155,7 @@ run_cont (void *cls,
155{ 155{
156 struct GNUNET_FS_PublishUblockContext *uc = cls; 156 struct GNUNET_FS_PublishUblockContext *uc = cls;
157 157
158 uc->task = GNUNET_SCHEDULER_NO_TASK; 158 uc->task = NULL;
159 uc->cont (uc->cont_cls, NULL); 159 uc->cont (uc->cont_cls, NULL);
160 GNUNET_free (uc); 160 GNUNET_free (uc);
161} 161}
@@ -316,7 +316,7 @@ GNUNET_FS_publish_ublock_cancel_ (struct GNUNET_FS_PublishUblockContext *uc)
316{ 316{
317 if (NULL != uc->qre) 317 if (NULL != uc->qre)
318 GNUNET_DATASTORE_cancel (uc->qre); 318 GNUNET_DATASTORE_cancel (uc->qre);
319 if (GNUNET_SCHEDULER_NO_TASK != uc->task) 319 if (NULL != uc->task)
320 GNUNET_SCHEDULER_cancel (uc->task); 320 GNUNET_SCHEDULER_cancel (uc->task);
321 GNUNET_free (uc); 321 GNUNET_free (uc);
322} 322}
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index c85d6d3df..8f640009a 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -223,7 +223,7 @@ probe_failure_handler (void *cls,
223{ 223{
224 struct GNUNET_FS_SearchResult *sr = cls; 224 struct GNUNET_FS_SearchResult *sr = cls;
225 225
226 sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK; 226 sr->probe_cancel_task = NULL;
227 sr->availability_trials++; 227 sr->availability_trials++;
228 GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES); 228 GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES);
229 sr->probe_ctx = NULL; 229 sr->probe_ctx = NULL;
@@ -249,7 +249,7 @@ probe_success_handler (void *cls,
249{ 249{
250 struct GNUNET_FS_SearchResult *sr = cls; 250 struct GNUNET_FS_SearchResult *sr = cls;
251 251
252 sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK; 252 sr->probe_cancel_task = NULL;
253 sr->availability_trials++; 253 sr->availability_trials++;
254 sr->availability_success++; 254 sr->availability_success++;
255 GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES); 255 GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES);
@@ -303,34 +303,34 @@ GNUNET_FS_search_probe_progress_ (void *cls,
303 /* ignore */ 303 /* ignore */
304 break; 304 break;
305 case GNUNET_FS_STATUS_DOWNLOAD_ERROR: 305 case GNUNET_FS_STATUS_DOWNLOAD_ERROR:
306 if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task) 306 if (NULL != sr->probe_cancel_task)
307 { 307 {
308 GNUNET_SCHEDULER_cancel (sr->probe_cancel_task); 308 GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
309 sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK; 309 sr->probe_cancel_task = NULL;
310 } 310 }
311 sr->probe_cancel_task = 311 sr->probe_cancel_task =
312 GNUNET_SCHEDULER_add_delayed (sr->remaining_probe_time, 312 GNUNET_SCHEDULER_add_delayed (sr->remaining_probe_time,
313 &probe_failure_handler, sr); 313 &probe_failure_handler, sr);
314 break; 314 break;
315 case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: 315 case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
316 if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task) 316 if (NULL != sr->probe_cancel_task)
317 { 317 {
318 GNUNET_SCHEDULER_cancel (sr->probe_cancel_task); 318 GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
319 sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK; 319 sr->probe_cancel_task = NULL;
320 } 320 }
321 sr->probe_cancel_task = 321 sr->probe_cancel_task =
322 GNUNET_SCHEDULER_add_now (&probe_success_handler, sr); 322 GNUNET_SCHEDULER_add_now (&probe_success_handler, sr);
323 break; 323 break;
324 case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: 324 case GNUNET_FS_STATUS_DOWNLOAD_STOPPED:
325 if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task) 325 if (NULL != sr->probe_cancel_task)
326 { 326 {
327 GNUNET_SCHEDULER_cancel (sr->probe_cancel_task); 327 GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
328 sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK; 328 sr->probe_cancel_task = NULL;
329 } 329 }
330 sr = NULL; 330 sr = NULL;
331 break; 331 break;
332 case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE: 332 case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE:
333 if (GNUNET_SCHEDULER_NO_TASK == sr->probe_cancel_task) 333 if (NULL == sr->probe_cancel_task)
334 { 334 {
335 sr->probe_active_time = GNUNET_TIME_absolute_get (); 335 sr->probe_active_time = GNUNET_TIME_absolute_get ();
336 sr->probe_cancel_task = 336 sr->probe_cancel_task =
@@ -339,10 +339,10 @@ GNUNET_FS_search_probe_progress_ (void *cls,
339 } 339 }
340 break; 340 break;
341 case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: 341 case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE:
342 if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task) 342 if (NULL != sr->probe_cancel_task)
343 { 343 {
344 GNUNET_SCHEDULER_cancel (sr->probe_cancel_task); 344 GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
345 sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK; 345 sr->probe_cancel_task = NULL;
346 } 346 }
347 dur = GNUNET_TIME_absolute_get_duration (sr->probe_active_time); 347 dur = GNUNET_TIME_absolute_get_duration (sr->probe_active_time);
348 sr->remaining_probe_time = 348 sr->remaining_probe_time =
@@ -396,7 +396,7 @@ start_probe_ping_task (struct GNUNET_FS_SearchResult *sr)
396 GNUNET_CONTAINER_DLL_insert (h->probes_head, 396 GNUNET_CONTAINER_DLL_insert (h->probes_head,
397 h->probes_tail, 397 h->probes_tail,
398 sr); 398 sr);
399 if (GNUNET_SCHEDULER_NO_TASK == h->probe_ping_task) 399 if (NULL == h->probe_ping_task)
400 h->probe_ping_task 400 h->probe_ping_task
401 = GNUNET_SCHEDULER_add_now (&probe_ping_task_cb, 401 = GNUNET_SCHEDULER_add_now (&probe_ping_task_cb,
402 h); 402 h);
@@ -419,7 +419,7 @@ GNUNET_FS_stop_probe_ping_task_ (struct GNUNET_FS_SearchResult *sr)
419 if (NULL == h->probes_head) 419 if (NULL == h->probes_head)
420 { 420 {
421 GNUNET_SCHEDULER_cancel (h->probe_ping_task); 421 GNUNET_SCHEDULER_cancel (h->probe_ping_task);
422 h->probe_ping_task = GNUNET_SCHEDULER_NO_TASK; 422 h->probe_ping_task = NULL;
423 } 423 }
424} 424}
425 425
@@ -520,10 +520,10 @@ GNUNET_FS_search_stop_probe_ (struct GNUNET_FS_SearchResult *sr)
520 sr->probe_ctx = NULL; 520 sr->probe_ctx = NULL;
521 GNUNET_FS_stop_probe_ping_task_ (sr); 521 GNUNET_FS_stop_probe_ping_task_ (sr);
522 } 522 }
523 if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task) 523 if (NULL != sr->probe_cancel_task)
524 { 524 {
525 GNUNET_SCHEDULER_cancel (sr->probe_cancel_task); 525 GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
526 sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK; 526 sr->probe_cancel_task = NULL;
527 } 527 }
528} 528}
529 529
@@ -1253,7 +1253,7 @@ do_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1253 struct GNUNET_FS_SearchContext *sc = cls; 1253 struct GNUNET_FS_SearchContext *sc = cls;
1254 struct GNUNET_CLIENT_Connection *client; 1254 struct GNUNET_CLIENT_Connection *client;
1255 1255
1256 sc->task = GNUNET_SCHEDULER_NO_TASK; 1256 sc->task = NULL;
1257 client = GNUNET_CLIENT_connect ("fs", sc->h->cfg); 1257 client = GNUNET_CLIENT_connect ("fs", sc->h->cfg);
1258 if (NULL == client) 1258 if (NULL == client)
1259 { 1259 {
@@ -1446,10 +1446,10 @@ search_result_freeze_probes (void *cls,
1446 sr->probe_ctx = NULL; 1446 sr->probe_ctx = NULL;
1447 GNUNET_FS_stop_probe_ping_task_ (sr); 1447 GNUNET_FS_stop_probe_ping_task_ (sr);
1448 } 1448 }
1449 if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task) 1449 if (NULL != sr->probe_cancel_task)
1450 { 1450 {
1451 GNUNET_SCHEDULER_cancel (sr->probe_cancel_task); 1451 GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
1452 sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK; 1452 sr->probe_cancel_task = NULL;
1453 } 1453 }
1454 if (NULL != sr->update_search) 1454 if (NULL != sr->update_search)
1455 GNUNET_FS_search_pause (sr->update_search); 1455 GNUNET_FS_search_pause (sr->update_search);
@@ -1545,10 +1545,10 @@ GNUNET_FS_search_signal_suspend_ (void *cls)
1545 pi.status = GNUNET_FS_STATUS_SEARCH_SUSPEND; 1545 pi.status = GNUNET_FS_STATUS_SEARCH_SUSPEND;
1546 sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc); 1546 sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc);
1547 GNUNET_break (NULL == sc->client_info); 1547 GNUNET_break (NULL == sc->client_info);
1548 if (sc->task != GNUNET_SCHEDULER_NO_TASK) 1548 if (sc->task != NULL)
1549 { 1549 {
1550 GNUNET_SCHEDULER_cancel (sc->task); 1550 GNUNET_SCHEDULER_cancel (sc->task);
1551 sc->task = GNUNET_SCHEDULER_NO_TASK; 1551 sc->task = NULL;
1552 } 1552 }
1553 if (NULL != sc->client) 1553 if (NULL != sc->client)
1554 { 1554 {
@@ -1609,10 +1609,10 @@ GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc)
1609{ 1609{
1610 struct GNUNET_FS_ProgressInfo pi; 1610 struct GNUNET_FS_ProgressInfo pi;
1611 1611
1612 if (GNUNET_SCHEDULER_NO_TASK != sc->task) 1612 if (NULL != sc->task)
1613 { 1613 {
1614 GNUNET_SCHEDULER_cancel (sc->task); 1614 GNUNET_SCHEDULER_cancel (sc->task);
1615 sc->task = GNUNET_SCHEDULER_NO_TASK; 1615 sc->task = NULL;
1616 } 1616 }
1617 if (NULL != sc->client) 1617 if (NULL != sc->client)
1618 GNUNET_CLIENT_disconnect (sc->client); 1618 GNUNET_CLIENT_disconnect (sc->client);
@@ -1636,7 +1636,7 @@ GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc)
1636 struct GNUNET_FS_ProgressInfo pi; 1636 struct GNUNET_FS_ProgressInfo pi;
1637 1637
1638 GNUNET_assert (NULL == sc->client); 1638 GNUNET_assert (NULL == sc->client);
1639 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sc->task); 1639 GNUNET_assert (NULL == sc->task);
1640 do_reconnect (sc, NULL); 1640 do_reconnect (sc, NULL);
1641 GNUNET_FS_search_sync_ (sc); 1641 GNUNET_FS_search_sync_ (sc);
1642 pi.status = GNUNET_FS_STATUS_SEARCH_CONTINUED; 1642 pi.status = GNUNET_FS_STATUS_SEARCH_CONTINUED;
@@ -1721,7 +1721,7 @@ search_result_free (void *cls,
1721 GNUNET_assert (NULL == sr->update_search); 1721 GNUNET_assert (NULL == sr->update_search);
1722 } 1722 }
1723 GNUNET_break (NULL == sr->probe_ctx); 1723 GNUNET_break (NULL == sr->probe_ctx);
1724 GNUNET_break (GNUNET_SCHEDULER_NO_TASK == sr->probe_cancel_task); 1724 GNUNET_break (NULL == sr->probe_cancel_task);
1725 GNUNET_break (NULL == sr->client_info); 1725 GNUNET_break (NULL == sr->client_info);
1726 GNUNET_free_non_null (sr->serialization); 1726 GNUNET_free_non_null (sr->serialization);
1727 GNUNET_FS_uri_destroy (sr->uri); 1727 GNUNET_FS_uri_destroy (sr->uri);
@@ -1766,7 +1766,7 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc)
1766 pi.status = GNUNET_FS_STATUS_SEARCH_STOPPED; 1766 pi.status = GNUNET_FS_STATUS_SEARCH_STOPPED;
1767 sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc); 1767 sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc);
1768 GNUNET_break (NULL == sc->client_info); 1768 GNUNET_break (NULL == sc->client_info);
1769 if (GNUNET_SCHEDULER_NO_TASK != sc->task) 1769 if (NULL != sc->task)
1770 GNUNET_SCHEDULER_cancel (sc->task); 1770 GNUNET_SCHEDULER_cancel (sc->task);
1771 if (NULL != sc->client) 1771 if (NULL != sc->client)
1772 GNUNET_CLIENT_disconnect (sc->client); 1772 GNUNET_CLIENT_disconnect (sc->client);
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c
index 1e098bd60..589f979d6 100644
--- a/src/fs/fs_test_lib.c
+++ b/src/fs/fs_test_lib.c
@@ -63,7 +63,7 @@ struct TestPublishOperation
63 /** 63 /**
64 * Task to abort publishing (timeout). 64 * Task to abort publishing (timeout).
65 */ 65 */
66 GNUNET_SCHEDULER_TaskIdentifier publish_timeout_task; 66 struct GNUNET_SCHEDULER_Task * publish_timeout_task;
67 67
68 /** 68 /**
69 * Seed for file generation. 69 * Seed for file generation.
@@ -131,7 +131,7 @@ struct TestDownloadOperation
131 /** 131 /**
132 * Function to call when download is done. 132 * Function to call when download is done.
133 */ 133 */
134 GNUNET_SCHEDULER_Task download_cont; 134 GNUNET_SCHEDULER_TaskCallback download_cont;
135 135
136 /** 136 /**
137 * Closure for download_cont. 137 * Closure for download_cont.
@@ -146,7 +146,7 @@ struct TestDownloadOperation
146 /** 146 /**
147 * Task to abort downloading (timeout). 147 * Task to abort downloading (timeout).
148 */ 148 */
149 GNUNET_SCHEDULER_TaskIdentifier download_timeout_task; 149 struct GNUNET_SCHEDULER_Task * download_timeout_task;
150 150
151 /** 151 /**
152 * Context for current download operation. 152 * Context for current download operation.
@@ -215,7 +215,7 @@ publish_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
215{ 215{
216 struct TestPublishOperation *po = cls; 216 struct TestPublishOperation *po = cls;
217 217
218 po->publish_timeout_task = GNUNET_SCHEDULER_NO_TASK; 218 po->publish_timeout_task = NULL;
219 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 219 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
220 "Timeout while trying to publish data\n"); 220 "Timeout while trying to publish data\n");
221 GNUNET_TESTBED_operation_done (po->fs_op); 221 GNUNET_TESTBED_operation_done (po->fs_op);
@@ -242,7 +242,7 @@ publish_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
242 { 242 {
243 case GNUNET_FS_STATUS_PUBLISH_COMPLETED: 243 case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
244 GNUNET_SCHEDULER_cancel (po->publish_timeout_task); 244 GNUNET_SCHEDULER_cancel (po->publish_timeout_task);
245 po->publish_timeout_task = GNUNET_SCHEDULER_NO_TASK; 245 po->publish_timeout_task = NULL;
246 po->publish_uri = 246 po->publish_uri =
247 GNUNET_FS_uri_dup (info->value.publish.specifics.completed.chk_uri); 247 GNUNET_FS_uri_dup (info->value.publish.specifics.completed.chk_uri);
248 GNUNET_SCHEDULER_add_continuation (&report_uri, po, 248 GNUNET_SCHEDULER_add_continuation (&report_uri, po,
@@ -489,7 +489,7 @@ download_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
489 489
490 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 490 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
491 "Timeout while trying to download file\n"); 491 "Timeout while trying to download file\n");
492 dop->download_timeout_task = GNUNET_SCHEDULER_NO_TASK; 492 dop->download_timeout_task = NULL;
493 GNUNET_FS_download_stop (dop->download_context, GNUNET_YES); 493 GNUNET_FS_download_stop (dop->download_context, GNUNET_YES);
494 GNUNET_SCHEDULER_add_continuation (dop->download_cont, 494 GNUNET_SCHEDULER_add_continuation (dop->download_cont,
495 dop->download_cont_cls, 495 dop->download_cont_cls,
@@ -543,7 +543,7 @@ download_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
543 break; 543 break;
544 case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: 544 case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
545 GNUNET_SCHEDULER_cancel (dop->download_timeout_task); 545 GNUNET_SCHEDULER_cancel (dop->download_timeout_task);
546 dop->download_timeout_task = GNUNET_SCHEDULER_NO_TASK; 546 dop->download_timeout_task = NULL;
547 GNUNET_SCHEDULER_add_continuation (&report_success, dop, 547 GNUNET_SCHEDULER_add_continuation (&report_success, dop,
548 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 548 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
549 break; 549 break;
@@ -627,7 +627,7 @@ GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer,
627 struct GNUNET_TIME_Relative timeout, 627 struct GNUNET_TIME_Relative timeout,
628 uint32_t anonymity, uint32_t seed, 628 uint32_t anonymity, uint32_t seed,
629 const struct GNUNET_FS_Uri *uri, unsigned int verbose, 629 const struct GNUNET_FS_Uri *uri, unsigned int verbose,
630 GNUNET_SCHEDULER_Task cont, void *cont_cls) 630 GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
631{ 631{
632 struct TestDownloadOperation *dop; 632 struct TestDownloadOperation *dop;
633 633
diff --git a/src/fs/fs_test_lib.h b/src/fs/fs_test_lib.h
index 679e0745c..112ff3893 100644
--- a/src/fs/fs_test_lib.h
+++ b/src/fs/fs_test_lib.h
@@ -89,7 +89,7 @@ GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer,
89 struct GNUNET_TIME_Relative timeout, 89 struct GNUNET_TIME_Relative timeout,
90 uint32_t anonymity, uint32_t seed, 90 uint32_t anonymity, uint32_t seed,
91 const struct GNUNET_FS_Uri *uri, unsigned int verbose, 91 const struct GNUNET_FS_Uri *uri, unsigned int verbose,
92 GNUNET_SCHEDULER_Task cont, void *cont_cls); 92 GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls);
93 93
94 94
95 95
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c
index 5dc39e4e6..715ecddb1 100644
--- a/src/fs/fs_tree.c
+++ b/src/fs/fs_tree.c
@@ -63,7 +63,7 @@ struct GNUNET_FS_TreeEncoder
63 /** 63 /**
64 * Function to call once we're done with processing. 64 * Function to call once we're done with processing.
65 */ 65 */
66 GNUNET_SCHEDULER_Task cont; 66 GNUNET_SCHEDULER_TaskCallback cont;
67 67
68 /** 68 /**
69 * Set to an error message (if we had an error). 69 * Set to an error message (if we had an error).
@@ -272,7 +272,7 @@ GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size,
272 GNUNET_FS_DataReader reader, 272 GNUNET_FS_DataReader reader,
273 GNUNET_FS_TreeBlockProcessor proc, 273 GNUNET_FS_TreeBlockProcessor proc,
274 GNUNET_FS_TreeProgressCallback progress, 274 GNUNET_FS_TreeProgressCallback progress,
275 GNUNET_SCHEDULER_Task cont) 275 GNUNET_SCHEDULER_TaskCallback cont)
276{ 276{
277 struct GNUNET_FS_TreeEncoder *te; 277 struct GNUNET_FS_TreeEncoder *te;
278 278
diff --git a/src/fs/fs_tree.h b/src/fs/fs_tree.h
index cd25a6dd1..2aef80b85 100644
--- a/src/fs/fs_tree.h
+++ b/src/fs/fs_tree.h
@@ -142,7 +142,7 @@ GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size,
142 void *cls, GNUNET_FS_DataReader reader, 142 void *cls, GNUNET_FS_DataReader reader,
143 GNUNET_FS_TreeBlockProcessor proc, 143 GNUNET_FS_TreeBlockProcessor proc,
144 GNUNET_FS_TreeProgressCallback progress, 144 GNUNET_FS_TreeProgressCallback progress,
145 GNUNET_SCHEDULER_Task cont); 145 GNUNET_SCHEDULER_TaskCallback cont);
146 146
147 147
148/** 148/**
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c
index 32725f66f..c3b19b9ed 100644
--- a/src/fs/gnunet-auto-share.c
+++ b/src/fs/gnunet-auto-share.c
@@ -97,12 +97,12 @@ static int do_disable_creation_time;
97/** 97/**
98 * Handle for the 'shutdown' task. 98 * Handle for the 'shutdown' task.
99 */ 99 */
100static GNUNET_SCHEDULER_TaskIdentifier kill_task; 100static struct GNUNET_SCHEDULER_Task * kill_task;
101 101
102/** 102/**
103 * Handle for the main task that does scanning and working. 103 * Handle for the main task that does scanning and working.
104 */ 104 */
105static GNUNET_SCHEDULER_TaskIdentifier run_task; 105static struct GNUNET_SCHEDULER_Task * run_task;
106 106
107/** 107/**
108 * Anonymity level option to use for publishing. 108 * Anonymity level option to use for publishing.
@@ -322,17 +322,17 @@ save_state ()
322static void 322static void
323do_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 323do_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
324{ 324{
325 kill_task = GNUNET_SCHEDULER_NO_TASK; 325 kill_task = NULL;
326 do_shutdown = GNUNET_YES; 326 do_shutdown = GNUNET_YES;
327 if (NULL != publish_proc) 327 if (NULL != publish_proc)
328 { 328 {
329 GNUNET_OS_process_kill (publish_proc, SIGKILL); 329 GNUNET_OS_process_kill (publish_proc, SIGKILL);
330 return; 330 return;
331 } 331 }
332 if (GNUNET_SCHEDULER_NO_TASK != run_task) 332 if (NULL != run_task)
333 { 333 {
334 GNUNET_SCHEDULER_cancel (run_task); 334 GNUNET_SCHEDULER_cancel (run_task);
335 run_task = GNUNET_SCHEDULER_NO_TASK; 335 run_task = NULL;
336 } 336 }
337} 337}
338 338
@@ -363,7 +363,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
363 const struct GNUNET_DISK_FileHandle *pr; 363 const struct GNUNET_DISK_FileHandle *pr;
364 364
365 365
366 run_task = GNUNET_SCHEDULER_NO_TASK; 366 run_task = NULL;
367 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ); 367 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
368 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 368 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
369 { 369 {
@@ -457,7 +457,7 @@ work (void *cls,
457 const struct GNUNET_DISK_FileHandle *pr; 457 const struct GNUNET_DISK_FileHandle *pr;
458 int argc; 458 int argc;
459 459
460 run_task = GNUNET_SCHEDULER_NO_TASK; 460 run_task = NULL;
461 wi = work_head; 461 wi = work_head;
462 GNUNET_CONTAINER_DLL_remove (work_head, 462 GNUNET_CONTAINER_DLL_remove (work_head,
463 work_tail, 463 work_tail,
@@ -629,7 +629,7 @@ add_file (void *cls,
629static void 629static void
630scan (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 630scan (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
631{ 631{
632 run_task = GNUNET_SCHEDULER_NO_TASK; 632 run_task = NULL;
633 start_time = GNUNET_TIME_absolute_get (); 633 start_time = GNUNET_TIME_absolute_get ();
634 (void) GNUNET_DISK_directory_scan (dir_name, 634 (void) GNUNET_DISK_directory_scan (dir_name,
635 &add_file, 635 &add_file,
diff --git a/src/fs/gnunet-daemon-fsprofiler.c b/src/fs/gnunet-daemon-fsprofiler.c
index 1549972a1..9c4f28351 100644
--- a/src/fs/gnunet-daemon-fsprofiler.c
+++ b/src/fs/gnunet-daemon-fsprofiler.c
@@ -69,12 +69,12 @@ struct Pattern
69 /** 69 /**
70 * Task to run the operation. 70 * Task to run the operation.
71 */ 71 */
72 GNUNET_SCHEDULER_TaskIdentifier task; 72 struct GNUNET_SCHEDULER_Task * task;
73 73
74 /** 74 /**
75 * Secondary task to run the operation. 75 * Secondary task to run the operation.
76 */ 76 */
77 GNUNET_SCHEDULER_TaskIdentifier stask; 77 struct GNUNET_SCHEDULER_Task * stask;
78 78
79 /** 79 /**
80 * X-value. 80 * X-value.
@@ -276,7 +276,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
276 276
277 while (NULL != (p = publish_head)) 277 while (NULL != (p = publish_head))
278 { 278 {
279 if (GNUNET_SCHEDULER_NO_TASK != p->task) 279 if (NULL != p->task)
280 GNUNET_SCHEDULER_cancel (p->task); 280 GNUNET_SCHEDULER_cancel (p->task);
281 if (NULL != p->ctx) 281 if (NULL != p->ctx)
282 GNUNET_FS_publish_stop (p->ctx); 282 GNUNET_FS_publish_stop (p->ctx);
@@ -285,9 +285,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
285 } 285 }
286 while (NULL != (p = download_head)) 286 while (NULL != (p = download_head))
287 { 287 {
288 if (GNUNET_SCHEDULER_NO_TASK != p->task) 288 if (NULL != p->task)
289 GNUNET_SCHEDULER_cancel (p->task); 289 GNUNET_SCHEDULER_cancel (p->task);
290 if (GNUNET_SCHEDULER_NO_TASK != p->stask) 290 if (NULL != p->stask)
291 GNUNET_SCHEDULER_cancel (p->stask); 291 GNUNET_SCHEDULER_cancel (p->stask);
292 if (NULL != p->ctx) 292 if (NULL != p->ctx)
293 GNUNET_FS_download_stop (p->ctx, GNUNET_YES); 293 GNUNET_FS_download_stop (p->ctx, GNUNET_YES);
@@ -320,7 +320,7 @@ publish_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
320{ 320{
321 struct Pattern *p = cls; 321 struct Pattern *p = cls;
322 322
323 p->task = GNUNET_SCHEDULER_NO_TASK; 323 p->task = NULL;
324 GNUNET_FS_publish_stop (p->ctx); 324 GNUNET_FS_publish_stop (p->ctx);
325} 325}
326 326
@@ -336,7 +336,7 @@ download_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
336{ 336{
337 struct Pattern *p = cls; 337 struct Pattern *p = cls;
338 338
339 p->task = GNUNET_SCHEDULER_NO_TASK; 339 p->task = NULL;
340 GNUNET_FS_download_stop (p->ctx, GNUNET_YES); 340 GNUNET_FS_download_stop (p->ctx, GNUNET_YES);
341} 341}
342 342
@@ -352,7 +352,7 @@ search_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
352{ 352{
353 struct Pattern *p = cls; 353 struct Pattern *p = cls;
354 354
355 p->stask = GNUNET_SCHEDULER_NO_TASK; 355 p->stask = NULL;
356 GNUNET_FS_search_stop (p->sctx); 356 GNUNET_FS_search_stop (p->sctx);
357} 357}
358 358
@@ -507,7 +507,7 @@ start_publish (void *cls,
507 struct Pattern *p = cls; 507 struct Pattern *p = cls;
508 struct GNUNET_FS_FileInformation *fi; 508 struct GNUNET_FS_FileInformation *fi;
509 509
510 p->task = GNUNET_SCHEDULER_NO_TASK; 510 p->task = NULL;
511 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 511 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
512 return; 512 return;
513 fi = make_file (p->x, p->y, p); 513 fi = make_file (p->x, p->y, p);
@@ -532,7 +532,7 @@ start_download (void *cls,
532 struct Pattern *p = cls; 532 struct Pattern *p = cls;
533 struct GNUNET_FS_Uri *keywords; 533 struct GNUNET_FS_Uri *keywords;
534 534
535 p->task = GNUNET_SCHEDULER_NO_TASK; 535 p->task = NULL;
536 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 536 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
537 return; 537 return;
538 keywords = make_keywords (p->x); 538 keywords = make_keywords (p->x);
diff --git a/src/fs/gnunet-fs-profiler.c b/src/fs/gnunet-fs-profiler.c
index 56a3084cc..ba081f7cf 100644
--- a/src/fs/gnunet-fs-profiler.c
+++ b/src/fs/gnunet-fs-profiler.c
@@ -50,7 +50,7 @@ static struct GNUNET_TIME_Relative timeout;
50/** 50/**
51 * Handle to the task run during termination. 51 * Handle to the task run during termination.
52 */ 52 */
53static GNUNET_SCHEDULER_TaskIdentifier terminate_taskid; 53static struct GNUNET_SCHEDULER_Task * terminate_taskid;
54 54
55 55
56/** 56/**
@@ -115,7 +115,7 @@ static void
115terminate_task (void *cls, 115terminate_task (void *cls,
116 const struct GNUNET_SCHEDULER_TaskContext *tc) 116 const struct GNUNET_SCHEDULER_TaskContext *tc)
117{ 117{
118 terminate_taskid = GNUNET_SCHEDULER_NO_TASK; 118 terminate_taskid = NULL;
119 GNUNET_TESTBED_get_statistics (0, NULL, 119 GNUNET_TESTBED_get_statistics (0, NULL,
120 NULL, NULL, 120 NULL, NULL,
121 &process_stats, 121 &process_stats,
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index ceed3109f..2ec50b14d 100644
--- a/src/fs/gnunet-publish.c
+++ b/src/fs/gnunet-publish.c
@@ -127,7 +127,7 @@ static int do_disable_creation_time;
127/** 127/**
128 * Task run on CTRL-C to kill everything nicely. 128 * Task run on CTRL-C to kill everything nicely.
129 */ 129 */
130static GNUNET_SCHEDULER_TaskIdentifier kill_task; 130static struct GNUNET_SCHEDULER_Task * kill_task;
131 131
132/** 132/**
133 * Handle to the directory scanner (for recursive insertions). 133 * Handle to the directory scanner (for recursive insertions).
@@ -159,7 +159,7 @@ do_stop_task (void *cls,
159{ 159{
160 struct GNUNET_FS_PublishContext *p; 160 struct GNUNET_FS_PublishContext *p;
161 161
162 kill_task = GNUNET_SCHEDULER_NO_TASK; 162 kill_task = NULL;
163 if (NULL != identity) 163 if (NULL != identity)
164 { 164 {
165 GNUNET_IDENTITY_disconnect (identity); 165 GNUNET_IDENTITY_disconnect (identity);
@@ -188,7 +188,7 @@ do_stop_task (void *cls,
188static void 188static void
189stop_scanner_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 189stop_scanner_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
190{ 190{
191 kill_task = GNUNET_SCHEDULER_NO_TASK; 191 kill_task = NULL;
192 if (NULL != ds) 192 if (NULL != ds)
193 { 193 {
194 GNUNET_FS_directory_scan_abort (ds); 194 GNUNET_FS_directory_scan_abort (ds);
@@ -256,10 +256,10 @@ progress_cb (void *cls,
256 case GNUNET_FS_STATUS_PUBLISH_ERROR: 256 case GNUNET_FS_STATUS_PUBLISH_ERROR:
257 FPRINTF (stderr, _("Error publishing: %s.\n"), 257 FPRINTF (stderr, _("Error publishing: %s.\n"),
258 info->value.publish.specifics.error.message); 258 info->value.publish.specifics.error.message);
259 if (kill_task != GNUNET_SCHEDULER_NO_TASK) 259 if (kill_task != NULL)
260 { 260 {
261 GNUNET_SCHEDULER_cancel (kill_task); 261 GNUNET_SCHEDULER_cancel (kill_task);
262 kill_task = GNUNET_SCHEDULER_NO_TASK; 262 kill_task = NULL;
263 } 263 }
264 kill_task = GNUNET_SCHEDULER_add_now (&do_stop_task, NULL); 264 kill_task = GNUNET_SCHEDULER_add_now (&do_stop_task, NULL);
265 break; 265 break;
@@ -284,7 +284,7 @@ progress_cb (void *cls,
284 } 284 }
285 if (NULL == info->value.publish.pctx) 285 if (NULL == info->value.publish.pctx)
286 { 286 {
287 if (GNUNET_SCHEDULER_NO_TASK != kill_task) 287 if (NULL != kill_task)
288 GNUNET_SCHEDULER_cancel (kill_task); 288 GNUNET_SCHEDULER_cancel (kill_task);
289 kill_task = GNUNET_SCHEDULER_add_now (&do_stop_task, NULL); 289 kill_task = GNUNET_SCHEDULER_add_now (&do_stop_task, NULL);
290 } 290 }
@@ -669,10 +669,10 @@ directory_scan_cb (void *cls,
669 FPRINTF (stdout, 669 FPRINTF (stdout,
670 "%s", 670 "%s",
671 _("Internal error scanning directory.\n")); 671 _("Internal error scanning directory.\n"));
672 if (kill_task != GNUNET_SCHEDULER_NO_TASK) 672 if (kill_task != NULL)
673 { 673 {
674 GNUNET_SCHEDULER_cancel (kill_task); 674 GNUNET_SCHEDULER_cancel (kill_task);
675 kill_task = GNUNET_SCHEDULER_NO_TASK; 675 kill_task = NULL;
676 } 676 }
677 kill_task = GNUNET_SCHEDULER_add_now (&stop_scanner_task, NULL); 677 kill_task = GNUNET_SCHEDULER_add_now (&stop_scanner_task, NULL);
678 break; 678 break;
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 7c8833ce8..4d33626c2 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -167,7 +167,7 @@ static struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
167/** 167/**
168 * ID of our task that we use to age the cover counters. 168 * ID of our task that we use to age the cover counters.
169 */ 169 */
170static GNUNET_SCHEDULER_TaskIdentifier cover_age_task; 170static struct GNUNET_SCHEDULER_Task * cover_age_task;
171 171
172/** 172/**
173 * Datastore 'GET' load tracking. 173 * Datastore 'GET' load tracking.
@@ -569,10 +569,10 @@ shutdown_task (void *cls,
569 block_cfg = NULL; 569 block_cfg = NULL;
570 GNUNET_STATISTICS_destroy (GSF_stats, GNUNET_NO); 570 GNUNET_STATISTICS_destroy (GSF_stats, GNUNET_NO);
571 GSF_stats = NULL; 571 GSF_stats = NULL;
572 if (GNUNET_SCHEDULER_NO_TASK != cover_age_task) 572 if (NULL != cover_age_task)
573 { 573 {
574 GNUNET_SCHEDULER_cancel (cover_age_task); 574 GNUNET_SCHEDULER_cancel (cover_age_task);
575 cover_age_task = GNUNET_SCHEDULER_NO_TASK; 575 cover_age_task = NULL;
576 } 576 }
577 GNUNET_FS_indexing_done (); 577 GNUNET_FS_indexing_done ();
578 GNUNET_LOAD_value_free (datastore_get_load); 578 GNUNET_LOAD_value_free (datastore_get_load);
diff --git a/src/fs/gnunet-service-fs_cadet_client.c b/src/fs/gnunet-service-fs_cadet_client.c
index f0905e6c3..88014f204 100644
--- a/src/fs/gnunet-service-fs_cadet_client.c
+++ b/src/fs/gnunet-service-fs_cadet_client.c
@@ -140,14 +140,14 @@ struct CadetHandle
140 * a few seconds to give the application a chance to give 140 * a few seconds to give the application a chance to give
141 * us another query). 141 * us another query).
142 */ 142 */
143 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 143 struct GNUNET_SCHEDULER_Task * timeout_task;
144 144
145 /** 145 /**
146 * Task to reset cadets that had errors (asynchronously, 146 * Task to reset cadets that had errors (asynchronously,
147 * as we may not be able to do it immediately during a 147 * as we may not be able to do it immediately during a
148 * callback from the cadet API). 148 * callback from the cadet API).
149 */ 149 */
150 GNUNET_SCHEDULER_TaskIdentifier reset_task; 150 struct GNUNET_SCHEDULER_Task * reset_task;
151 151
152}; 152};
153 153
@@ -258,7 +258,7 @@ cadet_timeout (void *cls,
258 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 258 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
259 "Timeout on cadet channel to %s\n", 259 "Timeout on cadet channel to %s\n",
260 GNUNET_i2s (&mh->target)); 260 GNUNET_i2s (&mh->target));
261 mh->timeout_task = GNUNET_SCHEDULER_NO_TASK; 261 mh->timeout_task = NULL;
262 tun = mh->channel; 262 tun = mh->channel;
263 mh->channel = NULL; 263 mh->channel = NULL;
264 if(NULL != tun) 264 if(NULL != tun)
@@ -278,7 +278,7 @@ reset_cadet_task (void *cls,
278{ 278{
279 struct CadetHandle *mh = cls; 279 struct CadetHandle *mh = cls;
280 280
281 mh->reset_task = GNUNET_SCHEDULER_NO_TASK; 281 mh->reset_task = NULL;
282 reset_cadet (mh); 282 reset_cadet (mh);
283} 283}
284 284
@@ -292,7 +292,7 @@ reset_cadet_task (void *cls,
292static void 292static void
293reset_cadet_async (struct CadetHandle *mh) 293reset_cadet_async (struct CadetHandle *mh)
294{ 294{
295 if (GNUNET_SCHEDULER_NO_TASK != mh->reset_task) 295 if (NULL != mh->reset_task)
296 GNUNET_SCHEDULER_cancel (mh->reset_task); 296 GNUNET_SCHEDULER_cancel (mh->reset_task);
297 mh->reset_task = GNUNET_SCHEDULER_add_now (&reset_cadet_task, 297 mh->reset_task = GNUNET_SCHEDULER_add_now (&reset_cadet_task,
298 mh); 298 mh);
@@ -527,10 +527,10 @@ get_cadet (const struct GNUNET_PeerIdentity *target)
527 target); 527 target);
528 if (NULL != mh) 528 if (NULL != mh)
529 { 529 {
530 if (GNUNET_SCHEDULER_NO_TASK != mh->timeout_task) 530 if (NULL != mh->timeout_task)
531 { 531 {
532 GNUNET_SCHEDULER_cancel (mh->timeout_task); 532 GNUNET_SCHEDULER_cancel (mh->timeout_task);
533 mh->timeout_task = GNUNET_SCHEDULER_NO_TASK; 533 mh->timeout_task = NULL;
534 } 534 }
535 return mh; 535 return mh;
536 } 536 }
@@ -698,9 +698,9 @@ cleaner_cb (void *cls,
698 mh); 698 mh);
699 if (NULL != mh->wh) 699 if (NULL != mh->wh)
700 GNUNET_CADET_notify_transmit_ready_cancel (mh->wh); 700 GNUNET_CADET_notify_transmit_ready_cancel (mh->wh);
701 if (GNUNET_SCHEDULER_NO_TASK != mh->timeout_task) 701 if (NULL != mh->timeout_task)
702 GNUNET_SCHEDULER_cancel (mh->timeout_task); 702 GNUNET_SCHEDULER_cancel (mh->timeout_task);
703 if (GNUNET_SCHEDULER_NO_TASK != mh->reset_task) 703 if (NULL != mh->reset_task)
704 GNUNET_SCHEDULER_cancel (mh->reset_task); 704 GNUNET_SCHEDULER_cancel (mh->reset_task);
705 GNUNET_assert (0 == 705 GNUNET_assert (0 ==
706 GNUNET_CONTAINER_multihashmap_size (mh->waiting_map)); 706 GNUNET_CONTAINER_multihashmap_size (mh->waiting_map));
diff --git a/src/fs/gnunet-service-fs_cadet_server.c b/src/fs/gnunet-service-fs_cadet_server.c
index 6ce18afb5..74251e4b7 100644
--- a/src/fs/gnunet-service-fs_cadet_server.c
+++ b/src/fs/gnunet-service-fs_cadet_server.c
@@ -108,12 +108,12 @@ struct CadetClient
108 /** 108 /**
109 * Task that is scheduled to asynchronously terminate the connection. 109 * Task that is scheduled to asynchronously terminate the connection.
110 */ 110 */
111 GNUNET_SCHEDULER_TaskIdentifier terminate_task; 111 struct GNUNET_SCHEDULER_Task * terminate_task;
112 112
113 /** 113 /**
114 * Task that is scheduled to terminate idle connections. 114 * Task that is scheduled to terminate idle connections.
115 */ 115 */
116 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 116 struct GNUNET_SCHEDULER_Task * timeout_task;
117 117
118 /** 118 /**
119 * Size of the last write that was initiated. 119 * Size of the last write that was initiated.
@@ -163,7 +163,7 @@ timeout_cadet_task (void *cls,
163 struct CadetClient *sc = cls; 163 struct CadetClient *sc = cls;
164 struct GNUNET_CADET_Channel *tun; 164 struct GNUNET_CADET_Channel *tun;
165 165
166 sc->timeout_task = GNUNET_SCHEDULER_NO_TASK; 166 sc->timeout_task = NULL;
167 tun = sc->channel; 167 tun = sc->channel;
168 sc->channel = NULL; 168 sc->channel = NULL;
169 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 169 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -181,7 +181,7 @@ timeout_cadet_task (void *cls,
181static void 181static void
182refresh_timeout_task (struct CadetClient *sc) 182refresh_timeout_task (struct CadetClient *sc)
183{ 183{
184 if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task) 184 if (NULL != sc->timeout_task)
185 GNUNET_SCHEDULER_cancel (sc->timeout_task); 185 GNUNET_SCHEDULER_cancel (sc->timeout_task);
186 sc->timeout_task = GNUNET_SCHEDULER_add_delayed (IDLE_TIMEOUT, 186 sc->timeout_task = GNUNET_SCHEDULER_add_delayed (IDLE_TIMEOUT,
187 &timeout_cadet_task, 187 &timeout_cadet_task,
@@ -530,9 +530,9 @@ cleaner_cb (void *cls,
530 GNUNET_STATISTICS_update (GSF_stats, 530 GNUNET_STATISTICS_update (GSF_stats,
531 gettext_noop ("# cadet connections active"), -1, 531 gettext_noop ("# cadet connections active"), -1,
532 GNUNET_NO); 532 GNUNET_NO);
533 if (GNUNET_SCHEDULER_NO_TASK != sc->terminate_task) 533 if (NULL != sc->terminate_task)
534 GNUNET_SCHEDULER_cancel (sc->terminate_task); 534 GNUNET_SCHEDULER_cancel (sc->terminate_task);
535 if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task) 535 if (NULL != sc->timeout_task)
536 GNUNET_SCHEDULER_cancel (sc->timeout_task); 536 GNUNET_SCHEDULER_cancel (sc->timeout_task);
537 if (NULL != sc->wh) 537 if (NULL != sc->wh)
538 GNUNET_CADET_notify_transmit_ready_cancel (sc->wh); 538 GNUNET_CADET_notify_transmit_ready_cancel (sc->wh);
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c
index 030d8b643..8c956c274 100644
--- a/src/fs/gnunet-service-fs_cp.c
+++ b/src/fs/gnunet-service-fs_cp.c
@@ -86,7 +86,7 @@ struct GSF_PeerTransmitHandle
86 /** 86 /**
87 * Task called on timeout, or 0 for none. 87 * Task called on timeout, or 0 for none.
88 */ 88 */
89 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 89 struct GNUNET_SCHEDULER_Task * timeout_task;
90 90
91 /** 91 /**
92 * Function to call to get the actual message. 92 * Function to call to get the actual message.
@@ -155,7 +155,7 @@ struct GSF_DelayedHandle
155 /** 155 /**
156 * Task for the delay. 156 * Task for the delay.
157 */ 157 */
158 GNUNET_SCHEDULER_TaskIdentifier delay_task; 158 struct GNUNET_SCHEDULER_Task * delay_task;
159 159
160 /** 160 /**
161 * Size of the message. 161 * Size of the message.
@@ -184,7 +184,7 @@ struct PeerRequest
184 /** 184 /**
185 * Task for asynchronous stopping of this request. 185 * Task for asynchronous stopping of this request.
186 */ 186 */
187 GNUNET_SCHEDULER_TaskIdentifier kill_task; 187 struct GNUNET_SCHEDULER_Task * kill_task;
188 188
189}; 189};
190 190
@@ -209,7 +209,7 @@ struct GSF_ConnectedPeer
209 /** 209 /**
210 * Task scheduled to revive migration to this peer. 210 * Task scheduled to revive migration to this peer.
211 */ 211 */
212 GNUNET_SCHEDULER_TaskIdentifier mig_revive_task; 212 struct GNUNET_SCHEDULER_Task * mig_revive_task;
213 213
214 /** 214 /**
215 * Messages (replies, queries, content migration) we would like to 215 * Messages (replies, queries, content migration) we would like to
@@ -248,7 +248,7 @@ struct GSF_ConnectedPeer
248 /** 248 /**
249 * Task scheduled if we need to retry bandwidth reservation later. 249 * Task scheduled if we need to retry bandwidth reservation later.
250 */ 250 */
251 GNUNET_SCHEDULER_TaskIdentifier rc_delay_task; 251 struct GNUNET_SCHEDULER_Task * rc_delay_task;
252 252
253 /** 253 /**
254 * Active requests from this neighbour, map of query to 'struct PeerRequest'. 254 * Active requests from this neighbour, map of query to 'struct PeerRequest'.
@@ -472,10 +472,10 @@ peer_transmit_ready_cb (void *cls, size_t size, void *buf)
472 schedule_transmission (pth); 472 schedule_transmission (pth);
473 return 0; 473 return 0;
474 } 474 }
475 if (GNUNET_SCHEDULER_NO_TASK != pth->timeout_task) 475 if (NULL != pth->timeout_task)
476 { 476 {
477 GNUNET_SCHEDULER_cancel (pth->timeout_task); 477 GNUNET_SCHEDULER_cancel (pth->timeout_task);
478 pth->timeout_task = GNUNET_SCHEDULER_NO_TASK; 478 pth->timeout_task = NULL;
479 } 479 }
480 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth); 480 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
481 if (GNUNET_YES == pth->is_query) 481 if (GNUNET_YES == pth->is_query)
@@ -516,7 +516,7 @@ retry_reservation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
516 struct GNUNET_PeerIdentity target; 516 struct GNUNET_PeerIdentity target;
517 517
518 GNUNET_PEER_resolve (cp->ppd.pid, &target); 518 GNUNET_PEER_resolve (cp->ppd.pid, &target);
519 cp->rc_delay_task = GNUNET_SCHEDULER_NO_TASK; 519 cp->rc_delay_task = NULL;
520 cp->rc = 520 cp->rc =
521 GNUNET_ATS_reserve_bandwidth (GSF_ats, &target, DBLOCK_SIZE, 521 GNUNET_ATS_reserve_bandwidth (GSF_ats, &target, DBLOCK_SIZE,
522 &ats_reserve_callback, cp); 522 &ats_reserve_callback, cp);
@@ -652,7 +652,7 @@ revive_migration (void *cls,
652 struct GSF_ConnectedPeer *cp = cls; 652 struct GSF_ConnectedPeer *cp = cls;
653 struct GNUNET_TIME_Relative bt; 653 struct GNUNET_TIME_Relative bt;
654 654
655 cp->mig_revive_task = GNUNET_SCHEDULER_NO_TASK; 655 cp->mig_revive_task = NULL;
656 bt = GNUNET_TIME_absolute_get_remaining (cp->ppd.migration_blocked_until); 656 bt = GNUNET_TIME_absolute_get_remaining (cp->ppd.migration_blocked_until);
657 if (0 != bt.rel_value_us) 657 if (0 != bt.rel_value_us)
658 { 658 {
@@ -715,7 +715,7 @@ GSF_handle_p2p_migration_stop_ (void *cls,
715 GNUNET_i2s (other), 715 GNUNET_i2s (other),
716 GNUNET_STRINGS_relative_time_to_string (bt, GNUNET_YES)); 716 GNUNET_STRINGS_relative_time_to_string (bt, GNUNET_YES));
717 cp->ppd.migration_blocked_until = GNUNET_TIME_relative_to_absolute (bt); 717 cp->ppd.migration_blocked_until = GNUNET_TIME_relative_to_absolute (bt);
718 if (GNUNET_SCHEDULER_NO_TASK == cp->mig_revive_task) 718 if (NULL == cp->mig_revive_task)
719 { 719 {
720 GSF_push_stop_ (cp); 720 GSF_push_stop_ (cp);
721 cp->mig_revive_task = 721 cp->mig_revive_task =
@@ -773,10 +773,10 @@ free_pending_request (struct PeerRequest *peerreq,
773{ 773{
774 struct GSF_ConnectedPeer *cp = peerreq->cp; 774 struct GSF_ConnectedPeer *cp = peerreq->cp;
775 775
776 if (GNUNET_SCHEDULER_NO_TASK != peerreq->kill_task) 776 if (NULL != peerreq->kill_task)
777 { 777 {
778 GNUNET_SCHEDULER_cancel (peerreq->kill_task); 778 GNUNET_SCHEDULER_cancel (peerreq->kill_task);
779 peerreq->kill_task = GNUNET_SCHEDULER_NO_TASK; 779 peerreq->kill_task = NULL;
780 } 780 }
781 GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# P2P searches active"), 781 GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# P2P searches active"),
782 -1, GNUNET_NO); 782 -1, GNUNET_NO);
@@ -825,7 +825,7 @@ peer_request_destroy (void *cls,
825 struct GSF_PendingRequest *pr = peerreq->pr; 825 struct GSF_PendingRequest *pr = peerreq->pr;
826 struct GSF_PendingRequestData *prd; 826 struct GSF_PendingRequestData *prd;
827 827
828 peerreq->kill_task = GNUNET_SCHEDULER_NO_TASK; 828 peerreq->kill_task = NULL;
829 prd = GSF_pending_request_get_data_ (pr); 829 prd = GSF_pending_request_get_data_ (pr);
830 cancel_pending_request (NULL, &prd->query, peerreq); 830 cancel_pending_request (NULL, &prd->query, peerreq);
831} 831}
@@ -987,7 +987,7 @@ handle_p2p_reply (void *cls,
987 } 987 }
988 if (GNUNET_BLOCK_EVALUATION_OK_LAST != eval) 988 if (GNUNET_BLOCK_EVALUATION_OK_LAST != eval)
989 return; 989 return;
990 if (GNUNET_SCHEDULER_NO_TASK == peerreq->kill_task) 990 if (NULL == peerreq->kill_task)
991 { 991 {
992 GNUNET_STATISTICS_update (GSF_stats, 992 GNUNET_STATISTICS_update (GSF_stats,
993 gettext_noop 993 gettext_noop
@@ -1356,7 +1356,7 @@ peer_transmit_timeout (void *cls,
1356 1356
1357 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1357 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1358 "Timeout trying to transmit to other peer\n"); 1358 "Timeout trying to transmit to other peer\n");
1359 pth->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1359 pth->timeout_task = NULL;
1360 cp = pth->cp; 1360 cp = pth->cp;
1361 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth); 1361 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
1362 if (GNUNET_YES == pth->is_query) 1362 if (GNUNET_YES == pth->is_query)
@@ -1440,10 +1440,10 @@ GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth)
1440{ 1440{
1441 struct GSF_ConnectedPeer *cp; 1441 struct GSF_ConnectedPeer *cp;
1442 1442
1443 if (GNUNET_SCHEDULER_NO_TASK != pth->timeout_task) 1443 if (NULL != pth->timeout_task)
1444 { 1444 {
1445 GNUNET_SCHEDULER_cancel (pth->timeout_task); 1445 GNUNET_SCHEDULER_cancel (pth->timeout_task);
1446 pth->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1446 pth->timeout_task = NULL;
1447 } 1447 }
1448 cp = pth->cp; 1448 cp = pth->cp;
1449 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth); 1449 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
@@ -1586,10 +1586,10 @@ GSF_peer_disconnect_handler_ (void *cls,
1586 GNUNET_ATS_reserve_bandwidth_cancel (cp->rc); 1586 GNUNET_ATS_reserve_bandwidth_cancel (cp->rc);
1587 cp->rc = NULL; 1587 cp->rc = NULL;
1588 } 1588 }
1589 if (GNUNET_SCHEDULER_NO_TASK != cp->rc_delay_task) 1589 if (NULL != cp->rc_delay_task)
1590 { 1590 {
1591 GNUNET_SCHEDULER_cancel (cp->rc_delay_task); 1591 GNUNET_SCHEDULER_cancel (cp->rc_delay_task);
1592 cp->rc_delay_task = GNUNET_SCHEDULER_NO_TASK; 1592 cp->rc_delay_task = NULL;
1593 } 1593 }
1594 GNUNET_CONTAINER_multihashmap_iterate (cp->request_map, 1594 GNUNET_CONTAINER_multihashmap_iterate (cp->request_map,
1595 &cancel_pending_request, cp); 1595 &cancel_pending_request, cp);
@@ -1608,10 +1608,10 @@ GSF_peer_disconnect_handler_ (void *cls,
1608 GNUNET_assert (0 == cp->cth_in_progress); 1608 GNUNET_assert (0 == cp->cth_in_progress);
1609 while (NULL != (pth = cp->pth_head)) 1609 while (NULL != (pth = cp->pth_head))
1610 { 1610 {
1611 if (pth->timeout_task != GNUNET_SCHEDULER_NO_TASK) 1611 if (pth->timeout_task != NULL)
1612 { 1612 {
1613 GNUNET_SCHEDULER_cancel (pth->timeout_task); 1613 GNUNET_SCHEDULER_cancel (pth->timeout_task);
1614 pth->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1614 pth->timeout_task = NULL;
1615 } 1615 }
1616 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth); 1616 GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
1617 pth->gmc (pth->gmc_cls, 0, NULL); 1617 pth->gmc (pth->gmc_cls, 0, NULL);
@@ -1625,10 +1625,10 @@ GSF_peer_disconnect_handler_ (void *cls,
1625 GNUNET_free (dh); 1625 GNUNET_free (dh);
1626 } 1626 }
1627 GNUNET_PEER_change_rc (cp->ppd.pid, -1); 1627 GNUNET_PEER_change_rc (cp->ppd.pid, -1);
1628 if (GNUNET_SCHEDULER_NO_TASK != cp->mig_revive_task) 1628 if (NULL != cp->mig_revive_task)
1629 { 1629 {
1630 GNUNET_SCHEDULER_cancel (cp->mig_revive_task); 1630 GNUNET_SCHEDULER_cancel (cp->mig_revive_task);
1631 cp->mig_revive_task = GNUNET_SCHEDULER_NO_TASK; 1631 cp->mig_revive_task = NULL;
1632 } 1632 }
1633 GNUNET_free (cp); 1633 GNUNET_free (cp);
1634} 1634}
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c
index 6d3b761be..0bb5e3f38 100644
--- a/src/fs/gnunet-service-fs_lc.c
+++ b/src/fs/gnunet-service-fs_lc.c
@@ -59,7 +59,7 @@ struct ClientRequest
59 /** 59 /**
60 * Task scheduled to destroy the request. 60 * Task scheduled to destroy the request.
61 */ 61 */
62 GNUNET_SCHEDULER_TaskIdentifier kill_task; 62 struct GNUNET_SCHEDULER_Task * kill_task;
63 63
64}; 64};
65 65
@@ -193,7 +193,7 @@ client_request_destroy (void *cls,
193 struct ClientRequest *cr = cls; 193 struct ClientRequest *cr = cls;
194 struct GSF_LocalClient *lc; 194 struct GSF_LocalClient *lc;
195 195
196 cr->kill_task = GNUNET_SCHEDULER_NO_TASK; 196 cr->kill_task = NULL;
197 lc = cr->lc; 197 lc = cr->lc;
198 GNUNET_CONTAINER_DLL_remove (lc->cr_head, lc->cr_tail, cr); 198 GNUNET_CONTAINER_DLL_remove (lc->cr_head, lc->cr_tail, cr);
199 GSF_pending_request_cancel_ (cr->pr, GNUNET_YES); 199 GSF_pending_request_cancel_ (cr->pr, GNUNET_YES);
@@ -242,7 +242,7 @@ client_response_handler (void *cls,
242 if (NULL == data) 242 if (NULL == data)
243 { 243 {
244 /* local-only request, with no result, clean up. */ 244 /* local-only request, with no result, clean up. */
245 if (GNUNET_SCHEDULER_NO_TASK == cr->kill_task) 245 if (NULL == cr->kill_task)
246 cr->kill_task = GNUNET_SCHEDULER_add_now (&client_request_destroy, 246 cr->kill_task = GNUNET_SCHEDULER_add_now (&client_request_destroy,
247 cr); 247 cr);
248 return; 248 return;
@@ -285,7 +285,7 @@ client_response_handler (void *cls,
285 (int) eval); 285 (int) eval);
286 return; 286 return;
287 } 287 }
288 if (GNUNET_SCHEDULER_NO_TASK == cr->kill_task) 288 if (NULL == cr->kill_task)
289 cr->kill_task = GNUNET_SCHEDULER_add_now (&client_request_destroy, cr); 289 cr->kill_task = GNUNET_SCHEDULER_add_now (&client_request_destroy, cr);
290} 290}
291 291
@@ -497,7 +497,7 @@ GSF_client_disconnect_handler_ (void *cls,
497 return; 497 return;
498 while (NULL != (cr = pos->cr_head)) 498 while (NULL != (cr = pos->cr_head))
499 { 499 {
500 if (GNUNET_SCHEDULER_NO_TASK != cr->kill_task) 500 if (NULL != cr->kill_task)
501 GNUNET_SCHEDULER_cancel (cr->kill_task); 501 GNUNET_SCHEDULER_cancel (cr->kill_task);
502 client_request_destroy (cr, NULL); 502 client_request_destroy (cr, NULL);
503 } 503 }
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c
index 07b6b4d65..6b793a1e0 100644
--- a/src/fs/gnunet-service-fs_pe.c
+++ b/src/fs/gnunet-service-fs_pe.c
@@ -196,7 +196,7 @@ struct PeerPlan
196 /** 196 /**
197 * Current task for executing the plan. 197 * Current task for executing the plan.
198 */ 198 */
199 GNUNET_SCHEDULER_TaskIdentifier task; 199 struct GNUNET_SCHEDULER_Task * task;
200}; 200};
201 201
202 202
@@ -337,7 +337,7 @@ plan (struct PeerPlan *pp, struct GSF_RequestPlan *rp)
337 GNUNET_CONTAINER_multihashmap_contains_value (pp->plan_map, 337 GNUNET_CONTAINER_multihashmap_contains_value (pp->plan_map,
338 get_rp_key (rp), 338 get_rp_key (rp),
339 rp)); 339 rp));
340 if (GNUNET_SCHEDULER_NO_TASK != pp->task) 340 if (NULL != pp->task)
341 GNUNET_SCHEDULER_cancel (pp->task); 341 GNUNET_SCHEDULER_cancel (pp->task);
342 pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp); 342 pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
343#undef N 343#undef N
@@ -391,7 +391,7 @@ transmit_message_callback (void *cls, size_t buf_size, void *buf)
391 if (NULL == buf) 391 if (NULL == buf)
392 { 392 {
393 /* failed, try again... */ 393 /* failed, try again... */
394 if (GNUNET_SCHEDULER_NO_TASK != pp->task) 394 if (NULL != pp->task)
395 GNUNET_SCHEDULER_cancel (pp->task); 395 GNUNET_SCHEDULER_cancel (pp->task);
396 396
397 pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp); 397 pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
@@ -404,7 +404,7 @@ transmit_message_callback (void *cls, size_t buf_size, void *buf)
404 rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap); 404 rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap);
405 if (NULL == rp) 405 if (NULL == rp)
406 { 406 {
407 if (GNUNET_SCHEDULER_NO_TASK != pp->task) 407 if (NULL != pp->task)
408 GNUNET_SCHEDULER_cancel (pp->task); 408 GNUNET_SCHEDULER_cancel (pp->task);
409 pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp); 409 pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
410 return 0; 410 return 0;
@@ -412,7 +412,7 @@ transmit_message_callback (void *cls, size_t buf_size, void *buf)
412 msize = GSF_pending_request_get_message_ (get_latest (rp), buf_size, buf); 412 msize = GSF_pending_request_get_message_ (get_latest (rp), buf_size, buf);
413 if (msize > buf_size) 413 if (msize > buf_size)
414 { 414 {
415 if (GNUNET_SCHEDULER_NO_TASK != pp->task) 415 if (NULL != pp->task)
416 GNUNET_SCHEDULER_cancel (pp->task); 416 GNUNET_SCHEDULER_cancel (pp->task);
417 /* buffer to small (message changed), try again */ 417 /* buffer to small (message changed), try again */
418 pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp); 418 pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
@@ -451,7 +451,7 @@ schedule_peer_transmission (void *cls,
451 size_t msize; 451 size_t msize;
452 struct GNUNET_TIME_Relative delay; 452 struct GNUNET_TIME_Relative delay;
453 453
454 pp->task = GNUNET_SCHEDULER_NO_TASK; 454 pp->task = NULL;
455 if (NULL != pp->pth) 455 if (NULL != pp->pth)
456 { 456 {
457 GSF_peer_transmit_cancel_ (pp->pth); 457 GSF_peer_transmit_cancel_ (pp->pth);
@@ -661,10 +661,10 @@ GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp)
661 GSF_peer_transmit_cancel_ (pp->pth); 661 GSF_peer_transmit_cancel_ (pp->pth);
662 pp->pth = NULL; 662 pp->pth = NULL;
663 } 663 }
664 if (GNUNET_SCHEDULER_NO_TASK != pp->task) 664 if (NULL != pp->task)
665 { 665 {
666 GNUNET_SCHEDULER_cancel (pp->task); 666 GNUNET_SCHEDULER_cancel (pp->task);
667 pp->task = GNUNET_SCHEDULER_NO_TASK; 667 pp->task = NULL;
668 } 668 }
669 while (NULL != (rp = GNUNET_CONTAINER_heap_remove_root (pp->priority_heap))) 669 while (NULL != (rp = GNUNET_CONTAINER_heap_remove_root (pp->priority_heap)))
670 { 670 {
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index f809efd6c..5dc03393a 100644
--- a/src/fs/gnunet-service-fs_pr.c
+++ b/src/fs/gnunet-service-fs_pr.c
@@ -157,7 +157,7 @@ struct GSF_PendingRequest
157 /** 157 /**
158 * Task that warns us if the local datastore lookup takes too long. 158 * Task that warns us if the local datastore lookup takes too long.
159 */ 159 */
160 GNUNET_SCHEDULER_TaskIdentifier warn_task; 160 struct GNUNET_SCHEDULER_Task * warn_task;
161 161
162 /** 162 /**
163 * Current offset for querying our local datastore for results. 163 * Current offset for querying our local datastore for results.
@@ -632,10 +632,10 @@ clean_request (void *cls, const struct GNUNET_HashCode *key, void *value)
632 GNUNET_DHT_get_stop (pr->gh); 632 GNUNET_DHT_get_stop (pr->gh);
633 pr->gh = NULL; 633 pr->gh = NULL;
634 } 634 }
635 if (GNUNET_SCHEDULER_NO_TASK != pr->warn_task) 635 if (NULL != pr->warn_task)
636 { 636 {
637 GNUNET_SCHEDULER_cancel (pr->warn_task); 637 GNUNET_SCHEDULER_cancel (pr->warn_task);
638 pr->warn_task = GNUNET_SCHEDULER_NO_TASK; 638 pr->warn_task = NULL;
639 } 639 }
640 GNUNET_assert (GNUNET_OK == 640 GNUNET_assert (GNUNET_OK ==
641 GNUNET_CONTAINER_multihashmap_remove (pr_map, 641 GNUNET_CONTAINER_multihashmap_remove (pr_map,
@@ -690,10 +690,10 @@ GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, int full_cleanup)
690 GNUNET_DHT_get_stop (pr->gh); 690 GNUNET_DHT_get_stop (pr->gh);
691 pr->gh = NULL; 691 pr->gh = NULL;
692 } 692 }
693 if (GNUNET_SCHEDULER_NO_TASK != pr->warn_task) 693 if (NULL != pr->warn_task)
694 { 694 {
695 GNUNET_SCHEDULER_cancel (pr->warn_task); 695 GNUNET_SCHEDULER_cancel (pr->warn_task);
696 pr->warn_task = GNUNET_SCHEDULER_NO_TASK; 696 pr->warn_task = NULL;
697 } 697 }
698 return; 698 return;
699 } 699 }
@@ -1307,7 +1307,7 @@ process_local_reply (void *cls, const struct GNUNET_HashCode * key, size_t size,
1307 unsigned int old_rf; 1307 unsigned int old_rf;
1308 1308
1309 GNUNET_SCHEDULER_cancel (pr->warn_task); 1309 GNUNET_SCHEDULER_cancel (pr->warn_task);
1310 pr->warn_task = GNUNET_SCHEDULER_NO_TASK; 1310 pr->warn_task = NULL;
1311 if (NULL != pr->qe) 1311 if (NULL != pr->qe)
1312 { 1312 {
1313 pr->qe = NULL; 1313 pr->qe = NULL;
@@ -1514,10 +1514,10 @@ process_local_reply (void *cls, const struct GNUNET_HashCode * key, size_t size,
1514check_error_and_continue: 1514check_error_and_continue:
1515 if (NULL != pr->qe) 1515 if (NULL != pr->qe)
1516 return; 1516 return;
1517 if (GNUNET_SCHEDULER_NO_TASK != pr->warn_task) 1517 if (NULL != pr->warn_task)
1518 { 1518 {
1519 GNUNET_SCHEDULER_cancel (pr->warn_task); 1519 GNUNET_SCHEDULER_cancel (pr->warn_task);
1520 pr->warn_task = GNUNET_SCHEDULER_NO_TASK; 1520 pr->warn_task = NULL;
1521 } 1521 }
1522 if (NULL == (cont = pr->llc_cont)) 1522 if (NULL == (cont = pr->llc_cont))
1523 return; /* no continuation */ 1523 return; /* no continuation */
@@ -1620,7 +1620,7 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr,
1620 ("# Datastore lookups concluded (error queueing)"), 1620 ("# Datastore lookups concluded (error queueing)"),
1621 1, GNUNET_NO); 1621 1, GNUNET_NO);
1622 GNUNET_SCHEDULER_cancel (pr->warn_task); 1622 GNUNET_SCHEDULER_cancel (pr->warn_task);
1623 pr->warn_task = GNUNET_SCHEDULER_NO_TASK; 1623 pr->warn_task = NULL;
1624 pr->llc_cont = NULL; 1624 pr->llc_cont = NULL;
1625 if (NULL != cont) 1625 if (NULL != cont)
1626 cont (cont_cls, pr, pr->local_result); 1626 cont (cont_cls, pr, pr->local_result);
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c
index f099f7fdc..88c92828f 100644
--- a/src/fs/gnunet-service-fs_push.c
+++ b/src/fs/gnunet-service-fs_push.c
@@ -163,7 +163,7 @@ static struct GNUNET_DATASTORE_QueueEntry *mig_qe;
163/** 163/**
164 * ID of task that collects blocks for migration. 164 * ID of task that collects blocks for migration.
165 */ 165 */
166static GNUNET_SCHEDULER_TaskIdentifier mig_task; 166static struct GNUNET_SCHEDULER_Task * mig_task;
167 167
168/** 168/**
169 * What is the maximum frequency at which we are allowed to 169 * What is the maximum frequency at which we are allowed to
@@ -452,7 +452,7 @@ consider_gathering ()
452 return; 452 return;
453 if (NULL != mig_qe) 453 if (NULL != mig_qe)
454 return; 454 return;
455 if (GNUNET_SCHEDULER_NO_TASK != mig_task) 455 if (NULL != mig_task)
456 return; 456 return;
457 if (mig_size >= MAX_MIGRATION_QUEUE) 457 if (mig_size >= MAX_MIGRATION_QUEUE)
458 return; 458 return;
@@ -575,7 +575,7 @@ static void
575gather_migration_blocks (void *cls, 575gather_migration_blocks (void *cls,
576 const struct GNUNET_SCHEDULER_TaskContext *tc) 576 const struct GNUNET_SCHEDULER_TaskContext *tc)
577{ 577{
578 mig_task = GNUNET_SCHEDULER_NO_TASK; 578 mig_task = NULL;
579 if (mig_size >= MAX_MIGRATION_QUEUE) 579 if (mig_size >= MAX_MIGRATION_QUEUE)
580 return; 580 return;
581 if (NULL == GSF_dsh) 581 if (NULL == GSF_dsh)
@@ -682,10 +682,10 @@ GSF_push_init_ ()
682void 682void
683GSF_push_done_ () 683GSF_push_done_ ()
684{ 684{
685 if (GNUNET_SCHEDULER_NO_TASK != mig_task) 685 if (NULL != mig_task)
686 { 686 {
687 GNUNET_SCHEDULER_cancel (mig_task); 687 GNUNET_SCHEDULER_cancel (mig_task);
688 mig_task = GNUNET_SCHEDULER_NO_TASK; 688 mig_task = NULL;
689 } 689 }
690 if (NULL != mig_qe) 690 if (NULL != mig_qe)
691 { 691 {
diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c
index 8e9d70f72..9eef491da 100644
--- a/src/fs/gnunet-service-fs_put.c
+++ b/src/fs/gnunet-service-fs_put.c
@@ -63,7 +63,7 @@ struct PutOperator
63 /** 63 /**
64 * ID of task that collects blocks for DHT PUTs. 64 * ID of task that collects blocks for DHT PUTs.
65 */ 65 */
66 GNUNET_SCHEDULER_TaskIdentifier dht_task; 66 struct GNUNET_SCHEDULER_Task * dht_task;
67 67
68 /** 68 /**
69 * How many entires with zero anonymity of our type do we currently 69 * How many entires with zero anonymity of our type do we currently
@@ -158,7 +158,7 @@ delay_dht_put_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
158{ 158{
159 struct PutOperator *po = cls; 159 struct PutOperator *po = cls;
160 160
161 po->dht_task = GNUNET_SCHEDULER_NO_TASK; 161 po->dht_task = NULL;
162 schedule_next_put (po); 162 schedule_next_put (po);
163} 163}
164 164
@@ -219,7 +219,7 @@ gather_dht_put_blocks (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
219{ 219{
220 struct PutOperator *po = cls; 220 struct PutOperator *po = cls;
221 221
222 po->dht_task = GNUNET_SCHEDULER_NO_TASK; 222 po->dht_task = NULL;
223 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 223 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
224 return; 224 return;
225 po->dht_qe = 225 po->dht_qe =
@@ -263,10 +263,10 @@ GSF_put_done_ ()
263 i = 0; 263 i = 0;
264 while ((po = &operators[i])->dht_put_type != GNUNET_BLOCK_TYPE_ANY) 264 while ((po = &operators[i])->dht_put_type != GNUNET_BLOCK_TYPE_ANY)
265 { 265 {
266 if (GNUNET_SCHEDULER_NO_TASK != po->dht_task) 266 if (NULL != po->dht_task)
267 { 267 {
268 GNUNET_SCHEDULER_cancel (po->dht_task); 268 GNUNET_SCHEDULER_cancel (po->dht_task);
269 po->dht_task = GNUNET_SCHEDULER_NO_TASK; 269 po->dht_task = NULL;
270 } 270 }
271 if (NULL != po->dht_put) 271 if (NULL != po->dht_put)
272 { 272 {
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c
index 8dee24912..94e7e0733 100644
--- a/src/fs/test_fs_download.c
+++ b/src/fs/test_fs_download.c
@@ -57,7 +57,7 @@ static struct GNUNET_FS_DownloadContext *download;
57 57
58static struct GNUNET_FS_PublishContext *publish; 58static struct GNUNET_FS_PublishContext *publish;
59 59
60static GNUNET_SCHEDULER_TaskIdentifier timeout_kill; 60static struct GNUNET_SCHEDULER_Task * timeout_kill;
61 61
62static char *fn; 62static char *fn;
63 63
@@ -80,7 +80,7 @@ timeout_kill_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
80 publish = NULL; 80 publish = NULL;
81 } 81 }
82 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Timeout downloading file\n"); 82 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Timeout downloading file\n");
83 timeout_kill = GNUNET_SCHEDULER_NO_TASK; 83 timeout_kill = NULL;
84 err = 1; 84 err = 1;
85} 85}
86 86
@@ -120,7 +120,7 @@ abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
120 GNUNET_free (fn); 120 GNUNET_free (fn);
121 fn = NULL; 121 fn = NULL;
122 GNUNET_SCHEDULER_cancel (timeout_kill); 122 GNUNET_SCHEDULER_cancel (timeout_kill);
123 timeout_kill = GNUNET_SCHEDULER_NO_TASK; 123 timeout_kill = NULL;
124} 124}
125 125
126 126
diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c
index a9b998013..7e1f01ae7 100644
--- a/src/fs/test_fs_download_persistence.c
+++ b/src/fs/test_fs_download_persistence.c
@@ -54,7 +54,7 @@ static struct GNUNET_FS_DownloadContext *download;
54 54
55static struct GNUNET_FS_PublishContext *publish; 55static struct GNUNET_FS_PublishContext *publish;
56 56
57static GNUNET_SCHEDULER_TaskIdentifier timeout_kill; 57static struct GNUNET_SCHEDULER_Task * timeout_kill;
58 58
59static char *fn; 59static char *fn;
60 60
@@ -75,7 +75,7 @@ timeout_kill_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
75 GNUNET_FS_publish_stop (publish); 75 GNUNET_FS_publish_stop (publish);
76 publish = NULL; 76 publish = NULL;
77 } 77 }
78 timeout_kill = GNUNET_SCHEDULER_NO_TASK; 78 timeout_kill = NULL;
79 err = 1; 79 err = 1;
80} 80}
81 81
@@ -107,7 +107,7 @@ abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
107 GNUNET_free (fn); 107 GNUNET_free (fn);
108 fn = NULL; 108 fn = NULL;
109 GNUNET_SCHEDULER_cancel (timeout_kill); 109 GNUNET_SCHEDULER_cancel (timeout_kill);
110 timeout_kill = GNUNET_SCHEDULER_NO_TASK; 110 timeout_kill = NULL;
111} 111}
112 112
113 113
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c
index c78008122..461bfdcdd 100644
--- a/src/fs/test_fs_namespace.c
+++ b/src/fs/test_fs_namespace.c
@@ -41,7 +41,7 @@ static struct GNUNET_FS_SearchContext *sks_search;
41 41
42static struct GNUNET_FS_SearchContext *ksk_search; 42static struct GNUNET_FS_SearchContext *ksk_search;
43 43
44static GNUNET_SCHEDULER_TaskIdentifier kill_task; 44static struct GNUNET_SCHEDULER_Task * kill_task;
45 45
46static int update_started; 46static int update_started;
47 47
@@ -58,7 +58,7 @@ abort_ksk_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
58 if (sks_search == NULL) 58 if (sks_search == NULL)
59 { 59 {
60 GNUNET_FS_stop (fs); 60 GNUNET_FS_stop (fs);
61 if (GNUNET_SCHEDULER_NO_TASK != kill_task) 61 if (NULL != kill_task)
62 GNUNET_SCHEDULER_cancel (kill_task); 62 GNUNET_SCHEDULER_cancel (kill_task);
63 } 63 }
64 } 64 }
@@ -75,7 +75,7 @@ abort_sks_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
75 if (ksk_search == NULL) 75 if (ksk_search == NULL)
76 { 76 {
77 GNUNET_FS_stop (fs); 77 GNUNET_FS_stop (fs);
78 if (GNUNET_SCHEDULER_NO_TASK != kill_task) 78 if (NULL != kill_task)
79 GNUNET_SCHEDULER_cancel (kill_task); 79 GNUNET_SCHEDULER_cancel (kill_task);
80 } 80 }
81} 81}
@@ -86,7 +86,7 @@ do_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
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 = GNUNET_SCHEDULER_NO_TASK; 89 kill_task = NULL;
90 abort_sks_search_task (NULL, tc); 90 abort_sks_search_task (NULL, tc);
91 abort_ksk_search_task (NULL, tc); 91 abort_ksk_search_task (NULL, tc);
92} 92}
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c
index 8e5e5f53b..3c8b6e34e 100644
--- a/src/fs/test_fs_publish_persistence.c
+++ b/src/fs/test_fs_publish_persistence.c
@@ -60,7 +60,7 @@ static char *fn2;
60 60
61static int err; 61static int err;
62 62
63static GNUNET_SCHEDULER_TaskIdentifier rtask; 63static struct GNUNET_SCHEDULER_Task * rtask;
64 64
65 65
66static void 66static void
@@ -76,10 +76,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
76 fn2 = NULL; 76 fn2 = NULL;
77 GNUNET_FS_stop (fs); 77 GNUNET_FS_stop (fs);
78 fs = NULL; 78 fs = NULL;
79 if (GNUNET_SCHEDULER_NO_TASK != rtask) 79 if (NULL != rtask)
80 { 80 {
81 GNUNET_SCHEDULER_cancel (rtask); 81 GNUNET_SCHEDULER_cancel (rtask);
82 rtask = GNUNET_SCHEDULER_NO_TASK; 82 rtask = NULL;
83 } 83 }
84} 84}
85 85
@@ -91,7 +91,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event);
91static void 91static void
92restart_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 92restart_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
93{ 93{
94 rtask = GNUNET_SCHEDULER_NO_TASK; 94 rtask = NULL;
95 GNUNET_FS_stop (fs); 95 GNUNET_FS_stop (fs);
96 fs = GNUNET_FS_start (cfg, "test-fs-publish-persistence", 96 fs = GNUNET_FS_start (cfg, "test-fs-publish-persistence",
97 &progress_cb, NULL, 97 &progress_cb, NULL,
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c
index f525fb474..caf2898b2 100644
--- a/src/fs/test_fs_search.c
+++ b/src/fs/test_fs_search.c
@@ -52,7 +52,7 @@ static struct GNUNET_FS_SearchContext *search;
52 52
53static struct GNUNET_FS_PublishContext *publish; 53static struct GNUNET_FS_PublishContext *publish;
54 54
55static GNUNET_SCHEDULER_TaskIdentifier timeout_task; 55static struct GNUNET_SCHEDULER_Task * timeout_task;
56 56
57static int err; 57static int err;
58 58
@@ -65,10 +65,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
65 GNUNET_FS_publish_stop (publish); 65 GNUNET_FS_publish_stop (publish);
66 publish = NULL; 66 publish = NULL;
67 } 67 }
68 if (GNUNET_SCHEDULER_NO_TASK != timeout_task) 68 if (NULL != timeout_task)
69 { 69 {
70 GNUNET_SCHEDULER_cancel (timeout_task); 70 GNUNET_SCHEDULER_cancel (timeout_task);
71 timeout_task = GNUNET_SCHEDULER_NO_TASK; 71 timeout_task = NULL;
72 } 72 }
73} 73}
74 74
@@ -78,7 +78,7 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
78{ 78{
79 fprintf (stderr, 79 fprintf (stderr,
80 "Timeout\n"); 80 "Timeout\n");
81 timeout_task = GNUNET_SCHEDULER_NO_TASK; 81 timeout_task = NULL;
82 if (NULL != search) 82 if (NULL != search)
83 { 83 {
84 GNUNET_FS_search_stop (search); 84 GNUNET_FS_search_stop (search);
diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c
index 34ea04aca..780f21d99 100644
--- a/src/fs/test_fs_search_persistence.c
+++ b/src/fs/test_fs_search_persistence.c
@@ -54,7 +54,7 @@ static struct GNUNET_FS_PublishContext *publish;
54 54
55static const struct GNUNET_CONFIGURATION_Handle *cfg; 55static const struct GNUNET_CONFIGURATION_Handle *cfg;
56 56
57static GNUNET_SCHEDULER_TaskIdentifier timeout_task; 57static struct GNUNET_SCHEDULER_Task * timeout_task;
58 58
59static int err; 59static int err;
60 60
@@ -62,7 +62,7 @@ static int err;
62static void 62static void
63abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 63abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
64{ 64{
65 timeout_task = GNUNET_SCHEDULER_NO_TASK; 65 timeout_task = NULL;
66 fprintf (stderr, 66 fprintf (stderr,
67 "Timeout\n"); 67 "Timeout\n");
68 if (NULL != search) 68 if (NULL != search)
@@ -86,10 +86,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
86 GNUNET_FS_publish_stop (publish); 86 GNUNET_FS_publish_stop (publish);
87 publish = NULL; 87 publish = NULL;
88 } 88 }
89 if (GNUNET_SCHEDULER_NO_TASK != timeout_task) 89 if (NULL != timeout_task)
90 { 90 {
91 GNUNET_SCHEDULER_cancel (timeout_task); 91 GNUNET_SCHEDULER_cancel (timeout_task);
92 timeout_task = GNUNET_SCHEDULER_NO_TASK; 92 timeout_task = NULL;
93 } 93 }
94} 94}
95 95
diff --git a/src/fs/test_fs_search_probes.c b/src/fs/test_fs_search_probes.c
index beae34763..c7abd073f 100644
--- a/src/fs/test_fs_search_probes.c
+++ b/src/fs/test_fs_search_probes.c
@@ -53,7 +53,7 @@ static struct GNUNET_FS_SearchContext *search;
53 53
54static struct GNUNET_FS_PublishContext *publish; 54static struct GNUNET_FS_PublishContext *publish;
55 55
56static GNUNET_SCHEDULER_TaskIdentifier timeout_task; 56static struct GNUNET_SCHEDULER_Task * timeout_task;
57 57
58static int err; 58static int err;
59 59
@@ -61,7 +61,7 @@ static int err;
61static void 61static void
62abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 62abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
63{ 63{
64 timeout_task = GNUNET_SCHEDULER_NO_TASK; 64 timeout_task = NULL;
65 fprintf (stderr, 65 fprintf (stderr,
66 "Timeout\n"); 66 "Timeout\n");
67 if (NULL != search) 67 if (NULL != search)
@@ -86,10 +86,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
86 GNUNET_FS_publish_stop (publish); 86 GNUNET_FS_publish_stop (publish);
87 publish = NULL; 87 publish = NULL;
88 } 88 }
89 if (GNUNET_SCHEDULER_NO_TASK != timeout_task) 89 if (NULL != timeout_task)
90 { 90 {
91 GNUNET_SCHEDULER_cancel (timeout_task); 91 GNUNET_SCHEDULER_cancel (timeout_task);
92 timeout_task = GNUNET_SCHEDULER_NO_TASK; 92 timeout_task = NULL;
93 } 93 }
94} 94}
95 95
diff --git a/src/fs/test_fs_search_with_and.c b/src/fs/test_fs_search_with_and.c
index 80cd03213..cca0e342e 100644
--- a/src/fs/test_fs_search_with_and.c
+++ b/src/fs/test_fs_search_with_and.c
@@ -58,7 +58,7 @@ static struct GNUNET_FS_SearchContext *search;
58 58
59static struct GNUNET_FS_PublishContext *publish; 59static struct GNUNET_FS_PublishContext *publish;
60 60
61static GNUNET_SCHEDULER_TaskIdentifier timeout_task; 61static struct GNUNET_SCHEDULER_Task * timeout_task;
62 62
63static int err; 63static int err;
64 64
@@ -73,10 +73,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
73 GNUNET_FS_publish_stop (publish); 73 GNUNET_FS_publish_stop (publish);
74 publish = NULL; 74 publish = NULL;
75 } 75 }
76 if (GNUNET_SCHEDULER_NO_TASK != timeout_task) 76 if (NULL != timeout_task)
77 { 77 {
78 GNUNET_SCHEDULER_cancel (timeout_task); 78 GNUNET_SCHEDULER_cancel (timeout_task);
79 timeout_task = GNUNET_SCHEDULER_NO_TASK; 79 timeout_task = NULL;
80 } 80 }
81} 81}
82 82
@@ -86,7 +86,7 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
86{ 86{
87 fprintf (stderr, 87 fprintf (stderr,
88 "Timeout\n"); 88 "Timeout\n");
89 timeout_task = GNUNET_SCHEDULER_NO_TASK; 89 timeout_task = NULL;
90 if (NULL != search) 90 if (NULL != search)
91 { 91 {
92 GNUNET_FS_search_stop (search); 92 GNUNET_FS_search_stop (search);
diff --git a/src/gns/gns_api.c b/src/gns/gns_api.c
index 9f7f28b71..327f89976 100644
--- a/src/gns/gns_api.c
+++ b/src/gns/gns_api.c
@@ -154,7 +154,7 @@ struct GNUNET_GNS_Handle
154 /** 154 /**
155 * Reconnect task 155 * Reconnect task
156 */ 156 */
157 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 157 struct GNUNET_SCHEDULER_Task * reconnect_task;
158 158
159 /** 159 /**
160 * How long do we wait until we try to reconnect? 160 * How long do we wait until we try to reconnect?
@@ -210,7 +210,7 @@ reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
210{ 210{
211 struct GNUNET_GNS_Handle *handle = cls; 211 struct GNUNET_GNS_Handle *handle = cls;
212 212
213 handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 213 handle->reconnect_task = NULL;
214 reconnect (handle); 214 reconnect (handle);
215} 215}
216 216
@@ -484,10 +484,10 @@ GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle)
484 GNUNET_CLIENT_disconnect (handle->client); 484 GNUNET_CLIENT_disconnect (handle->client);
485 handle->client = NULL; 485 handle->client = NULL;
486 } 486 }
487 if (GNUNET_SCHEDULER_NO_TASK != handle->reconnect_task) 487 if (NULL != handle->reconnect_task)
488 { 488 {
489 GNUNET_SCHEDULER_cancel (handle->reconnect_task); 489 GNUNET_SCHEDULER_cancel (handle->reconnect_task);
490 handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 490 handle->reconnect_task = NULL;
491 } 491 }
492 GNUNET_assert (NULL == handle->lookup_head); 492 GNUNET_assert (NULL == handle->lookup_head);
493 GNUNET_free (handle); 493 GNUNET_free (handle);
diff --git a/src/gns/gnunet-bcd.c b/src/gns/gnunet-bcd.c
index 4e018c12d..200591f41 100644
--- a/src/gns/gnunet-bcd.c
+++ b/src/gns/gnunet-bcd.c
@@ -51,7 +51,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
51/** 51/**
52 * Our primary task for the HTTPD. 52 * Our primary task for the HTTPD.
53 */ 53 */
54static GNUNET_SCHEDULER_TaskIdentifier http_task; 54static struct GNUNET_SCHEDULER_Task * http_task;
55 55
56/** 56/**
57 * Our main website. 57 * Our main website.
@@ -278,7 +278,7 @@ access_handler_callback (void *cls, struct MHD_Connection *connection,
278 * Function that queries MHD's select sets and 278 * Function that queries MHD's select sets and
279 * starts the task waiting for them. 279 * starts the task waiting for them.
280 */ 280 */
281static GNUNET_SCHEDULER_TaskIdentifier 281static struct GNUNET_SCHEDULER_Task *
282prepare_daemon (struct MHD_Daemon *daemon_handle); 282prepare_daemon (struct MHD_Daemon *daemon_handle);
283 283
284 284
@@ -291,7 +291,7 @@ run_daemon (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
291{ 291{
292 struct MHD_Daemon *daemon_handle = cls; 292 struct MHD_Daemon *daemon_handle = cls;
293 293
294 http_task = GNUNET_SCHEDULER_NO_TASK; 294 http_task = NULL;
295 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 295 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
296 return; 296 return;
297 GNUNET_assert (MHD_YES == MHD_run (daemon_handle)); 297 GNUNET_assert (MHD_YES == MHD_run (daemon_handle));
@@ -303,10 +303,10 @@ run_daemon (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
303 * Function that queries MHD's select sets and 303 * Function that queries MHD's select sets and
304 * starts the task waiting for them. 304 * starts the task waiting for them.
305 */ 305 */
306static GNUNET_SCHEDULER_TaskIdentifier 306static struct GNUNET_SCHEDULER_Task *
307prepare_daemon (struct MHD_Daemon *daemon_handle) 307prepare_daemon (struct MHD_Daemon *daemon_handle)
308{ 308{
309 GNUNET_SCHEDULER_TaskIdentifier ret; 309 struct GNUNET_SCHEDULER_Task * ret;
310 fd_set rs; 310 fd_set rs;
311 fd_set ws; 311 fd_set ws;
312 fd_set es; 312 fd_set es;
@@ -389,10 +389,10 @@ server_stop (void *cls,
389{ 389{
390 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 390 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
391 "HTTP server shutdown\n"); 391 "HTTP server shutdown\n");
392 if (GNUNET_SCHEDULER_NO_TASK != http_task) 392 if (NULL != http_task)
393 { 393 {
394 GNUNET_SCHEDULER_cancel (http_task); 394 GNUNET_SCHEDULER_cancel (http_task);
395 http_task = GNUNET_SCHEDULER_NO_TASK; 395 http_task = NULL;
396 } 396 }
397 if (NULL != daemon_handle) 397 if (NULL != daemon_handle)
398 { 398 {
diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c
index bd909f938..0e347ca7e 100644
--- a/src/gns/gnunet-dns2gns.c
+++ b/src/gns/gnunet-dns2gns.c
@@ -80,7 +80,7 @@ struct Request
80 * Task run on timeout or shutdown to clean up without 80 * Task run on timeout or shutdown to clean up without
81 * response. 81 * response.
82 */ 82 */
83 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 83 struct GNUNET_SCHEDULER_Task * timeout_task;
84 84
85 /** 85 /**
86 * Number of bytes in 'addr'. 86 * Number of bytes in 'addr'.
@@ -113,12 +113,12 @@ static struct GNUNET_NETWORK_Handle *listen_socket6;
113/** 113/**
114 * Task for IPv4 socket. 114 * Task for IPv4 socket.
115 */ 115 */
116static GNUNET_SCHEDULER_TaskIdentifier t4; 116static struct GNUNET_SCHEDULER_Task * t4;
117 117
118/** 118/**
119 * Task for IPv6 socket. 119 * Task for IPv6 socket.
120 */ 120 */
121static GNUNET_SCHEDULER_TaskIdentifier t6; 121static struct GNUNET_SCHEDULER_Task * t6;
122 122
123/** 123/**
124 * DNS suffix, suffix of this gateway in DNS; defaults to '.zkey.eu' 124 * DNS suffix, suffix of this gateway in DNS; defaults to '.zkey.eu'
@@ -176,9 +176,9 @@ static void
176do_shutdown (void *cls, 176do_shutdown (void *cls,
177 const struct GNUNET_SCHEDULER_TaskContext *tc) 177 const struct GNUNET_SCHEDULER_TaskContext *tc)
178{ 178{
179 if (GNUNET_SCHEDULER_NO_TASK != t4) 179 if (NULL != t4)
180 GNUNET_SCHEDULER_cancel (t4); 180 GNUNET_SCHEDULER_cancel (t4);
181 if (GNUNET_SCHEDULER_NO_TASK != t6) 181 if (NULL != t6)
182 GNUNET_SCHEDULER_cancel (t6); 182 GNUNET_SCHEDULER_cancel (t6);
183 if (NULL != listen_socket4) 183 if (NULL != listen_socket4)
184 { 184 {
diff --git a/src/gns/gnunet-gns-proxy.c b/src/gns/gnunet-gns-proxy.c
index 93aee2004..47875281b 100644
--- a/src/gns/gnunet-gns-proxy.c
+++ b/src/gns/gnunet-gns-proxy.c
@@ -356,7 +356,7 @@ struct MhdHttpList
356 /** 356 /**
357 * The task ID 357 * The task ID
358 */ 358 */
359 GNUNET_SCHEDULER_TaskIdentifier httpd_task; 359 struct GNUNET_SCHEDULER_Task * httpd_task;
360 360
361 /** 361 /**
362 * is this an ssl daemon? 362 * is this an ssl daemon?
@@ -456,17 +456,17 @@ struct Socks5Request
456 /** 456 /**
457 * Client socket read task 457 * Client socket read task
458 */ 458 */
459 GNUNET_SCHEDULER_TaskIdentifier rtask; 459 struct GNUNET_SCHEDULER_Task * rtask;
460 460
461 /** 461 /**
462 * Client socket write task 462 * Client socket write task
463 */ 463 */
464 GNUNET_SCHEDULER_TaskIdentifier wtask; 464 struct GNUNET_SCHEDULER_Task * wtask;
465 465
466 /** 466 /**
467 * Timeout task 467 * Timeout task
468 */ 468 */
469 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 469 struct GNUNET_SCHEDULER_Task * timeout_task;
470 470
471 /** 471 /**
472 * Read buffer 472 * Read buffer
@@ -593,17 +593,17 @@ static struct GNUNET_NETWORK_Handle *lsock6;
593/** 593/**
594 * The listen task ID for IPv4 594 * The listen task ID for IPv4
595 */ 595 */
596static GNUNET_SCHEDULER_TaskIdentifier ltask4; 596static struct GNUNET_SCHEDULER_Task * ltask4;
597 597
598/** 598/**
599 * The listen task ID for IPv6 599 * The listen task ID for IPv6
600 */ 600 */
601static GNUNET_SCHEDULER_TaskIdentifier ltask6; 601static struct GNUNET_SCHEDULER_Task * ltask6;
602 602
603/** 603/**
604 * The cURL download task (curl multi API). 604 * The cURL download task (curl multi API).
605 */ 605 */
606static GNUNET_SCHEDULER_TaskIdentifier curl_download_task; 606static struct GNUNET_SCHEDULER_Task * curl_download_task;
607 607
608/** 608/**
609 * The cURL multi handle 609 * The cURL multi handle
@@ -716,11 +716,11 @@ cleanup_s5r (struct Socks5Request *s5r)
716 if ( (NULL != s5r->response) && 716 if ( (NULL != s5r->response) &&
717 (curl_failure_response != s5r->response) ) 717 (curl_failure_response != s5r->response) )
718 MHD_destroy_response (s5r->response); 718 MHD_destroy_response (s5r->response);
719 if (GNUNET_SCHEDULER_NO_TASK != s5r->rtask) 719 if (NULL != s5r->rtask)
720 GNUNET_SCHEDULER_cancel (s5r->rtask); 720 GNUNET_SCHEDULER_cancel (s5r->rtask);
721 if (GNUNET_SCHEDULER_NO_TASK != s5r->timeout_task) 721 if (NULL != s5r->timeout_task)
722 GNUNET_SCHEDULER_cancel (s5r->timeout_task); 722 GNUNET_SCHEDULER_cancel (s5r->timeout_task);
723 if (GNUNET_SCHEDULER_NO_TASK != s5r->wtask) 723 if (NULL != s5r->wtask)
724 GNUNET_SCHEDULER_cancel (s5r->wtask); 724 GNUNET_SCHEDULER_cancel (s5r->wtask);
725 if (NULL != s5r->gns_lookup) 725 if (NULL != s5r->gns_lookup)
726 GNUNET_GNS_lookup_cancel (s5r->gns_lookup); 726 GNUNET_GNS_lookup_cancel (s5r->gns_lookup);
@@ -1266,10 +1266,10 @@ curl_download_prepare ()
1266 long to; 1266 long to;
1267 struct GNUNET_TIME_Relative rtime; 1267 struct GNUNET_TIME_Relative rtime;
1268 1268
1269 if (GNUNET_SCHEDULER_NO_TASK != curl_download_task) 1269 if (NULL != curl_download_task)
1270 { 1270 {
1271 GNUNET_SCHEDULER_cancel (curl_download_task); 1271 GNUNET_SCHEDULER_cancel (curl_download_task);
1272 curl_download_task = GNUNET_SCHEDULER_NO_TASK; 1272 curl_download_task = NULL;
1273 } 1273 }
1274 max = -1; 1274 max = -1;
1275 FD_ZERO (&rs); 1275 FD_ZERO (&rs);
@@ -1327,7 +1327,7 @@ curl_task_download (void *cls,
1327 CURLMcode mret; 1327 CURLMcode mret;
1328 struct Socks5Request *s5r; 1328 struct Socks5Request *s5r;
1329 1329
1330 curl_download_task = GNUNET_SCHEDULER_NO_TASK; 1330 curl_download_task = NULL;
1331 do 1331 do
1332 { 1332 {
1333 running = 0; 1333 running = 0;
@@ -1750,7 +1750,7 @@ mhd_log_callback (void *cls,
1750 } 1750 }
1751 s5r->url = GNUNET_strdup (url); 1751 s5r->url = GNUNET_strdup (url);
1752 GNUNET_SCHEDULER_cancel (s5r->timeout_task); 1752 GNUNET_SCHEDULER_cancel (s5r->timeout_task);
1753 s5r->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1753 s5r->timeout_task = NULL;
1754 return s5r; 1754 return s5r;
1755 } 1755 }
1756 } 1756 }
@@ -1772,10 +1772,10 @@ kill_httpd (struct MhdHttpList *hd)
1772 hd); 1772 hd);
1773 GNUNET_free_non_null (hd->domain); 1773 GNUNET_free_non_null (hd->domain);
1774 MHD_stop_daemon (hd->daemon); 1774 MHD_stop_daemon (hd->daemon);
1775 if (GNUNET_SCHEDULER_NO_TASK != hd->httpd_task) 1775 if (NULL != hd->httpd_task)
1776 { 1776 {
1777 GNUNET_SCHEDULER_cancel (hd->httpd_task); 1777 GNUNET_SCHEDULER_cancel (hd->httpd_task);
1778 hd->httpd_task = GNUNET_SCHEDULER_NO_TASK; 1778 hd->httpd_task = NULL;
1779 } 1779 }
1780 GNUNET_free_non_null (hd->proxy_cert); 1780 GNUNET_free_non_null (hd->proxy_cert);
1781 if (hd == httpd) 1781 if (hd == httpd)
@@ -1796,7 +1796,7 @@ kill_httpd_task (void *cls,
1796{ 1796{
1797 struct MhdHttpList *hd = cls; 1797 struct MhdHttpList *hd = cls;
1798 1798
1799 hd->httpd_task = GNUNET_SCHEDULER_NO_TASK; 1799 hd->httpd_task = NULL;
1800 kill_httpd (hd); 1800 kill_httpd (hd);
1801} 1801}
1802 1802
@@ -1858,7 +1858,7 @@ schedule_httpd (struct MhdHttpList *hd)
1858 wrs = NULL; 1858 wrs = NULL;
1859 wws = NULL; 1859 wws = NULL;
1860 } 1860 }
1861 if (GNUNET_SCHEDULER_NO_TASK != hd->httpd_task) 1861 if (NULL != hd->httpd_task)
1862 GNUNET_SCHEDULER_cancel (hd->httpd_task); 1862 GNUNET_SCHEDULER_cancel (hd->httpd_task);
1863 if ( (MHD_YES != haveto) && 1863 if ( (MHD_YES != haveto) &&
1864 (-1 == max) && 1864 (-1 == max) &&
@@ -1895,7 +1895,7 @@ do_httpd (void *cls,
1895{ 1895{
1896 struct MhdHttpList *hd = cls; 1896 struct MhdHttpList *hd = cls;
1897 1897
1898 hd->httpd_task = GNUNET_SCHEDULER_NO_TASK; 1898 hd->httpd_task = NULL;
1899 MHD_run (hd->daemon); 1899 MHD_run (hd->daemon);
1900 schedule_httpd (hd); 1900 schedule_httpd (hd);
1901} 1901}
@@ -1909,7 +1909,7 @@ do_httpd (void *cls,
1909static void 1909static void
1910run_mhd_now (struct MhdHttpList *hd) 1910run_mhd_now (struct MhdHttpList *hd)
1911{ 1911{
1912 if (GNUNET_SCHEDULER_NO_TASK != 1912 if (NULL !=
1913 hd->httpd_task) 1913 hd->httpd_task)
1914 GNUNET_SCHEDULER_cancel (hd->httpd_task); 1914 GNUNET_SCHEDULER_cancel (hd->httpd_task);
1915 hd->httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd, 1915 hd->httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd,
@@ -2146,7 +2146,7 @@ timeout_s5r_handshake (void *cls,
2146{ 2146{
2147 struct Socks5Request *s5r = cls; 2147 struct Socks5Request *s5r = cls;
2148 2148
2149 s5r->timeout_task = GNUNET_SCHEDULER_NO_TASK; 2149 s5r->timeout_task = NULL;
2150 cleanup_s5r (s5r); 2150 cleanup_s5r (s5r);
2151} 2151}
2152 2152
@@ -2221,7 +2221,7 @@ do_write (void *cls,
2221 struct Socks5Request *s5r = cls; 2221 struct Socks5Request *s5r = cls;
2222 ssize_t len; 2222 ssize_t len;
2223 2223
2224 s5r->wtask = GNUNET_SCHEDULER_NO_TASK; 2224 s5r->wtask = NULL;
2225 len = GNUNET_NETWORK_socket_send (s5r->sock, 2225 len = GNUNET_NETWORK_socket_send (s5r->sock,
2226 s5r->wbuf, 2226 s5r->wbuf,
2227 s5r->wbuf_len); 2227 s5r->wbuf_len);
@@ -2253,7 +2253,7 @@ do_write (void *cls,
2253 GNUNET_assert (0); 2253 GNUNET_assert (0);
2254 break; 2254 break;
2255 case SOCKS5_REQUEST: 2255 case SOCKS5_REQUEST:
2256 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != s5r->rtask); 2256 GNUNET_assert (NULL != s5r->rtask);
2257 break; 2257 break;
2258 case SOCKS5_DATA_TRANSFER: 2258 case SOCKS5_DATA_TRANSFER:
2259 setup_data_transfer (s5r); 2259 setup_data_transfer (s5r);
@@ -2285,7 +2285,7 @@ signal_socks_failure (struct Socks5Request *s5r,
2285 s_resp->version = SOCKS_VERSION_5; 2285 s_resp->version = SOCKS_VERSION_5;
2286 s_resp->reply = sc; 2286 s_resp->reply = sc;
2287 s5r->state = SOCKS5_WRITE_THEN_CLEANUP; 2287 s5r->state = SOCKS5_WRITE_THEN_CLEANUP;
2288 if (GNUNET_SCHEDULER_NO_TASK != s5r->wtask) 2288 if (NULL != s5r->wtask)
2289 s5r->wtask = 2289 s5r->wtask =
2290 GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL, 2290 GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
2291 s5r->sock, 2291 s5r->sock,
@@ -2314,7 +2314,7 @@ signal_socks_success (struct Socks5Request *s5r)
2314 sizeof (struct in_addr) + sizeof (uint16_t)); 2314 sizeof (struct in_addr) + sizeof (uint16_t));
2315 s5r->wbuf_len += sizeof (struct Socks5ServerResponseMessage) + 2315 s5r->wbuf_len += sizeof (struct Socks5ServerResponseMessage) +
2316 sizeof (struct in_addr) + sizeof (uint16_t); 2316 sizeof (struct in_addr) + sizeof (uint16_t);
2317 if (GNUNET_SCHEDULER_NO_TASK == s5r->wtask) 2317 if (NULL == s5r->wtask)
2318 s5r->wtask = 2318 s5r->wtask =
2319 GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL, 2319 GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
2320 s5r->sock, 2320 s5r->sock,
@@ -2482,7 +2482,7 @@ do_s5r_read (void *cls,
2482 ssize_t rlen; 2482 ssize_t rlen;
2483 size_t alen; 2483 size_t alen;
2484 2484
2485 s5r->rtask = GNUNET_SCHEDULER_NO_TASK; 2485 s5r->rtask = NULL;
2486 if ( (NULL != tc->read_ready) && 2486 if ( (NULL != tc->read_ready) &&
2487 (GNUNET_NETWORK_fdset_isset (tc->read_ready, s5r->sock)) ) 2487 (GNUNET_NETWORK_fdset_isset (tc->read_ready, s5r->sock)) )
2488 { 2488 {
@@ -2527,7 +2527,7 @@ do_s5r_read (void *cls,
2527 s5r->wbuf_len = sizeof (struct Socks5ServerHelloMessage); 2527 s5r->wbuf_len = sizeof (struct Socks5ServerHelloMessage);
2528 s_hello->version = SOCKS_VERSION_5; 2528 s_hello->version = SOCKS_VERSION_5;
2529 s_hello->auth_method = SOCKS_AUTH_NONE; 2529 s_hello->auth_method = SOCKS_AUTH_NONE;
2530 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == s5r->wtask); 2530 GNUNET_assert (NULL == s5r->wtask);
2531 s5r->wtask = GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL, 2531 s5r->wtask = GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
2532 s5r->sock, 2532 s5r->sock,
2533 &do_write, s5r); 2533 &do_write, s5r);
@@ -2666,7 +2666,7 @@ do_s5r_read (void *cls,
2666 } 2666 }
2667 /* We are done reading right now */ 2667 /* We are done reading right now */
2668 GNUNET_SCHEDULER_cancel (s5r->rtask); 2668 GNUNET_SCHEDULER_cancel (s5r->rtask);
2669 s5r->rtask = GNUNET_SCHEDULER_NO_TASK; 2669 s5r->rtask = NULL;
2670 return; 2670 return;
2671 case SOCKS5_RESOLVING: 2671 case SOCKS5_RESOLVING:
2672 GNUNET_assert (0); 2672 GNUNET_assert (0);
@@ -2696,9 +2696,9 @@ do_accept (void *cls,
2696 struct Socks5Request *s5r; 2696 struct Socks5Request *s5r;
2697 2697
2698 if (lsock == lsock4) 2698 if (lsock == lsock4)
2699 ltask4 = GNUNET_SCHEDULER_NO_TASK; 2699 ltask4 = NULL;
2700 else 2700 else
2701 ltask6 = GNUNET_SCHEDULER_NO_TASK; 2701 ltask6 = NULL;
2702 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 2702 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
2703 return; 2703 return;
2704 if (lsock == lsock4) 2704 if (lsock == lsock4)
@@ -2778,20 +2778,20 @@ do_shutdown (void *cls,
2778 GNUNET_GNS_disconnect (gns_handle); 2778 GNUNET_GNS_disconnect (gns_handle);
2779 gns_handle = NULL; 2779 gns_handle = NULL;
2780 } 2780 }
2781 if (GNUNET_SCHEDULER_NO_TASK != curl_download_task) 2781 if (NULL != curl_download_task)
2782 { 2782 {
2783 GNUNET_SCHEDULER_cancel (curl_download_task); 2783 GNUNET_SCHEDULER_cancel (curl_download_task);
2784 curl_download_task = GNUNET_SCHEDULER_NO_TASK; 2784 curl_download_task = NULL;
2785 } 2785 }
2786 if (GNUNET_SCHEDULER_NO_TASK != ltask4) 2786 if (NULL != ltask4)
2787 { 2787 {
2788 GNUNET_SCHEDULER_cancel (ltask4); 2788 GNUNET_SCHEDULER_cancel (ltask4);
2789 ltask4 = GNUNET_SCHEDULER_NO_TASK; 2789 ltask4 = NULL;
2790 } 2790 }
2791 if (GNUNET_SCHEDULER_NO_TASK != ltask6) 2791 if (NULL != ltask6)
2792 { 2792 {
2793 GNUNET_SCHEDULER_cancel (ltask6); 2793 GNUNET_SCHEDULER_cancel (ltask6);
2794 ltask6 = GNUNET_SCHEDULER_NO_TASK; 2794 ltask6 = NULL;
2795 } 2795 }
2796 gnutls_x509_crt_deinit (proxy_ca.cert); 2796 gnutls_x509_crt_deinit (proxy_ca.cert);
2797 gnutls_x509_privkey_deinit (proxy_ca.key); 2797 gnutls_x509_privkey_deinit (proxy_ca.key);
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c
index 57cdbc5f5..d95c28450 100644
--- a/src/gns/gnunet-service-gns.c
+++ b/src/gns/gnunet-service-gns.c
@@ -218,7 +218,7 @@ static struct GNUNET_TIME_Relative zone_publish_time_window;
218/** 218/**
219 * zone publish task 219 * zone publish task
220 */ 220 */
221static GNUNET_SCHEDULER_TaskIdentifier zone_publish_task; 221static struct GNUNET_SCHEDULER_Task * zone_publish_task;
222 222
223/** 223/**
224 * #GNUNET_YES if zone has never been published before 224 * #GNUNET_YES if zone has never been published before
@@ -281,10 +281,10 @@ shutdown_task (void *cls,
281 GNUNET_STATISTICS_destroy (statistics, GNUNET_NO); 281 GNUNET_STATISTICS_destroy (statistics, GNUNET_NO);
282 statistics = NULL; 282 statistics = NULL;
283 } 283 }
284 if (GNUNET_SCHEDULER_NO_TASK != zone_publish_task) 284 if (NULL != zone_publish_task)
285 { 285 {
286 GNUNET_SCHEDULER_cancel (zone_publish_task); 286 GNUNET_SCHEDULER_cancel (zone_publish_task);
287 zone_publish_task = GNUNET_SCHEDULER_NO_TASK; 287 zone_publish_task = NULL;
288 } 288 }
289 if (NULL != namestore_iter) 289 if (NULL != namestore_iter)
290 { 290 {
@@ -329,7 +329,7 @@ static void
329publish_zone_dht_next (void *cls, 329publish_zone_dht_next (void *cls,
330 const struct GNUNET_SCHEDULER_TaskContext *tc) 330 const struct GNUNET_SCHEDULER_TaskContext *tc)
331{ 331{
332 zone_publish_task = GNUNET_SCHEDULER_NO_TASK; 332 zone_publish_task = NULL;
333 GNUNET_NAMESTORE_zone_iterator_next (namestore_iter); 333 GNUNET_NAMESTORE_zone_iterator_next (namestore_iter);
334} 334}
335 335
@@ -609,7 +609,7 @@ static void
609publish_zone_dht_start (void *cls, 609publish_zone_dht_start (void *cls,
610 const struct GNUNET_SCHEDULER_TaskContext *tc) 610 const struct GNUNET_SCHEDULER_TaskContext *tc)
611{ 611{
612 zone_publish_task = GNUNET_SCHEDULER_NO_TASK; 612 zone_publish_task = NULL;
613 613
614 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 614 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
615 "Starting DHT zone update!\n"); 615 "Starting DHT zone update!\n");
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index 897a8b218..9e901f60c 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -334,7 +334,7 @@ struct GNS_ResolverHandle
334 /** 334 /**
335 * ID of a task associated with the resolution process. 335 * ID of a task associated with the resolution process.
336 */ 336 */
337 GNUNET_SCHEDULER_TaskIdentifier task_id; 337 struct GNUNET_SCHEDULER_Task * task_id;
338 338
339 /** 339 /**
340 * The name to resolve 340 * The name to resolve
@@ -549,7 +549,7 @@ fail_resolution (void *cls,
549{ 549{
550 struct GNS_ResolverHandle *rh = cls; 550 struct GNS_ResolverHandle *rh = cls;
551 551
552 rh->task_id = GNUNET_SCHEDULER_NO_TASK; 552 rh->task_id = NULL;
553 rh->proc (rh->proc_cls, 0, NULL); 553 rh->proc (rh->proc_cls, 0, NULL);
554 GNS_resolver_lookup_cancel (rh); 554 GNS_resolver_lookup_cancel (rh);
555} 555}
@@ -845,7 +845,7 @@ dns_result_parser (void *cls,
845 845
846 rh->dns_request = NULL; 846 rh->dns_request = NULL;
847 GNUNET_SCHEDULER_cancel (rh->task_id); 847 GNUNET_SCHEDULER_cancel (rh->task_id);
848 rh->task_id = GNUNET_SCHEDULER_NO_TASK; 848 rh->task_id = NULL;
849 p = GNUNET_DNSPARSER_parse ((const char *) dns, 849 p = GNUNET_DNSPARSER_parse ((const char *) dns,
850 dns_len); 850 dns_len);
851 if (NULL == p) 851 if (NULL == p)
@@ -2232,7 +2232,7 @@ recursive_resolution (void *cls,
2232{ 2232{
2233 struct GNS_ResolverHandle *rh = cls; 2233 struct GNS_ResolverHandle *rh = cls;
2234 2234
2235 rh->task_id = GNUNET_SCHEDULER_NO_TASK; 2235 rh->task_id = NULL;
2236 if (MAX_RECURSION < rh->loop_limiter++) 2236 if (MAX_RECURSION < rh->loop_limiter++)
2237 { 2237 {
2238 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 2238 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -2456,10 +2456,10 @@ GNS_resolver_lookup_cancel (struct GNS_ResolverHandle *rh)
2456 GNUNET_free (rh->g2dc); 2456 GNUNET_free (rh->g2dc);
2457 rh->g2dc = NULL; 2457 rh->g2dc = NULL;
2458 } 2458 }
2459 if (GNUNET_SCHEDULER_NO_TASK != rh->task_id) 2459 if (NULL != rh->task_id)
2460 { 2460 {
2461 GNUNET_SCHEDULER_cancel (rh->task_id); 2461 GNUNET_SCHEDULER_cancel (rh->task_id);
2462 rh->task_id = GNUNET_SCHEDULER_NO_TASK; 2462 rh->task_id = NULL;
2463 } 2463 }
2464 if (NULL != rh->get_handle) 2464 if (NULL != rh->get_handle)
2465 { 2465 {
diff --git a/src/gns/gnunet-service-gns_shorten.c b/src/gns/gnunet-service-gns_shorten.c
index 34dcd42f6..f744c3d6f 100644
--- a/src/gns/gnunet-service-gns_shorten.c
+++ b/src/gns/gnunet-service-gns_shorten.c
@@ -106,7 +106,7 @@ struct GetPseuAuthorityHandle
106 /** 106 /**
107 * Task to abort DHT lookup operation. 107 * Task to abort DHT lookup operation.
108 */ 108 */
109 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 109 struct GNUNET_SCHEDULER_Task * timeout_task;
110 110
111}; 111};
112 112
@@ -160,10 +160,10 @@ free_get_pseu_authority_handle (struct GetPseuAuthorityHandle *gph)
160 GNUNET_NAMECACHE_cancel (gph->namecache_task); 160 GNUNET_NAMECACHE_cancel (gph->namecache_task);
161 gph->namecache_task = NULL; 161 gph->namecache_task = NULL;
162 } 162 }
163 if (GNUNET_SCHEDULER_NO_TASK != gph->timeout_task) 163 if (NULL != gph->timeout_task)
164 { 164 {
165 GNUNET_SCHEDULER_cancel (gph->timeout_task); 165 GNUNET_SCHEDULER_cancel (gph->timeout_task);
166 gph->timeout_task = GNUNET_SCHEDULER_NO_TASK; 166 gph->timeout_task = NULL;
167 } 167 }
168 GNUNET_CONTAINER_DLL_remove (gph_head, gph_tail, gph); 168 GNUNET_CONTAINER_DLL_remove (gph_head, gph_tail, gph);
169 GNUNET_free_non_null (gph->current_label); 169 GNUNET_free_non_null (gph->current_label);
diff --git a/src/gns/test_gns_proxy.c b/src/gns/test_gns_proxy.c
index 9e2c29fb4..1f7cc7d93 100644
--- a/src/gns/test_gns_proxy.c
+++ b/src/gns/test_gns_proxy.c
@@ -45,9 +45,9 @@ static struct GNUNET_NAMESTORE_Handle *namestore;
45 45
46static struct MHD_Daemon *mhd; 46static struct MHD_Daemon *mhd;
47 47
48static GNUNET_SCHEDULER_TaskIdentifier mhd_task_id; 48static struct GNUNET_SCHEDULER_Task * mhd_task_id;
49 49
50static GNUNET_SCHEDULER_TaskIdentifier curl_task_id; 50static struct GNUNET_SCHEDULER_Task * curl_task_id;
51 51
52static CURL *curl; 52static CURL *curl;
53 53
@@ -117,15 +117,15 @@ mhd_ahc (void *cls,
117static void 117static void
118do_shutdown () 118do_shutdown ()
119{ 119{
120 if (mhd_task_id != GNUNET_SCHEDULER_NO_TASK) 120 if (mhd_task_id != NULL)
121 { 121 {
122 GNUNET_SCHEDULER_cancel (mhd_task_id); 122 GNUNET_SCHEDULER_cancel (mhd_task_id);
123 mhd_task_id = GNUNET_SCHEDULER_NO_TASK; 123 mhd_task_id = NULL;
124 } 124 }
125 if (curl_task_id != GNUNET_SCHEDULER_NO_TASK) 125 if (curl_task_id != NULL)
126 { 126 {
127 GNUNET_SCHEDULER_cancel (curl_task_id); 127 GNUNET_SCHEDULER_cancel (curl_task_id);
128 curl_task_id = GNUNET_SCHEDULER_NO_TASK; 128 curl_task_id = NULL;
129 } 129 }
130 if (NULL != mhd) 130 if (NULL != mhd)
131 { 131 {
@@ -164,7 +164,7 @@ static void
164curl_task (void *cls, 164curl_task (void *cls,
165 const struct GNUNET_SCHEDULER_TaskContext *tc) 165 const struct GNUNET_SCHEDULER_TaskContext *tc)
166{ 166{
167 curl_task_id = GNUNET_SCHEDULER_NO_TASK; 167 curl_task_id = NULL;
168 curl_main (); 168 curl_main ();
169} 169}
170 170
@@ -314,7 +314,7 @@ static void
314mhd_task (void *cls, 314mhd_task (void *cls,
315 const struct GNUNET_SCHEDULER_TaskContext *tc) 315 const struct GNUNET_SCHEDULER_TaskContext *tc)
316{ 316{
317 mhd_task_id = GNUNET_SCHEDULER_NO_TASK; 317 mhd_task_id = NULL;
318 MHD_run (mhd); 318 MHD_run (mhd);
319 mhd_main (); 319 mhd_main ();
320} 320}
@@ -332,7 +332,7 @@ mhd_main ()
332 unsigned MHD_LONG_LONG timeout; 332 unsigned MHD_LONG_LONG timeout;
333 struct GNUNET_TIME_Relative delay; 333 struct GNUNET_TIME_Relative delay;
334 334
335 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == mhd_task_id); 335 GNUNET_assert (NULL == mhd_task_id);
336 FD_ZERO (&rs); 336 FD_ZERO (&rs);
337 FD_ZERO (&ws); 337 FD_ZERO (&ws);
338 FD_ZERO (&es); 338 FD_ZERO (&es);
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index 62ecc5dfd..833f24ece 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -275,16 +275,24 @@ run (void *cls,
275 return; 275 return;
276 } 276 }
277 stats = GNUNET_STATISTICS_create ("hostlist", cfg); 277 stats = GNUNET_STATISTICS_create ("hostlist", cfg);
278 if (NULL == stats)
279 {
280 GNUNET_break (0);
281 return;
282 }
278 if (bootstrapping) 283 if (bootstrapping)
279 GNUNET_HOSTLIST_client_start (cfg, stats, &client_ch, &client_dh, 284 GNUNET_HOSTLIST_client_start (cfg, stats,
280 &client_adv_handler, learning); 285 &client_ch,
286 &client_dh,
287 &client_adv_handler,
288 learning);
281 core = 289 core =
282 GNUNET_CORE_connect (cfg, NULL, 290 GNUNET_CORE_connect (cfg, NULL,
283 &core_init, 291 &core_init,
284 &connect_handler, 292 &connect_handler,
285 &disconnect_handler, NULL, 293 &disconnect_handler,
286 GNUNET_NO, NULL, 294 NULL, GNUNET_NO,
287 GNUNET_NO, 295 NULL, GNUNET_NO,
288 learning ? learn_handlers : no_learn_handlers); 296 learning ? learn_handlers : no_learn_handlers);
289 297
290 298
@@ -346,7 +354,8 @@ main (int argc, char *const *argv)
346 GNUNET_log_setup ("hostlist", "WARNING", NULL); 354 GNUNET_log_setup ("hostlist", "WARNING", NULL);
347 ret = 355 ret =
348 (GNUNET_OK == 356 (GNUNET_OK ==
349 GNUNET_PROGRAM_run (argc, argv, "hostlist", 357 GNUNET_PROGRAM_run (argc, argv,
358 "hostlist",
350 _("GNUnet hostlist server and client"), 359 _("GNUnet hostlist server and client"),
351 options, 360 options,
352 &run, NULL)) ? 0 : 1; 361 &run, NULL)) ? 0 : 1;
diff --git a/src/hostlist/gnunet-daemon-hostlist_client.c b/src/hostlist/gnunet-daemon-hostlist_client.c
index b92f195f8..0751668b3 100644
--- a/src/hostlist/gnunet-daemon-hostlist_client.c
+++ b/src/hostlist/gnunet-daemon-hostlist_client.c
@@ -205,27 +205,27 @@ static struct GNUNET_TIME_Relative hostlist_delay;
205/** 205/**
206 * ID of the task, checking if hostlist download should take plate 206 * ID of the task, checking if hostlist download should take plate
207 */ 207 */
208static GNUNET_SCHEDULER_TaskIdentifier ti_check_download; 208static struct GNUNET_SCHEDULER_Task * ti_check_download;
209 209
210/** 210/**
211 * ID of the task downloading the hostlist 211 * ID of the task downloading the hostlist
212 */ 212 */
213static GNUNET_SCHEDULER_TaskIdentifier ti_download; 213static struct GNUNET_SCHEDULER_Task * ti_download;
214 214
215/** 215/**
216 * ID of the task saving the hostlsit in a regular intervall 216 * ID of the task saving the hostlsit in a regular intervall
217 */ 217 */
218static GNUNET_SCHEDULER_TaskIdentifier ti_saving_task; 218static struct GNUNET_SCHEDULER_Task * ti_saving_task;
219 219
220/** 220/**
221 * ID of the task called to initiate a download 221 * ID of the task called to initiate a download
222 */ 222 */
223static GNUNET_SCHEDULER_TaskIdentifier ti_download_dispatcher_task; 223static struct GNUNET_SCHEDULER_Task * ti_download_dispatcher_task;
224 224
225/** 225/**
226 * ID of the task controlling the locking between two hostlist tests 226 * ID of the task controlling the locking between two hostlist tests
227 */ 227 */
228static GNUNET_SCHEDULER_TaskIdentifier ti_testing_intervall_task; 228static struct GNUNET_SCHEDULER_Task * ti_testing_intervall_task;
229 229
230/** 230/**
231 * At what time MUST the current hostlist request be done? 231 * At what time MUST the current hostlist request be done?
@@ -846,7 +846,7 @@ task_download (void *cls,
846 struct CURLMsg *msg; 846 struct CURLMsg *msg;
847 CURLMcode mret; 847 CURLMcode mret;
848 848
849 ti_download = GNUNET_SCHEDULER_NO_TASK; 849 ti_download = NULL;
850 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 850 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
851 { 851 {
852 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 852 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1044,7 +1044,7 @@ static void
1044task_download_dispatcher (void *cls, 1044task_download_dispatcher (void *cls,
1045 const struct GNUNET_SCHEDULER_TaskContext *tc) 1045 const struct GNUNET_SCHEDULER_TaskContext *tc)
1046{ 1046{
1047 ti_download_dispatcher_task = GNUNET_SCHEDULER_NO_TASK; 1047 ti_download_dispatcher_task = NULL;
1048 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1048 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1049 return; 1049 return;
1050 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download is initiated...\n"); 1050 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download is initiated...\n");
@@ -1075,7 +1075,7 @@ task_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1075 static int once; 1075 static int once;
1076 struct GNUNET_TIME_Relative delay; 1076 struct GNUNET_TIME_Relative delay;
1077 1077
1078 ti_check_download = GNUNET_SCHEDULER_NO_TASK; 1078 ti_check_download = NULL;
1079 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1079 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1080 return; 1080 return;
1081 if (stats == NULL) 1081 if (stats == NULL)
@@ -1084,7 +1084,7 @@ task_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1084 return; /* in shutdown */ 1084 return; /* in shutdown */
1085 } 1085 }
1086 if ( (stat_connection_count < MIN_CONNECTIONS) && 1086 if ( (stat_connection_count < MIN_CONNECTIONS) &&
1087 (GNUNET_SCHEDULER_NO_TASK == ti_download_dispatcher_task) ) 1087 (NULL == ti_download_dispatcher_task) )
1088 ti_download_dispatcher_task = 1088 ti_download_dispatcher_task =
1089 GNUNET_SCHEDULER_add_now (&task_download_dispatcher, NULL); 1089 GNUNET_SCHEDULER_add_now (&task_download_dispatcher, NULL);
1090 1090
@@ -1126,7 +1126,7 @@ static void
1126task_testing_intervall_reset (void *cls, 1126task_testing_intervall_reset (void *cls,
1127 const struct GNUNET_SCHEDULER_TaskContext *tc) 1127 const struct GNUNET_SCHEDULER_TaskContext *tc)
1128{ 1128{
1129 ti_testing_intervall_task = GNUNET_SCHEDULER_NO_TASK; 1129 ti_testing_intervall_task = NULL;
1130 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1130 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1131 return; 1131 return;
1132 stat_testing_allowed = GNUNET_OK; 1132 stat_testing_allowed = GNUNET_OK;
@@ -1144,7 +1144,7 @@ task_testing_intervall_reset (void *cls,
1144static void 1144static void
1145task_hostlist_saving (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 1145task_hostlist_saving (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1146{ 1146{
1147 ti_saving_task = GNUNET_SCHEDULER_NO_TASK; 1147 ti_saving_task = NULL;
1148 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1148 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1149 return; 1149 return;
1150 save_hostlist_file (GNUNET_NO); 1150 save_hostlist_file (GNUNET_NO);
@@ -1284,7 +1284,7 @@ static void
1284primary_task (void *cls, int success) 1284primary_task (void *cls, int success)
1285{ 1285{
1286 sget = NULL; 1286 sget = NULL;
1287 GNUNET_assert (stats != NULL); 1287 GNUNET_assert (NULL != stats);
1288 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1288 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1289 "Statistics request done, scheduling hostlist download\n"); 1289 "Statistics request done, scheduling hostlist download\n");
1290 ti_check_download = GNUNET_SCHEDULER_add_now (&task_check, NULL); 1290 ti_check_download = GNUNET_SCHEDULER_add_now (&task_check, NULL);
@@ -1310,7 +1310,8 @@ process_stat (void *cls,
1310 hostlist_delay.rel_value_us = value * 1000LL; 1310 hostlist_delay.rel_value_us = value * 1000LL;
1311 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1311 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1312 "Initial time between hostlist downloads is %s\n", 1312 "Initial time between hostlist downloads is %s\n",
1313 GNUNET_STRINGS_relative_time_to_string (hostlist_delay, GNUNET_YES)); 1313 GNUNET_STRINGS_relative_time_to_string (hostlist_delay,
1314 GNUNET_YES));
1314 return GNUNET_OK; 1315 return GNUNET_OK;
1315} 1316}
1316 1317
@@ -1441,13 +1442,14 @@ save_hostlist_file (int shutdown)
1441 if (NULL == wh) 1442 if (NULL == wh)
1442 { 1443 {
1443 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1444 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1444 _ 1445 _("Could not open file `%s' for writing to save hostlists: %s\n"),
1445 ("Could not open file `%s' for writing to save hostlists: %s\n"), 1446 filename,
1446 filename, STRERROR (errno)); 1447 STRERROR (errno));
1447 GNUNET_free (filename); 1448 GNUNET_free (filename);
1448 return; 1449 return;
1449 } 1450 }
1450 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Writing %u hostlist URIs to `%s'\n"), 1451 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1452 _("Writing %u hostlist URIs to `%s'\n"),
1451 linked_list_size, filename); 1453 linked_list_size, filename);
1452 /* add code to write hostlists to file using bio */ 1454 /* add code to write hostlists to file using bio */
1453 ok = GNUNET_YES; 1455 ok = GNUNET_YES;
@@ -1525,6 +1527,7 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
1525 transport = GNUNET_TRANSPORT_connect (c, NULL, NULL, NULL, NULL, NULL); 1527 transport = GNUNET_TRANSPORT_connect (c, NULL, NULL, NULL, NULL, NULL);
1526 if (NULL == transport) 1528 if (NULL == transport)
1527 { 1529 {
1530 GNUNET_break (0);
1528 curl_global_cleanup (); 1531 curl_global_cleanup ();
1529 return GNUNET_SYSERR; 1532 return GNUNET_SYSERR;
1530 } 1533 }
@@ -1532,8 +1535,9 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
1532 stats = st; 1535 stats = st;
1533 1536
1534 /* Read proxy configuration */ 1537 /* Read proxy configuration */
1535 if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg, 1538 if (GNUNET_OK ==
1536 "HOSTLIST", "PROXY", &proxy)) 1539 GNUNET_CONFIGURATION_get_value_string (cfg,
1540 "HOSTLIST", "PROXY", &proxy))
1537 { 1541 {
1538 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1542 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1539 "Found proxy host: `%s'\n", 1543 "Found proxy host: `%s'\n",
@@ -1557,23 +1561,26 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
1557 } 1561 }
1558 1562
1559 /* proxy type */ 1563 /* proxy type */
1560 if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg, 1564 if (GNUNET_OK ==
1561 "HOSTLIST", "PROXY_TYPE", &proxytype_str)) 1565 GNUNET_CONFIGURATION_get_value_string (cfg,
1566 "HOSTLIST",
1567 "PROXY_TYPE",
1568 &proxytype_str))
1562 { 1569 {
1563 GNUNET_STRINGS_utf8_toupper (proxytype_str, proxytype_str); 1570 GNUNET_STRINGS_utf8_toupper (proxytype_str,
1564 1571 proxytype_str);
1565 proxy_type = CURLPROXY_HTTP; 1572 proxy_type = CURLPROXY_HTTP;
1566 if (0 == strcmp(proxytype_str, "HTTP")) 1573 if (0 == strcmp (proxytype_str, "HTTP"))
1567 proxy_type = CURLPROXY_HTTP; 1574 proxy_type = CURLPROXY_HTTP;
1568 else if (0 == strcmp(proxytype_str, "HTTP_1_0")) 1575 else if (0 == strcmp (proxytype_str, "HTTP_1_0"))
1569 proxy_type = CURLPROXY_HTTP_1_0; 1576 proxy_type = CURLPROXY_HTTP_1_0;
1570 else if (0 == strcmp(proxytype_str, "SOCKS4")) 1577 else if (0 == strcmp (proxytype_str, "SOCKS4"))
1571 proxy_type = CURLPROXY_SOCKS4; 1578 proxy_type = CURLPROXY_SOCKS4;
1572 else if (0 == strcmp(proxytype_str, "SOCKS5")) 1579 else if (0 == strcmp (proxytype_str, "SOCKS5"))
1573 proxy_type = CURLPROXY_SOCKS5; 1580 proxy_type = CURLPROXY_SOCKS5;
1574 else if (0 == strcmp(proxytype_str, "SOCKS4A")) 1581 else if (0 == strcmp (proxytype_str, "SOCKS4A"))
1575 proxy_type = CURLPROXY_SOCKS4A; 1582 proxy_type = CURLPROXY_SOCKS4A;
1576 else if (0 == strcmp(proxytype_str, "SOCKS5_HOSTNAME")) 1583 else if (0 == strcmp (proxytype_str, "SOCKS5_HOSTNAME"))
1577 proxy_type = CURLPROXY_SOCKS5_HOSTNAME; 1584 proxy_type = CURLPROXY_SOCKS5_HOSTNAME;
1578 else 1585 else
1579 { 1586 {
@@ -1613,7 +1620,8 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
1613 "Hostlists will be saved to file again in %s\n", 1620 "Hostlists will be saved to file again in %s\n",
1614 GNUNET_STRINGS_relative_time_to_string (SAVING_INTERVAL, GNUNET_YES)); 1621 GNUNET_STRINGS_relative_time_to_string (SAVING_INTERVAL, GNUNET_YES));
1615 ti_saving_task = 1622 ti_saving_task =
1616 GNUNET_SCHEDULER_add_delayed (SAVING_INTERVAL, &task_hostlist_saving, 1623 GNUNET_SCHEDULER_add_delayed (SAVING_INTERVAL,
1624 &task_hostlist_saving,
1617 NULL); 1625 NULL);
1618 } 1626 }
1619 else 1627 else
@@ -1628,22 +1636,26 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
1628 if (GNUNET_YES == GNUNET_DISK_file_test (filename)) 1636 if (GNUNET_YES == GNUNET_DISK_file_test (filename))
1629 { 1637 {
1630 result = remove (filename); 1638 result = remove (filename);
1631 if (result == 0) 1639 if (0 == result)
1632 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1640 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1633 _ 1641 _("Since learning is not enabled on this peer, hostlist file `%s' was removed\n"),
1634 ("Since learning is not enabled on this peer, hostlist file `%s' was removed\n"),
1635 filename); 1642 filename);
1636 else 1643 else
1637 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1644 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
1638 _("Hostlist file `%s' could not be removed\n"), filename); 1645 "remove",
1646 filename);
1639 } 1647 }
1640 } 1648 }
1641 GNUNET_free (filename); 1649 GNUNET_free (filename);
1642 } 1650 }
1651 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1652 "Loading stats value on hostlist download frequency\n");
1643 sget = GNUNET_STATISTICS_get (stats, "hostlist", 1653 sget = GNUNET_STATISTICS_get (stats, "hostlist",
1644 gettext_noop 1654 gettext_noop
1645 ("# milliseconds between hostlist downloads"), 1655 ("# milliseconds between hostlist downloads"),
1646 GNUNET_TIME_UNIT_MINUTES, &primary_task, &process_stat, 1656 GNUNET_TIME_UNIT_MINUTES,
1657 &primary_task,
1658 &process_stat,
1647 NULL); 1659 NULL);
1648 return GNUNET_OK; 1660 return GNUNET_OK;
1649} 1661}
@@ -1664,31 +1676,31 @@ GNUNET_HOSTLIST_client_stop ()
1664 stats = NULL; 1676 stats = NULL;
1665 if (GNUNET_YES == stat_learning) 1677 if (GNUNET_YES == stat_learning)
1666 save_hostlist_file (GNUNET_YES); 1678 save_hostlist_file (GNUNET_YES);
1667 if (ti_saving_task != GNUNET_SCHEDULER_NO_TASK) 1679 if (ti_saving_task != NULL)
1668 { 1680 {
1669 GNUNET_SCHEDULER_cancel (ti_saving_task); 1681 GNUNET_SCHEDULER_cancel (ti_saving_task);
1670 ti_saving_task = GNUNET_SCHEDULER_NO_TASK; 1682 ti_saving_task = NULL;
1671 } 1683 }
1672 1684
1673 if (ti_download_dispatcher_task != GNUNET_SCHEDULER_NO_TASK) 1685 if (ti_download_dispatcher_task != NULL)
1674 { 1686 {
1675 GNUNET_SCHEDULER_cancel (ti_download_dispatcher_task); 1687 GNUNET_SCHEDULER_cancel (ti_download_dispatcher_task);
1676 ti_download_dispatcher_task = GNUNET_SCHEDULER_NO_TASK; 1688 ti_download_dispatcher_task = NULL;
1677 } 1689 }
1678 if (ti_testing_intervall_task != GNUNET_SCHEDULER_NO_TASK) 1690 if (ti_testing_intervall_task != NULL)
1679 { 1691 {
1680 GNUNET_SCHEDULER_cancel (ti_testing_intervall_task); 1692 GNUNET_SCHEDULER_cancel (ti_testing_intervall_task);
1681 ti_testing_intervall_task = GNUNET_SCHEDULER_NO_TASK; 1693 ti_testing_intervall_task = NULL;
1682 } 1694 }
1683 if (ti_download != GNUNET_SCHEDULER_NO_TASK) 1695 if (ti_download != NULL)
1684 { 1696 {
1685 GNUNET_SCHEDULER_cancel (ti_download); 1697 GNUNET_SCHEDULER_cancel (ti_download);
1686 ti_download = GNUNET_SCHEDULER_NO_TASK; 1698 ti_download = NULL;
1687 } 1699 }
1688 if (ti_check_download != GNUNET_SCHEDULER_NO_TASK) 1700 if (ti_check_download != NULL)
1689 { 1701 {
1690 GNUNET_SCHEDULER_cancel (ti_check_download); 1702 GNUNET_SCHEDULER_cancel (ti_check_download);
1691 ti_check_download = GNUNET_SCHEDULER_NO_TASK; 1703 ti_check_download = NULL;
1692 curl_global_cleanup (); 1704 curl_global_cleanup ();
1693 } 1705 }
1694 if (NULL != transport) 1706 if (NULL != transport)
diff --git a/src/hostlist/gnunet-daemon-hostlist_server.c b/src/hostlist/gnunet-daemon-hostlist_server.c
index 9c8b14598..542fa1a98 100644
--- a/src/hostlist/gnunet-daemon-hostlist_server.c
+++ b/src/hostlist/gnunet-daemon-hostlist_server.c
@@ -74,12 +74,12 @@ static struct GNUNET_PEERINFO_NotifyContext *notify;
74/** 74/**
75 * Our primary task for IPv4. 75 * Our primary task for IPv4.
76 */ 76 */
77static GNUNET_SCHEDULER_TaskIdentifier hostlist_task_v4; 77static struct GNUNET_SCHEDULER_Task * hostlist_task_v4;
78 78
79/** 79/**
80 * Our primary task for IPv6. 80 * Our primary task for IPv6.
81 */ 81 */
82static GNUNET_SCHEDULER_TaskIdentifier hostlist_task_v6; 82static struct GNUNET_SCHEDULER_Task * hostlist_task_v6;
83 83
84/** 84/**
85 * Our canonical response. 85 * Our canonical response.
@@ -618,7 +618,7 @@ process_notify (void *cls,
618 * Function that queries MHD's select sets and 618 * Function that queries MHD's select sets and
619 * starts the task waiting for them. 619 * starts the task waiting for them.
620 */ 620 */
621static GNUNET_SCHEDULER_TaskIdentifier 621static struct GNUNET_SCHEDULER_Task *
622prepare_daemon (struct MHD_Daemon *daemon_handle); 622prepare_daemon (struct MHD_Daemon *daemon_handle);
623 623
624 624
@@ -636,9 +636,9 @@ run_daemon (void *cls,
636 struct MHD_Daemon *daemon_handle = cls; 636 struct MHD_Daemon *daemon_handle = cls;
637 637
638 if (daemon_handle == daemon_handle_v4) 638 if (daemon_handle == daemon_handle_v4)
639 hostlist_task_v4 = GNUNET_SCHEDULER_NO_TASK; 639 hostlist_task_v4 = NULL;
640 else 640 else
641 hostlist_task_v6 = GNUNET_SCHEDULER_NO_TASK; 641 hostlist_task_v6 = NULL;
642 642
643 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 643 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
644 return; 644 return;
@@ -656,10 +656,10 @@ run_daemon (void *cls,
656 * 656 *
657 * @param daemon_handle HTTP server to prepare to run 657 * @param daemon_handle HTTP server to prepare to run
658 */ 658 */
659static GNUNET_SCHEDULER_TaskIdentifier 659static struct GNUNET_SCHEDULER_Task *
660prepare_daemon (struct MHD_Daemon *daemon_handle) 660prepare_daemon (struct MHD_Daemon *daemon_handle)
661{ 661{
662 GNUNET_SCHEDULER_TaskIdentifier ret; 662 struct GNUNET_SCHEDULER_Task * ret;
663 fd_set rs; 663 fd_set rs;
664 fd_set ws; 664 fd_set ws;
665 fd_set es; 665 fd_set es;
@@ -917,15 +917,15 @@ GNUNET_HOSTLIST_server_stop ()
917{ 917{
918 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 918 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
919 "Hostlist server shutdown\n"); 919 "Hostlist server shutdown\n");
920 if (GNUNET_SCHEDULER_NO_TASK != hostlist_task_v6) 920 if (NULL != hostlist_task_v6)
921 { 921 {
922 GNUNET_SCHEDULER_cancel (hostlist_task_v6); 922 GNUNET_SCHEDULER_cancel (hostlist_task_v6);
923 hostlist_task_v6 = GNUNET_SCHEDULER_NO_TASK; 923 hostlist_task_v6 = NULL;
924 } 924 }
925 if (GNUNET_SCHEDULER_NO_TASK != hostlist_task_v4) 925 if (NULL != hostlist_task_v4)
926 { 926 {
927 GNUNET_SCHEDULER_cancel (hostlist_task_v4); 927 GNUNET_SCHEDULER_cancel (hostlist_task_v4);
928 hostlist_task_v4 = GNUNET_SCHEDULER_NO_TASK; 928 hostlist_task_v4 = NULL;
929 } 929 }
930 if (NULL != daemon_handle_v4) 930 if (NULL != daemon_handle_v4)
931 { 931 {
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c
index a39f346ae..21cd164bc 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist.c
@@ -35,7 +35,7 @@
35 35
36static int ok; 36static int ok;
37 37
38static GNUNET_SCHEDULER_TaskIdentifier timeout_task; 38static struct GNUNET_SCHEDULER_Task * timeout_task;
39 39
40struct PeerContext 40struct PeerContext
41{ 41{
@@ -83,7 +83,7 @@ clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
83static void 83static void
84timeout_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 84timeout_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
85{ 85{
86 timeout_task = GNUNET_SCHEDULER_NO_TASK; 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, tc);
@@ -106,10 +106,10 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
106 return; 106 return;
107 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected, shutting down.\n"); 107 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected, shutting down.\n");
108 ok = 0; 108 ok = 0;
109 if (timeout_task != GNUNET_SCHEDULER_NO_TASK) 109 if (timeout_task != NULL)
110 { 110 {
111 GNUNET_SCHEDULER_cancel (timeout_task); 111 GNUNET_SCHEDULER_cancel (timeout_task);
112 timeout_task = GNUNET_SCHEDULER_NO_TASK; 112 timeout_task = NULL;
113 } 113 }
114 GNUNET_SCHEDULER_add_now (&clean_up, NULL); 114 GNUNET_SCHEDULER_add_now (&clean_up, NULL);
115} 115}
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
index 9f4d8e3d7..5f497f242 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
@@ -64,9 +64,9 @@ static char *current_adv_uri;
64 64
65static const struct GNUNET_CONFIGURATION_Handle *cfg; 65static const struct GNUNET_CONFIGURATION_Handle *cfg;
66 66
67static GNUNET_SCHEDULER_TaskIdentifier timeout_task; 67static struct GNUNET_SCHEDULER_Task * timeout_task;
68 68
69static GNUNET_SCHEDULER_TaskIdentifier check_task; 69static struct GNUNET_SCHEDULER_Task * check_task;
70 70
71static struct PeerContext adv_peer; 71static struct PeerContext adv_peer;
72 72
@@ -83,10 +83,10 @@ static void
83shutdown_testcase () 83shutdown_testcase ()
84{ 84{
85 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown testcase....\n"); 85 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown testcase....\n");
86 if (timeout_task != GNUNET_SCHEDULER_NO_TASK) 86 if (timeout_task != NULL)
87 { 87 {
88 GNUNET_SCHEDULER_cancel (timeout_task); 88 GNUNET_SCHEDULER_cancel (timeout_task);
89 timeout_task = GNUNET_SCHEDULER_NO_TASK; 89 timeout_task = NULL;
90 } 90 }
91 if (NULL != download_stats) 91 if (NULL != download_stats)
92 { 92 {
@@ -113,10 +113,10 @@ shutdown_testcase ()
113 GNUNET_STATISTICS_destroy (learn_peer.stats, GNUNET_NO); 113 GNUNET_STATISTICS_destroy (learn_peer.stats, GNUNET_NO);
114 learn_peer.stats = NULL; 114 learn_peer.stats = NULL;
115 } 115 }
116 if (check_task != GNUNET_SCHEDULER_NO_TASK) 116 if (check_task != NULL)
117 { 117 {
118 GNUNET_SCHEDULER_cancel (check_task); 118 GNUNET_SCHEDULER_cancel (check_task);
119 check_task = GNUNET_SCHEDULER_NO_TASK; 119 check_task = NULL;
120 } 120 }
121 if (NULL != current_adv_uri) 121 if (NULL != current_adv_uri)
122 { 122 {
@@ -168,7 +168,7 @@ shutdown_testcase ()
168static void 168static void
169timeout_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 169timeout_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
170{ 170{
171 timeout_task = GNUNET_SCHEDULER_NO_TASK; 171 timeout_task = NULL;
172 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 172 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
173 "Timeout while executing testcase, test failed.\n"); 173 "Timeout while executing testcase, test failed.\n");
174 timeout = GNUNET_YES; 174 timeout = GNUNET_YES;
@@ -269,7 +269,7 @@ check_statistics (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
269{ 269{
270 char *stat; 270 char *stat;
271 271
272 check_task = GNUNET_SCHEDULER_NO_TASK; 272 check_task = NULL;
273 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 273 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
274 return; 274 return;
275 GNUNET_asprintf (&stat, gettext_noop ("# advertised URI `%s' downloaded"), 275 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 1962bcd45..5ff97ff6b 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
@@ -35,7 +35,7 @@
35 35
36static int ok; 36static int ok;
37 37
38static GNUNET_SCHEDULER_TaskIdentifier timeout_task; 38static struct GNUNET_SCHEDULER_Task * timeout_task;
39 39
40struct PeerContext 40struct PeerContext
41{ 41{
@@ -83,7 +83,7 @@ clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
83static void 83static void
84timeout_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 84timeout_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
85{ 85{
86 timeout_task = GNUNET_SCHEDULER_NO_TASK; 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, tc);
@@ -106,10 +106,10 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
106 return; 106 return;
107 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected, shutting down.\n"); 107 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected, shutting down.\n");
108 ok = 0; 108 ok = 0;
109 if (timeout_task != GNUNET_SCHEDULER_NO_TASK) 109 if (timeout_task != NULL)
110 { 110 {
111 GNUNET_SCHEDULER_cancel (timeout_task); 111 GNUNET_SCHEDULER_cancel (timeout_task);
112 timeout_task = GNUNET_SCHEDULER_NO_TASK; 112 timeout_task = NULL;
113 } 113 }
114 GNUNET_SCHEDULER_add_now (&clean_up, NULL); 114 GNUNET_SCHEDULER_add_now (&clean_up, NULL);
115} 115}
diff --git a/src/identity/identity_api.c b/src/identity/identity_api.c
index 3028ff3fd..d4ee6c01b 100644
--- a/src/identity/identity_api.c
+++ b/src/identity/identity_api.c
@@ -155,7 +155,7 @@ struct GNUNET_IDENTITY_Handle
155 /** 155 /**
156 * Task doing exponential back-off trying to reconnect. 156 * Task doing exponential back-off trying to reconnect.
157 */ 157 */
158 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 158 struct GNUNET_SCHEDULER_Task * reconnect_task;
159 159
160 /** 160 /**
161 * Time for next connect retry. 161 * Time for next connect retry.
@@ -210,7 +210,7 @@ reconnect (void *cls,
210static void 210static void
211reschedule_connect (struct GNUNET_IDENTITY_Handle *h) 211reschedule_connect (struct GNUNET_IDENTITY_Handle *h)
212{ 212{
213 GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); 213 GNUNET_assert (h->reconnect_task == NULL);
214 214
215 if (NULL != h->th) 215 if (NULL != h->th)
216 { 216 {
@@ -542,7 +542,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
542 struct GNUNET_IDENTITY_Operation *op; 542 struct GNUNET_IDENTITY_Operation *op;
543 struct GNUNET_MessageHeader msg; 543 struct GNUNET_MessageHeader msg;
544 544
545 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 545 h->reconnect_task = NULL;
546 LOG (GNUNET_ERROR_TYPE_DEBUG, 546 LOG (GNUNET_ERROR_TYPE_DEBUG,
547 "Connecting to identity service.\n"); 547 "Connecting to identity service.\n");
548 GNUNET_assert (NULL == h->client); 548 GNUNET_assert (NULL == h->client);
@@ -966,10 +966,10 @@ GNUNET_IDENTITY_disconnect (struct GNUNET_IDENTITY_Handle *h)
966 struct GNUNET_IDENTITY_Operation *op; 966 struct GNUNET_IDENTITY_Operation *op;
967 967
968 GNUNET_assert (NULL != h); 968 GNUNET_assert (NULL != h);
969 if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK) 969 if (h->reconnect_task != NULL)
970 { 970 {
971 GNUNET_SCHEDULER_cancel (h->reconnect_task); 971 GNUNET_SCHEDULER_cancel (h->reconnect_task);
972 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 972 h->reconnect_task = NULL;
973 } 973 }
974 if (NULL != h->th) 974 if (NULL != h->th)
975 { 975 {
diff --git a/src/identity/test_identity.c b/src/identity/test_identity.c
index 6797afe3c..0dca38411 100644
--- a/src/identity/test_identity.c
+++ b/src/identity/test_identity.c
@@ -50,7 +50,7 @@ static struct GNUNET_IDENTITY_Operation *op;
50/** 50/**
51 * Handle for task for timeout termination. 51 * Handle for task for timeout termination.
52 */ 52 */
53static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 53static struct GNUNET_SCHEDULER_Task * endbadly_task;
54 54
55 55
56/** 56/**
@@ -107,10 +107,10 @@ end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
107static void 107static void
108end () 108end ()
109{ 109{
110 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 110 if (endbadly_task != NULL)
111 { 111 {
112 GNUNET_SCHEDULER_cancel (endbadly_task); 112 GNUNET_SCHEDULER_cancel (endbadly_task);
113 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 113 endbadly_task = NULL;
114 } 114 }
115 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS, 115 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
116 &end_normally, NULL); 116 &end_normally, NULL);
diff --git a/src/identity/test_identity_defaults.c b/src/identity/test_identity_defaults.c
index 980f4abd2..0d9c2ee27 100644
--- a/src/identity/test_identity_defaults.c
+++ b/src/identity/test_identity_defaults.c
@@ -50,7 +50,7 @@ static struct GNUNET_IDENTITY_Operation *op;
50/** 50/**
51 * Handle for task for timeout termination. 51 * Handle for task for timeout termination.
52 */ 52 */
53static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 53static struct GNUNET_SCHEDULER_Task * endbadly_task;
54 54
55 55
56/** 56/**
@@ -107,10 +107,10 @@ end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
107static void 107static void
108end () 108end ()
109{ 109{
110 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 110 if (endbadly_task != NULL)
111 { 111 {
112 GNUNET_SCHEDULER_cancel (endbadly_task); 112 GNUNET_SCHEDULER_cancel (endbadly_task);
113 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 113 endbadly_task = NULL;
114 } 114 }
115 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS, 115 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
116 &end_normally, NULL); 116 &end_normally, NULL);
diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h
index 9bd037dfa..ad8f3a2b9 100644
--- a/src/include/gnunet_bandwidth_lib.h
+++ b/src/include/gnunet_bandwidth_lib.h
@@ -113,7 +113,7 @@ struct GNUNET_BANDWIDTH_Tracker
113 * Task scheduled to call the @e excess_cb once we have 113 * Task scheduled to call the @e excess_cb once we have
114 * reached the maximum bandwidth the tracker can hold. 114 * reached the maximum bandwidth the tracker can hold.
115 */ 115 */
116 GNUNET_SCHEDULER_TaskIdentifier excess_task; 116 struct GNUNET_SCHEDULER_Task * excess_task;
117 117
118 /** 118 /**
119 * Time when we last updated the tracker. 119 * Time when we last updated the tracker.
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h
index ec605a3fd..4ee21e193 100644
--- a/src/include/gnunet_scheduler_lib.h
+++ b/src/include/gnunet_scheduler_lib.h
@@ -40,14 +40,7 @@ extern "C"
40/** 40/**
41 * Opaque reference to a task. 41 * Opaque reference to a task.
42 */ 42 */
43typedef unsigned long long GNUNET_SCHEDULER_TaskIdentifier; 43struct GNUNET_SCHEDULER_Task;
44
45
46/**
47 * Constant used to indicate that the scheduled
48 * task has no others as prerequisites.
49 */
50#define GNUNET_SCHEDULER_NO_TASK ((GNUNET_SCHEDULER_TaskIdentifier) 0)
51 44
52/** 45/**
53 * Reasons why the schedule may have triggered 46 * Reasons why the schedule may have triggered
@@ -56,36 +49,41 @@ typedef unsigned long long GNUNET_SCHEDULER_TaskIdentifier;
56enum GNUNET_SCHEDULER_Reason 49enum GNUNET_SCHEDULER_Reason
57{ 50{
58 /** 51 /**
52 * This task is not ready.
53 */
54 GNUNET_SCHEDULER_REASON_NONE = 0,
55
56 /**
59 * This is the very first task run during startup. 57 * This is the very first task run during startup.
60 */ 58 */
61 GNUNET_SCHEDULER_REASON_STARTUP = 0, 59 GNUNET_SCHEDULER_REASON_STARTUP = 1,
62 60
63 /** 61 /**
64 * We are shutting down and are running all shutdown-related tasks 62 * We are shutting down and are running all shutdown-related tasks
65 * (regardless of timeout, etc.). 63 * (regardless of timeout, etc.).
66 */ 64 */
67 GNUNET_SCHEDULER_REASON_SHUTDOWN = 1, 65 GNUNET_SCHEDULER_REASON_SHUTDOWN = 2,
68 66
69 /** 67 /**
70 * The specified timeout has expired. 68 * The specified timeout has expired.
71 * (also set if the delay given was 0). 69 * (also set if the delay given was 0).
72 */ 70 */
73 GNUNET_SCHEDULER_REASON_TIMEOUT = 2, 71 GNUNET_SCHEDULER_REASON_TIMEOUT = 4,
74 72
75 /** 73 /**
76 * The reading socket is ready. 74 * The reading socket is ready.
77 */ 75 */
78 GNUNET_SCHEDULER_REASON_READ_READY = 4, 76 GNUNET_SCHEDULER_REASON_READ_READY = 8,
79 77
80 /** 78 /**
81 * The writing socket is ready. 79 * The writing socket is ready.
82 */ 80 */
83 GNUNET_SCHEDULER_REASON_WRITE_READY = 8, 81 GNUNET_SCHEDULER_REASON_WRITE_READY = 16,
84 82
85 /** 83 /**
86 * The prerequisite task is done. 84 * The prerequisite task is done.
87 */ 85 */
88 GNUNET_SCHEDULER_REASON_PREREQ_DONE = 16 86 GNUNET_SCHEDULER_REASON_PREREQ_DONE = 32
89}; 87};
90 88
91 89
@@ -193,9 +191,9 @@ struct GNUNET_SCHEDULER_TaskContext
193 * @param cls closure 191 * @param cls closure
194 * @param tc context information (why was this task triggered now) 192 * @param tc context information (why was this task triggered now)
195 */ 193 */
196typedef void (*GNUNET_SCHEDULER_Task) (void *cls, 194typedef void
197 const struct GNUNET_SCHEDULER_TaskContext 195(*GNUNET_SCHEDULER_TaskCallback) (void *cls,
198 * tc); 196 const struct GNUNET_SCHEDULER_TaskContext *tc);
199 197
200 198
201/** 199/**
@@ -209,11 +207,12 @@ typedef void (*GNUNET_SCHEDULER_Task) (void *cls,
209 * @param timeout relative value when to return 207 * @param timeout relative value when to return
210 * @return number of selected sockets, #GNUNET_SYSERR on error 208 * @return number of selected sockets, #GNUNET_SYSERR on error
211 */ 209 */
212typedef int (*GNUNET_SCHEDULER_select) (void *cls, 210typedef int
213 struct GNUNET_NETWORK_FDSet *rfds, 211(*GNUNET_SCHEDULER_select) (void *cls,
214 struct GNUNET_NETWORK_FDSet *wfds, 212 struct GNUNET_NETWORK_FDSet *rfds,
215 struct GNUNET_NETWORK_FDSet *efds, 213 struct GNUNET_NETWORK_FDSet *wfds,
216 struct GNUNET_TIME_Relative timeout); 214 struct GNUNET_NETWORK_FDSet *efds,
215 struct GNUNET_TIME_Relative timeout);
217 216
218 217
219/** 218/**
@@ -231,7 +230,8 @@ typedef int (*GNUNET_SCHEDULER_select) (void *cls,
231 * @param task_cls closure of task 230 * @param task_cls closure of task
232 */ 231 */
233void 232void
234GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls); 233GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_TaskCallback task,
234 void *task_cls);
235 235
236 236
237/** 237/**
@@ -279,7 +279,7 @@ GNUNET_SCHEDULER_get_reason (void);
279 * @return the closure of the callback of the cancelled task 279 * @return the closure of the callback of the cancelled task
280 */ 280 */
281void * 281void *
282GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task); 282GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task);
283 283
284 284
285/** 285/**
@@ -292,7 +292,8 @@ GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task);
292 * @param reason reason for task invocation 292 * @param reason reason for task invocation
293 */ 293 */
294void 294void
295GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, void *task_cls, 295GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_TaskCallback task,
296 void *task_cls,
296 enum GNUNET_SCHEDULER_Reason reason); 297 enum GNUNET_SCHEDULER_Reason reason);
297 298
298 299
@@ -307,7 +308,8 @@ GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, void *task_cls,
307 * @param priority priority to use for the task 308 * @param priority priority to use for the task
308 */ 309 */
309void 310void
310GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_Task task, void *task_cls, 311GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_TaskCallback task,
312 void *task_cls,
311 enum GNUNET_SCHEDULER_Reason reason, 313 enum GNUNET_SCHEDULER_Reason reason,
312 enum GNUNET_SCHEDULER_Priority priority); 314 enum GNUNET_SCHEDULER_Priority priority);
313 315
@@ -321,9 +323,10 @@ GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_Task task, voi
321 * @return unique task identifier for the job 323 * @return unique task identifier for the job
322 * only valid until @a task is started! 324 * only valid until @a task is started!
323 */ 325 */
324GNUNET_SCHEDULER_TaskIdentifier 326struct GNUNET_SCHEDULER_Task *
325GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, 327GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio,
326 GNUNET_SCHEDULER_Task task, void *task_cls); 328 GNUNET_SCHEDULER_TaskCallback task,
329 void *task_cls);
327 330
328 331
329/** 332/**
@@ -341,8 +344,9 @@ GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio,
341 * @return unique task identifier for the job 344 * @return unique task identifier for the job
342 * only valid until @a task is started! 345 * only valid until @a task is started!
343 */ 346 */
344GNUNET_SCHEDULER_TaskIdentifier 347struct GNUNET_SCHEDULER_Task *
345GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls); 348GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_TaskCallback task,
349 void *task_cls);
346 350
347 351
348/** 352/**
@@ -359,9 +363,9 @@ GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls);
359 * @return unique task identifier for the job 363 * @return unique task identifier for the job
360 * only valid until @a task is started! 364 * only valid until @a task is started!
361 */ 365 */
362GNUNET_SCHEDULER_TaskIdentifier 366struct GNUNET_SCHEDULER_Task *
363GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, 367GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness,
364 GNUNET_SCHEDULER_Task task, 368 GNUNET_SCHEDULER_TaskCallback task,
365 void *task_cls); 369 void *task_cls);
366 370
367 371
@@ -377,9 +381,10 @@ GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness,
377 * @return unique task identifier for the job 381 * @return unique task identifier for the job
378 * only valid until @a task is started! 382 * only valid until @a task is started!
379 */ 383 */
380GNUNET_SCHEDULER_TaskIdentifier 384struct GNUNET_SCHEDULER_Task *
381GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, 385GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay,
382 GNUNET_SCHEDULER_Task task, void *task_cls); 386 GNUNET_SCHEDULER_TaskCallback task,
387 void *task_cls);
383 388
384 389
385/** 390/**
@@ -394,10 +399,11 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay,
394 * @return unique task identifier for the job 399 * @return unique task identifier for the job
395 * only valid until @a task is started! 400 * only valid until @a task is started!
396 */ 401 */
397GNUNET_SCHEDULER_TaskIdentifier 402struct GNUNET_SCHEDULER_Task *
398GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay, 403GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
399 enum GNUNET_SCHEDULER_Priority priority, 404 enum GNUNET_SCHEDULER_Priority priority,
400 GNUNET_SCHEDULER_Task task, void *task_cls); 405 GNUNET_SCHEDULER_TaskCallback task,
406 void *task_cls);
401 407
402 408
403/** 409/**
@@ -415,10 +421,11 @@ GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
415 * @return unique task identifier for the job 421 * @return unique task identifier for the job
416 * only valid until @a task is started! 422 * only valid until @a task is started!
417 */ 423 */
418GNUNET_SCHEDULER_TaskIdentifier 424struct GNUNET_SCHEDULER_Task *
419GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, 425GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay,
420 struct GNUNET_NETWORK_Handle *rfd, 426 struct GNUNET_NETWORK_Handle *rfd,
421 GNUNET_SCHEDULER_Task task, void *task_cls); 427 GNUNET_SCHEDULER_TaskCallback task,
428 void *task_cls);
422 429
423 430
424/** 431/**
@@ -438,11 +445,12 @@ GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay,
438 * @return unique task identifier for the job 445 * @return unique task identifier for the job
439 * only valid until @a task is started! 446 * only valid until @a task is started!
440 */ 447 */
441GNUNET_SCHEDULER_TaskIdentifier 448struct GNUNET_SCHEDULER_Task *
442GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay, 449GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay,
443 enum GNUNET_SCHEDULER_Priority priority, 450 enum GNUNET_SCHEDULER_Priority priority,
444 struct GNUNET_NETWORK_Handle *rfd, 451 struct GNUNET_NETWORK_Handle *rfd,
445 GNUNET_SCHEDULER_Task task, void *task_cls); 452 GNUNET_SCHEDULER_TaskCallback task,
453 void *task_cls);
446 454
447 455
448/** 456/**
@@ -460,10 +468,11 @@ GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay,
460 * @return unique task identifier for the job 468 * @return unique task identifier for the job
461 * only valid until @a task is started! 469 * only valid until @a task is started!
462 */ 470 */
463GNUNET_SCHEDULER_TaskIdentifier 471struct GNUNET_SCHEDULER_Task *
464GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, 472GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
465 struct GNUNET_NETWORK_Handle *wfd, 473 struct GNUNET_NETWORK_Handle *wfd,
466 GNUNET_SCHEDULER_Task task, void *task_cls); 474 GNUNET_SCHEDULER_TaskCallback task,
475 void *task_cls);
467 476
468 477
469/** 478/**
@@ -484,12 +493,14 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
484 * @return unique task identifier for the job 493 * @return unique task identifier for the job
485 * only valid until "task" is started! 494 * only valid until "task" is started!
486 */ 495 */
487GNUNET_SCHEDULER_TaskIdentifier 496struct GNUNET_SCHEDULER_Task *
488GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay, 497GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay,
489 enum GNUNET_SCHEDULER_Priority priority, 498 enum GNUNET_SCHEDULER_Priority priority,
490 struct GNUNET_NETWORK_Handle *fd, 499 struct GNUNET_NETWORK_Handle *fd,
491 int on_read, int on_write, 500 int on_read,
492 GNUNET_SCHEDULER_Task task, void *task_cls); 501 int on_write,
502 GNUNET_SCHEDULER_TaskCallback task,
503 void *task_cls);
493 504
494/** 505/**
495 * Schedule a new task to be run with a specified delay or when the 506 * Schedule a new task to be run with a specified delay or when the
@@ -506,10 +517,11 @@ GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay,
506 * @return unique task identifier for the job 517 * @return unique task identifier for the job
507 * only valid until "task" is started! 518 * only valid until "task" is started!
508 */ 519 */
509GNUNET_SCHEDULER_TaskIdentifier 520struct GNUNET_SCHEDULER_Task *
510GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, 521GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay,
511 const struct GNUNET_DISK_FileHandle *rfd, 522 const struct GNUNET_DISK_FileHandle *rfd,
512 GNUNET_SCHEDULER_Task task, void *task_cls); 523 GNUNET_SCHEDULER_TaskCallback task,
524 void *task_cls);
513 525
514 526
515/** 527/**
@@ -527,10 +539,11 @@ GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay,
527 * @return unique task identifier for the job 539 * @return unique task identifier for the job
528 * only valid until @a task is started! 540 * only valid until @a task is started!
529 */ 541 */
530GNUNET_SCHEDULER_TaskIdentifier 542struct GNUNET_SCHEDULER_Task *
531GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, 543GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay,
532 const struct GNUNET_DISK_FileHandle *wfd, 544 const struct GNUNET_DISK_FileHandle *wfd,
533 GNUNET_SCHEDULER_Task task, void *task_cls); 545 GNUNET_SCHEDULER_TaskCallback task,
546 void *task_cls);
534 547
535 548
536/** 549/**
@@ -551,12 +564,13 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay,
551 * @return unique task identifier for the job 564 * @return unique task identifier for the job
552 * only valid until @a task is started! 565 * only valid until @a task is started!
553 */ 566 */
554GNUNET_SCHEDULER_TaskIdentifier 567struct GNUNET_SCHEDULER_Task *
555GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay, 568GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay,
556 enum GNUNET_SCHEDULER_Priority priority, 569 enum GNUNET_SCHEDULER_Priority priority,
557 const struct GNUNET_DISK_FileHandle *fd, 570 const struct GNUNET_DISK_FileHandle *fd,
558 int on_read, int on_write, 571 int on_read, int on_write,
559 GNUNET_SCHEDULER_Task task, void *task_cls); 572 GNUNET_SCHEDULER_TaskCallback task,
573 void *task_cls);
560 574
561 575
562/** 576/**
@@ -586,12 +600,13 @@ GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay,
586 * @return unique task identifier for the job 600 * @return unique task identifier for the job
587 * only valid until "task" is started! 601 * only valid until "task" is started!
588 */ 602 */
589GNUNET_SCHEDULER_TaskIdentifier 603struct GNUNET_SCHEDULER_Task *
590GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, 604GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
591 struct GNUNET_TIME_Relative delay, 605 struct GNUNET_TIME_Relative delay,
592 const struct GNUNET_NETWORK_FDSet *rs, 606 const struct GNUNET_NETWORK_FDSet *rs,
593 const struct GNUNET_NETWORK_FDSet *ws, 607 const struct GNUNET_NETWORK_FDSet *ws,
594 GNUNET_SCHEDULER_Task task, void *task_cls); 608 GNUNET_SCHEDULER_TaskCallback task,
609 void *task_cls);
595 610
596/** 611/**
597 * Sets the select function to use in the scheduler (scheduler_select). 612 * Sets the select function to use in the scheduler (scheduler_select).
diff --git a/src/include/gnunet_sensor_util_lib.h b/src/include/gnunet_sensor_util_lib.h
index 3cb88904b..86e017d97 100644
--- a/src/include/gnunet_sensor_util_lib.h
+++ b/src/include/gnunet_sensor_util_lib.h
@@ -124,7 +124,7 @@ struct GNUNET_SENSOR_SensorInfo
124 char *gnunet_stat_name; 124 char *gnunet_stat_name;
125 125
126 /** 126 /**
127 * Handle to statistics get request (OR GNUNET_SCHEDULER_NO_TASK) 127 * Handle to statistics get request (OR NULL)
128 */ 128 */
129 struct GNUNET_STATISTICS_GetHandle *gnunet_stat_get_handle; 129 struct GNUNET_STATISTICS_GetHandle *gnunet_stat_get_handle;
130 130
@@ -178,9 +178,9 @@ struct GNUNET_SENSOR_SensorInfo
178 int report_anomalies; 178 int report_anomalies;
179 179
180 /** 180 /**
181 * Execution task (OR GNUNET_SCHEDULER_NO_TASK) 181 * Execution task (OR NULL)
182 */ 182 */
183 GNUNET_SCHEDULER_TaskIdentifier execution_task; 183 struct GNUNET_SCHEDULER_Task * execution_task;
184 184
185 /** 185 /**
186 * Is the sensor being executed 186 * Is the sensor being executed
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h
index 79fd88f44..d1b341a8c 100644
--- a/src/include/gnunet_transport_service.h
+++ b/src/include/gnunet_transport_service.h
@@ -432,7 +432,7 @@ struct GNUNET_TRANSPORT_OfferHelloHandle;
432struct GNUNET_TRANSPORT_OfferHelloHandle * 432struct GNUNET_TRANSPORT_OfferHelloHandle *
433GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, 433GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
434 const struct GNUNET_MessageHeader *hello, 434 const struct GNUNET_MessageHeader *hello,
435 GNUNET_SCHEDULER_Task cont, void *cls); 435 GNUNET_SCHEDULER_TaskCallback cont, void *cls);
436 436
437 437
438/** 438/**
diff --git a/src/multicast/test_multicast.c b/src/multicast/test_multicast.c
index a8a8cb611..a6b0c7dd6 100644
--- a/src/multicast/test_multicast.c
+++ b/src/multicast/test_multicast.c
@@ -45,7 +45,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
45/** 45/**
46 * Handle for task for timeout termination. 46 * Handle for task for timeout termination.
47 */ 47 */
48static GNUNET_SCHEDULER_TaskIdentifier end_badly_task; 48static struct GNUNET_SCHEDULER_Task * end_badly_task;
49 49
50 50
51/** 51/**
@@ -96,10 +96,10 @@ end ()
96{ 96{
97 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending tests.\n"); 97 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending tests.\n");
98 98
99 if (end_badly_task != GNUNET_SCHEDULER_NO_TASK) 99 if (end_badly_task != NULL)
100 { 100 {
101 GNUNET_SCHEDULER_cancel (end_badly_task); 101 GNUNET_SCHEDULER_cancel (end_badly_task);
102 end_badly_task = GNUNET_SCHEDULER_NO_TASK; 102 end_badly_task = NULL;
103 } 103 }
104 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS, 104 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
105 &end_normally, NULL); 105 &end_normally, NULL);
diff --git a/src/namecache/namecache_api.c b/src/namecache/namecache_api.c
index 26d80f4bf..9f979d992 100644
--- a/src/namecache/namecache_api.c
+++ b/src/namecache/namecache_api.c
@@ -159,7 +159,7 @@ struct GNUNET_NAMECACHE_Handle
159 /** 159 /**
160 * Reconnect task 160 * Reconnect task
161 */ 161 */
162 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 162 struct GNUNET_SCHEDULER_Task * reconnect_task;
163 163
164 /** 164 /**
165 * Delay introduced before we reconnect. 165 * Delay introduced before we reconnect.
@@ -503,7 +503,7 @@ reconnect_task (void *cls,
503{ 503{
504 struct GNUNET_NAMECACHE_Handle *h = cls; 504 struct GNUNET_NAMECACHE_Handle *h = cls;
505 505
506 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 506 h->reconnect_task = NULL;
507 reconnect (h); 507 reconnect (h);
508} 508}
509 509
@@ -601,10 +601,10 @@ GNUNET_NAMECACHE_disconnect (struct GNUNET_NAMECACHE_Handle *h)
601 GNUNET_CLIENT_disconnect (h->client); 601 GNUNET_CLIENT_disconnect (h->client);
602 h->client = NULL; 602 h->client = NULL;
603 } 603 }
604 if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task) 604 if (NULL != h->reconnect_task)
605 { 605 {
606 GNUNET_SCHEDULER_cancel (h->reconnect_task); 606 GNUNET_SCHEDULER_cancel (h->reconnect_task);
607 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 607 h->reconnect_task = NULL;
608 } 608 }
609 GNUNET_free (h); 609 GNUNET_free (h);
610} 610}
diff --git a/src/namecache/test_namecache_api_cache_block.c b/src/namecache/test_namecache_api_cache_block.c
index ec3ddf0a9..b15dc9645 100644
--- a/src/namecache/test_namecache_api_cache_block.c
+++ b/src/namecache/test_namecache_api_cache_block.c
@@ -36,7 +36,7 @@
36 36
37static struct GNUNET_NAMECACHE_Handle *nsh; 37static struct GNUNET_NAMECACHE_Handle *nsh;
38 38
39static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 39static struct GNUNET_SCHEDULER_Task * endbadly_task;
40 40
41static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 41static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
42 42
@@ -122,17 +122,17 @@ name_lookup_proc (void *cls,
122 122
123 GNUNET_assert (NULL != cls); 123 GNUNET_assert (NULL != cls);
124 124
125 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 125 if (endbadly_task != NULL)
126 { 126 {
127 GNUNET_SCHEDULER_cancel (endbadly_task); 127 GNUNET_SCHEDULER_cancel (endbadly_task);
128 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 128 endbadly_task = NULL;
129 } 129 }
130 130
131 if (NULL == block) 131 if (NULL == block)
132 { 132 {
133 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 133 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
134 _("Namecache returned no block\n")); 134 _("Namecache returned no block\n"));
135 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 135 if (endbadly_task != NULL)
136 GNUNET_SCHEDULER_cancel (endbadly_task); 136 GNUNET_SCHEDULER_cancel (endbadly_task);
137 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 137 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
138 return; 138 return;
diff --git a/src/namestore/gnunet-namestore-fcfsd.c b/src/namestore/gnunet-namestore-fcfsd.c
index 5286b9056..c82977b28 100644
--- a/src/namestore/gnunet-namestore-fcfsd.c
+++ b/src/namestore/gnunet-namestore-fcfsd.c
@@ -194,7 +194,7 @@ static struct MHD_Daemon *httpd;
194/** 194/**
195 * Main HTTP task. 195 * Main HTTP task.
196 */ 196 */
197static GNUNET_SCHEDULER_TaskIdentifier httpd_task; 197static struct GNUNET_SCHEDULER_Task * httpd_task;
198 198
199/** 199/**
200 * Handle to the namestore. 200 * Handle to the namestore.
@@ -239,10 +239,10 @@ do_httpd (void *cls,
239static void 239static void
240run_httpd_now () 240run_httpd_now ()
241{ 241{
242 if (GNUNET_SCHEDULER_NO_TASK != httpd_task) 242 if (NULL != httpd_task)
243 { 243 {
244 GNUNET_SCHEDULER_cancel (httpd_task); 244 GNUNET_SCHEDULER_cancel (httpd_task);
245 httpd_task = GNUNET_SCHEDULER_NO_TASK; 245 httpd_task = NULL;
246 } 246 }
247 httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd, NULL); 247 httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd, NULL);
248} 248}
@@ -846,7 +846,7 @@ static void
846do_httpd (void *cls, 846do_httpd (void *cls,
847 const struct GNUNET_SCHEDULER_TaskContext *tc) 847 const struct GNUNET_SCHEDULER_TaskContext *tc)
848{ 848{
849 httpd_task = GNUNET_SCHEDULER_NO_TASK; 849 httpd_task = NULL;
850 MHD_run (httpd); 850 MHD_run (httpd);
851 run_httpd (); 851 run_httpd ();
852} 852}
@@ -862,10 +862,10 @@ static void
862do_shutdown (void *cls, 862do_shutdown (void *cls,
863 const struct GNUNET_SCHEDULER_TaskContext *tc) 863 const struct GNUNET_SCHEDULER_TaskContext *tc)
864{ 864{
865 if (GNUNET_SCHEDULER_NO_TASK != httpd_task) 865 if (NULL != httpd_task)
866 { 866 {
867 GNUNET_SCHEDULER_cancel (httpd_task); 867 GNUNET_SCHEDULER_cancel (httpd_task);
868 httpd_task = GNUNET_SCHEDULER_NO_TASK; 868 httpd_task = NULL;
869 } 869 }
870 if (NULL != ns) 870 if (NULL != ns)
871 { 871 {
diff --git a/src/namestore/gnunet-service-namestore.c b/src/namestore/gnunet-service-namestore.c
index 1f4226297..9716a73b6 100644
--- a/src/namestore/gnunet-service-namestore.c
+++ b/src/namestore/gnunet-service-namestore.c
@@ -152,7 +152,7 @@ struct ZoneMonitor
152 /** 152 /**
153 * Task active during initial iteration. 153 * Task active during initial iteration.
154 */ 154 */
155 GNUNET_SCHEDULER_TaskIdentifier task; 155 struct GNUNET_SCHEDULER_Task * task;
156 156
157 /** 157 /**
158 * Offset of the zone iteration used to address next result of the zone 158 * Offset of the zone iteration used to address next result of the zone
@@ -355,10 +355,10 @@ client_disconnect_notification (void *cls,
355 GNUNET_CONTAINER_DLL_remove (monitor_head, 355 GNUNET_CONTAINER_DLL_remove (monitor_head,
356 monitor_tail, 356 monitor_tail,
357 zm); 357 zm);
358 if (GNUNET_SCHEDULER_NO_TASK != zm->task) 358 if (NULL != zm->task)
359 { 359 {
360 GNUNET_SCHEDULER_cancel (zm->task); 360 GNUNET_SCHEDULER_cancel (zm->task);
361 zm->task = GNUNET_SCHEDULER_NO_TASK; 361 zm->task = NULL;
362 } 362 }
363 GNUNET_free (zm); 363 GNUNET_free (zm);
364 break; 364 break;
@@ -1614,7 +1614,7 @@ monitor_next (void *cls,
1614 struct ZoneMonitor *zm = cls; 1614 struct ZoneMonitor *zm = cls;
1615 int ret; 1615 int ret;
1616 1616
1617 zm->task = GNUNET_SCHEDULER_NO_TASK; 1617 zm->task = NULL;
1618 ret = GSN_database->iterate_records (GSN_database->cls, 1618 ret = GSN_database->iterate_records (GSN_database->cls,
1619 (0 == memcmp (&zm->zone, &zero, sizeof (zero))) 1619 (0 == memcmp (&zm->zone, &zero, sizeof (zero)))
1620 ? NULL 1620 ? NULL
diff --git a/src/namestore/namestore_api.c b/src/namestore/namestore_api.c
index c089929a6..eca65f116 100644
--- a/src/namestore/namestore_api.c
+++ b/src/namestore/namestore_api.c
@@ -214,7 +214,7 @@ struct GNUNET_NAMESTORE_Handle
214 /** 214 /**
215 * Reconnect task 215 * Reconnect task
216 */ 216 */
217 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 217 struct GNUNET_SCHEDULER_Task * reconnect_task;
218 218
219 /** 219 /**
220 * Delay introduced before we reconnect. 220 * Delay introduced before we reconnect.
@@ -874,7 +874,7 @@ reconnect_task (void *cls,
874{ 874{
875 struct GNUNET_NAMESTORE_Handle *h = cls; 875 struct GNUNET_NAMESTORE_Handle *h = cls;
876 876
877 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 877 h->reconnect_task = NULL;
878 reconnect (h); 878 reconnect (h);
879} 879}
880 880
@@ -979,10 +979,10 @@ GNUNET_NAMESTORE_disconnect (struct GNUNET_NAMESTORE_Handle *h)
979 GNUNET_CLIENT_disconnect (h->client); 979 GNUNET_CLIENT_disconnect (h->client);
980 h->client = NULL; 980 h->client = NULL;
981 } 981 }
982 if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task) 982 if (NULL != h->reconnect_task)
983 { 983 {
984 GNUNET_SCHEDULER_cancel (h->reconnect_task); 984 GNUNET_SCHEDULER_cancel (h->reconnect_task);
985 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 985 h->reconnect_task = NULL;
986 } 986 }
987 GNUNET_free (h); 987 GNUNET_free (h);
988} 988}
diff --git a/src/namestore/test_namestore_api_lookup_nick.c b/src/namestore/test_namestore_api_lookup_nick.c
index 2a3933e79..1f7647ca5 100644
--- a/src/namestore/test_namestore_api_lookup_nick.c
+++ b/src/namestore/test_namestore_api_lookup_nick.c
@@ -37,7 +37,7 @@
37 37
38static struct GNUNET_NAMESTORE_Handle *nsh; 38static struct GNUNET_NAMESTORE_Handle *nsh;
39 39
40static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 40static struct GNUNET_SCHEDULER_Task * endbadly_task;
41 41
42static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 42static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
43 43
@@ -206,14 +206,14 @@ void lookup_it (void *cls,
206 if ((GNUNET_YES == found_nick) && (GNUNET_YES == found_record)) 206 if ((GNUNET_YES == found_nick) && (GNUNET_YES == found_record))
207 { 207 {
208 GNUNET_SCHEDULER_cancel (endbadly_task); 208 GNUNET_SCHEDULER_cancel (endbadly_task);
209 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 209 endbadly_task = NULL;
210 GNUNET_SCHEDULER_add_now (&end, NULL ); 210 GNUNET_SCHEDULER_add_now (&end, NULL );
211 } 211 }
212 else 212 else
213 { 213 {
214 GNUNET_break (0); 214 GNUNET_break (0);
215 GNUNET_SCHEDULER_cancel (endbadly_task); 215 GNUNET_SCHEDULER_cancel (endbadly_task);
216 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 216 endbadly_task = NULL;
217 GNUNET_SCHEDULER_add_now (&endbadly, NULL ); 217 GNUNET_SCHEDULER_add_now (&endbadly, NULL );
218 } 218 }
219} 219}
diff --git a/src/namestore/test_namestore_api_lookup_private.c b/src/namestore/test_namestore_api_lookup_private.c
index 87b580bb9..51ec5f4a1 100644
--- a/src/namestore/test_namestore_api_lookup_private.c
+++ b/src/namestore/test_namestore_api_lookup_private.c
@@ -35,7 +35,7 @@
35 35
36static struct GNUNET_NAMESTORE_Handle *nsh; 36static struct GNUNET_NAMESTORE_Handle *nsh;
37 37
38static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 38static struct GNUNET_SCHEDULER_Task * endbadly_task;
39 39
40static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 40static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
41 41
@@ -136,7 +136,7 @@ void lookup_it (void *cls,
136 136
137 /* Done */ 137 /* Done */
138 GNUNET_SCHEDULER_cancel (endbadly_task); 138 GNUNET_SCHEDULER_cancel (endbadly_task);
139 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 139 endbadly_task = NULL;
140 GNUNET_SCHEDULER_add_now (&end, NULL ); 140 GNUNET_SCHEDULER_add_now (&end, NULL );
141} 141}
142 142
diff --git a/src/namestore/test_namestore_api_lookup_public.c b/src/namestore/test_namestore_api_lookup_public.c
index df54f906c..7d4c2e69d 100644
--- a/src/namestore/test_namestore_api_lookup_public.c
+++ b/src/namestore/test_namestore_api_lookup_public.c
@@ -39,7 +39,7 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
39 39
40static struct GNUNET_NAMECACHE_Handle *nch; 40static struct GNUNET_NAMECACHE_Handle *nch;
41 41
42static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 42static struct GNUNET_SCHEDULER_Task * endbadly_task;
43 43
44static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 44static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
45 45
@@ -139,17 +139,17 @@ name_lookup_proc (void *cls,
139 ncqe = NULL; 139 ncqe = NULL;
140 GNUNET_assert (NULL != cls); 140 GNUNET_assert (NULL != cls);
141 141
142 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 142 if (endbadly_task != NULL)
143 { 143 {
144 GNUNET_SCHEDULER_cancel (endbadly_task); 144 GNUNET_SCHEDULER_cancel (endbadly_task);
145 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 145 endbadly_task = NULL;
146 } 146 }
147 147
148 if (NULL == block) 148 if (NULL == block)
149 { 149 {
150 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 150 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
151 _("Namestore returned no block\n")); 151 _("Namestore returned no block\n"));
152 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 152 if (endbadly_task != NULL)
153 GNUNET_SCHEDULER_cancel (endbadly_task); 153 GNUNET_SCHEDULER_cancel (endbadly_task);
154 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 154 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
155 return; 155 return;
diff --git a/src/namestore/test_namestore_api_lookup_shadow.c b/src/namestore/test_namestore_api_lookup_shadow.c
index e423dbb3e..373aa116d 100644
--- a/src/namestore/test_namestore_api_lookup_shadow.c
+++ b/src/namestore/test_namestore_api_lookup_shadow.c
@@ -41,7 +41,7 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
41 41
42static struct GNUNET_NAMECACHE_Handle *nch; 42static struct GNUNET_NAMECACHE_Handle *nch;
43 43
44static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 44static struct GNUNET_SCHEDULER_Task * endbadly_task;
45 45
46static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 46static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
47 47
@@ -171,17 +171,17 @@ name_lookup_proc (void *cls,
171 ncqe = NULL; 171 ncqe = NULL;
172 GNUNET_assert (NULL != cls); 172 GNUNET_assert (NULL != cls);
173 173
174 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 174 if (endbadly_task != NULL)
175 { 175 {
176 GNUNET_SCHEDULER_cancel (endbadly_task); 176 GNUNET_SCHEDULER_cancel (endbadly_task);
177 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 177 endbadly_task = NULL;
178 } 178 }
179 179
180 if (NULL == block) 180 if (NULL == block)
181 { 181 {
182 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 182 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
183 _("Namestore returned no block\n")); 183 _("Namestore returned no block\n"));
184 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 184 if (endbadly_task != NULL)
185 GNUNET_SCHEDULER_cancel (endbadly_task); 185 GNUNET_SCHEDULER_cancel (endbadly_task);
186 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 186 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
187 return; 187 return;
diff --git a/src/namestore/test_namestore_api_lookup_shadow_filter.c b/src/namestore/test_namestore_api_lookup_shadow_filter.c
index 825c4d0a4..9a18d84b7 100644
--- a/src/namestore/test_namestore_api_lookup_shadow_filter.c
+++ b/src/namestore/test_namestore_api_lookup_shadow_filter.c
@@ -42,9 +42,9 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
42 42
43static struct GNUNET_NAMECACHE_Handle *nch; 43static struct GNUNET_NAMECACHE_Handle *nch;
44 44
45static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 45static struct GNUNET_SCHEDULER_Task * endbadly_task;
46 46
47static GNUNET_SCHEDULER_TaskIdentifier delayed_lookup_task; 47static struct GNUNET_SCHEDULER_Task * delayed_lookup_task;
48 48
49static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 49static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
50 50
@@ -99,10 +99,10 @@ cleanup ()
99static void 99static void
100endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 100endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
101{ 101{
102 if (GNUNET_SCHEDULER_NO_TASK != delayed_lookup_task) 102 if (NULL != delayed_lookup_task)
103 { 103 {
104 GNUNET_SCHEDULER_cancel (delayed_lookup_task); 104 GNUNET_SCHEDULER_cancel (delayed_lookup_task);
105 delayed_lookup_task = GNUNET_SCHEDULER_NO_TASK; 105 delayed_lookup_task = NULL;
106 } 106 }
107 if (NULL != nsqe) 107 if (NULL != nsqe)
108 { 108 {
@@ -222,17 +222,17 @@ name_lookup_active_proc (void *cls,
222 222
223 ncqe = NULL; 223 ncqe = NULL;
224 ncqe_shadow = NULL; 224 ncqe_shadow = NULL;
225 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 225 if (endbadly_task != NULL)
226 { 226 {
227 GNUNET_SCHEDULER_cancel (endbadly_task); 227 GNUNET_SCHEDULER_cancel (endbadly_task);
228 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 228 endbadly_task = NULL;
229 } 229 }
230 230
231 if (NULL == block) 231 if (NULL == block)
232 { 232 {
233 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 233 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
234 _("Namestore returned no block\n")); 234 _("Namestore returned no block\n"));
235 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 235 if (endbadly_task != NULL)
236 GNUNET_SCHEDULER_cancel (endbadly_task); 236 GNUNET_SCHEDULER_cancel (endbadly_task);
237 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 237 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
238 return; 238 return;
@@ -249,7 +249,7 @@ name_lookup_shadow (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
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");
252 delayed_lookup_task = GNUNET_SCHEDULER_NO_TASK; 252 delayed_lookup_task = NULL;
253 ncqe_shadow = GNUNET_NAMECACHE_lookup_block (nch, &derived_hash, 253 ncqe_shadow = GNUNET_NAMECACHE_lookup_block (nch, &derived_hash,
254 &name_lookup_active_proc, &records[1]); 254 &name_lookup_active_proc, &records[1]);
255} 255}
diff --git a/src/namestore/test_namestore_api_monitoring.c b/src/namestore/test_namestore_api_monitoring.c
index f7eb5fd89..0477f23de 100644
--- a/src/namestore/test_namestore_api_monitoring.c
+++ b/src/namestore/test_namestore_api_monitoring.c
@@ -32,7 +32,7 @@
32 32
33static struct GNUNET_NAMESTORE_Handle * nsh; 33static struct GNUNET_NAMESTORE_Handle * nsh;
34 34
35static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 35static struct GNUNET_SCHEDULER_Task * endbadly_task;
36 36
37static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey; 37static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
38 38
@@ -196,10 +196,10 @@ zone_proc (void *cls,
196 196
197 if (2 == ++returned_records) 197 if (2 == ++returned_records)
198 { 198 {
199 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 199 if (endbadly_task != NULL)
200 { 200 {
201 GNUNET_SCHEDULER_cancel (endbadly_task); 201 GNUNET_SCHEDULER_cancel (endbadly_task);
202 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 202 endbadly_task = NULL;
203 } 203 }
204 if (GNUNET_YES == fail) 204 if (GNUNET_YES == fail)
205 GNUNET_SCHEDULER_add_now (&endbadly, NULL); 205 GNUNET_SCHEDULER_add_now (&endbadly, NULL);
diff --git a/src/namestore/test_namestore_api_monitoring_existing.c b/src/namestore/test_namestore_api_monitoring_existing.c
index ae922d30e..a02860c86 100644
--- a/src/namestore/test_namestore_api_monitoring_existing.c
+++ b/src/namestore/test_namestore_api_monitoring_existing.c
@@ -33,7 +33,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
33 33
34static struct GNUNET_NAMESTORE_Handle * nsh; 34static struct GNUNET_NAMESTORE_Handle * nsh;
35 35
36static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 36static struct GNUNET_SCHEDULER_Task * endbadly_task;
37 37
38static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey; 38static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
39 39
@@ -194,10 +194,10 @@ zone_proc (void *cls,
194 194
195 if (2 == ++returned_records) 195 if (2 == ++returned_records)
196 { 196 {
197 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 197 if (endbadly_task != NULL)
198 { 198 {
199 GNUNET_SCHEDULER_cancel (endbadly_task); 199 GNUNET_SCHEDULER_cancel (endbadly_task);
200 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 200 endbadly_task = NULL;
201 } 201 }
202 if (GNUNET_YES == fail) 202 if (GNUNET_YES == fail)
203 GNUNET_SCHEDULER_add_now (&endbadly, NULL); 203 GNUNET_SCHEDULER_add_now (&endbadly, NULL);
diff --git a/src/namestore/test_namestore_api_remove.c b/src/namestore/test_namestore_api_remove.c
index a6b4731d2..771c90042 100644
--- a/src/namestore/test_namestore_api_remove.c
+++ b/src/namestore/test_namestore_api_remove.c
@@ -36,7 +36,7 @@
36 36
37static struct GNUNET_NAMESTORE_Handle *nsh; 37static struct GNUNET_NAMESTORE_Handle *nsh;
38 38
39static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 39static struct GNUNET_SCHEDULER_Task * endbadly_task;
40 40
41static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 41static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
42 42
@@ -103,7 +103,7 @@ remove_cont (void *cls,
103 { 103 {
104 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 104 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
105 _("Records could not be removed: `%s'\n"), emsg); 105 _("Records could not be removed: `%s'\n"), emsg);
106 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 106 if (endbadly_task != NULL)
107 GNUNET_SCHEDULER_cancel (endbadly_task); 107 GNUNET_SCHEDULER_cancel (endbadly_task);
108 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 108 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
109 return; 109 return;
@@ -111,7 +111,7 @@ remove_cont (void *cls,
111 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 111 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
112 "Records were removed, perform lookup\n"); 112 "Records were removed, perform lookup\n");
113 removed = GNUNET_YES; 113 removed = GNUNET_YES;
114 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 114 if (endbadly_task != NULL)
115 GNUNET_SCHEDULER_cancel (endbadly_task); 115 GNUNET_SCHEDULER_cancel (endbadly_task);
116 GNUNET_SCHEDULER_add_now (&end, NULL); 116 GNUNET_SCHEDULER_add_now (&end, NULL);
117} 117}
@@ -130,7 +130,7 @@ put_cont (void *cls, int32_t success,
130 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 130 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
131 "Namestore could not store record: `%s'\n", 131 "Namestore could not store record: `%s'\n",
132 emsg); 132 emsg);
133 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 133 if (endbadly_task != NULL)
134 GNUNET_SCHEDULER_cancel (endbadly_task); 134 GNUNET_SCHEDULER_cancel (endbadly_task);
135 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 135 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
136 return; 136 return;
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 b87aec6a9..9e08efa1b 100644
--- a/src/namestore/test_namestore_api_remove_not_existing_record.c
+++ b/src/namestore/test_namestore_api_remove_not_existing_record.c
@@ -36,7 +36,7 @@
36 36
37static struct GNUNET_NAMESTORE_Handle *nsh; 37static struct GNUNET_NAMESTORE_Handle *nsh;
38 38
39static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 39static struct GNUNET_SCHEDULER_Task * endbadly_task;
40 40
41static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 41static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
42 42
@@ -98,10 +98,10 @@ put_cont (void *cls, int32_t success, const char *emsg)
98{ 98{
99 GNUNET_assert (NULL != cls); 99 GNUNET_assert (NULL != cls);
100 nsqe = NULL; 100 nsqe = NULL;
101 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 101 if (endbadly_task != NULL)
102 { 102 {
103 GNUNET_SCHEDULER_cancel (endbadly_task); 103 GNUNET_SCHEDULER_cancel (endbadly_task);
104 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 104 endbadly_task = NULL;
105 } 105 }
106 106
107 switch (success) { 107 switch (success) {
diff --git a/src/namestore/test_namestore_api_store.c b/src/namestore/test_namestore_api_store.c
index 5fd0e9b81..2eea1b0bd 100644
--- a/src/namestore/test_namestore_api_store.c
+++ b/src/namestore/test_namestore_api_store.c
@@ -36,7 +36,7 @@
36 36
37static struct GNUNET_NAMESTORE_Handle *nsh; 37static struct GNUNET_NAMESTORE_Handle *nsh;
38 38
39static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 39static struct GNUNET_SCHEDULER_Task * endbadly_task;
40 40
41static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 41static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
42 42
@@ -104,7 +104,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
104 name, 104 name,
105 (success == GNUNET_OK) ? "SUCCESS" : "FAIL"); 105 (success == GNUNET_OK) ? "SUCCESS" : "FAIL");
106 GNUNET_SCHEDULER_cancel (endbadly_task); 106 GNUNET_SCHEDULER_cancel (endbadly_task);
107 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 107 endbadly_task = NULL;
108 GNUNET_SCHEDULER_add_now (&end, NULL); 108 GNUNET_SCHEDULER_add_now (&end, NULL);
109} 109}
110 110
diff --git a/src/namestore/test_namestore_api_store_update.c b/src/namestore/test_namestore_api_store_update.c
index 73515e130..475fafa44 100644
--- a/src/namestore/test_namestore_api_store_update.c
+++ b/src/namestore/test_namestore_api_store_update.c
@@ -47,7 +47,7 @@ static struct GNUNET_NAMESTORE_Handle *nsh;
47 47
48static struct GNUNET_NAMECACHE_Handle *nch; 48static struct GNUNET_NAMECACHE_Handle *nch;
49 49
50static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 50static struct GNUNET_SCHEDULER_Task * endbadly_task;
51 51
52static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey; 52static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
53 53
@@ -168,7 +168,7 @@ rd_decrypt_cb (void *cls,
168 GNUNET_assert (0 == memcmp (&rd_cmp_data, rd[0].data, TEST_RECORD_DATALEN2)); 168 GNUNET_assert (0 == memcmp (&rd_cmp_data, rd[0].data, TEST_RECORD_DATALEN2));
169 169
170 GNUNET_SCHEDULER_cancel (endbadly_task); 170 GNUNET_SCHEDULER_cancel (endbadly_task);
171 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 171 endbadly_task = NULL;
172 GNUNET_SCHEDULER_add_now (&end, NULL); 172 GNUNET_SCHEDULER_add_now (&end, NULL);
173 } 173 }
174} 174}
@@ -187,7 +187,7 @@ name_lookup_proc (void *cls,
187 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 187 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
188 _("Namecache returned no block for `%s'\n"), 188 _("Namecache returned no block for `%s'\n"),
189 name); 189 name);
190 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 190 if (endbadly_task != NULL)
191 GNUNET_SCHEDULER_cancel (endbadly_task); 191 GNUNET_SCHEDULER_cancel (endbadly_task);
192 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 192 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
193 return; 193 return;
diff --git a/src/namestore/test_namestore_api_zone_iteration.c b/src/namestore/test_namestore_api_zone_iteration.c
index 933845206..85f3b3fac 100644
--- a/src/namestore/test_namestore_api_zone_iteration.c
+++ b/src/namestore/test_namestore_api_zone_iteration.c
@@ -32,7 +32,7 @@
32 32
33static struct GNUNET_NAMESTORE_Handle * nsh; 33static struct GNUNET_NAMESTORE_Handle * nsh;
34 34
35static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 35static struct GNUNET_SCHEDULER_Task * endbadly_task;
36 36
37static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey; 37static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
38 38
@@ -117,10 +117,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
117 GNUNET_NAMESTORE_zone_iteration_stop (zi); 117 GNUNET_NAMESTORE_zone_iteration_stop (zi);
118 zi = NULL; 118 zi = NULL;
119 } 119 }
120 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 120 if (endbadly_task != NULL)
121 { 121 {
122 GNUNET_SCHEDULER_cancel (endbadly_task); 122 GNUNET_SCHEDULER_cancel (endbadly_task);
123 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 123 endbadly_task = NULL;
124 } 124 }
125 125
126 if (privkey != NULL) 126 if (privkey != NULL)
@@ -292,7 +292,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
292 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to created records: `%s'\n", 292 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to created records: `%s'\n",
293 emsg); 293 emsg);
294 GNUNET_break (0); 294 GNUNET_break (0);
295 if (GNUNET_SCHEDULER_NO_TASK != endbadly_task) 295 if (NULL != endbadly_task)
296 GNUNET_SCHEDULER_cancel (endbadly_task); 296 GNUNET_SCHEDULER_cancel (endbadly_task);
297 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 297 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
298 return; 298 return;
@@ -311,7 +311,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
311 { 311 {
312 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to create zone iterator\n"); 312 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to create zone iterator\n");
313 GNUNET_break (0); 313 GNUNET_break (0);
314 if (GNUNET_SCHEDULER_NO_TASK != endbadly_task) 314 if (NULL != endbadly_task)
315 GNUNET_SCHEDULER_cancel (endbadly_task); 315 GNUNET_SCHEDULER_cancel (endbadly_task);
316 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 316 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
317 return; 317 return;
@@ -360,7 +360,7 @@ empty_zone_proc (void *cls,
360 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 360 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
361 _("Expected empty zone but received zone private key\n")); 361 _("Expected empty zone but received zone private key\n"));
362 GNUNET_break (0); 362 GNUNET_break (0);
363 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 363 if (endbadly_task != NULL)
364 GNUNET_SCHEDULER_cancel (endbadly_task); 364 GNUNET_SCHEDULER_cancel (endbadly_task);
365 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 365 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
366 return; 366 return;
@@ -370,7 +370,7 @@ empty_zone_proc (void *cls,
370 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 370 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
371 _("Expected no zone content but received data\n")); 371 _("Expected no zone content but received data\n"));
372 GNUNET_break (0); 372 GNUNET_break (0);
373 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 373 if (endbadly_task != NULL)
374 GNUNET_SCHEDULER_cancel (endbadly_task); 374 GNUNET_SCHEDULER_cancel (endbadly_task);
375 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 375 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
376 return; 376 return;
diff --git a/src/namestore/test_namestore_api_zone_iteration_nick.c b/src/namestore/test_namestore_api_zone_iteration_nick.c
index 6ea4e39c0..5b8f5bde1 100644
--- a/src/namestore/test_namestore_api_zone_iteration_nick.c
+++ b/src/namestore/test_namestore_api_zone_iteration_nick.c
@@ -34,7 +34,7 @@
34 34
35static struct GNUNET_NAMESTORE_Handle * nsh; 35static struct GNUNET_NAMESTORE_Handle * nsh;
36 36
37static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 37static struct GNUNET_SCHEDULER_Task * endbadly_task;
38 38
39static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey; 39static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
40 40
@@ -120,10 +120,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
120 GNUNET_NAMESTORE_zone_iteration_stop (zi); 120 GNUNET_NAMESTORE_zone_iteration_stop (zi);
121 zi = NULL; 121 zi = NULL;
122 } 122 }
123 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 123 if (endbadly_task != NULL)
124 { 124 {
125 GNUNET_SCHEDULER_cancel (endbadly_task); 125 GNUNET_SCHEDULER_cancel (endbadly_task);
126 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 126 endbadly_task = NULL;
127 } 127 }
128 128
129 if (privkey != NULL) 129 if (privkey != NULL)
@@ -268,7 +268,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
268 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to created records: `%s'\n", 268 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to created records: `%s'\n",
269 emsg); 269 emsg);
270 GNUNET_break (0); 270 GNUNET_break (0);
271 if (GNUNET_SCHEDULER_NO_TASK != endbadly_task) 271 if (NULL != endbadly_task)
272 GNUNET_SCHEDULER_cancel (endbadly_task); 272 GNUNET_SCHEDULER_cancel (endbadly_task);
273 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 273 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
274 return; 274 return;
@@ -287,7 +287,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
287 { 287 {
288 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to create zone iterator\n"); 288 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to create zone iterator\n");
289 GNUNET_break (0); 289 GNUNET_break (0);
290 if (GNUNET_SCHEDULER_NO_TASK != endbadly_task) 290 if (NULL != endbadly_task)
291 GNUNET_SCHEDULER_cancel (endbadly_task); 291 GNUNET_SCHEDULER_cancel (endbadly_task);
292 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 292 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
293 return; 293 return;
@@ -385,7 +385,7 @@ empty_zone_proc (void *cls,
385 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 385 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
386 _("Expected empty zone but received zone private key\n")); 386 _("Expected empty zone but received zone private key\n"));
387 GNUNET_break (0); 387 GNUNET_break (0);
388 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 388 if (endbadly_task != NULL)
389 GNUNET_SCHEDULER_cancel (endbadly_task); 389 GNUNET_SCHEDULER_cancel (endbadly_task);
390 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 390 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
391 return; 391 return;
@@ -395,7 +395,7 @@ empty_zone_proc (void *cls,
395 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 395 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
396 _("Expected no zone content but received data\n")); 396 _("Expected no zone content but received data\n"));
397 GNUNET_break (0); 397 GNUNET_break (0);
398 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 398 if (endbadly_task != NULL)
399 GNUNET_SCHEDULER_cancel (endbadly_task); 399 GNUNET_SCHEDULER_cancel (endbadly_task);
400 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 400 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
401 return; 401 return;
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 ed393af8e..3f8d481d1 100644
--- a/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
+++ b/src/namestore/test_namestore_api_zone_iteration_specific_zone.c
@@ -33,7 +33,7 @@
33 33
34static struct GNUNET_NAMESTORE_Handle * nsh; 34static struct GNUNET_NAMESTORE_Handle * nsh;
35 35
36static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 36static struct GNUNET_SCHEDULER_Task * endbadly_task;
37 37
38static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey; 38static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
39 39
@@ -118,10 +118,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
118 zi = NULL; 118 zi = NULL;
119 } 119 }
120 120
121 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 121 if (endbadly_task != NULL)
122 { 122 {
123 GNUNET_SCHEDULER_cancel (endbadly_task); 123 GNUNET_SCHEDULER_cancel (endbadly_task);
124 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 124 endbadly_task = NULL;
125 } 125 }
126 126
127 if (privkey != NULL) 127 if (privkey != NULL)
@@ -275,7 +275,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
275 "Failed to created records: `%s'\n", 275 "Failed to created records: `%s'\n",
276 emsg); 276 emsg);
277 GNUNET_break (0); 277 GNUNET_break (0);
278 if (GNUNET_SCHEDULER_NO_TASK != endbadly_task) 278 if (NULL != endbadly_task)
279 GNUNET_SCHEDULER_cancel (endbadly_task); 279 GNUNET_SCHEDULER_cancel (endbadly_task);
280 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 280 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
281 return; 281 return;
@@ -296,7 +296,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
296 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 296 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
297 "Failed to create zone iterator\n"); 297 "Failed to create zone iterator\n");
298 GNUNET_break (0); 298 GNUNET_break (0);
299 if (GNUNET_SCHEDULER_NO_TASK != endbadly_task) 299 if (NULL != endbadly_task)
300 GNUNET_SCHEDULER_cancel (endbadly_task); 300 GNUNET_SCHEDULER_cancel (endbadly_task);
301 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 301 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
302 return; 302 return;
@@ -345,7 +345,7 @@ empty_zone_proc (void *cls,
345 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 345 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
346 _("Expected empty zone but received zone private key\n")); 346 _("Expected empty zone but received zone private key\n"));
347 GNUNET_break (0); 347 GNUNET_break (0);
348 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 348 if (endbadly_task != NULL)
349 GNUNET_SCHEDULER_cancel (endbadly_task); 349 GNUNET_SCHEDULER_cancel (endbadly_task);
350 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 350 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
351 return; 351 return;
@@ -355,7 +355,7 @@ empty_zone_proc (void *cls,
355 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 355 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
356 _("Expected no zone content but received data\n")); 356 _("Expected no zone content but received data\n"));
357 GNUNET_break (0); 357 GNUNET_break (0);
358 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 358 if (endbadly_task != NULL)
359 GNUNET_SCHEDULER_cancel (endbadly_task); 359 GNUNET_SCHEDULER_cancel (endbadly_task);
360 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 360 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
361 return; 361 return;
diff --git a/src/namestore/test_namestore_api_zone_iteration_stop.c b/src/namestore/test_namestore_api_zone_iteration_stop.c
index 38aae9b6d..942c381a3 100644
--- a/src/namestore/test_namestore_api_zone_iteration_stop.c
+++ b/src/namestore/test_namestore_api_zone_iteration_stop.c
@@ -32,7 +32,7 @@
32 32
33static struct GNUNET_NAMESTORE_Handle * nsh; 33static struct GNUNET_NAMESTORE_Handle * nsh;
34 34
35static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 35static struct GNUNET_SCHEDULER_Task * endbadly_task;
36 36
37static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey; 37static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
38 38
@@ -118,10 +118,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
118 zi = NULL; 118 zi = NULL;
119 } 119 }
120 120
121 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 121 if (endbadly_task != NULL)
122 { 122 {
123 GNUNET_SCHEDULER_cancel (endbadly_task); 123 GNUNET_SCHEDULER_cancel (endbadly_task);
124 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 124 endbadly_task = NULL;
125 } 125 }
126 126
127 if (privkey != NULL) 127 if (privkey != NULL)
@@ -266,10 +266,10 @@ zone_proc (void *cls,
266 "Telling namestore to stop zone iteration\n"); 266 "Telling namestore to stop zone iteration\n");
267 GNUNET_NAMESTORE_zone_iteration_stop (zi); 267 GNUNET_NAMESTORE_zone_iteration_stop (zi);
268 zi = NULL; 268 zi = NULL;
269 if (GNUNET_SCHEDULER_NO_TASK != endbadly_task) 269 if (NULL != endbadly_task)
270 { 270 {
271 GNUNET_SCHEDULER_cancel (endbadly_task); 271 GNUNET_SCHEDULER_cancel (endbadly_task);
272 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 272 endbadly_task = NULL;
273 } 273 }
274 res = 0; 274 res = 0;
275 GNUNET_SCHEDULER_add_delayed (WAIT, &end, NULL); 275 GNUNET_SCHEDULER_add_delayed (WAIT, &end, NULL);
@@ -303,7 +303,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
303 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to created records: `%s'\n", 303 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to created records: `%s'\n",
304 emsg); 304 emsg);
305 GNUNET_break (0); 305 GNUNET_break (0);
306 if (GNUNET_SCHEDULER_NO_TASK != endbadly_task) 306 if (NULL != endbadly_task)
307 GNUNET_SCHEDULER_cancel (endbadly_task); 307 GNUNET_SCHEDULER_cancel (endbadly_task);
308 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 308 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
309 return; 309 return;
@@ -322,7 +322,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
322 { 322 {
323 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to create zone iterator\n"); 323 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to create zone iterator\n");
324 GNUNET_break (0); 324 GNUNET_break (0);
325 if (GNUNET_SCHEDULER_NO_TASK != endbadly_task) 325 if (NULL != endbadly_task)
326 GNUNET_SCHEDULER_cancel (endbadly_task); 326 GNUNET_SCHEDULER_cancel (endbadly_task);
327 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 327 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
328 return; 328 return;
@@ -371,7 +371,7 @@ empty_zone_proc (void *cls,
371 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 371 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
372 _("Expected empty zone but received zone private key\n")); 372 _("Expected empty zone but received zone private key\n"));
373 GNUNET_break (0); 373 GNUNET_break (0);
374 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 374 if (endbadly_task != NULL)
375 GNUNET_SCHEDULER_cancel (endbadly_task); 375 GNUNET_SCHEDULER_cancel (endbadly_task);
376 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 376 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
377 return; 377 return;
@@ -381,7 +381,7 @@ empty_zone_proc (void *cls,
381 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 381 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
382 _("Expected no zone content but received data\n")); 382 _("Expected no zone content but received data\n"));
383 GNUNET_break (0); 383 GNUNET_break (0);
384 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 384 if (endbadly_task != NULL)
385 GNUNET_SCHEDULER_cancel (endbadly_task); 385 GNUNET_SCHEDULER_cancel (endbadly_task);
386 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL); 386 endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
387 return; 387 return;
diff --git a/src/namestore/test_namestore_api_zone_to_name.c b/src/namestore/test_namestore_api_zone_to_name.c
index 9ade0cfc1..5c75fcb91 100644
--- a/src/namestore/test_namestore_api_zone_to_name.c
+++ b/src/namestore/test_namestore_api_zone_to_name.c
@@ -39,7 +39,7 @@
39 39
40static struct GNUNET_NAMESTORE_Handle * nsh; 40static struct GNUNET_NAMESTORE_Handle * nsh;
41 41
42static GNUNET_SCHEDULER_TaskIdentifier endbadly_task; 42static struct GNUNET_SCHEDULER_Task * endbadly_task;
43 43
44static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey; 44static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
45 45
@@ -81,10 +81,10 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
81static void 81static void
82end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 82end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
83{ 83{
84 if (endbadly_task != GNUNET_SCHEDULER_NO_TASK) 84 if (endbadly_task != NULL)
85 { 85 {
86 GNUNET_SCHEDULER_cancel (endbadly_task); 86 GNUNET_SCHEDULER_cancel (endbadly_task);
87 endbadly_task = GNUNET_SCHEDULER_NO_TASK; 87 endbadly_task = NULL;
88 } 88 }
89 if (privkey != NULL) 89 if (privkey != NULL)
90 GNUNET_free (privkey); 90 GNUNET_free (privkey);
diff --git a/src/nat/nat.c b/src/nat/nat.c
index 85d069e07..0225508a6 100644
--- a/src/nat/nat.c
+++ b/src/nat/nat.c
@@ -230,27 +230,27 @@ struct GNUNET_NAT_Handle
230 /** 230 /**
231 * ID of select gnunet-helper-nat-server stdout read task 231 * ID of select gnunet-helper-nat-server stdout read task
232 */ 232 */
233 GNUNET_SCHEDULER_TaskIdentifier server_read_task; 233 struct GNUNET_SCHEDULER_Task * server_read_task;
234 234
235 /** 235 /**
236 * ID of interface IP-scan task 236 * ID of interface IP-scan task
237 */ 237 */
238 GNUNET_SCHEDULER_TaskIdentifier ifc_task; 238 struct GNUNET_SCHEDULER_Task * ifc_task;
239 239
240 /** 240 /**
241 * ID of hostname DNS lookup task 241 * ID of hostname DNS lookup task
242 */ 242 */
243 GNUNET_SCHEDULER_TaskIdentifier hostname_task; 243 struct GNUNET_SCHEDULER_Task * hostname_task;
244 244
245 /** 245 /**
246 * ID of DynDNS lookup task 246 * ID of DynDNS lookup task
247 */ 247 */
248 GNUNET_SCHEDULER_TaskIdentifier dns_task; 248 struct GNUNET_SCHEDULER_Task * dns_task;
249 249
250 /** 250 /**
251 * ID of task to add addresses from bind. 251 * ID of task to add addresses from bind.
252 */ 252 */
253 GNUNET_SCHEDULER_TaskIdentifier bind_task; 253 struct GNUNET_SCHEDULER_Task * bind_task;
254 254
255 /** 255 /**
256 * How often do we scan for changes in our IP address from our local 256 * How often do we scan for changes in our IP address from our local
@@ -758,7 +758,7 @@ process_interfaces (void *cls, const char *name, int isDefault,
758 return GNUNET_OK; 758 return GNUNET_OK;
759 } 759 }
760 if ((h->internal_address == NULL) && (h->server_proc == NULL) && 760 if ((h->internal_address == NULL) && (h->server_proc == NULL) &&
761 (h->server_read_task == GNUNET_SCHEDULER_NO_TASK) && 761 (h->server_read_task == NULL) &&
762 (GNUNET_YES == isDefault) && ((addr->sa_family == AF_INET) || 762 (GNUNET_YES == isDefault) && ((addr->sa_family == AF_INET) ||
763 (addr->sa_family == AF_INET6))) 763 (addr->sa_family == AF_INET6)))
764 { 764 {
@@ -784,7 +784,7 @@ restart_nat_server (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
784{ 784{
785 struct GNUNET_NAT_Handle *h = cls; 785 struct GNUNET_NAT_Handle *h = cls;
786 786
787 h->server_read_task = GNUNET_SCHEDULER_NO_TASK; 787 h->server_read_task = NULL;
788 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 788 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
789 return; 789 return;
790 start_gnunet_nat_server (h); 790 start_gnunet_nat_server (h);
@@ -811,7 +811,7 @@ nat_server_read (void *cls,
811 const char *port_start; 811 const char *port_start;
812 struct sockaddr_in sin_addr; 812 struct sockaddr_in sin_addr;
813 813
814 h->server_read_task = GNUNET_SCHEDULER_NO_TASK; 814 h->server_read_task = NULL;
815 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 815 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
816 return; 816 return;
817 memset (mybuf, 0, sizeof (mybuf)); 817 memset (mybuf, 0, sizeof (mybuf));
@@ -946,7 +946,7 @@ list_interfaces (void *cls,
946{ 946{
947 struct GNUNET_NAT_Handle *h = cls; 947 struct GNUNET_NAT_Handle *h = cls;
948 948
949 h->ifc_task = GNUNET_SCHEDULER_NO_TASK; 949 h->ifc_task = NULL;
950 remove_from_address_list_by_source (h, LAL_INTERFACE_ADDRESS); 950 remove_from_address_list_by_source (h, LAL_INTERFACE_ADDRESS);
951 GNUNET_OS_network_interfaces_list (&process_interfaces, h); 951 GNUNET_OS_network_interfaces_list (&process_interfaces, h);
952 h->ifc_task = 952 h->ifc_task =
@@ -967,7 +967,7 @@ resolve_hostname (void *cls,
967{ 967{
968 struct GNUNET_NAT_Handle *h = cls; 968 struct GNUNET_NAT_Handle *h = cls;
969 969
970 h->hostname_task = GNUNET_SCHEDULER_NO_TASK; 970 h->hostname_task = NULL;
971 remove_from_address_list_by_source (h, LAL_HOSTNAME_DNS); 971 remove_from_address_list_by_source (h, LAL_HOSTNAME_DNS);
972 h->hostname_dns = 972 h->hostname_dns =
973 GNUNET_RESOLVER_hostname_resolve (AF_UNSPEC, HOSTNAME_RESOLVE_TIMEOUT, 973 GNUNET_RESOLVER_hostname_resolve (AF_UNSPEC, HOSTNAME_RESOLVE_TIMEOUT,
@@ -989,7 +989,7 @@ resolve_dns (void *cls,
989 struct GNUNET_NAT_Handle *h = cls; 989 struct GNUNET_NAT_Handle *h = cls;
990 struct LocalAddressList *pos; 990 struct LocalAddressList *pos;
991 991
992 h->dns_task = GNUNET_SCHEDULER_NO_TASK; 992 h->dns_task = NULL;
993 for (pos = h->lal_head; NULL != pos; pos = pos->next) 993 for (pos = h->lal_head; NULL != pos; pos = pos->next)
994 if (pos->source == LAL_EXTERNAL_IP) 994 if (pos->source == LAL_EXTERNAL_IP)
995 pos->source = LAL_EXTERNAL_IP_OLD; 995 pos->source = LAL_EXTERNAL_IP_OLD;
@@ -1124,7 +1124,7 @@ add_from_bind (void *cls,
1124 struct sockaddr *sa; 1124 struct sockaddr *sa;
1125 const struct sockaddr_in *v4; 1125 const struct sockaddr_in *v4;
1126 1126
1127 h->bind_task = GNUNET_SCHEDULER_NO_TASK; 1127 h->bind_task = NULL;
1128 for (i = 0; i < h->num_local_addrs; i++) 1128 for (i = 0; i < h->num_local_addrs; i++)
1129 { 1129 {
1130 sa = h->local_addrs[i]; 1130 sa = h->local_addrs[i];
@@ -1384,30 +1384,30 @@ GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h)
1384 GNUNET_RESOLVER_request_cancel (h->hostname_dns); 1384 GNUNET_RESOLVER_request_cancel (h->hostname_dns);
1385 h->hostname_dns = NULL; 1385 h->hostname_dns = NULL;
1386 } 1386 }
1387 if (GNUNET_SCHEDULER_NO_TASK != h->server_read_task) 1387 if (NULL != h->server_read_task)
1388 { 1388 {
1389 GNUNET_SCHEDULER_cancel (h->server_read_task); 1389 GNUNET_SCHEDULER_cancel (h->server_read_task);
1390 h->server_read_task = GNUNET_SCHEDULER_NO_TASK; 1390 h->server_read_task = NULL;
1391 } 1391 }
1392 if (GNUNET_SCHEDULER_NO_TASK != h->bind_task) 1392 if (NULL != h->bind_task)
1393 { 1393 {
1394 GNUNET_SCHEDULER_cancel (h->bind_task); 1394 GNUNET_SCHEDULER_cancel (h->bind_task);
1395 h->bind_task = GNUNET_SCHEDULER_NO_TASK; 1395 h->bind_task = NULL;
1396 } 1396 }
1397 if (GNUNET_SCHEDULER_NO_TASK != h->ifc_task) 1397 if (NULL != h->ifc_task)
1398 { 1398 {
1399 GNUNET_SCHEDULER_cancel (h->ifc_task); 1399 GNUNET_SCHEDULER_cancel (h->ifc_task);
1400 h->ifc_task = GNUNET_SCHEDULER_NO_TASK; 1400 h->ifc_task = NULL;
1401 } 1401 }
1402 if (GNUNET_SCHEDULER_NO_TASK != h->hostname_task) 1402 if (NULL != h->hostname_task)
1403 { 1403 {
1404 GNUNET_SCHEDULER_cancel (h->hostname_task); 1404 GNUNET_SCHEDULER_cancel (h->hostname_task);
1405 h->hostname_task = GNUNET_SCHEDULER_NO_TASK; 1405 h->hostname_task = NULL;
1406 } 1406 }
1407 if (GNUNET_SCHEDULER_NO_TASK != h->dns_task) 1407 if (NULL != h->dns_task)
1408 { 1408 {
1409 GNUNET_SCHEDULER_cancel (h->dns_task); 1409 GNUNET_SCHEDULER_cancel (h->dns_task);
1410 h->dns_task = GNUNET_SCHEDULER_NO_TASK; 1410 h->dns_task = NULL;
1411 } 1411 }
1412 if (NULL != h->server_proc) 1412 if (NULL != h->server_proc)
1413 { 1413 {
diff --git a/src/nat/nat_auto.c b/src/nat/nat_auto.c
index 8fc85d7a7..33ce8c1f1 100644
--- a/src/nat/nat_auto.c
+++ b/src/nat/nat_auto.c
@@ -129,7 +129,7 @@ struct GNUNET_NAT_AutoHandle
129 /** 129 /**
130 * Task identifier for the timeout. 130 * Task identifier for the timeout.
131 */ 131 */
132 GNUNET_SCHEDULER_TaskIdentifier task; 132 struct GNUNET_SCHEDULER_Task * task;
133 133
134 /** 134 /**
135 * Where are we in the test? 135 * Where are we in the test?
@@ -196,7 +196,7 @@ reversal_test (void *cls,
196{ 196{
197 struct GNUNET_NAT_AutoHandle *ah = cls; 197 struct GNUNET_NAT_AutoHandle *ah = cls;
198 198
199 ah->task = GNUNET_SCHEDULER_NO_TASK; 199 ah->task = NULL;
200 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 200 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
201 _("Testing connection reversal with ICMP server.\n")); 201 _("Testing connection reversal with ICMP server.\n"));
202 GNUNET_RESOLVER_connect (ah->cfg); 202 GNUNET_RESOLVER_connect (ah->cfg);
@@ -603,10 +603,10 @@ GNUNET_NAT_autoconfig_cancel (struct GNUNET_NAT_AutoHandle *ah)
603 GNUNET_NAT_mini_get_external_ipv4_cancel (ah->eh); 603 GNUNET_NAT_mini_get_external_ipv4_cancel (ah->eh);
604 ah->eh = NULL; 604 ah->eh = NULL;
605 } 605 }
606 if (GNUNET_SCHEDULER_NO_TASK != ah->task) 606 if (NULL != ah->task)
607 { 607 {
608 GNUNET_SCHEDULER_cancel (ah->task); 608 GNUNET_SCHEDULER_cancel (ah->task);
609 ah->task = GNUNET_SCHEDULER_NO_TASK; 609 ah->task = NULL;
610 } 610 }
611 GNUNET_CONFIGURATION_destroy (ah->cfg); 611 GNUNET_CONFIGURATION_destroy (ah->cfg);
612 GNUNET_CONFIGURATION_destroy (ah->initial_cfg); 612 GNUNET_CONFIGURATION_destroy (ah->initial_cfg);
diff --git a/src/nat/nat_mini.c b/src/nat/nat_mini.c
index 1e8ab7ecc..47ba27de8 100644
--- a/src/nat/nat_mini.c
+++ b/src/nat/nat_mini.c
@@ -66,7 +66,7 @@ struct GNUNET_NAT_ExternalHandle
66 /** 66 /**
67 * Read task. 67 * Read task.
68 */ 68 */
69 GNUNET_SCHEDULER_TaskIdentifier task; 69 struct GNUNET_SCHEDULER_Task * task;
70 70
71 /** 71 /**
72 * Handle to 'external-ip' process. 72 * Handle to 'external-ip' process.
@@ -120,7 +120,7 @@ read_external_ipv4 (void *cls,
120 ssize_t ret; 120 ssize_t ret;
121 struct in_addr addr; 121 struct in_addr addr;
122 122
123 eh->task = GNUNET_SCHEDULER_NO_TASK; 123 eh->task = NULL;
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],
@@ -170,7 +170,7 @@ signal_external_ip_error (void *cls,
170{ 170{
171 struct GNUNET_NAT_ExternalHandle *eh = cls; 171 struct GNUNET_NAT_ExternalHandle *eh = cls;
172 172
173 eh->task = GNUNET_SCHEDULER_NO_TASK; 173 eh->task = NULL;
174 eh->cb (eh->cb_cls, 174 eh->cb (eh->cb_cls,
175 NULL, 175 NULL,
176 eh->ret); 176 eh->ret);
@@ -254,7 +254,7 @@ GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle *eh)
254 } 254 }
255 if (NULL != eh->opipe) 255 if (NULL != eh->opipe)
256 GNUNET_DISK_pipe_close (eh->opipe); 256 GNUNET_DISK_pipe_close (eh->opipe);
257 if (GNUNET_SCHEDULER_NO_TASK != eh->task) 257 if (NULL != eh->task)
258 GNUNET_SCHEDULER_cancel (eh->task); 258 GNUNET_SCHEDULER_cancel (eh->task);
259 GNUNET_free (eh); 259 GNUNET_free (eh);
260} 260}
@@ -300,7 +300,7 @@ struct GNUNET_NAT_MiniHandle
300 * We check the mapping periodically to see if it 300 * We check the mapping periodically to see if it
301 * still works. This task triggers the check. 301 * still works. This task triggers the check.
302 */ 302 */
303 GNUNET_SCHEDULER_TaskIdentifier refresh_task; 303 struct GNUNET_SCHEDULER_Task * refresh_task;
304 304
305 /** 305 /**
306 * Are we mapping TCP or UDP? 306 * Are we mapping TCP or UDP?
@@ -543,7 +543,7 @@ process_map_output (void *cls,
543 GNUNET_SYSERR, 543 GNUNET_SYSERR,
544 NULL, 0, 544 NULL, 0,
545 GNUNET_NAT_ERROR_UPNPC_PORTMAP_FAILED); 545 GNUNET_NAT_ERROR_UPNPC_PORTMAP_FAILED);
546 if (GNUNET_SCHEDULER_NO_TASK == mini->refresh_task) 546 if (NULL == mini->refresh_task)
547 mini->refresh_task = 547 mini->refresh_task =
548 GNUNET_SCHEDULER_add_delayed (MAP_REFRESH_FREQ, &do_refresh, mini); 548 GNUNET_SCHEDULER_add_delayed (MAP_REFRESH_FREQ, &do_refresh, mini);
549 return; 549 return;
@@ -664,10 +664,10 @@ GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini)
664{ 664{
665 char pstr[6]; 665 char pstr[6];
666 666
667 if (GNUNET_SCHEDULER_NO_TASK != mini->refresh_task) 667 if (NULL != mini->refresh_task)
668 { 668 {
669 GNUNET_SCHEDULER_cancel (mini->refresh_task); 669 GNUNET_SCHEDULER_cancel (mini->refresh_task);
670 mini->refresh_task = GNUNET_SCHEDULER_NO_TASK; 670 mini->refresh_task = NULL;
671 } 671 }
672 if (NULL != mini->refresh_cmd) 672 if (NULL != mini->refresh_cmd)
673 { 673 {
diff --git a/src/nat/nat_test.c b/src/nat/nat_test.c
index b96ee60ed..33fbb1070 100644
--- a/src/nat/nat_test.c
+++ b/src/nat/nat_test.c
@@ -60,7 +60,7 @@ struct NatActivity
60 /** 60 /**
61 * Task reading from the incoming connection. 61 * Task reading from the incoming connection.
62 */ 62 */
63 GNUNET_SCHEDULER_TaskIdentifier rtask; 63 struct GNUNET_SCHEDULER_Task * rtask;
64}; 64};
65 65
66 66
@@ -141,12 +141,12 @@ struct GNUNET_NAT_Test
141 /** 141 /**
142 * Identity of task for the listen socket (if any) 142 * Identity of task for the listen socket (if any)
143 */ 143 */
144 GNUNET_SCHEDULER_TaskIdentifier ltask; 144 struct GNUNET_SCHEDULER_Task * ltask;
145 145
146 /** 146 /**
147 * Task identifier for the timeout (if any) 147 * Task identifier for the timeout (if any)
148 */ 148 */
149 GNUNET_SCHEDULER_TaskIdentifier ttask; 149 struct GNUNET_SCHEDULER_Task * ttask;
150 150
151 /** 151 /**
152 * GNUNET_YES if we're testing TCP 152 * GNUNET_YES if we're testing TCP
@@ -250,7 +250,7 @@ do_read (void *cls,
250 struct GNUNET_NAT_Test *tst; 250 struct GNUNET_NAT_Test *tst;
251 uint16_t data; 251 uint16_t data;
252 252
253 na->rtask = GNUNET_SCHEDULER_NO_TASK; 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);
256 if ((NULL != tc->write_ready) && 256 if ((NULL != tc->write_ready) &&
@@ -287,7 +287,7 @@ do_accept (void *cls,
287 struct GNUNET_NETWORK_Handle *s; 287 struct GNUNET_NETWORK_Handle *s;
288 struct NatActivity *wl; 288 struct NatActivity *wl;
289 289
290 tst->ltask = GNUNET_SCHEDULER_NO_TASK; 290 tst->ltask = NULL;
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 =
@@ -386,7 +386,7 @@ do_timeout (void *cls,
386{ 386{
387 struct GNUNET_NAT_Test *nh = cls; 387 struct GNUNET_NAT_Test *nh = cls;
388 388
389 nh->ttask = GNUNET_SCHEDULER_NO_TASK; 389 nh->ttask = NULL;
390 nh->report (nh->report_cls, 390 nh->report (nh->report_cls,
391 (GNUNET_NAT_ERROR_SUCCESS == nh->status) 391 (GNUNET_NAT_ERROR_SUCCESS == nh->status)
392 ? GNUNET_NAT_ERROR_TIMEOUT 392 ? GNUNET_NAT_ERROR_TIMEOUT
@@ -495,10 +495,10 @@ GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
495 { 495 {
496 LOG (GNUNET_ERROR_TYPE_ERROR, 496 LOG (GNUNET_ERROR_TYPE_ERROR,
497 _("NAT test failed to start NAT library\n")); 497 _("NAT test failed to start NAT library\n"));
498 if (GNUNET_SCHEDULER_NO_TASK != nh->ltask) 498 if (NULL != nh->ltask)
499 { 499 {
500 GNUNET_SCHEDULER_cancel (nh->ltask); 500 GNUNET_SCHEDULER_cancel (nh->ltask);
501 nh->ltask = GNUNET_SCHEDULER_NO_TASK; 501 nh->ltask = NULL;
502 } 502 }
503 if (NULL != nh->lsock) 503 if (NULL != nh->lsock)
504 { 504 {
@@ -541,9 +541,9 @@ GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst)
541 GNUNET_NETWORK_socket_close (pos->sock); 541 GNUNET_NETWORK_socket_close (pos->sock);
542 GNUNET_free (pos); 542 GNUNET_free (pos);
543 } 543 }
544 if (GNUNET_SCHEDULER_NO_TASK != tst->ttask) 544 if (NULL != tst->ttask)
545 GNUNET_SCHEDULER_cancel (tst->ttask); 545 GNUNET_SCHEDULER_cancel (tst->ttask);
546 if (GNUNET_SCHEDULER_NO_TASK != tst->ltask) 546 if (NULL != tst->ltask)
547 GNUNET_SCHEDULER_cancel (tst->ltask); 547 GNUNET_SCHEDULER_cancel (tst->ltask);
548 if (NULL != tst->lsock) 548 if (NULL != tst->lsock)
549 GNUNET_NETWORK_socket_close (tst->lsock); 549 GNUNET_NETWORK_socket_close (tst->lsock);
diff --git a/src/nat/test_nat_test.c b/src/nat/test_nat_test.c
index d32015b56..a5e6ba209 100644
--- a/src/nat/test_nat_test.c
+++ b/src/nat/test_nat_test.c
@@ -36,7 +36,7 @@ static int ret = 1;
36 36
37static struct GNUNET_NAT_Test *tst; 37static struct GNUNET_NAT_Test *tst;
38 38
39static GNUNET_SCHEDULER_TaskIdentifier tsk; 39static struct GNUNET_SCHEDULER_Task * tsk;
40 40
41 41
42static void 42static void
@@ -54,7 +54,7 @@ report_result (void *cls,
54 GNUNET_NAT_test_stop (tst); 54 GNUNET_NAT_test_stop (tst);
55 tst = NULL; 55 tst = NULL;
56 GNUNET_SCHEDULER_cancel (tsk); 56 GNUNET_SCHEDULER_cancel (tsk);
57 tsk = GNUNET_SCHEDULER_NO_TASK; 57 tsk = NULL;
58} 58}
59 59
60 60
@@ -62,7 +62,7 @@ static void
62failed_timeout (void *cls, 62failed_timeout (void *cls,
63 const struct GNUNET_SCHEDULER_TaskContext *tc) 63 const struct GNUNET_SCHEDULER_TaskContext *tc)
64{ 64{
65 tsk = GNUNET_SCHEDULER_NO_TASK; 65 tsk = NULL;
66 fprintf (stderr, 66 fprintf (stderr,
67 "NAT test failed to terminate on timeout\n"); 67 "NAT test failed to terminate on timeout\n");
68 ret = 2; 68 ret = 2;
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c
index 3e39056be..bdba7bbaf 100644
--- a/src/nse/gnunet-nse-profiler.c
+++ b/src/nse/gnunet-nse-profiler.c
@@ -179,7 +179,7 @@ static struct GNUNET_CONFIGURATION_Handle *testing_cfg;
179/** 179/**
180 * The shutdown task 180 * The shutdown task
181 */ 181 */
182static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id; 182static struct GNUNET_SCHEDULER_Task * shutdown_task_id;
183 183
184/** 184/**
185 * Maximum number of connections to NSE services. 185 * Maximum number of connections to NSE services.
@@ -270,7 +270,7 @@ close_monitor_connections ()
270static void 270static void
271shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 271shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
272{ 272{
273 shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; 273 shutdown_task_id = NULL;
274 if (GNUNET_YES == shutting_down) 274 if (GNUNET_YES == shutting_down)
275 return; 275 return;
276 shutting_down = GNUNET_YES; 276 shutting_down = GNUNET_YES;
@@ -298,7 +298,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
298static void 298static void
299shutdown_now () 299shutdown_now ()
300{ 300{
301 if (GNUNET_SCHEDULER_NO_TASK != shutdown_task_id) 301 if (NULL != shutdown_task_id)
302 GNUNET_SCHEDULER_cancel (shutdown_task_id); 302 GNUNET_SCHEDULER_cancel (shutdown_task_id);
303 shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 303 shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
304} 304}
diff --git a/src/nse/gnunet-nse.c b/src/nse/gnunet-nse.c
index ec2ad26d3..8fb5afde3 100644
--- a/src/nse/gnunet-nse.c
+++ b/src/nse/gnunet-nse.c
@@ -45,7 +45,7 @@ static struct GNUNET_CLIENT_TestHandle *test;
45/** 45/**
46 * Shutdown task 46 * Shutdown task
47 */ 47 */
48static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 48static struct GNUNET_SCHEDULER_Task * shutdown_task;
49 49
50/** 50/**
51 * The program status; 0 for success. 51 * The program status; 0 for success.
@@ -62,7 +62,7 @@ static int status;
62static void 62static void
63do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 63do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
64{ 64{
65 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 65 shutdown_task = NULL;
66 if (NULL != test) 66 if (NULL != test)
67 GNUNET_CLIENT_service_test_cancel (test); 67 GNUNET_CLIENT_service_test_cancel (test);
68 if (NULL != nse) 68 if (NULL != nse)
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index 317750b70..e83e94eb0 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -130,7 +130,7 @@ struct NSEPeerEntry
130 /** 130 /**
131 * Task scheduled to send message to this peer. 131 * Task scheduled to send message to this peer.
132 */ 132 */
133 GNUNET_SCHEDULER_TaskIdentifier transmit_task; 133 struct GNUNET_SCHEDULER_Task * transmit_task;
134 134
135 /** 135 /**
136 * Did we receive or send a message about the previous round 136 * Did we receive or send a message about the previous round
@@ -275,12 +275,12 @@ static unsigned int estimate_count;
275/** 275/**
276 * Task scheduled to update our flood message for the next round. 276 * Task scheduled to update our flood message for the next round.
277 */ 277 */
278static GNUNET_SCHEDULER_TaskIdentifier flood_task; 278static struct GNUNET_SCHEDULER_Task * flood_task;
279 279
280/** 280/**
281 * Task scheduled to compute our proof. 281 * Task scheduled to compute our proof.
282 */ 282 */
283static GNUNET_SCHEDULER_TaskIdentifier proof_task; 283static struct GNUNET_SCHEDULER_Task * proof_task;
284 284
285/** 285/**
286 * Notification context, simplifies client broadcasts. 286 * Notification context, simplifies client broadcasts.
@@ -635,7 +635,7 @@ transmit_ready (void *cls,
635 peer_entry); 635 peer_entry);
636 } 636 }
637 if ((0 == ntohl (size_estimate_messages[idx].hop_count)) && 637 if ((0 == ntohl (size_estimate_messages[idx].hop_count)) &&
638 (GNUNET_SCHEDULER_NO_TASK != proof_task)) 638 (NULL != proof_task))
639 { 639 {
640 GNUNET_STATISTICS_update (stats, 640 GNUNET_STATISTICS_update (stats,
641 "# flood messages not generated (no proof yet)", 641 "# flood messages not generated (no proof yet)",
@@ -681,7 +681,7 @@ transmit_task_cb (void *cls,
681{ 681{
682 struct NSEPeerEntry *peer_entry = cls; 682 struct NSEPeerEntry *peer_entry = cls;
683 683
684 peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK; 684 peer_entry->transmit_task = NULL;
685 685
686 GNUNET_assert (NULL == peer_entry->th); 686 GNUNET_assert (NULL == peer_entry->th);
687 peer_entry->th = 687 peer_entry->th =
@@ -772,7 +772,7 @@ schedule_current_round (void *cls,
772 peer_entry->previous_round = GNUNET_NO; 772 peer_entry->previous_round = GNUNET_NO;
773 return GNUNET_OK; 773 return GNUNET_OK;
774 } 774 }
775 if (GNUNET_SCHEDULER_NO_TASK != peer_entry->transmit_task) 775 if (NULL != peer_entry->transmit_task)
776 { 776 {
777 GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); 777 GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
778 peer_entry->previous_round = GNUNET_NO; 778 peer_entry->previous_round = GNUNET_NO;
@@ -806,7 +806,7 @@ update_flood_message (void *cls,
806 struct GNUNET_TIME_Relative offset; 806 struct GNUNET_TIME_Relative offset;
807 unsigned int i; 807 unsigned int i;
808 808
809 flood_task = GNUNET_SCHEDULER_NO_TASK; 809 flood_task = NULL;
810 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 810 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
811 return; 811 return;
812 offset = GNUNET_TIME_absolute_get_remaining (next_timestamp); 812 offset = GNUNET_TIME_absolute_get_remaining (next_timestamp);
@@ -931,7 +931,7 @@ find_proof (void *cls,
931 struct GNUNET_HashCode result; 931 struct GNUNET_HashCode result;
932 unsigned int i; 932 unsigned int i;
933 933
934 proof_task = GNUNET_SCHEDULER_NO_TASK; 934 proof_task = NULL;
935 memcpy (&buf[sizeof (uint64_t)], &my_identity, 935 memcpy (&buf[sizeof (uint64_t)], &my_identity,
936 sizeof (struct GNUNET_PeerIdentity)); 936 sizeof (struct GNUNET_PeerIdentity));
937 i = 0; 937 i = 0;
@@ -1034,17 +1034,17 @@ update_flood_times (void *cls,
1034 { 1034 {
1035 /* still stuck in previous round, no point to update, check that 1035 /* still stuck in previous round, no point to update, check that
1036 * we are active here though... */ 1036 * we are active here though... */
1037 if ( (GNUNET_SCHEDULER_NO_TASK == peer_entry->transmit_task) && 1037 if ( (NULL == peer_entry->transmit_task) &&
1038 (NULL == peer_entry->th) ) 1038 (NULL == peer_entry->th) )
1039 { 1039 {
1040 GNUNET_break (0); 1040 GNUNET_break (0);
1041 } 1041 }
1042 return GNUNET_OK; 1042 return GNUNET_OK;
1043 } 1043 }
1044 if (GNUNET_SCHEDULER_NO_TASK != peer_entry->transmit_task) 1044 if (NULL != peer_entry->transmit_task)
1045 { 1045 {
1046 GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); 1046 GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
1047 peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK; 1047 peer_entry->transmit_task = NULL;
1048 } 1048 }
1049 delay = get_transmit_delay (0); 1049 delay = get_transmit_delay (0);
1050 peer_entry->transmit_task = 1050 peer_entry->transmit_task =
@@ -1169,10 +1169,10 @@ handle_p2p_size_estimate (void *cls,
1169 } 1169 }
1170 /* got up-to-date information for current round, cancel transmission to 1170 /* got up-to-date information for current round, cancel transmission to
1171 * this peer altogether */ 1171 * this peer altogether */
1172 if (GNUNET_SCHEDULER_NO_TASK != peer_entry->transmit_task) 1172 if (NULL != peer_entry->transmit_task)
1173 { 1173 {
1174 GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); 1174 GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
1175 peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK; 1175 peer_entry->transmit_task = NULL;
1176 } 1176 }
1177 if (NULL != peer_entry->th) 1177 if (NULL != peer_entry->th)
1178 { 1178 {
@@ -1189,7 +1189,7 @@ handle_p2p_size_estimate (void *cls,
1189 /* push back our result now, that peer is spreading bad information... */ 1189 /* push back our result now, that peer is spreading bad information... */
1190 if (NULL == peer_entry->th) 1190 if (NULL == peer_entry->th)
1191 { 1191 {
1192 if (peer_entry->transmit_task != GNUNET_SCHEDULER_NO_TASK) 1192 if (peer_entry->transmit_task != NULL)
1193 GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); 1193 GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
1194 peer_entry->transmit_task = 1194 peer_entry->transmit_task =
1195 GNUNET_SCHEDULER_add_now (&transmit_task_cb, peer_entry); 1195 GNUNET_SCHEDULER_add_now (&transmit_task_cb, peer_entry);
@@ -1214,10 +1214,10 @@ handle_p2p_size_estimate (void *cls,
1214 if (idx == estimate_index) 1214 if (idx == estimate_index)
1215 { 1215 {
1216 /* cancel any activity for current round */ 1216 /* cancel any activity for current round */
1217 if (peer_entry->transmit_task != GNUNET_SCHEDULER_NO_TASK) 1217 if (peer_entry->transmit_task != NULL)
1218 { 1218 {
1219 GNUNET_SCHEDULER_cancel (peer_entry->transmit_task); 1219 GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
1220 peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK; 1220 peer_entry->transmit_task = NULL;
1221 } 1221 }
1222 if (peer_entry->th != NULL) 1222 if (peer_entry->th != NULL)
1223 { 1223 {
@@ -1303,9 +1303,9 @@ handle_core_disconnect (void *cls,
1303 GNUNET_assert (GNUNET_YES == 1303 GNUNET_assert (GNUNET_YES ==
1304 GNUNET_CONTAINER_multipeermap_remove (peers, peer, 1304 GNUNET_CONTAINER_multipeermap_remove (peers, peer,
1305 pos)); 1305 pos));
1306 if (pos->transmit_task != GNUNET_SCHEDULER_NO_TASK) { 1306 if (pos->transmit_task != NULL) {
1307 GNUNET_SCHEDULER_cancel (pos->transmit_task); 1307 GNUNET_SCHEDULER_cancel (pos->transmit_task);
1308 pos->transmit_task = GNUNET_SCHEDULER_NO_TASK; 1308 pos->transmit_task = NULL;
1309 } 1309 }
1310 if (NULL != pos->th) 1310 if (NULL != pos->th)
1311 { 1311 {
@@ -1345,15 +1345,15 @@ static void
1345shutdown_task (void *cls, 1345shutdown_task (void *cls,
1346 const struct GNUNET_SCHEDULER_TaskContext *tc) 1346 const struct GNUNET_SCHEDULER_TaskContext *tc)
1347{ 1347{
1348 if (GNUNET_SCHEDULER_NO_TASK != flood_task) 1348 if (NULL != flood_task)
1349 { 1349 {
1350 GNUNET_SCHEDULER_cancel (flood_task); 1350 GNUNET_SCHEDULER_cancel (flood_task);
1351 flood_task = GNUNET_SCHEDULER_NO_TASK; 1351 flood_task = NULL;
1352 } 1352 }
1353 if (GNUNET_SCHEDULER_NO_TASK != proof_task) 1353 if (NULL != proof_task)
1354 { 1354 {
1355 GNUNET_SCHEDULER_cancel (proof_task); 1355 GNUNET_SCHEDULER_cancel (proof_task);
1356 proof_task = GNUNET_SCHEDULER_NO_TASK; 1356 proof_task = NULL;
1357 write_proof (); /* remember progress */ 1357 write_proof (); /* remember progress */
1358 } 1358 }
1359 if (NULL != nc) 1359 if (NULL != nc)
diff --git a/src/nse/nse_api.c b/src/nse/nse_api.c
index bc927f481..edd05b71a 100644
--- a/src/nse/nse_api.c
+++ b/src/nse/nse_api.c
@@ -57,7 +57,7 @@ struct GNUNET_NSE_Handle
57 /** 57 /**
58 * Task doing exponential back-off trying to reconnect. 58 * Task doing exponential back-off trying to reconnect.
59 */ 59 */
60 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 60 struct GNUNET_SCHEDULER_Task * reconnect_task;
61 61
62 /** 62 /**
63 * Time for next connect retry. 63 * Time for next connect retry.
@@ -133,7 +133,7 @@ message_handler (void *cls, const struct GNUNET_MessageHeader *msg)
133static void 133static void
134reschedule_connect (struct GNUNET_NSE_Handle *h) 134reschedule_connect (struct GNUNET_NSE_Handle *h)
135{ 135{
136 GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); 136 GNUNET_assert (h->reconnect_task == NULL);
137 137
138 if (NULL != h->th) 138 if (NULL != h->th)
139 { 139 {
@@ -206,7 +206,7 @@ reconnect (void *cls,
206{ 206{
207 struct GNUNET_NSE_Handle *h = cls; 207 struct GNUNET_NSE_Handle *h = cls;
208 208
209 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 209 h->reconnect_task = NULL;
210 LOG (GNUNET_ERROR_TYPE_DEBUG, 210 LOG (GNUNET_ERROR_TYPE_DEBUG,
211 "Connecting to network size estimation service.\n"); 211 "Connecting to network size estimation service.\n");
212 GNUNET_assert (NULL == h->client); 212 GNUNET_assert (NULL == h->client);
@@ -256,10 +256,10 @@ void
256GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h) 256GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h)
257{ 257{
258 GNUNET_assert (NULL != h); 258 GNUNET_assert (NULL != h);
259 if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK) 259 if (h->reconnect_task != NULL)
260 { 260 {
261 GNUNET_SCHEDULER_cancel (h->reconnect_task); 261 GNUNET_SCHEDULER_cancel (h->reconnect_task);
262 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 262 h->reconnect_task = NULL;
263 } 263 }
264 if (NULL != h->th) 264 if (NULL != h->th)
265 { 265 {
diff --git a/src/nse/test_nse_api.c b/src/nse/test_nse_api.c
index 324d4ff16..5eff16c79 100644
--- a/src/nse/test_nse_api.c
+++ b/src/nse/test_nse_api.c
@@ -29,7 +29,7 @@
29 29
30static struct GNUNET_NSE_Handle *h; 30static struct GNUNET_NSE_Handle *h;
31 31
32static GNUNET_SCHEDULER_TaskIdentifier die_task; 32static struct GNUNET_SCHEDULER_Task * die_task;
33 33
34 34
35/** 35/**
@@ -69,7 +69,7 @@ check_nse_message (void *cls, struct GNUNET_TIME_Absolute timestamp,
69 estimate, std_dev); 69 estimate, std_dev);
70 /* Fantastic check below. Expect NaN, the only thing not equal to itself. */ 70 /* Fantastic check below. Expect NaN, the only thing not equal to itself. */
71 (*ok) = 0; 71 (*ok) = 0;
72 if (die_task != GNUNET_SCHEDULER_NO_TASK) 72 if (die_task != NULL)
73 GNUNET_SCHEDULER_cancel (die_task); 73 GNUNET_SCHEDULER_cancel (die_task);
74 die_task = GNUNET_SCHEDULER_add_now (&end_test, NULL); 74 die_task = GNUNET_SCHEDULER_add_now (&end_test, NULL);
75} 75}
diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c
index b00333d2c..05ae99e8d 100644
--- a/src/peerinfo-tool/gnunet-peerinfo.c
+++ b/src/peerinfo-tool/gnunet-peerinfo.c
@@ -175,7 +175,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
175/** 175/**
176 * Main state machine task (if active). 176 * Main state machine task (if active).
177 */ 177 */
178static GNUNET_SCHEDULER_TaskIdentifier tt; 178static struct GNUNET_SCHEDULER_Task * tt;
179 179
180/** 180/**
181 * Pending #GNUNET_TRANSPORT_get_hello() operation. 181 * Pending #GNUNET_TRANSPORT_get_hello() operation.
@@ -626,10 +626,10 @@ shutdown_task (void *cls,
626 GNUNET_PEERINFO_add_peer_cancel (ac); 626 GNUNET_PEERINFO_add_peer_cancel (ac);
627 ac = NULL; 627 ac = NULL;
628 } 628 }
629 if (GNUNET_SCHEDULER_NO_TASK != tt) 629 if (NULL != tt)
630 { 630 {
631 GNUNET_SCHEDULER_cancel (tt); 631 GNUNET_SCHEDULER_cancel (tt);
632 tt = GNUNET_SCHEDULER_NO_TASK; 632 tt = NULL;
633 } 633 }
634 if (NULL != pic) 634 if (NULL != pic)
635 { 635 {
@@ -806,7 +806,7 @@ static void
806state_machine (void *cls, 806state_machine (void *cls,
807 const struct GNUNET_SCHEDULER_TaskContext *tc) 807 const struct GNUNET_SCHEDULER_TaskContext *tc)
808{ 808{
809 tt = GNUNET_SCHEDULER_NO_TASK; 809 tt = NULL;
810 810
811 if (NULL != put_uri) 811 if (NULL != put_uri)
812 { 812 {
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c
index 20042f8e3..e2539bd55 100644
--- a/src/peerinfo/peerinfo_api.c
+++ b/src/peerinfo/peerinfo_api.c
@@ -110,7 +110,7 @@ struct GNUNET_PEERINFO_IteratorContext
110 /** 110 /**
111 * Task responsible for timeout. 111 * Task responsible for timeout.
112 */ 112 */
113 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 113 struct GNUNET_SCHEDULER_Task * timeout_task;
114 114
115 /** 115 /**
116 * Timeout for the operation. 116 * Timeout for the operation.
@@ -179,7 +179,7 @@ struct GNUNET_PEERINFO_Handle
179 /** 179 /**
180 * ID for a reconnect task. 180 * ID for a reconnect task.
181 */ 181 */
182 GNUNET_SCHEDULER_TaskIdentifier r_task; 182 struct GNUNET_SCHEDULER_Task * r_task;
183 183
184 /** 184 /**
185 * Are we now receiving? 185 * Are we now receiving?
@@ -247,10 +247,10 @@ GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h)
247 GNUNET_CLIENT_disconnect (h->client); 247 GNUNET_CLIENT_disconnect (h->client);
248 h->client = NULL; 248 h->client = NULL;
249 } 249 }
250 if (GNUNET_SCHEDULER_NO_TASK != h->r_task) 250 if (NULL != h->r_task)
251 { 251 {
252 GNUNET_SCHEDULER_cancel (h->r_task); 252 GNUNET_SCHEDULER_cancel (h->r_task);
253 h->r_task = GNUNET_SCHEDULER_NO_TASK; 253 h->r_task = NULL;
254 } 254 }
255 GNUNET_free (h); 255 GNUNET_free (h);
256} 256}
@@ -287,7 +287,7 @@ reconnect_task (void *cls,
287{ 287{
288 struct GNUNET_PEERINFO_Handle *h = cls; 288 struct GNUNET_PEERINFO_Handle *h = cls;
289 289
290 h->r_task = GNUNET_SCHEDULER_NO_TASK; 290 h->r_task = NULL;
291 reconnect (h); 291 reconnect (h);
292} 292}
293 293
@@ -300,10 +300,10 @@ reconnect_task (void *cls,
300static void 300static void
301reconnect (struct GNUNET_PEERINFO_Handle *h) 301reconnect (struct GNUNET_PEERINFO_Handle *h)
302{ 302{
303 if (GNUNET_SCHEDULER_NO_TASK != h->r_task) 303 if (NULL != h->r_task)
304 { 304 {
305 GNUNET_SCHEDULER_cancel (h->r_task); 305 GNUNET_SCHEDULER_cancel (h->r_task);
306 h->r_task = GNUNET_SCHEDULER_NO_TASK; 306 h->r_task = NULL;
307 } 307 }
308 if (NULL != h->th) 308 if (NULL != h->th)
309 { 309 {
@@ -709,7 +709,7 @@ signal_timeout (void *cls,
709 GNUNET_PEERINFO_Processor cb; 709 GNUNET_PEERINFO_Processor cb;
710 void *cb_cls; 710 void *cb_cls;
711 711
712 ic->timeout_task = GNUNET_SCHEDULER_NO_TASK; 712 ic->timeout_task = NULL;
713 cb = ic->callback; 713 cb = ic->callback;
714 cb_cls = ic->callback_cls; 714 cb_cls = ic->callback_cls;
715 GNUNET_PEERINFO_iterate_cancel (ic); 715 GNUNET_PEERINFO_iterate_cancel (ic);
@@ -811,10 +811,10 @@ GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic)
811 struct GNUNET_PEERINFO_Handle *h; 811 struct GNUNET_PEERINFO_Handle *h;
812 812
813 h = ic->h; 813 h = ic->h;
814 if (GNUNET_SCHEDULER_NO_TASK != ic->timeout_task) 814 if (NULL != ic->timeout_task)
815 { 815 {
816 GNUNET_SCHEDULER_cancel (ic->timeout_task); 816 GNUNET_SCHEDULER_cancel (ic->timeout_task);
817 ic->timeout_task = GNUNET_SCHEDULER_NO_TASK; 817 ic->timeout_task = NULL;
818 } 818 }
819 ic->callback = NULL; 819 ic->callback = NULL;
820 if (GNUNET_YES == ic->request_transmitted) 820 if (GNUNET_YES == ic->request_transmitted)
diff --git a/src/peerinfo/peerinfo_api_notify.c b/src/peerinfo/peerinfo_api_notify.c
index af41b08f9..aaa62588e 100644
--- a/src/peerinfo/peerinfo_api_notify.c
+++ b/src/peerinfo/peerinfo_api_notify.c
@@ -66,7 +66,7 @@ struct GNUNET_PEERINFO_NotifyContext
66 /** 66 /**
67 * Tasked used for delayed re-connection attempt. 67 * Tasked used for delayed re-connection attempt.
68 */ 68 */
69 GNUNET_SCHEDULER_TaskIdentifier task; 69 struct GNUNET_SCHEDULER_Task * task;
70 70
71 /** 71 /**
72 * Include friend only HELLOs in callbacks 72 * Include friend only HELLOs in callbacks
@@ -107,7 +107,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
107{ 107{
108 struct GNUNET_PEERINFO_NotifyContext *nc = cls; 108 struct GNUNET_PEERINFO_NotifyContext *nc = cls;
109 109
110 nc->task = GNUNET_SCHEDULER_NO_TASK; 110 nc->task = NULL;
111 nc->client = GNUNET_CLIENT_connect ("peerinfo", nc->cfg); 111 nc->client = GNUNET_CLIENT_connect ("peerinfo", nc->cfg);
112 if (NULL == nc->client) 112 if (NULL == nc->client)
113 { 113 {
@@ -295,7 +295,7 @@ GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc)
295 } 295 }
296 if (NULL != nc->client) 296 if (NULL != nc->client)
297 GNUNET_CLIENT_disconnect (nc->client); 297 GNUNET_CLIENT_disconnect (nc->client);
298 if (GNUNET_SCHEDULER_NO_TASK != nc->task) 298 if (NULL != nc->task)
299 GNUNET_SCHEDULER_cancel (nc->task); 299 GNUNET_SCHEDULER_cancel (nc->task);
300 GNUNET_free (nc); 300 GNUNET_free (nc);
301} 301}
diff --git a/src/peerinfo/test_peerinfo_api_notify_friend_only.c b/src/peerinfo/test_peerinfo_api_notify_friend_only.c
index c47fe6387..0b252621e 100644
--- a/src/peerinfo/test_peerinfo_api_notify_friend_only.c
+++ b/src/peerinfo/test_peerinfo_api_notify_friend_only.c
@@ -58,12 +58,12 @@ static int res_cb_wo_fo;
58 58
59struct GNUNET_PeerIdentity pid; 59struct GNUNET_PeerIdentity pid;
60 60
61GNUNET_SCHEDULER_TaskIdentifier 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, const struct GNUNET_SCHEDULER_TaskContext *tc)
65{ 65{
66 timeout_task = GNUNET_SCHEDULER_NO_TASK; 66 timeout_task = NULL;
67 GNUNET_break(0); 67 GNUNET_break(0);
68 if (NULL != pnc_wo_fo) 68 if (NULL != pnc_wo_fo)
69 { 69 {
@@ -95,10 +95,10 @@ done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
95 GNUNET_PEERINFO_disconnect (h); 95 GNUNET_PEERINFO_disconnect (h);
96 h = NULL; 96 h = NULL;
97 97
98 if (GNUNET_SCHEDULER_NO_TASK != timeout_task) 98 if (NULL != timeout_task)
99 { 99 {
100 GNUNET_SCHEDULER_cancel (timeout_task); 100 GNUNET_SCHEDULER_cancel (timeout_task);
101 timeout_task = GNUNET_SCHEDULER_NO_TASK; 101 timeout_task = NULL;
102 } 102 }
103 103
104 if ((GNUNET_YES == res_cb_w_fo) && (GNUNET_NO == res_cb_wo_fo)) 104 if ((GNUNET_YES == res_cb_w_fo) && (GNUNET_NO == res_cb_wo_fo))
diff --git a/src/peerstore/peerstore_api.c b/src/peerstore/peerstore_api.c
index 39f37b022..2138b23ff 100644
--- a/src/peerstore/peerstore_api.c
+++ b/src/peerstore/peerstore_api.c
@@ -213,7 +213,7 @@ struct GNUNET_PEERSTORE_IterateContext
213 * Task identifier for the function called 213 * Task identifier for the function called
214 * on iterate request timeout 214 * on iterate request timeout
215 */ 215 */
216 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 216 struct GNUNET_SCHEDULER_Task * timeout_task;
217 217
218}; 218};
219 219
@@ -367,7 +367,7 @@ iterate_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
367 GNUNET_PEERSTORE_Processor callback; 367 GNUNET_PEERSTORE_Processor callback;
368 void *callback_cls; 368 void *callback_cls;
369 369
370 ic->timeout_task = GNUNET_SCHEDULER_NO_TASK; 370 ic->timeout_task = NULL;
371 callback = ic->callback; 371 callback = ic->callback;
372 callback_cls = ic->callback_cls; 372 callback_cls = ic->callback_cls;
373 GNUNET_PEERSTORE_iterate_cancel (ic); 373 GNUNET_PEERSTORE_iterate_cancel (ic);
@@ -729,10 +729,10 @@ handle_iterate_result (void *cls, const struct GNUNET_MessageHeader *msg)
729void 729void
730GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic) 730GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic)
731{ 731{
732 if (GNUNET_SCHEDULER_NO_TASK != ic->timeout_task) 732 if (NULL != ic->timeout_task)
733 { 733 {
734 GNUNET_SCHEDULER_cancel (ic->timeout_task); 734 GNUNET_SCHEDULER_cancel (ic->timeout_task);
735 ic->timeout_task = GNUNET_SCHEDULER_NO_TASK; 735 ic->timeout_task = NULL;
736 } 736 }
737 if (GNUNET_NO == ic->iterating) 737 if (GNUNET_NO == ic->iterating)
738 { 738 {
diff --git a/src/psyc/test_psyc.c b/src/psyc/test_psyc.c
index 134ba8cb7..02b6d3d9a 100644
--- a/src/psyc/test_psyc.c
+++ b/src/psyc/test_psyc.c
@@ -52,7 +52,7 @@ struct GNUNET_PeerIdentity this_peer;
52/** 52/**
53 * Handle for task for timeout termination. 53 * Handle for task for timeout termination.
54 */ 54 */
55GNUNET_SCHEDULER_TaskIdentifier end_badly_task; 55struct GNUNET_SCHEDULER_Task * end_badly_task;
56 56
57struct GNUNET_PSYC_Master *mst; 57struct GNUNET_PSYC_Master *mst;
58struct GNUNET_PSYC_Slave *slv; 58struct GNUNET_PSYC_Slave *slv;
@@ -187,10 +187,10 @@ end ()
187{ 187{
188 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending tests.\n"); 188 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending tests.\n");
189 189
190 if (end_badly_task != GNUNET_SCHEDULER_NO_TASK) 190 if (end_badly_task != NULL)
191 { 191 {
192 GNUNET_SCHEDULER_cancel (end_badly_task); 192 GNUNET_SCHEDULER_cancel (end_badly_task);
193 end_badly_task = GNUNET_SCHEDULER_NO_TASK; 193 end_badly_task = NULL;
194 } 194 }
195 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS, 195 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
196 &end_normally, NULL); 196 &end_normally, NULL);
diff --git a/src/psycstore/psycstore_api.c b/src/psycstore/psycstore_api.c
index 9ef1fb61a..7b71c9d3a 100644
--- a/src/psycstore/psycstore_api.c
+++ b/src/psycstore/psycstore_api.c
@@ -131,7 +131,7 @@ struct GNUNET_PSYCSTORE_Handle
131 /** 131 /**
132 * Task doing exponential back-off trying to reconnect. 132 * Task doing exponential back-off trying to reconnect.
133 */ 133 */
134 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 134 struct GNUNET_SCHEDULER_Task * reconnect_task;
135 135
136 /** 136 /**
137 * Time for next connect retry. 137 * Time for next connect retry.
@@ -200,7 +200,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
200static void 200static void
201reschedule_connect (struct GNUNET_PSYCSTORE_Handle *h) 201reschedule_connect (struct GNUNET_PSYCSTORE_Handle *h)
202{ 202{
203 GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); 203 GNUNET_assert (h->reconnect_task == NULL);
204 204
205 if (NULL != h->th) 205 if (NULL != h->th)
206 { 206 {
@@ -545,7 +545,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
545{ 545{
546 struct GNUNET_PSYCSTORE_Handle *h = cls; 546 struct GNUNET_PSYCSTORE_Handle *h = cls;
547 547
548 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 548 h->reconnect_task = NULL;
549 LOG (GNUNET_ERROR_TYPE_DEBUG, 549 LOG (GNUNET_ERROR_TYPE_DEBUG,
550 "Connecting to PSYCstore service.\n"); 550 "Connecting to PSYCstore service.\n");
551 GNUNET_assert (NULL == h->client); 551 GNUNET_assert (NULL == h->client);
@@ -582,10 +582,10 @@ void
582GNUNET_PSYCSTORE_disconnect (struct GNUNET_PSYCSTORE_Handle *h) 582GNUNET_PSYCSTORE_disconnect (struct GNUNET_PSYCSTORE_Handle *h)
583{ 583{
584 GNUNET_assert (NULL != h); 584 GNUNET_assert (NULL != h);
585 if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK) 585 if (h->reconnect_task != NULL)
586 { 586 {
587 GNUNET_SCHEDULER_cancel (h->reconnect_task); 587 GNUNET_SCHEDULER_cancel (h->reconnect_task);
588 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 588 h->reconnect_task = NULL;
589 } 589 }
590 if (NULL != h->th) 590 if (NULL != h->th)
591 { 591 {
diff --git a/src/psycstore/test_psycstore.c b/src/psycstore/test_psycstore.c
index 125e64f58..8ece3c1b7 100644
--- a/src/psycstore/test_psycstore.c
+++ b/src/psycstore/test_psycstore.c
@@ -54,7 +54,7 @@ static struct GNUNET_PSYCSTORE_OperationHandle *op;
54/** 54/**
55 * Handle for task for timeout termination. 55 * Handle for task for timeout termination.
56 */ 56 */
57static GNUNET_SCHEDULER_TaskIdentifier end_badly_task; 57static struct GNUNET_SCHEDULER_Task * end_badly_task;
58 58
59static struct GNUNET_CRYPTO_EddsaPrivateKey *channel_key; 59static struct GNUNET_CRYPTO_EddsaPrivateKey *channel_key;
60static struct GNUNET_CRYPTO_EcdsaPrivateKey *slave_key; 60static struct GNUNET_CRYPTO_EcdsaPrivateKey *slave_key;
@@ -143,10 +143,10 @@ end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
143static void 143static void
144end () 144end ()
145{ 145{
146 if (end_badly_task != GNUNET_SCHEDULER_NO_TASK) 146 if (end_badly_task != NULL)
147 { 147 {
148 GNUNET_SCHEDULER_cancel (end_badly_task); 148 GNUNET_SCHEDULER_cancel (end_badly_task);
149 end_badly_task = GNUNET_SCHEDULER_NO_TASK; 149 end_badly_task = NULL;
150 } 150 }
151 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS, 151 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
152 &end_normally, NULL); 152 &end_normally, NULL);
diff --git a/src/pt/gnunet-daemon-pt.c b/src/pt/gnunet-daemon-pt.c
index 832d51d63..72fef144a 100644
--- a/src/pt/gnunet-daemon-pt.c
+++ b/src/pt/gnunet-daemon-pt.c
@@ -228,7 +228,7 @@ struct RequestContext
228 /** 228 /**
229 * Task used to abort this operation with timeout. 229 * Task used to abort this operation with timeout.
230 */ 230 */
231 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 231 struct GNUNET_SCHEDULER_Task * timeout_task;
232 232
233 /** 233 /**
234 * Length of the request message that follows this struct. 234 * Length of the request message that follows this struct.
diff --git a/src/pt/test_gns_vpn.c b/src/pt/test_gns_vpn.c
index eaf94dfa7..e9c89b42a 100644
--- a/src/pt/test_gns_vpn.c
+++ b/src/pt/test_gns_vpn.c
@@ -45,9 +45,9 @@ static struct GNUNET_NAMESTORE_Handle *namestore;
45 45
46static struct MHD_Daemon *mhd; 46static struct MHD_Daemon *mhd;
47 47
48static GNUNET_SCHEDULER_TaskIdentifier mhd_task_id; 48static struct GNUNET_SCHEDULER_Task * mhd_task_id;
49 49
50static GNUNET_SCHEDULER_TaskIdentifier curl_task_id; 50static struct GNUNET_SCHEDULER_Task * curl_task_id;
51 51
52static CURL *curl; 52static CURL *curl;
53 53
@@ -131,15 +131,15 @@ mhd_ahc (void *cls,
131static void 131static void
132do_shutdown () 132do_shutdown ()
133{ 133{
134 if (mhd_task_id != GNUNET_SCHEDULER_NO_TASK) 134 if (mhd_task_id != NULL)
135 { 135 {
136 GNUNET_SCHEDULER_cancel (mhd_task_id); 136 GNUNET_SCHEDULER_cancel (mhd_task_id);
137 mhd_task_id = GNUNET_SCHEDULER_NO_TASK; 137 mhd_task_id = NULL;
138 } 138 }
139 if (curl_task_id != GNUNET_SCHEDULER_NO_TASK) 139 if (curl_task_id != NULL)
140 { 140 {
141 GNUNET_SCHEDULER_cancel (curl_task_id); 141 GNUNET_SCHEDULER_cancel (curl_task_id);
142 curl_task_id = GNUNET_SCHEDULER_NO_TASK; 142 curl_task_id = NULL;
143 } 143 }
144 if (NULL != mhd) 144 if (NULL != mhd)
145 { 145 {
@@ -162,7 +162,7 @@ static void
162curl_task (void *cls, 162curl_task (void *cls,
163 const struct GNUNET_SCHEDULER_TaskContext *tc) 163 const struct GNUNET_SCHEDULER_TaskContext *tc)
164{ 164{
165 curl_task_id = GNUNET_SCHEDULER_NO_TASK; 165 curl_task_id = NULL;
166 curl_main (); 166 curl_main ();
167} 167}
168 168
@@ -311,7 +311,7 @@ static void
311mhd_task (void *cls, 311mhd_task (void *cls,
312 const struct GNUNET_SCHEDULER_TaskContext *tc) 312 const struct GNUNET_SCHEDULER_TaskContext *tc)
313{ 313{
314 mhd_task_id = GNUNET_SCHEDULER_NO_TASK; 314 mhd_task_id = NULL;
315 MHD_run (mhd); 315 MHD_run (mhd);
316 mhd_main (); 316 mhd_main ();
317} 317}
@@ -329,7 +329,7 @@ mhd_main ()
329 unsigned MHD_LONG_LONG timeout; 329 unsigned MHD_LONG_LONG timeout;
330 struct GNUNET_TIME_Relative delay; 330 struct GNUNET_TIME_Relative delay;
331 331
332 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == mhd_task_id); 332 GNUNET_assert (NULL == mhd_task_id);
333 FD_ZERO (&rs); 333 FD_ZERO (&rs);
334 FD_ZERO (&ws); 334 FD_ZERO (&ws);
335 FD_ZERO (&es); 335 FD_ZERO (&es);
diff --git a/src/pt/test_gnunet_vpn.c b/src/pt/test_gnunet_vpn.c
index 7e83fdcd1..ce6fbdd53 100644
--- a/src/pt/test_gnunet_vpn.c
+++ b/src/pt/test_gnunet_vpn.c
@@ -43,11 +43,11 @@ static struct GNUNET_VPN_Handle *vpn;
43 43
44static struct MHD_Daemon *mhd; 44static struct MHD_Daemon *mhd;
45 45
46static GNUNET_SCHEDULER_TaskIdentifier mhd_task_id; 46static struct GNUNET_SCHEDULER_Task * mhd_task_id;
47 47
48static GNUNET_SCHEDULER_TaskIdentifier curl_task_id; 48static struct GNUNET_SCHEDULER_Task * curl_task_id;
49 49
50static GNUNET_SCHEDULER_TaskIdentifier ctrl_c_task_id; 50static struct GNUNET_SCHEDULER_Task * ctrl_c_task_id;
51 51
52static struct GNUNET_VPN_RedirectionRequest *rr; 52static struct GNUNET_VPN_RedirectionRequest *rr;
53 53
@@ -128,20 +128,20 @@ mhd_ahc (void *cls, struct MHD_Connection *connection, const char *url,
128static void 128static void
129do_shutdown () 129do_shutdown ()
130{ 130{
131 if (mhd_task_id != GNUNET_SCHEDULER_NO_TASK) 131 if (mhd_task_id != NULL)
132 { 132 {
133 GNUNET_SCHEDULER_cancel (mhd_task_id); 133 GNUNET_SCHEDULER_cancel (mhd_task_id);
134 mhd_task_id = GNUNET_SCHEDULER_NO_TASK; 134 mhd_task_id = NULL;
135 } 135 }
136 if (curl_task_id != GNUNET_SCHEDULER_NO_TASK) 136 if (curl_task_id != NULL)
137 { 137 {
138 GNUNET_SCHEDULER_cancel (curl_task_id); 138 GNUNET_SCHEDULER_cancel (curl_task_id);
139 curl_task_id = GNUNET_SCHEDULER_NO_TASK; 139 curl_task_id = NULL;
140 } 140 }
141 if (ctrl_c_task_id != GNUNET_SCHEDULER_NO_TASK) 141 if (ctrl_c_task_id != NULL)
142 { 142 {
143 GNUNET_SCHEDULER_cancel (ctrl_c_task_id); 143 GNUNET_SCHEDULER_cancel (ctrl_c_task_id);
144 ctrl_c_task_id = GNUNET_SCHEDULER_NO_TASK; 144 ctrl_c_task_id = NULL;
145 } 145 }
146 if (NULL != mhd) 146 if (NULL != mhd)
147 { 147 {
@@ -173,7 +173,7 @@ curl_main (void);
173static void 173static void
174curl_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 174curl_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
175{ 175{
176 curl_task_id = GNUNET_SCHEDULER_NO_TASK; 176 curl_task_id = NULL;
177 curl_main (); 177 curl_main ();
178} 178}
179 179
@@ -301,7 +301,7 @@ mhd_main (void);
301static void 301static void
302mhd_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 302mhd_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
303{ 303{
304 mhd_task_id = GNUNET_SCHEDULER_NO_TASK; 304 mhd_task_id = NULL;
305 MHD_run (mhd); 305 MHD_run (mhd);
306 mhd_main (); 306 mhd_main ();
307} 307}
@@ -310,7 +310,7 @@ mhd_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
310static void 310static void
311ctrl_c_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 311ctrl_c_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
312{ 312{
313 ctrl_c_task_id = GNUNET_SCHEDULER_NO_TASK; 313 ctrl_c_task_id = NULL;
314 do_shutdown (); 314 do_shutdown ();
315 GNUNET_break (0); 315 GNUNET_break (0);
316 global_ret = 1; 316 global_ret = 1;
@@ -329,7 +329,7 @@ mhd_main ()
329 unsigned MHD_LONG_LONG timeout; 329 unsigned MHD_LONG_LONG timeout;
330 struct GNUNET_TIME_Relative delay; 330 struct GNUNET_TIME_Relative delay;
331 331
332 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == mhd_task_id); 332 GNUNET_assert (NULL == mhd_task_id);
333 FD_ZERO (&rs); 333 FD_ZERO (&rs);
334 FD_ZERO (&ws); 334 FD_ZERO (&ws);
335 FD_ZERO (&es); 335 FD_ZERO (&es);
diff --git a/src/regex/gnunet-daemon-regexprofiler.c b/src/regex/gnunet-daemon-regexprofiler.c
index 3d6624cb8..6831a850c 100644
--- a/src/regex/gnunet-daemon-regexprofiler.c
+++ b/src/regex/gnunet-daemon-regexprofiler.c
@@ -62,7 +62,7 @@ static struct REGEX_INTERNAL_Announcement *announce_handle;
62/** 62/**
63 * Periodically reannounce regex. 63 * Periodically reannounce regex.
64 */ 64 */
65static GNUNET_SCHEDULER_TaskIdentifier reannounce_task; 65static struct GNUNET_SCHEDULER_Task * reannounce_task;
66 66
67/** 67/**
68 * What's the maximum reannounce period. 68 * What's the maximum reannounce period.
@@ -145,7 +145,7 @@ reannounce_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
145 struct GNUNET_TIME_Relative random_delay; 145 struct GNUNET_TIME_Relative random_delay;
146 char *regex = cls; 146 char *regex = cls;
147 147
148 reannounce_task = GNUNET_SCHEDULER_NO_TASK; 148 reannounce_task = NULL;
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);
@@ -208,7 +208,7 @@ announce_regex (const char * regex)
208 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 208 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
209 "Daemon for %s starting\n", 209 "Daemon for %s starting\n",
210 policy_filename); 210 policy_filename);
211 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == reannounce_task); 211 GNUNET_assert (NULL == reannounce_task);
212 copy = GNUNET_strdup (regex); 212 copy = GNUNET_strdup (regex);
213 reannounce_task = GNUNET_SCHEDULER_add_now (reannounce_regex, (void *) copy); 213 reannounce_task = GNUNET_SCHEDULER_add_now (reannounce_regex, (void *) copy);
214} 214}
diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c
index 5a7cb9acd..0e87565c4 100644
--- a/src/regex/gnunet-regex-profiler.c
+++ b/src/regex/gnunet-regex-profiler.c
@@ -170,7 +170,7 @@ struct RegexPeer
170 /** 170 /**
171 * Operation timeout 171 * Operation timeout
172 */ 172 */
173 GNUNET_SCHEDULER_TaskIdentifier timeout; 173 struct GNUNET_SCHEDULER_Task * timeout;
174 174
175 /** 175 /**
176 * Deamon start 176 * Deamon start
@@ -211,17 +211,17 @@ static struct GNUNET_CONFIGURATION_Handle *cfg;
211/** 211/**
212 * Abort task identifier 212 * Abort task identifier
213 */ 213 */
214static GNUNET_SCHEDULER_TaskIdentifier abort_task; 214static struct GNUNET_SCHEDULER_Task * abort_task;
215 215
216/** 216/**
217 * Shutdown task identifier 217 * Shutdown task identifier
218 */ 218 */
219static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 219static struct GNUNET_SCHEDULER_Task * shutdown_task;
220 220
221/** 221/**
222 * Host registration task identifier 222 * Host registration task identifier
223 */ 223 */
224static GNUNET_SCHEDULER_TaskIdentifier register_hosts_task; 224static struct GNUNET_SCHEDULER_Task * register_hosts_task;
225 225
226/** 226/**
227 * Global event mask for all testbed events 227 * Global event mask for all testbed events
@@ -296,7 +296,7 @@ static unsigned int next_search;
296/** 296/**
297 * Search timeout task identifier. 297 * Search timeout task identifier.
298 */ 298 */
299static GNUNET_SCHEDULER_TaskIdentifier search_timeout_task; 299static struct GNUNET_SCHEDULER_Task * search_timeout_task;
300 300
301/** 301/**
302 * Search timeout in seconds. 302 * Search timeout in seconds.
@@ -410,10 +410,10 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
410 char output_buffer[512]; 410 char output_buffer[512];
411 size_t size; 411 size_t size;
412 412
413 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 413 shutdown_task = NULL;
414 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 414 if (NULL != abort_task)
415 GNUNET_SCHEDULER_cancel (abort_task); 415 GNUNET_SCHEDULER_cancel (abort_task);
416 if (GNUNET_SCHEDULER_NO_TASK != register_hosts_task) 416 if (NULL != register_hosts_task)
417 GNUNET_SCHEDULER_cancel (register_hosts_task); 417 GNUNET_SCHEDULER_cancel (register_hosts_task);
418 418
419 for (peer_cnt = 0; peer_cnt < num_peers; peer_cnt++) 419 for (peer_cnt = 0; peer_cnt < num_peers; peer_cnt++)
@@ -479,9 +479,9 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
479 unsigned long i = (unsigned long) cls; 479 unsigned long i = (unsigned long) cls;
480 480
481 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Aborting from line %lu...\n", i); 481 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Aborting from line %lu...\n", i);
482 abort_task = GNUNET_SCHEDULER_NO_TASK; 482 abort_task = NULL;
483 result = GNUNET_SYSERR; 483 result = GNUNET_SYSERR;
484 if (GNUNET_SCHEDULER_NO_TASK != shutdown_task) 484 if (NULL != shutdown_task)
485 GNUNET_SCHEDULER_cancel (shutdown_task); 485 GNUNET_SCHEDULER_cancel (shutdown_task);
486 shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 486 shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
487} 487}
@@ -734,10 +734,10 @@ regex_found_handler (void *cls,
734 strings_found++; 734 strings_found++;
735 parallel_searches--; 735 parallel_searches--;
736 736
737 if (GNUNET_SCHEDULER_NO_TASK != peer->timeout) 737 if (NULL != peer->timeout)
738 { 738 {
739 GNUNET_SCHEDULER_cancel (peer->timeout); 739 GNUNET_SCHEDULER_cancel (peer->timeout);
740 peer->timeout = GNUNET_SCHEDULER_NO_TASK; 740 peer->timeout = NULL;
741 if (GNUNET_NO == in_shutdown) 741 if (GNUNET_NO == in_shutdown)
742 GNUNET_SCHEDULER_add_now (&announce_next_regex, NULL); 742 GNUNET_SCHEDULER_add_now (&announce_next_regex, NULL);
743 } 743 }
@@ -791,10 +791,10 @@ regex_found_handler (void *cls,
791 "All strings successfully matched in %s\n", 791 "All strings successfully matched in %s\n",
792 GNUNET_STRINGS_relative_time_to_string (prof_time, GNUNET_NO)); 792 GNUNET_STRINGS_relative_time_to_string (prof_time, GNUNET_NO));
793 793
794 if (GNUNET_SCHEDULER_NO_TASK != search_timeout_task) 794 if (NULL != search_timeout_task)
795 { 795 {
796 GNUNET_SCHEDULER_cancel (search_timeout_task); 796 GNUNET_SCHEDULER_cancel (search_timeout_task);
797 search_timeout_task = GNUNET_SCHEDULER_NO_TASK; 797 search_timeout_task = NULL;
798 } 798 }
799 799
800 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Collecting stats.\n"); 800 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Collecting stats.\n");
@@ -853,7 +853,7 @@ find_timed_out (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
853{ 853{
854 struct RegexPeer *p = cls; 854 struct RegexPeer *p = cls;
855 855
856 p->timeout = GNUNET_SCHEDULER_NO_TASK; 856 p->timeout = NULL;
857 857
858 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 858 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
859 return; 859 return;
@@ -996,7 +996,7 @@ announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
996 if (strings_found != num_peers) 996 if (strings_found != num_peers)
997 { 997 {
998 struct GNUNET_TIME_Relative new_delay; 998 struct GNUNET_TIME_Relative new_delay;
999 if (GNUNET_SCHEDULER_NO_TASK != search_timeout_task) 999 if (NULL != search_timeout_task)
1000 GNUNET_SCHEDULER_cancel (search_timeout_task); 1000 GNUNET_SCHEDULER_cancel (search_timeout_task);
1001 new_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15); 1001 new_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15);
1002 search_timeout_task = GNUNET_SCHEDULER_add_delayed (new_delay, 1002 search_timeout_task = GNUNET_SCHEDULER_add_delayed (new_delay,
@@ -1130,10 +1130,10 @@ test_master (void *cls,
1130 "Testbed started in %s\n", 1130 "Testbed started in %s\n",
1131 GNUNET_STRINGS_relative_time_to_string (prof_time, GNUNET_NO)); 1131 GNUNET_STRINGS_relative_time_to_string (prof_time, GNUNET_NO));
1132 1132
1133 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 1133 if (NULL != abort_task)
1134 { 1134 {
1135 GNUNET_SCHEDULER_cancel (abort_task); 1135 GNUNET_SCHEDULER_cancel (abort_task);
1136 abort_task = GNUNET_SCHEDULER_NO_TASK; 1136 abort_task = NULL;
1137 } 1137 }
1138 1138
1139 for (i = 0; i < num_peers; i++) 1139 for (i = 0; i < num_peers; i++)
diff --git a/src/regex/gnunet-regex-simulation-profiler.c b/src/regex/gnunet-regex-simulation-profiler.c
index f00108011..9c2567895 100644
--- a/src/regex/gnunet-regex-simulation-profiler.c
+++ b/src/regex/gnunet-regex-simulation-profiler.c
@@ -91,17 +91,17 @@ static struct ProgressMeter *meter;
91/** 91/**
92 * Abort task identifier. 92 * Abort task identifier.
93 */ 93 */
94static GNUNET_SCHEDULER_TaskIdentifier abort_task; 94static struct GNUNET_SCHEDULER_Task * abort_task;
95 95
96/** 96/**
97 * Shutdown task identifier. 97 * Shutdown task identifier.
98 */ 98 */
99static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 99static struct GNUNET_SCHEDULER_Task * shutdown_task;
100 100
101/** 101/**
102 * Scan task identifier; 102 * Scan task identifier;
103 */ 103 */
104static GNUNET_SCHEDULER_TaskIdentifier scan_task; 104static struct GNUNET_SCHEDULER_Task * scan_task;
105 105
106/** 106/**
107 * Global testing status. 107 * Global testing status.
@@ -276,8 +276,8 @@ free_meter (struct ProgressMeter *meter)
276static void 276static void
277do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 277do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
278{ 278{
279 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 279 shutdown_task = NULL;
280 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 280 if (NULL != abort_task)
281 GNUNET_SCHEDULER_cancel (abort_task); 281 GNUNET_SCHEDULER_cancel (abort_task);
282 if (NULL != mysql_ctx) 282 if (NULL != mysql_ctx)
283 GNUNET_MYSQL_context_destroy (mysql_ctx); 283 GNUNET_MYSQL_context_destroy (mysql_ctx);
@@ -298,9 +298,9 @@ static void
298do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 298do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
299{ 299{
300 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Aborting\n"); 300 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
301 abort_task = GNUNET_SCHEDULER_NO_TASK; 301 abort_task = NULL;
302 GNUNET_SCHEDULER_cancel (scan_task); 302 GNUNET_SCHEDULER_cancel (scan_task);
303 scan_task = GNUNET_SCHEDULER_NO_TASK; 303 scan_task = NULL;
304 result = GNUNET_SYSERR; 304 result = GNUNET_SYSERR;
305 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 305 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
306} 306}
diff --git a/src/regex/gnunet-service-regex.c b/src/regex/gnunet-service-regex.c
index 6daab0be3..419829cc1 100644
--- a/src/regex/gnunet-service-regex.c
+++ b/src/regex/gnunet-service-regex.c
@@ -69,7 +69,7 @@ struct ClientEntry
69 /** 69 /**
70 * Task for re-announcing. 70 * Task for re-announcing.
71 */ 71 */
72 GNUNET_SCHEDULER_TaskIdentifier refresh_task; 72 struct GNUNET_SCHEDULER_Task * refresh_task;
73 73
74}; 74};
75 75
@@ -143,10 +143,10 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
143 nx = ce->next; 143 nx = ce->next;
144 if (ce->client == client) 144 if (ce->client == client)
145 { 145 {
146 if (GNUNET_SCHEDULER_NO_TASK != ce->refresh_task) 146 if (NULL != ce->refresh_task)
147 { 147 {
148 GNUNET_SCHEDULER_cancel (ce->refresh_task); 148 GNUNET_SCHEDULER_cancel (ce->refresh_task);
149 ce->refresh_task = GNUNET_SCHEDULER_NO_TASK; 149 ce->refresh_task = NULL;
150 } 150 }
151 if (NULL != ce->ah) 151 if (NULL != ce->ah)
152 { 152 {
diff --git a/src/regex/test_regex_api.c b/src/regex/test_regex_api.c
index a35934c9c..1603d19fa 100644
--- a/src/regex/test_regex_api.c
+++ b/src/regex/test_regex_api.c
@@ -45,14 +45,14 @@ static struct GNUNET_REGEX_Search *s;
45 45
46static int ok = 1; 46static int ok = 1;
47 47
48static GNUNET_SCHEDULER_TaskIdentifier 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) 53 const struct GNUNET_SCHEDULER_TaskContext *tc)
54{ 54{
55 die_task = GNUNET_SCHEDULER_NO_TASK; 55 die_task = NULL;
56 GNUNET_REGEX_announce_cancel (a); 56 GNUNET_REGEX_announce_cancel (a);
57 a = NULL; 57 a = NULL;
58 GNUNET_REGEX_search_cancel (s); 58 GNUNET_REGEX_search_cancel (s);
@@ -64,7 +64,7 @@ end (void *cls,
64static void 64static void
65end_badly () 65end_badly ()
66{ 66{
67 die_task = GNUNET_SCHEDULER_NO_TASK; 67 die_task = NULL;
68 FPRINTF (stderr, "%s", "Testcase failed (timeout).\n"); 68 FPRINTF (stderr, "%s", "Testcase failed (timeout).\n");
69 GNUNET_REGEX_announce_cancel (a); 69 GNUNET_REGEX_announce_cancel (a);
70 a = NULL; 70 a = NULL;
diff --git a/src/revocation/gnunet-service-revocation.c b/src/revocation/gnunet-service-revocation.c
index 8e5f554ed..ab4069dab 100644
--- a/src/revocation/gnunet-service-revocation.c
+++ b/src/revocation/gnunet-service-revocation.c
@@ -68,7 +68,7 @@ struct PeerEntry
68 /** 68 /**
69 * Tasked used to trigger the set union operation. 69 * Tasked used to trigger the set union operation.
70 */ 70 */
71 GNUNET_SCHEDULER_TaskIdentifier transmit_task; 71 struct GNUNET_SCHEDULER_Task * transmit_task;
72 72
73 /** 73 /**
74 * Handle to active set union operation (over revocation sets). 74 * Handle to active set union operation (over revocation sets).
@@ -468,7 +468,7 @@ transmit_task_cb (void *cls,
468 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 468 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
469 "Starting set exchange with peer `%s'\n", 469 "Starting set exchange with peer `%s'\n",
470 GNUNET_i2s (&peer_entry->id)); 470 GNUNET_i2s (&peer_entry->id));
471 peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK; 471 peer_entry->transmit_task = NULL;
472 peer_entry->so = GNUNET_SET_prepare (&peer_entry->id, 472 peer_entry->so = GNUNET_SET_prepare (&peer_entry->id,
473 &revocation_set_union_app_id, 473 &revocation_set_union_app_id,
474 NULL, 474 NULL,
@@ -570,10 +570,10 @@ handle_core_disconnect (void *cls,
570 GNUNET_CONTAINER_multipeermap_remove (peers, peer, 570 GNUNET_CONTAINER_multipeermap_remove (peers, peer,
571 pos)); 571 pos));
572 GNUNET_MQ_destroy (pos->mq); 572 GNUNET_MQ_destroy (pos->mq);
573 if (pos->transmit_task != GNUNET_SCHEDULER_NO_TASK) 573 if (pos->transmit_task != NULL)
574 { 574 {
575 GNUNET_SCHEDULER_cancel (pos->transmit_task); 575 GNUNET_SCHEDULER_cancel (pos->transmit_task);
576 pos->transmit_task = GNUNET_SCHEDULER_NO_TASK; 576 pos->transmit_task = NULL;
577 } 577 }
578 if (NULL != pos->so) 578 if (NULL != pos->so)
579 { 579 {
diff --git a/src/rps/gnunet-service-rps.c b/src/rps/gnunet-service-rps.c
index 09ed5de48..e09db5ca6 100644
--- a/src/rps/gnunet-service-rps.c
+++ b/src/rps/gnunet-service-rps.c
@@ -695,7 +695,7 @@ float beta;
695/** 695/**
696 * Identifier for the main task that runs periodically. 696 * Identifier for the main task that runs periodically.
697 */ 697 */
698GNUNET_SCHEDULER_TaskIdentifier do_round_task; 698struct GNUNET_SCHEDULER_Task * do_round_task;
699 699
700/** 700/**
701 * Time inverval the do_round task runs in. 701 * Time inverval the do_round task runs in.
@@ -1318,10 +1318,10 @@ shutdown_task (void *cls,
1318{ 1318{
1319 LOG(GNUNET_ERROR_TYPE_DEBUG, "RPS is going down\n"); 1319 LOG(GNUNET_ERROR_TYPE_DEBUG, "RPS is going down\n");
1320 1320
1321 if ( GNUNET_SCHEDULER_NO_TASK != do_round_task ) 1321 if ( NULL != do_round_task )
1322 { 1322 {
1323 GNUNET_SCHEDULER_cancel (do_round_task); 1323 GNUNET_SCHEDULER_cancel (do_round_task);
1324 do_round_task = GNUNET_SCHEDULER_NO_TASK; 1324 do_round_task = NULL;
1325 } 1325 }
1326 1326
1327 GNUNET_NSE_disconnect(nse); 1327 GNUNET_NSE_disconnect(nse);
diff --git a/src/sensor/gnunet-sensor-profiler.c b/src/sensor/gnunet-sensor-profiler.c
index 21574774d..74b1fa8a2 100644
--- a/src/sensor/gnunet-sensor-profiler.c
+++ b/src/sensor/gnunet-sensor-profiler.c
@@ -87,7 +87,7 @@ static const char *sensor_dst_dir = "/tmp/gnunet-sensor-profiler";
87/** 87/**
88 * Scheduled task to shutdown 88 * Scheduled task to shutdown
89 */ 89 */
90static GNUNET_SCHEDULER_TaskIdentifier shutdown_task = GNUNET_SCHEDULER_NO_TASK; 90static struct GNUNET_SCHEDULER_Task * shutdown_task = NULL;
91 91
92/** 92/**
93 * GNUnet configuration 93 * GNUnet configuration
@@ -157,7 +157,7 @@ static unsigned int sensor_names_size = 0;
157/** 157/**
158 * Task run after any waiting period 158 * Task run after any waiting period
159 */ 159 */
160static GNUNET_SCHEDULER_TaskIdentifier delayed_task = GNUNET_SCHEDULER_NO_TASK; 160static struct GNUNET_SCHEDULER_Task * delayed_task = NULL;
161 161
162 162
163/** 163/**
@@ -180,10 +180,10 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
180 int i; 180 int i;
181 181
182 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down.\n"); 182 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down.\n");
183 if (GNUNET_SCHEDULER_NO_TASK != delayed_task) 183 if (NULL != delayed_task)
184 { 184 {
185 GNUNET_SCHEDULER_cancel (delayed_task); 185 GNUNET_SCHEDULER_cancel (delayed_task);
186 delayed_task = GNUNET_SCHEDULER_NO_TASK; 186 delayed_task = NULL;
187 } 187 }
188 for (i = 0; i < num_peers; i++) 188 for (i = 0; i < num_peers; i++)
189 { 189 {
@@ -536,7 +536,7 @@ simulate_anomalies (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
536 uint32_t an_peer; 536 uint32_t an_peer;
537 struct GNUNET_TIME_Relative shutdown_delay; 537 struct GNUNET_TIME_Relative shutdown_delay;
538 538
539 delayed_task = GNUNET_SCHEDULER_NO_TASK; 539 delayed_task = NULL;
540 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 540 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
541 "Training period over, simulating anomalies now.\n"); 541 "Training period over, simulating anomalies now.\n");
542 GNUNET_assert (anomalous_peers <= num_peers); 542 GNUNET_assert (anomalous_peers <= num_peers);
@@ -572,7 +572,7 @@ peers_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
572 unsigned long long int training_points; 572 unsigned long long int training_points;
573 struct GNUNET_TIME_Relative training_period; 573 struct GNUNET_TIME_Relative training_period;
574 574
575 delayed_task = GNUNET_SCHEDULER_NO_TASK; 575 delayed_task = NULL;
576 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers are ready.\n"); 576 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers are ready.\n");
577 GNUNET_assert (GNUNET_OK == 577 GNUNET_assert (GNUNET_OK ==
578 GNUNET_CONFIGURATION_get_value_number (cfg, 578 GNUNET_CONFIGURATION_get_value_number (cfg,
diff --git a/src/sensor/gnunet-service-sensor_monitoring.c b/src/sensor/gnunet-service-sensor_monitoring.c
index 4f1f9472a..f473c3a75 100644
--- a/src/sensor/gnunet-service-sensor_monitoring.c
+++ b/src/sensor/gnunet-service-sensor_monitoring.c
@@ -410,7 +410,7 @@ schedule_sensor (void *cls, const struct GNUNET_HashCode *key, void *value)
410 LOG (GNUNET_ERROR_TYPE_DEBUG, 410 LOG (GNUNET_ERROR_TYPE_DEBUG,
411 "Scheduling sensor `%s' to run after %" PRIu64 " microseconds\n", 411 "Scheduling sensor `%s' to run after %" PRIu64 " microseconds\n",
412 sensorinfo->name, sensorinfo->interval.rel_value_us); 412 sensorinfo->name, sensorinfo->interval.rel_value_us);
413 if (GNUNET_SCHEDULER_NO_TASK != sensorinfo->execution_task) 413 if (NULL != sensorinfo->execution_task)
414 { 414 {
415 LOG (GNUNET_ERROR_TYPE_ERROR, 415 LOG (GNUNET_ERROR_TYPE_ERROR,
416 _("Sensor `%s' execution task already set, this should not happen\n"), 416 _("Sensor `%s' execution task already set, this should not happen\n"),
diff --git a/src/sensor/gnunet-service-sensor_reporting.c b/src/sensor/gnunet-service-sensor_reporting.c
index 8d69836a0..d08d67449 100644
--- a/src/sensor/gnunet-service-sensor_reporting.c
+++ b/src/sensor/gnunet-service-sensor_reporting.c
@@ -162,9 +162,9 @@ struct ValueInfo
162 struct GNUNET_PEERSTORE_WatchContext *wc; 162 struct GNUNET_PEERSTORE_WatchContext *wc;
163 163
164 /** 164 /**
165 * Collection point reporting task (or #GNUNET_SCHEDULER_NO_TASK) 165 * Collection point reporting task (or #NULL)
166 */ 166 */
167 GNUNET_SCHEDULER_TaskIdentifier reporting_task; 167 struct GNUNET_SCHEDULER_Task * reporting_task;
168 168
169}; 169};
170 170
@@ -237,7 +237,7 @@ struct CadetPeer
237 /** 237 /**
238 * Task used to try reconnection to collection point after failure 238 * Task used to try reconnection to collection point after failure
239 */ 239 */
240 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 240 struct GNUNET_SCHEDULER_Task * reconnect_task;
241 241
242 /** 242 /**
243 * Are we currently destroying the channel and its context? 243 * Are we currently destroying the channel and its context?
@@ -400,10 +400,10 @@ destroy_value_info (struct ValueInfo *vi)
400 GNUNET_PEERSTORE_watch_cancel (vi->wc); 400 GNUNET_PEERSTORE_watch_cancel (vi->wc);
401 vi->wc = NULL; 401 vi->wc = NULL;
402 } 402 }
403 if (GNUNET_SCHEDULER_NO_TASK != vi->reporting_task) 403 if (NULL != vi->reporting_task)
404 { 404 {
405 GNUNET_SCHEDULER_cancel (vi->reporting_task); 405 GNUNET_SCHEDULER_cancel (vi->reporting_task);
406 vi->reporting_task = GNUNET_SCHEDULER_NO_TASK; 406 vi->reporting_task = NULL;
407 } 407 }
408 if (NULL != vi->last_value) 408 if (NULL != vi->last_value)
409 { 409 {
@@ -463,10 +463,10 @@ static void
463destroy_cadet_peer (struct CadetPeer *cadetp) 463destroy_cadet_peer (struct CadetPeer *cadetp)
464{ 464{
465 cadetp->destroying = GNUNET_YES; 465 cadetp->destroying = GNUNET_YES;
466 if (GNUNET_SCHEDULER_NO_TASK != cadetp->reconnect_task) 466 if (NULL != cadetp->reconnect_task)
467 { 467 {
468 GNUNET_SCHEDULER_cancel (cadetp->reconnect_task); 468 GNUNET_SCHEDULER_cancel (cadetp->reconnect_task);
469 cadetp->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 469 cadetp->reconnect_task = NULL;
470 } 470 }
471 if (NULL != cadetp->mq) 471 if (NULL != cadetp->mq)
472 { 472 {
@@ -625,7 +625,7 @@ cp_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
625 LOG (GNUNET_ERROR_TYPE_INFO, 625 LOG (GNUNET_ERROR_TYPE_INFO,
626 "Retrying connection to collection point `%s'.\n", 626 "Retrying connection to collection point `%s'.\n",
627 GNUNET_i2s (&cadetp->peer_id)); 627 GNUNET_i2s (&cadetp->peer_id));
628 cadetp->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 628 cadetp->reconnect_task = NULL;
629 GNUNET_assert (NULL == cadetp->channel); 629 GNUNET_assert (NULL == cadetp->channel);
630 cadetp->channel = 630 cadetp->channel =
631 GNUNET_CADET_channel_create (cadet, cadetp, &cadetp->peer_id, 631 GNUNET_CADET_channel_create (cadet, cadetp, &cadetp->peer_id,
@@ -740,7 +740,7 @@ get_cadet_peer (struct GNUNET_PeerIdentity pid)
740 GNUNET_APPLICATION_TYPE_SENSORDASHBOARD, 740 GNUNET_APPLICATION_TYPE_SENSORDASHBOARD,
741 GNUNET_CADET_OPTION_RELIABLE); 741 GNUNET_CADET_OPTION_RELIABLE);
742 cadetp->mq = cp_mq_create (cadetp); 742 cadetp->mq = cp_mq_create (cadetp);
743 cadetp->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 743 cadetp->reconnect_task = NULL;
744 GNUNET_CONTAINER_DLL_insert (cadetp_head, cadetp_tail, cadetp); 744 GNUNET_CONTAINER_DLL_insert (cadetp_head, cadetp_tail, cadetp);
745 return cadetp; 745 return cadetp;
746} 746}
diff --git a/src/sensor/gnunet-service-sensor_update.c b/src/sensor/gnunet-service-sensor_update.c
index aa7716f1c..a6390b6dd 100644
--- a/src/sensor/gnunet-service-sensor_update.c
+++ b/src/sensor/gnunet-service-sensor_update.c
@@ -168,7 +168,7 @@ static int updating;
168/** 168/**
169 * GNUnet scheduler task that starts the update check process. 169 * GNUnet scheduler task that starts the update check process.
170 */ 170 */
171static GNUNET_SCHEDULER_TaskIdentifier update_task; 171static struct GNUNET_SCHEDULER_Task * update_task;
172 172
173/** 173/**
174 * Pointer to service reset function called when we have new sensor updates. 174 * Pointer to service reset function called when we have new sensor updates.
@@ -237,10 +237,10 @@ SENSOR_update_stop ()
237 237
238 up_default = NULL; 238 up_default = NULL;
239 up = up_head; 239 up = up_head;
240 if (GNUNET_SCHEDULER_NO_TASK != update_task) 240 if (NULL != update_task)
241 { 241 {
242 GNUNET_SCHEDULER_cancel (update_task); 242 GNUNET_SCHEDULER_cancel (update_task);
243 update_task = GNUNET_SCHEDULER_NO_TASK; 243 update_task = NULL;
244 } 244 }
245 while (NULL != up) 245 while (NULL != up)
246 { 246 {
@@ -390,7 +390,7 @@ check_for_updates (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
390 struct GNUNET_MessageHeader *msg; 390 struct GNUNET_MessageHeader *msg;
391 size_t msg_size; 391 size_t msg_size;
392 392
393 update_task = GNUNET_SCHEDULER_NO_TASK; 393 update_task = NULL;
394 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 394 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
395 return; 395 return;
396 if (GNUNET_YES == updating) 396 if (GNUNET_YES == updating)
diff --git a/src/sensor/perf_pow_sign.c b/src/sensor/perf_pow_sign.c
index b55354490..d89fe46ef 100644
--- a/src/sensor/perf_pow_sign.c
+++ b/src/sensor/perf_pow_sign.c
@@ -71,7 +71,7 @@ static int ok = 1;
71/** 71/**
72 * Task used to shutdown / expire the test 72 * Task used to shutdown / expire the test
73 */ 73 */
74static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 74static struct GNUNET_SCHEDULER_Task * shutdown_task;
75 75
76/** 76/**
77 * Message to be exchanged 77 * Message to be exchanged
diff --git a/src/sensor/sensor_api.c b/src/sensor/sensor_api.c
index 628873f91..8d72d16cb 100644
--- a/src/sensor/sensor_api.c
+++ b/src/sensor/sensor_api.c
@@ -121,7 +121,7 @@ struct GNUNET_SENSOR_IterateContext
121 /** 121 /**
122 * Task responsible for timeout. 122 * Task responsible for timeout.
123 */ 123 */
124 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 124 struct GNUNET_SCHEDULER_Task * timeout_task;
125 125
126}; 126};
127 127
@@ -365,7 +365,7 @@ signal_sensor_iteration_timeout (void *cls,
365 GNUNET_SENSOR_SensorIterateCB cb; 365 GNUNET_SENSOR_SensorIterateCB cb;
366 void *cb_cls; 366 void *cb_cls;
367 367
368 ic->timeout_task = GNUNET_SCHEDULER_NO_TASK; 368 ic->timeout_task = NULL;
369 cb = ic->callback; 369 cb = ic->callback;
370 cb_cls = ic->callback_cls; 370 cb_cls = ic->callback_cls;
371 GNUNET_SENSOR_iterate_cancel (ic); 371 GNUNET_SENSOR_iterate_cancel (ic);
@@ -417,10 +417,10 @@ GNUNET_SENSOR_iterate_cancel (struct GNUNET_SENSOR_IterateContext *ic)
417 ic->callback_cls = NULL; 417 ic->callback_cls = NULL;
418 return; 418 return;
419 } 419 }
420 if (GNUNET_SCHEDULER_NO_TASK != ic->timeout_task) 420 if (NULL != ic->timeout_task)
421 { 421 {
422 GNUNET_SCHEDULER_cancel (ic->timeout_task); 422 GNUNET_SCHEDULER_cancel (ic->timeout_task);
423 ic->timeout_task = GNUNET_SCHEDULER_NO_TASK; 423 ic->timeout_task = NULL;
424 } 424 }
425 GNUNET_CONTAINER_DLL_remove (h->ic_head, h->ic_tail, ic); 425 GNUNET_CONTAINER_DLL_remove (h->ic_head, h->ic_tail, ic);
426 GNUNET_free (ic); 426 GNUNET_free (ic);
diff --git a/src/sensor/sensor_util_lib.c b/src/sensor/sensor_util_lib.c
index fd5337343..381465d22 100644
--- a/src/sensor/sensor_util_lib.c
+++ b/src/sensor/sensor_util_lib.c
@@ -274,7 +274,7 @@ load_sensor_from_cfg (struct GNUNET_CONFIGURATION_Handle *cfg,
274 GNUNET_free (dummy); 274 GNUNET_free (dummy);
275 } 275 }
276 //execution task 276 //execution task
277 sensor->execution_task = GNUNET_SCHEDULER_NO_TASK; 277 sensor->execution_task = NULL;
278 //running 278 //running
279 sensor->running = GNUNET_NO; 279 sensor->running = GNUNET_NO;
280 return sensor; 280 return sensor;
@@ -479,10 +479,10 @@ destroy_sensor (void *cls, const struct GNUNET_HashCode *key, void *value)
479{ 479{
480 struct GNUNET_SENSOR_SensorInfo *sensor = value; 480 struct GNUNET_SENSOR_SensorInfo *sensor = value;
481 481
482 if (GNUNET_SCHEDULER_NO_TASK != sensor->execution_task) 482 if (NULL != sensor->execution_task)
483 { 483 {
484 GNUNET_SCHEDULER_cancel (sensor->execution_task); 484 GNUNET_SCHEDULER_cancel (sensor->execution_task);
485 sensor->execution_task = GNUNET_SCHEDULER_NO_TASK; 485 sensor->execution_task = NULL;
486 } 486 }
487 if (NULL != sensor->gnunet_stat_get_handle) 487 if (NULL != sensor->gnunet_stat_get_handle)
488 { 488 {
diff --git a/src/sensor/sensor_util_lib_crypto.c b/src/sensor/sensor_util_lib_crypto.c
index 41cba1991..154b7667c 100644
--- a/src/sensor/sensor_util_lib_crypto.c
+++ b/src/sensor/sensor_util_lib_crypto.c
@@ -65,7 +65,7 @@ struct GNUNET_SENSOR_crypto_pow_context
65 /** 65 /**
66 * Task that calculates the proof-of-work 66 * Task that calculates the proof-of-work
67 */ 67 */
68 GNUNET_SCHEDULER_TaskIdentifier calculate_pow_task; 68 struct GNUNET_SCHEDULER_Task * calculate_pow_task;
69 69
70 /** 70 /**
71 * Size of msg (allocated after this struct) 71 * Size of msg (allocated after this struct)
@@ -157,7 +157,7 @@ calculate_pow (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
157 cx->matching_bits)) 157 cx->matching_bits))
158 { 158 {
159 LOG (GNUNET_ERROR_TYPE_DEBUG, "Found pow %" PRIu64 ".\n", cx->pow); 159 LOG (GNUNET_ERROR_TYPE_DEBUG, "Found pow %" PRIu64 ".\n", cx->pow);
160 cx->calculate_pow_task = GNUNET_SCHEDULER_NO_TASK; 160 cx->calculate_pow_task = NULL;
161 result_block = 161 result_block =
162 GNUNET_malloc (sizeof (struct GNUNET_SENSOR_crypto_pow_block) + 162 GNUNET_malloc (sizeof (struct GNUNET_SENSOR_crypto_pow_block) +
163 cx->msg_size); 163 cx->msg_size);
@@ -197,10 +197,10 @@ void
197GNUNET_SENSOR_crypto_pow_sign_cancel (struct GNUNET_SENSOR_crypto_pow_context 197GNUNET_SENSOR_crypto_pow_sign_cancel (struct GNUNET_SENSOR_crypto_pow_context
198 *cx) 198 *cx)
199{ 199{
200 if (GNUNET_SCHEDULER_NO_TASK != cx->calculate_pow_task) 200 if (NULL != cx->calculate_pow_task)
201 { 201 {
202 GNUNET_SCHEDULER_cancel (cx->calculate_pow_task); 202 GNUNET_SCHEDULER_cancel (cx->calculate_pow_task);
203 cx->calculate_pow_task = GNUNET_SCHEDULER_NO_TASK; 203 cx->calculate_pow_task = NULL;
204 } 204 }
205 GNUNET_free (cx); 205 GNUNET_free (cx);
206 cx = NULL; 206 cx = NULL;
diff --git a/src/sensor/test_gnunet-service-sensor_reporting.c b/src/sensor/test_gnunet-service-sensor_reporting.c
index 4a58647ad..dd9a2125a 100644
--- a/src/sensor/test_gnunet-service-sensor_reporting.c
+++ b/src/sensor/test_gnunet-service-sensor_reporting.c
@@ -89,7 +89,7 @@ struct TestPeer
89 /** 89 /**
90 * GNUNET scheduler task that forces the anomaly after a stabilization delay 90 * GNUNET scheduler task that forces the anomaly after a stabilization delay
91 */ 91 */
92 GNUNET_SCHEDULER_TaskIdentifier delay_task; 92 struct GNUNET_SCHEDULER_Task * delay_task;
93 93
94}; 94};
95 95
@@ -152,7 +152,7 @@ static struct GNUNET_PEERSTORE_Handle *peerstore;
152/** 152/**
153 * Task used to shutdown / expire the test 153 * Task used to shutdown / expire the test
154 */ 154 */
155static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 155static struct GNUNET_SCHEDULER_Task * shutdown_task;
156 156
157/** 157/**
158 * Status of the test to be returned by main() 158 * Status of the test to be returned by main()
@@ -163,10 +163,10 @@ static int ok = 1;
163static void 163static void
164destroy_peer (struct TestPeer *peer) 164destroy_peer (struct TestPeer *peer)
165{ 165{
166 if (GNUNET_SCHEDULER_NO_TASK != peer->delay_task) 166 if (NULL != peer->delay_task)
167 { 167 {
168 GNUNET_SCHEDULER_cancel (peer->delay_task); 168 GNUNET_SCHEDULER_cancel (peer->delay_task);
169 peer->delay_task = GNUNET_SCHEDULER_NO_TASK; 169 peer->delay_task = NULL;
170 } 170 }
171 if (NULL != peer->sensor_op) 171 if (NULL != peer->sensor_op)
172 { 172 {
@@ -280,7 +280,7 @@ force_anomaly_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
280{ 280{
281 struct TestPeer *peer = cls; 281 struct TestPeer *peer = cls;
282 282
283 peer->delay_task = GNUNET_SCHEDULER_NO_TASK; 283 peer->delay_task = NULL;
284 GNUNET_SENSOR_force_anomaly (peer->sensor, (char *) sensor_name, GNUNET_YES, 284 GNUNET_SENSOR_force_anomaly (peer->sensor, (char *) sensor_name, GNUNET_YES,
285 NULL, NULL); 285 NULL, NULL);
286} 286}
@@ -481,7 +481,7 @@ peer_info_cb (void *cb_cls, struct GNUNET_TESTBED_Operation *op,
481 peer = GNUNET_new (struct TestPeer); 481 peer = GNUNET_new (struct TestPeer);
482 482
483 peer->testbed_peer = testbed_peer; 483 peer->testbed_peer = testbed_peer;
484 peer->delay_task = GNUNET_SCHEDULER_NO_TASK; 484 peer->delay_task = NULL;
485 GNUNET_CRYPTO_get_peer_identity (pinfo->result.cfg, &peer->peer_id); 485 GNUNET_CRYPTO_get_peer_identity (pinfo->result.cfg, &peer->peer_id);
486 if (NULL == peer_head) /* First peer (collection point) */ 486 if (NULL == peer_head) /* First peer (collection point) */
487 { 487 {
diff --git a/src/sensor/test_pow_sign.c b/src/sensor/test_pow_sign.c
index 71ab6af81..b3039ff25 100644
--- a/src/sensor/test_pow_sign.c
+++ b/src/sensor/test_pow_sign.c
@@ -66,7 +66,7 @@ static int ok = 1;
66/** 66/**
67 * Task used to shutdown / expire the test 67 * Task used to shutdown / expire the test
68 */ 68 */
69static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 69static struct GNUNET_SCHEDULER_Task * shutdown_task;
70 70
71/** 71/**
72 * Message to be exchanged 72 * Message to be exchanged
diff --git a/src/set/gnunet-service-set.c b/src/set/gnunet-service-set.c
index 2291bd2f2..dc5a787f6 100644
--- a/src/set/gnunet-service-set.c
+++ b/src/set/gnunet-service-set.c
@@ -475,10 +475,10 @@ incoming_destroy (struct Operation *incoming)
475 GNUNET_CONTAINER_DLL_remove (incoming_head, 475 GNUNET_CONTAINER_DLL_remove (incoming_head,
476 incoming_tail, 476 incoming_tail,
477 incoming); 477 incoming);
478 if (GNUNET_SCHEDULER_NO_TASK != incoming->timeout_task) 478 if (NULL != incoming->timeout_task)
479 { 479 {
480 GNUNET_SCHEDULER_cancel (incoming->timeout_task); 480 GNUNET_SCHEDULER_cancel (incoming->timeout_task);
481 incoming->timeout_task = GNUNET_SCHEDULER_NO_TASK; 481 incoming->timeout_task = NULL;
482 } 482 }
483 /* make sure that the tunnel end handler will not destroy us again */ 483 /* make sure that the tunnel end handler will not destroy us again */
484 incoming->vt = NULL; 484 incoming->vt = NULL;
@@ -543,9 +543,9 @@ incoming_suggest (struct Operation *incoming,
543 incoming->suggest_id = suggest_id++; 543 incoming->suggest_id = suggest_id++;
544 if (0 == suggest_id) 544 if (0 == suggest_id)
545 suggest_id++; 545 suggest_id++;
546 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != incoming->timeout_task); 546 GNUNET_assert (NULL != incoming->timeout_task);
547 GNUNET_SCHEDULER_cancel (incoming->timeout_task); 547 GNUNET_SCHEDULER_cancel (incoming->timeout_task);
548 incoming->timeout_task = GNUNET_SCHEDULER_NO_TASK; 548 incoming->timeout_task = NULL;
549 mqm = GNUNET_MQ_msg_nested_mh (cmsg, 549 mqm = GNUNET_MQ_msg_nested_mh (cmsg,
550 GNUNET_MESSAGE_TYPE_SET_REQUEST, 550 GNUNET_MESSAGE_TYPE_SET_REQUEST,
551 incoming->spec->context_msg); 551 incoming->spec->context_msg);
@@ -624,7 +624,7 @@ handle_incoming_msg (struct Operation *op,
624 &msg->app_id); 624 &msg->app_id);
625 if (NULL == listener) 625 if (NULL == listener)
626 { 626 {
627 GNUNET_break (GNUNET_SCHEDULER_NO_TASK != op->timeout_task); 627 GNUNET_break (NULL != op->timeout_task);
628 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 628 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
629 "No matching listener for incoming request (op %u, app %s), waiting with timeout\n", 629 "No matching listener for incoming request (op %u, app %s), waiting with timeout\n",
630 ntohl (msg->operation), 630 ntohl (msg->operation),
@@ -1279,7 +1279,7 @@ incoming_timeout_cb (void *cls,
1279{ 1279{
1280 struct Operation *incoming = cls; 1280 struct Operation *incoming = cls;
1281 1281
1282 incoming->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1282 incoming->timeout_task = NULL;
1283 GNUNET_assert (GNUNET_YES == incoming->is_incoming); 1283 GNUNET_assert (GNUNET_YES == incoming->is_incoming);
1284 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1284 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1285 return; 1285 return;
diff --git a/src/set/gnunet-service-set.h b/src/set/gnunet-service-set.h
index b2904dc06..d1b957e73 100644
--- a/src/set/gnunet-service-set.h
+++ b/src/set/gnunet-service-set.h
@@ -366,7 +366,7 @@ struct Operation
366 * Timeout task, if the incoming peer has not been accepted 366 * Timeout task, if the incoming peer has not been accepted
367 * after the timeout, it will be disconnected. 367 * after the timeout, it will be disconnected.
368 */ 368 */
369 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 369 struct GNUNET_SCHEDULER_Task * timeout_task;
370 370
371 /** 371 /**
372 * Unique request id for the request from a remote peer, sent to the 372 * Unique request id for the request from a remote peer, sent to the
diff --git a/src/set/set_api.c b/src/set/set_api.c
index 453a235b2..0327daab1 100644
--- a/src/set/set_api.c
+++ b/src/set/set_api.c
@@ -204,7 +204,7 @@ struct GNUNET_SET_ListenHandle
204 /** 204 /**
205 * Task for reconnecting when the listener fails. 205 * Task for reconnecting when the listener fails.
206 */ 206 */
207 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 207 struct GNUNET_SCHEDULER_Task * reconnect_task;
208 208
209 /** 209 /**
210 * Operation we listen for. 210 * Operation we listen for.
@@ -786,7 +786,7 @@ listen_connect (void *cls,
786 "Listener not reconnecting due to shutdown\n"); 786 "Listener not reconnecting due to shutdown\n");
787 return; 787 return;
788 } 788 }
789 lh->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 789 lh->reconnect_task = NULL;
790 GNUNET_assert (NULL == lh->client); 790 GNUNET_assert (NULL == lh->client);
791 lh->client = GNUNET_CLIENT_connect ("set", lh->cfg); 791 lh->client = GNUNET_CLIENT_connect ("set", lh->cfg);
792 if (NULL == lh->client) 792 if (NULL == lh->client)
@@ -860,10 +860,10 @@ GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh)
860 GNUNET_CLIENT_disconnect (lh->client); 860 GNUNET_CLIENT_disconnect (lh->client);
861 lh->client = NULL; 861 lh->client = NULL;
862 } 862 }
863 if (GNUNET_SCHEDULER_NO_TASK != lh->reconnect_task) 863 if (NULL != lh->reconnect_task)
864 { 864 {
865 GNUNET_SCHEDULER_cancel (lh->reconnect_task); 865 GNUNET_SCHEDULER_cancel (lh->reconnect_task);
866 lh->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 866 lh->reconnect_task = NULL;
867 } 867 }
868 GNUNET_free (lh); 868 GNUNET_free (lh);
869} 869}
diff --git a/src/social/test_social.c b/src/social/test_social.c
index 320526594..f17892953 100644
--- a/src/social/test_social.c
+++ b/src/social/test_social.c
@@ -48,7 +48,7 @@ int res;
48/** 48/**
49 * Handle for task for timeout termination. 49 * Handle for task for timeout termination.
50 */ 50 */
51GNUNET_SCHEDULER_TaskIdentifier end_badly_task; 51struct GNUNET_SCHEDULER_Task * end_badly_task;
52 52
53const struct GNUNET_CONFIGURATION_Handle *cfg; 53const struct GNUNET_CONFIGURATION_Handle *cfg;
54 54
@@ -196,10 +196,10 @@ end ()
196{ 196{
197 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending tests.\n"); 197 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending tests.\n");
198 198
199 if (end_badly_task != GNUNET_SCHEDULER_NO_TASK) 199 if (end_badly_task != NULL)
200 { 200 {
201 GNUNET_SCHEDULER_cancel (end_badly_task); 201 GNUNET_SCHEDULER_cancel (end_badly_task);
202 end_badly_task = GNUNET_SCHEDULER_NO_TASK; 202 end_badly_task = NULL;
203 } 203 }
204 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS, 204 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
205 &end_normally, NULL); 205 &end_normally, NULL);
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c
index 52d49308a..661cca796 100644
--- a/src/statistics/statistics_api.c
+++ b/src/statistics/statistics_api.c
@@ -149,7 +149,7 @@ struct GNUNET_STATISTICS_GetHandle
149 /** 149 /**
150 * Task run on timeout. 150 * Task run on timeout.
151 */ 151 */
152 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 152 struct GNUNET_SCHEDULER_Task * timeout_task;
153 153
154 /** 154 /**
155 * Associated value. 155 * Associated value.
@@ -230,7 +230,7 @@ struct GNUNET_STATISTICS_Handle
230 /** 230 /**
231 * Task doing exponential back-off trying to reconnect. 231 * Task doing exponential back-off trying to reconnect.
232 */ 232 */
233 GNUNET_SCHEDULER_TaskIdentifier backoff_task; 233 struct GNUNET_SCHEDULER_Task * backoff_task;
234 234
235 /** 235 /**
236 * Time for next connect retry. 236 * Time for next connect retry.
@@ -367,10 +367,10 @@ schedule_watch_request (struct GNUNET_STATISTICS_Handle *h,
367static void 367static void
368free_action_item (struct GNUNET_STATISTICS_GetHandle *gh) 368free_action_item (struct GNUNET_STATISTICS_GetHandle *gh)
369{ 369{
370 if (GNUNET_SCHEDULER_NO_TASK != gh->timeout_task) 370 if (NULL != gh->timeout_task)
371 { 371 {
372 GNUNET_SCHEDULER_cancel (gh->timeout_task); 372 GNUNET_SCHEDULER_cancel (gh->timeout_task);
373 gh->timeout_task = GNUNET_SCHEDULER_NO_TASK; 373 gh->timeout_task = NULL;
374 } 374 }
375 GNUNET_free_non_null (gh->subsystem); 375 GNUNET_free_non_null (gh->subsystem);
376 GNUNET_free_non_null (gh->name); 376 GNUNET_free_non_null (gh->name);
@@ -426,7 +426,7 @@ try_connect (struct GNUNET_STATISTICS_Handle *h)
426 struct GNUNET_STATISTICS_GetHandle *gn; 426 struct GNUNET_STATISTICS_GetHandle *gn;
427 unsigned int i; 427 unsigned int i;
428 428
429 if (GNUNET_SCHEDULER_NO_TASK != h->backoff_task) 429 if (NULL != h->backoff_task)
430 return GNUNET_NO; 430 return GNUNET_NO;
431 if (NULL != h->client) 431 if (NULL != h->client)
432 return GNUNET_YES; 432 return GNUNET_YES;
@@ -470,7 +470,7 @@ reconnect_task (void *cls,
470{ 470{
471 struct GNUNET_STATISTICS_Handle *h = cls; 471 struct GNUNET_STATISTICS_Handle *h = cls;
472 472
473 h->backoff_task = GNUNET_SCHEDULER_NO_TASK; 473 h->backoff_task = NULL;
474 schedule_action (h); 474 schedule_action (h);
475} 475}
476 476
@@ -502,7 +502,7 @@ reconnect_later (struct GNUNET_STATISTICS_Handle *h)
502 int loss; 502 int loss;
503 struct GNUNET_STATISTICS_GetHandle *gh; 503 struct GNUNET_STATISTICS_GetHandle *gh;
504 504
505 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->backoff_task); 505 GNUNET_assert (NULL == h->backoff_task);
506 if (GNUNET_YES == h->do_destroy) 506 if (GNUNET_YES == h->do_destroy)
507 { 507 {
508 /* So we are shutting down and the service is not reachable. 508 /* So we are shutting down and the service is not reachable.
@@ -992,10 +992,10 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h,
992 if (NULL == h) 992 if (NULL == h)
993 return; 993 return;
994 GNUNET_assert (GNUNET_NO == h->do_destroy); // Don't call twice. 994 GNUNET_assert (GNUNET_NO == h->do_destroy); // Don't call twice.
995 if (GNUNET_SCHEDULER_NO_TASK != h->backoff_task) 995 if (NULL != h->backoff_task)
996 { 996 {
997 GNUNET_SCHEDULER_cancel (h->backoff_task); 997 GNUNET_SCHEDULER_cancel (h->backoff_task);
998 h->backoff_task = GNUNET_SCHEDULER_NO_TASK; 998 h->backoff_task = NULL;
999 } 999 }
1000 if (sync_first) 1000 if (sync_first)
1001 { 1001 {
@@ -1117,7 +1117,7 @@ schedule_action (struct GNUNET_STATISTICS_Handle *h)
1117 struct GNUNET_TIME_Relative timeout; 1117 struct GNUNET_TIME_Relative timeout;
1118 1118
1119 if ( (NULL != h->th) || 1119 if ( (NULL != h->th) ||
1120 (GNUNET_SCHEDULER_NO_TASK != h->backoff_task) ) 1120 (NULL != h->backoff_task) )
1121 return; /* action already pending */ 1121 return; /* action already pending */
1122 if (GNUNET_YES != try_connect (h)) 1122 if (GNUNET_YES != try_connect (h))
1123 { 1123 {
@@ -1172,7 +1172,7 @@ run_get_timeout (void *cls,
1172 GNUNET_STATISTICS_Callback cont = gh->cont; 1172 GNUNET_STATISTICS_Callback cont = gh->cont;
1173 void *cont_cls = gh->cls; 1173 void *cont_cls = gh->cls;
1174 1174
1175 gh->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1175 gh->timeout_task = NULL;
1176 GNUNET_STATISTICS_get_cancel (gh); 1176 GNUNET_STATISTICS_get_cancel (gh);
1177 cont (cont_cls, GNUNET_SYSERR); 1177 cont (cont_cls, GNUNET_SYSERR);
1178} 1178}
@@ -1246,10 +1246,10 @@ GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh)
1246{ 1246{
1247 if (NULL == gh) 1247 if (NULL == gh)
1248 return; 1248 return;
1249 if (GNUNET_SCHEDULER_NO_TASK != gh->timeout_task) 1249 if (NULL != gh->timeout_task)
1250 { 1250 {
1251 GNUNET_SCHEDULER_cancel (gh->timeout_task); 1251 GNUNET_SCHEDULER_cancel (gh->timeout_task);
1252 gh->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1252 gh->timeout_task = NULL;
1253 } 1253 }
1254 gh->cont = NULL; 1254 gh->cont = NULL;
1255 if (gh->sh->current == gh) 1255 if (gh->sh->current == gh)
diff --git a/src/statistics/test_statistics_api_watch.c b/src/statistics/test_statistics_api_watch.c
index 05806ac4b..bd529e327 100644
--- a/src/statistics/test_statistics_api_watch.c
+++ b/src/statistics/test_statistics_api_watch.c
@@ -33,7 +33,7 @@ static struct GNUNET_STATISTICS_Handle *h;
33 33
34static struct GNUNET_STATISTICS_Handle *h2; 34static struct GNUNET_STATISTICS_Handle *h2;
35 35
36static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 36static struct GNUNET_SCHEDULER_Task * shutdown_task;
37 37
38 38
39static void 39static void
diff --git a/src/statistics/test_statistics_api_watch_zero_value.c b/src/statistics/test_statistics_api_watch_zero_value.c
index 462c91ebe..44ac46167 100644
--- a/src/statistics/test_statistics_api_watch_zero_value.c
+++ b/src/statistics/test_statistics_api_watch_zero_value.c
@@ -33,7 +33,7 @@ static struct GNUNET_STATISTICS_Handle *h;
33 33
34static struct GNUNET_STATISTICS_Handle *h2; 34static struct GNUNET_STATISTICS_Handle *h2;
35 35
36static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 36static struct GNUNET_SCHEDULER_Task * shutdown_task;
37 37
38 38
39static void 39static void
diff --git a/src/testbed/gnunet-daemon-latency-logger.c b/src/testbed/gnunet-daemon-latency-logger.c
index fb9364c28..945cf42f4 100644
--- a/src/testbed/gnunet-daemon-latency-logger.c
+++ b/src/testbed/gnunet-daemon-latency-logger.c
@@ -98,7 +98,7 @@ struct sqlite3_stmt *stmt_insert;
98/** 98/**
99 * Shutdown task identifier 99 * Shutdown task identifier
100 */ 100 */
101GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 101struct GNUNET_SCHEDULER_Task * shutdown_task;
102 102
103 103
104/** 104/**
@@ -136,7 +136,7 @@ free_iterator (void *cls,
136static void 136static void
137do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 137do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
138{ 138{
139 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 139 shutdown_task = NULL;
140 GNUNET_ATS_performance_done (ats); 140 GNUNET_ATS_performance_done (ats);
141 ats = NULL; 141 ats = NULL;
142 if (NULL != stmt_insert) 142 if (NULL != stmt_insert)
diff --git a/src/testbed/gnunet-daemon-testbed-blacklist.c b/src/testbed/gnunet-daemon-testbed-blacklist.c
index 95cdda8bd..d437c8c05 100644
--- a/src/testbed/gnunet-daemon-testbed-blacklist.c
+++ b/src/testbed/gnunet-daemon-testbed-blacklist.c
@@ -72,7 +72,7 @@ struct GNUNET_TRANSPORT_Blacklist *bh;
72/** 72/**
73 * Task for shutdown 73 * Task for shutdown
74 */ 74 */
75static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 75static struct GNUNET_SCHEDULER_Task * shutdown_task;
76 76
77/** 77/**
78 * Are we allowing or denying access from peers 78 * Are we allowing or denying access from peers
diff --git a/src/testbed/gnunet-daemon-testbed-underlay.c b/src/testbed/gnunet-daemon-testbed-underlay.c
index 59c9331e1..f41419231 100644
--- a/src/testbed/gnunet-daemon-testbed-underlay.c
+++ b/src/testbed/gnunet-daemon-testbed-underlay.c
@@ -104,7 +104,7 @@ static unsigned int num_hostkeys;
104/** 104/**
105 * Task for shutdown 105 * Task for shutdown
106 */ 106 */
107static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 107static struct GNUNET_SCHEDULER_Task * shutdown_task;
108 108
109 109
110/** 110/**
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c
index 6937d7262..ccb868e8b 100644
--- a/src/testbed/gnunet-helper-testbed.c
+++ b/src/testbed/gnunet-helper-testbed.c
@@ -124,22 +124,22 @@ static struct GNUNET_DISK_PipeHandle *sigpipe;
124/** 124/**
125 * Task identifier for the read task 125 * Task identifier for the read task
126 */ 126 */
127static GNUNET_SCHEDULER_TaskIdentifier read_task_id; 127static struct GNUNET_SCHEDULER_Task * read_task_id;
128 128
129/** 129/**
130 * Task identifier for the write task 130 * Task identifier for the write task
131 */ 131 */
132static GNUNET_SCHEDULER_TaskIdentifier write_task_id; 132static struct GNUNET_SCHEDULER_Task * write_task_id;
133 133
134/** 134/**
135 * Task to kill the child 135 * Task to kill the child
136 */ 136 */
137static GNUNET_SCHEDULER_TaskIdentifier child_death_task_id; 137static struct GNUNET_SCHEDULER_Task * child_death_task_id;
138 138
139/** 139/**
140 * shutdown task id 140 * shutdown task id
141 */ 141 */
142static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id; 142static struct GNUNET_SCHEDULER_Task * shutdown_task_id;
143 143
144/** 144/**
145 * Are we done reading messages from stdin? 145 * Are we done reading messages from stdin?
@@ -162,26 +162,26 @@ static void
162shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 162shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
163{ 163{
164 LOG_DEBUG ("Shutting down\n"); 164 LOG_DEBUG ("Shutting down\n");
165 shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; 165 shutdown_task_id = NULL;
166 if (NULL != testbed) 166 if (NULL != testbed)
167 { 167 {
168 LOG_DEBUG ("Killing testbed\n"); 168 LOG_DEBUG ("Killing testbed\n");
169 GNUNET_break (0 == GNUNET_OS_process_kill (testbed, GNUNET_TERM_SIG)); 169 GNUNET_break (0 == GNUNET_OS_process_kill (testbed, GNUNET_TERM_SIG));
170 } 170 }
171 if (GNUNET_SCHEDULER_NO_TASK != read_task_id) 171 if (NULL != read_task_id)
172 { 172 {
173 GNUNET_SCHEDULER_cancel (read_task_id); 173 GNUNET_SCHEDULER_cancel (read_task_id);
174 read_task_id = GNUNET_SCHEDULER_NO_TASK; 174 read_task_id = NULL;
175 } 175 }
176 if (GNUNET_SCHEDULER_NO_TASK != write_task_id) 176 if (NULL != write_task_id)
177 { 177 {
178 GNUNET_SCHEDULER_cancel (write_task_id); 178 GNUNET_SCHEDULER_cancel (write_task_id);
179 write_task_id = GNUNET_SCHEDULER_NO_TASK; 179 write_task_id = NULL;
180 } 180 }
181 if (GNUNET_SCHEDULER_NO_TASK != child_death_task_id) 181 if (NULL != child_death_task_id)
182 { 182 {
183 GNUNET_SCHEDULER_cancel (child_death_task_id); 183 GNUNET_SCHEDULER_cancel (child_death_task_id);
184 child_death_task_id = GNUNET_SCHEDULER_NO_TASK; 184 child_death_task_id = NULL;
185 } 185 }
186 if (NULL != stdin_fd) 186 if (NULL != stdin_fd)
187 (void) GNUNET_DISK_file_close (stdin_fd); 187 (void) GNUNET_DISK_file_close (stdin_fd);
@@ -209,7 +209,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
209static void 209static void
210shutdown_now (void) 210shutdown_now (void)
211{ 211{
212 if (GNUNET_SCHEDULER_NO_TASK != shutdown_task_id) 212 if (NULL != shutdown_task_id)
213 GNUNET_SCHEDULER_cancel (shutdown_task_id); 213 GNUNET_SCHEDULER_cancel (shutdown_task_id);
214 shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 214 shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
215} 215}
@@ -228,7 +228,7 @@ write_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
228 ssize_t bytes_wrote; 228 ssize_t bytes_wrote;
229 229
230 GNUNET_assert (NULL != wc); 230 GNUNET_assert (NULL != wc);
231 write_task_id = GNUNET_SCHEDULER_NO_TASK; 231 write_task_id = NULL;
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);
@@ -275,7 +275,7 @@ child_death_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
275 int ret; 275 int ret;
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 = GNUNET_SCHEDULER_NO_TASK; 278 child_death_task_id = NULL;
279 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 279 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
280 { 280 {
281 child_death_task_id = 281 child_death_task_id =
@@ -518,7 +518,7 @@ read_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
518 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE]; 518 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE];
519 ssize_t sread; 519 ssize_t sread;
520 520
521 read_task_id = GNUNET_SCHEDULER_NO_TASK; 521 read_task_id = NULL;
522 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 522 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
523 return; 523 return;
524 sread = GNUNET_DISK_file_read (stdin_fd, buf, sizeof (buf)); 524 sread = GNUNET_DISK_file_read (stdin_fd, buf, sizeof (buf));
diff --git a/src/testbed/gnunet-service-testbed-logger.c b/src/testbed/gnunet-service-testbed-logger.c
index 6bf33e681..7d3c834e2 100644
--- a/src/testbed/gnunet-service-testbed-logger.c
+++ b/src/testbed/gnunet-service-testbed-logger.c
@@ -83,7 +83,7 @@ struct GNUNET_BIO_WriteHandle *bio;
83/** 83/**
84 * The shutdown task handle 84 * The shutdown task handle
85 */ 85 */
86static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id; 86static struct GNUNET_SCHEDULER_Task * shutdown_task_id;
87 87
88/** 88/**
89 * The number of connections we have 89 * The number of connections we have
@@ -126,7 +126,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
126{ 126{
127 struct MessageQueue *mq_entry; 127 struct MessageQueue *mq_entry;
128 128
129 shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; 129 shutdown_task_id = NULL;
130 in_shutdown = GNUNET_YES; 130 in_shutdown = GNUNET_YES;
131 if (0 != nconn) 131 if (0 != nconn)
132 { 132 {
@@ -166,7 +166,7 @@ client_disconnected (void *cls, struct GNUNET_SERVER_Client *client)
166 nconn--; 166 nconn--;
167 if (GNUNET_YES != in_shutdown) 167 if (GNUNET_YES != in_shutdown)
168 return; 168 return;
169 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != shutdown_task_id); 169 GNUNET_assert (NULL != shutdown_task_id);
170 GNUNET_SCHEDULER_cancel (shutdown_task_id); 170 GNUNET_SCHEDULER_cancel (shutdown_task_id);
171 shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 171 shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
172} 172}
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c
index a1d6aed09..039e0d346 100644
--- a/src/testbed/gnunet-service-testbed.c
+++ b/src/testbed/gnunet-service-testbed.c
@@ -132,7 +132,7 @@ static struct MessageQueue *mq_tail;
132/** 132/**
133 * The shutdown task handle 133 * The shutdown task handle
134 */ 134 */
135static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id; 135static struct GNUNET_SCHEDULER_Task * shutdown_task_id;
136 136
137 137
138/** 138/**
@@ -736,7 +736,7 @@ GST_clear_fopcq ()
736 { 736 {
737 GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fopc); 737 GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fopc);
738 GNUNET_TESTBED_forward_operation_msg_cancel_ (fopc->opc); 738 GNUNET_TESTBED_forward_operation_msg_cancel_ (fopc->opc);
739 if (GNUNET_SCHEDULER_NO_TASK != fopc->timeout_task) 739 if (NULL != fopc->timeout_task)
740 GNUNET_SCHEDULER_cancel (fopc->timeout_task); 740 GNUNET_SCHEDULER_cancel (fopc->timeout_task);
741 GNUNET_SERVER_client_drop (fopc->client); 741 GNUNET_SERVER_client_drop (fopc->client);
742 switch (fopc->type) 742 switch (fopc->type)
@@ -784,7 +784,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
784 struct MessageQueue *mq_entry; 784 struct MessageQueue *mq_entry;
785 uint32_t id; 785 uint32_t id;
786 786
787 shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; 787 shutdown_task_id = NULL;
788 LOG_DEBUG ("Shutting down testbed service\n"); 788 LOG_DEBUG ("Shutting down testbed service\n");
789 /* cleanup any remaining forwarded operations */ 789 /* cleanup any remaining forwarded operations */
790 GST_clear_fopcq (); 790 GST_clear_fopcq ();
diff --git a/src/testbed/gnunet-service-testbed.h b/src/testbed/gnunet-service-testbed.h
index 7966864b6..a4eb8e7e8 100644
--- a/src/testbed/gnunet-service-testbed.h
+++ b/src/testbed/gnunet-service-testbed.h
@@ -106,7 +106,7 @@ struct ForwardedOperationContext
106 /** 106 /**
107 * Task ID for the timeout task 107 * Task ID for the timeout task
108 */ 108 */
109 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 109 struct GNUNET_SCHEDULER_Task * timeout_task;
110 110
111 /** 111 /**
112 * The id of the operation that has been forwarded 112 * The id of the operation that has been forwarded
diff --git a/src/testbed/gnunet-service-testbed_barriers.c b/src/testbed/gnunet-service-testbed_barriers.c
index de2c175f1..5e6e391ac 100644
--- a/src/testbed/gnunet-service-testbed_barriers.c
+++ b/src/testbed/gnunet-service-testbed_barriers.c
@@ -199,7 +199,7 @@ struct Barrier
199 /** 199 /**
200 * Identifier for the timeout task 200 * Identifier for the timeout task
201 */ 201 */
202 GNUNET_SCHEDULER_TaskIdentifier tout_task; 202 struct GNUNET_SCHEDULER_Task * tout_task;
203 203
204 /** 204 /**
205 * The status of this barrier 205 * The status of this barrier
diff --git a/src/testbed/gnunet-service-testbed_connectionpool.c b/src/testbed/gnunet-service-testbed_connectionpool.c
index 6d9a27972..51909ae3e 100644
--- a/src/testbed/gnunet-service-testbed_connectionpool.c
+++ b/src/testbed/gnunet-service-testbed_connectionpool.c
@@ -126,12 +126,12 @@ struct PooledConnection
126 /** 126 /**
127 * The task to expire this connection from the connection pool 127 * The task to expire this connection from the connection pool
128 */ 128 */
129 GNUNET_SCHEDULER_TaskIdentifier expire_task; 129 struct GNUNET_SCHEDULER_Task * expire_task;
130 130
131 /** 131 /**
132 * The task to notify a waiting #GST_ConnectionPool_GetHandle object 132 * The task to notify a waiting #GST_ConnectionPool_GetHandle object
133 */ 133 */
134 GNUNET_SCHEDULER_TaskIdentifier notify_task; 134 struct GNUNET_SCHEDULER_Task * notify_task;
135 135
136 /** 136 /**
137 * Number of active requests using this pooled connection 137 * Number of active requests using this pooled connection
@@ -286,10 +286,10 @@ destroy_pooled_connection (struct PooledConnection *entry)
286 GNUNET_CONTAINER_multihashmap32_remove (map, 286 GNUNET_CONTAINER_multihashmap32_remove (map,
287 entry->index, 287 entry->index,
288 entry)); 288 entry));
289 if (GNUNET_SCHEDULER_NO_TASK != entry->notify_task) 289 if (NULL != entry->notify_task)
290 { 290 {
291 GNUNET_SCHEDULER_cancel (entry->notify_task); 291 GNUNET_SCHEDULER_cancel (entry->notify_task);
292 entry->notify_task = GNUNET_SCHEDULER_NO_TASK; 292 entry->notify_task = NULL;
293 } 293 }
294 LOG_DEBUG ("Cleaning up handles of a pooled connection\n"); 294 LOG_DEBUG ("Cleaning up handles of a pooled connection\n");
295 if (NULL != entry->handle_transport) 295 if (NULL != entry->handle_transport)
@@ -322,7 +322,7 @@ expire (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
322{ 322{
323 struct PooledConnection *entry = cls; 323 struct PooledConnection *entry = cls;
324 324
325 entry->expire_task = GNUNET_SCHEDULER_NO_TASK; 325 entry->expire_task = NULL;
326 destroy_pooled_connection (entry); 326 destroy_pooled_connection (entry);
327} 327}
328 328
@@ -335,10 +335,10 @@ expire (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
335static void 335static void
336expire_task_cancel (struct PooledConnection *entry) 336expire_task_cancel (struct PooledConnection *entry)
337{ 337{
338 if (GNUNET_SCHEDULER_NO_TASK != entry->expire_task) 338 if (NULL != entry->expire_task)
339 { 339 {
340 GNUNET_SCHEDULER_cancel (entry->expire_task); 340 GNUNET_SCHEDULER_cancel (entry->expire_task);
341 entry->expire_task = GNUNET_SCHEDULER_NO_TASK; 341 entry->expire_task = NULL;
342 } 342 }
343} 343}
344 344
@@ -355,7 +355,7 @@ add_to_lru (struct PooledConnection *entry)
355 GNUNET_assert (!entry->in_lru); 355 GNUNET_assert (!entry->in_lru);
356 GNUNET_CONTAINER_DLL_insert_tail (head_lru, tail_lru, entry); 356 GNUNET_CONTAINER_DLL_insert_tail (head_lru, tail_lru, entry);
357 entry->in_lru = GNUNET_YES; 357 entry->in_lru = GNUNET_YES;
358 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == entry->expire_task); 358 GNUNET_assert (NULL == entry->expire_task);
359 entry->expire_task = GNUNET_SCHEDULER_add_delayed (CACHE_EXPIRY, 359 entry->expire_task = GNUNET_SCHEDULER_add_delayed (CACHE_EXPIRY,
360 &expire, entry); 360 &expire, entry);
361} 361}
@@ -415,8 +415,8 @@ connection_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
415 struct GST_ConnectionPool_GetHandle *gh; 415 struct GST_ConnectionPool_GetHandle *gh;
416 struct GST_ConnectionPool_GetHandle *gh_next; 416 struct GST_ConnectionPool_GetHandle *gh_next;
417 417
418 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != entry->notify_task); 418 GNUNET_assert (NULL != entry->notify_task);
419 entry->notify_task = GNUNET_SCHEDULER_NO_TASK; 419 entry->notify_task = NULL;
420 gh = search_waiting (entry, entry->head_waiting); 420 gh = search_waiting (entry, entry->head_waiting);
421 GNUNET_assert (NULL != gh); 421 GNUNET_assert (NULL != gh);
422 gh_next = NULL; 422 gh_next = NULL;
@@ -524,7 +524,7 @@ opstart_get_handle_transport (void *cls)
524 } 524 }
525 if (0 == entry->demand) 525 if (0 == entry->demand)
526 return; 526 return;
527 if (GNUNET_SCHEDULER_NO_TASK != entry->notify_task) 527 if (NULL != entry->notify_task)
528 return; 528 return;
529 if (NULL != search_waiting (entry, entry->head_waiting)) 529 if (NULL != search_waiting (entry, entry->head_waiting))
530 { 530 {
@@ -597,7 +597,7 @@ core_startup_cb (void *cls,
597 sizeof (struct GNUNET_PeerIdentity)); 597 sizeof (struct GNUNET_PeerIdentity));
598 if (0 == entry->demand) 598 if (0 == entry->demand)
599 return; 599 return;
600 if (GNUNET_SCHEDULER_NO_TASK != entry->notify_task) 600 if (NULL != entry->notify_task)
601 return; 601 return;
602 if (NULL != search_waiting (entry, entry->head_waiting)) 602 if (NULL != search_waiting (entry, entry->head_waiting))
603 { 603 {
@@ -832,7 +832,7 @@ GST_connection_pool_get_handle (unsigned int peer_id,
832 GNUNET_CONTAINER_DLL_insert (entry->head_waiting, entry->tail_waiting, gh); 832 GNUNET_CONTAINER_DLL_insert (entry->head_waiting, entry->tail_waiting, gh);
833 if (NULL != handle) 833 if (NULL != handle)
834 { 834 {
835 if (GNUNET_SCHEDULER_NO_TASK == entry->notify_task) 835 if (NULL == entry->notify_task)
836 { 836 {
837 if (NULL != search_waiting (entry, entry->head_waiting)) 837 if (NULL != search_waiting (entry, entry->head_waiting))
838 entry->notify_task = GNUNET_SCHEDULER_add_now (&connection_ready, entry); 838 entry->notify_task = GNUNET_SCHEDULER_add_now (&connection_ready, entry);
@@ -888,10 +888,10 @@ GST_connection_pool_get_handle_done (struct GST_ConnectionPool_GetHandle *gh)
888 { 888 {
889 GNUNET_CONTAINER_DLL_remove (entry->head_waiting, entry->tail_waiting, gh); 889 GNUNET_CONTAINER_DLL_remove (entry->head_waiting, entry->tail_waiting, gh);
890 if ( (NULL == search_waiting (entry, entry->head_waiting)) 890 if ( (NULL == search_waiting (entry, entry->head_waiting))
891 && (GNUNET_SCHEDULER_NO_TASK != entry->notify_task) ) 891 && (NULL != entry->notify_task) )
892 { 892 {
893 GNUNET_SCHEDULER_cancel (entry->notify_task); 893 GNUNET_SCHEDULER_cancel (entry->notify_task);
894 entry->notify_task = GNUNET_SCHEDULER_NO_TASK; 894 entry->notify_task = NULL;
895 } 895 }
896 } 896 }
897 if (gh->notify_waiting) 897 if (gh->notify_waiting)
diff --git a/src/testbed/gnunet-service-testbed_cpustatus.c b/src/testbed/gnunet-service-testbed_cpustatus.c
index 712df48b3..fa0ee52c0 100644
--- a/src/testbed/gnunet-service-testbed_cpustatus.c
+++ b/src/testbed/gnunet-service-testbed_cpustatus.c
@@ -85,7 +85,7 @@ static double agedIOLoad = -1;
85 */ 85 */
86struct GNUNET_BIO_WriteHandle *bw; 86struct GNUNET_BIO_WriteHandle *bw;
87 87
88GNUNET_SCHEDULER_TaskIdentifier sample_load_task_id; 88struct GNUNET_SCHEDULER_Task * sample_load_task_id;
89 89
90 90
91#ifdef OSX 91#ifdef OSX
@@ -656,7 +656,7 @@ sample_load_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
656 unsigned int mem_usage; 656 unsigned int mem_usage;
657 unsigned int nproc; 657 unsigned int nproc;
658 658
659 sample_load_task_id = GNUNET_SCHEDULER_NO_TASK; 659 sample_load_task_id = NULL;
660 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 660 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
661 return; 661 return;
662 ld_cpu = cpu_get_load (); 662 ld_cpu = cpu_get_load ();
@@ -767,10 +767,10 @@ GST_stats_destroy ()
767#elif OSX 767#elif OSX
768 GNUNET_free_non_null (prev_cpu_load); 768 GNUNET_free_non_null (prev_cpu_load);
769#endif 769#endif
770 if (GNUNET_SCHEDULER_NO_TASK != sample_load_task_id) 770 if (NULL != sample_load_task_id)
771 { 771 {
772 GNUNET_SCHEDULER_cancel (sample_load_task_id); 772 GNUNET_SCHEDULER_cancel (sample_load_task_id);
773 sample_load_task_id = GNUNET_SCHEDULER_NO_TASK; 773 sample_load_task_id = NULL;
774 } 774 }
775 GNUNET_break (GNUNET_OK == GNUNET_BIO_write_close (bw)); 775 GNUNET_break (GNUNET_OK == GNUNET_BIO_write_close (bw));
776 bw = NULL; 776 bw = NULL;
diff --git a/src/testbed/gnunet-service-testbed_links.c b/src/testbed/gnunet-service-testbed_links.c
index cb908f12b..4c2e6c58a 100644
--- a/src/testbed/gnunet-service-testbed_links.c
+++ b/src/testbed/gnunet-service-testbed_links.c
@@ -92,7 +92,7 @@ struct LCFContext
92 /** 92 /**
93 * The timeout task 93 * The timeout task
94 */ 94 */
95 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 95 struct GNUNET_SCHEDULER_Task * timeout_task;
96 96
97 /** 97 /**
98 * The id of the operation which created this context 98 * The id of the operation which created this context
@@ -206,7 +206,7 @@ struct Neighbour
206 /** 206 /**
207 * Task id for the task to call notifications from the notification list 207 * Task id for the task to call notifications from the notification list
208 */ 208 */
209 GNUNET_SCHEDULER_TaskIdentifier notify_task; 209 struct GNUNET_SCHEDULER_Task * notify_task;
210 210
211 /** 211 /**
212 * How many references are present currently to this neighbour's connection 212 * How many references are present currently to this neighbour's connection
@@ -265,7 +265,7 @@ struct NeighbourConnectCtxt
265 /** 265 /**
266 * Task to be run upon timeout 266 * Task to be run upon timeout
267 */ 267 */
268 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 268 struct GNUNET_SCHEDULER_Task * timeout_task;
269 269
270 /** 270 /**
271 * The notification handle associated with the neighbour's connection request 271 * The notification handle associated with the neighbour's connection request
@@ -317,7 +317,7 @@ static struct LCFContextQueue *lcfq_tail;
317/** 317/**
318 * The lcf_task handle 318 * The lcf_task handle
319 */ 319 */
320static GNUNET_SCHEDULER_TaskIdentifier lcf_proc_task_id; 320static struct GNUNET_SCHEDULER_Task * lcf_proc_task_id;
321 321
322/** 322/**
323 * The size of the route list 323 * The size of the route list
@@ -602,7 +602,7 @@ lcf_proc_cc (void *cls, const char *emsg)
602{ 602{
603 struct LCFContext *lcf = cls; 603 struct LCFContext *lcf = cls;
604 604
605 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id); 605 GNUNET_assert (NULL == lcf_proc_task_id);
606 switch (lcf->state) 606 switch (lcf->state)
607 { 607 {
608 case INIT: 608 case INIT:
@@ -652,14 +652,14 @@ lcf_forwarded_operation_timeout (void *cls,
652{ 652{
653 struct LCFContext *lcf = cls; 653 struct LCFContext *lcf = cls;
654 654
655 lcf->timeout_task = GNUNET_SCHEDULER_NO_TASK; 655 lcf->timeout_task = NULL;
656 // GST_forwarded_operation_timeout (lcf->fopc, tc); 656 // GST_forwarded_operation_timeout (lcf->fopc, tc);
657 LOG (GNUNET_ERROR_TYPE_WARNING, 657 LOG (GNUNET_ERROR_TYPE_WARNING,
658 "A forwarded controller link operation has timed out\n"); 658 "A forwarded controller link operation has timed out\n");
659 send_controller_link_response (lcf->client, lcf->operation_id, NULL, 659 send_controller_link_response (lcf->client, lcf->operation_id, NULL,
660 "A forwarded controller link operation has " 660 "A forwarded controller link operation has "
661 "timed out\n"); 661 "timed out\n");
662 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id); 662 GNUNET_assert (NULL == lcf_proc_task_id);
663 lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf); 663 lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
664} 664}
665 665
@@ -676,7 +676,7 @@ lcf_proc_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
676 struct LCFContext *lcf = cls; 676 struct LCFContext *lcf = cls;
677 struct LCFContextQueue *lcfq; 677 struct LCFContextQueue *lcfq;
678 678
679 lcf_proc_task_id = GNUNET_SCHEDULER_NO_TASK; 679 lcf_proc_task_id = NULL;
680 switch (lcf->state) 680 switch (lcf->state)
681 { 681 {
682 case INIT: 682 case INIT:
@@ -753,7 +753,7 @@ slave_event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
753 GNUNET_TESTBED_operation_done (lcf->op); 753 GNUNET_TESTBED_operation_done (lcf->op);
754 lcf->op = NULL; 754 lcf->op = NULL;
755 GNUNET_assert (FINISHED == lcf->state); 755 GNUNET_assert (FINISHED == lcf->state);
756 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != lcf->timeout_task); 756 GNUNET_assert (NULL != lcf->timeout_task);
757 GNUNET_SCHEDULER_cancel (lcf->timeout_task); 757 GNUNET_SCHEDULER_cancel (lcf->timeout_task);
758 if (NULL == event->details.operation_finished.emsg) 758 if (NULL == event->details.operation_finished.emsg)
759 send_controller_link_response (lcf->client, lcf->operation_id, 759 send_controller_link_response (lcf->client, lcf->operation_id,
@@ -764,7 +764,7 @@ slave_event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
764 send_controller_link_response (lcf->client, lcf->operation_id, 764 send_controller_link_response (lcf->client, lcf->operation_id,
765 NULL, 765 NULL,
766 event->details.operation_finished.emsg); 766 event->details.operation_finished.emsg);
767 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id); 767 GNUNET_assert (NULL == lcf_proc_task_id);
768 lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf); 768 lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
769 return; 769 return;
770} 770}
@@ -862,8 +862,8 @@ neighbour_connect_notify_task (void *cls,
862 struct NeighbourConnectNotification *h; 862 struct NeighbourConnectNotification *h;
863 863
864 GNUNET_assert (NULL != (h = n->nl_head)); 864 GNUNET_assert (NULL != (h = n->nl_head));
865 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != n->notify_task); 865 GNUNET_assert (NULL != n->notify_task);
866 n->notify_task = GNUNET_SCHEDULER_NO_TASK; 866 n->notify_task = NULL;
867 GNUNET_assert (NULL != n->controller); 867 GNUNET_assert (NULL != n->controller);
868 GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h); 868 GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h);
869 trigger_notifications (n); 869 trigger_notifications (n);
@@ -888,7 +888,7 @@ trigger_notifications (struct Neighbour *n)
888 return; 888 return;
889 if (NULL == n->controller) 889 if (NULL == n->controller)
890 return; 890 return;
891 if (GNUNET_SCHEDULER_NO_TASK != n->notify_task) 891 if (NULL != n->notify_task)
892 return; 892 return;
893 if (1 == n->inactive) 893 if (1 == n->inactive)
894 { 894 {
@@ -936,7 +936,7 @@ oprelease_neighbour_conn (void *cls)
936 struct Neighbour *n = cls; 936 struct Neighbour *n = cls;
937 937
938 GNUNET_assert (0 == n->reference_cnt); 938 GNUNET_assert (0 == n->reference_cnt);
939 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == n->notify_task); 939 GNUNET_assert (NULL == n->notify_task);
940 GNUNET_assert (NULL == n->nl_head); 940 GNUNET_assert (NULL == n->nl_head);
941 if (NULL != n->controller) 941 if (NULL != n->controller)
942 { 942 {
@@ -1006,12 +1006,12 @@ GST_neighbour_get_connection_cancel (struct NeighbourConnectNotification *h)
1006 GNUNET_free (h); 1006 GNUNET_free (h);
1007 if (GNUNET_NO == cleanup_task) 1007 if (GNUNET_NO == cleanup_task)
1008 return; 1008 return;
1009 if (GNUNET_SCHEDULER_NO_TASK == n->notify_task) 1009 if (NULL == n->notify_task)
1010 return; 1010 return;
1011 GNUNET_assert (0 < n->reference_cnt); 1011 GNUNET_assert (0 < n->reference_cnt);
1012 n->reference_cnt--; 1012 n->reference_cnt--;
1013 GNUNET_SCHEDULER_cancel (n->notify_task); 1013 GNUNET_SCHEDULER_cancel (n->notify_task);
1014 n->notify_task = GNUNET_SCHEDULER_NO_TASK; 1014 n->notify_task = NULL;
1015 if (NULL == n->nl_head) 1015 if (NULL == n->nl_head)
1016 { 1016 {
1017 if ( (0 == n->reference_cnt) && (0 == n->inactive) ) 1017 if ( (0 == n->reference_cnt) && (0 == n->inactive) )
@@ -1056,7 +1056,7 @@ cleanup_ncc (struct NeighbourConnectCtxt *ncc)
1056{ 1056{
1057 if (NULL != ncc->nh) 1057 if (NULL != ncc->nh)
1058 GST_neighbour_get_connection_cancel (ncc->nh); 1058 GST_neighbour_get_connection_cancel (ncc->nh);
1059 if (GNUNET_SCHEDULER_NO_TASK != ncc->timeout_task) 1059 if (NULL != ncc->timeout_task)
1060 GNUNET_SCHEDULER_cancel (ncc->timeout_task); 1060 GNUNET_SCHEDULER_cancel (ncc->timeout_task);
1061 GNUNET_SERVER_client_drop (ncc->client); 1061 GNUNET_SERVER_client_drop (ncc->client);
1062 GNUNET_CONTAINER_DLL_remove (ncc_head, ncc_tail, ncc); 1062 GNUNET_CONTAINER_DLL_remove (ncc_head, ncc_tail, ncc);
@@ -1126,7 +1126,7 @@ timeout_neighbour_connect (void *cls,
1126{ 1126{
1127 struct NeighbourConnectCtxt *ncc = cls; 1127 struct NeighbourConnectCtxt *ncc = cls;
1128 1128
1129 ncc->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1129 ncc->timeout_task = NULL;
1130 send_controller_link_response (ncc->client, ncc->op_id, NULL, 1130 send_controller_link_response (ncc->client, ncc->op_id, NULL,
1131 "Could not connect to delegated controller"); 1131 "Could not connect to delegated controller");
1132 cleanup_ncc (ncc); 1132 cleanup_ncc (ncc);
@@ -1145,7 +1145,7 @@ neighbour_connect_cb (void *cls, struct GNUNET_TESTBED_Controller *c)
1145 struct NeighbourConnectCtxt *ncc = cls; 1145 struct NeighbourConnectCtxt *ncc = cls;
1146 1146
1147 GNUNET_SCHEDULER_cancel (ncc->timeout_task); 1147 GNUNET_SCHEDULER_cancel (ncc->timeout_task);
1148 ncc->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1148 ncc->timeout_task = NULL;
1149 ncc->nh = NULL; 1149 ncc->nh = NULL;
1150 GST_neighbour_release_connection (ncc->n); 1150 GST_neighbour_release_connection (ncc->n);
1151 send_controller_link_response (ncc->client, ncc->op_id, NULL, NULL); 1151 send_controller_link_response (ncc->client, ncc->op_id, NULL, NULL);
@@ -1314,7 +1314,7 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client,
1314 lcfq->lcf->client = client; 1314 lcfq->lcf->client = client;
1315 if (NULL == lcfq_head) 1315 if (NULL == lcfq_head)
1316 { 1316 {
1317 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id); 1317 GNUNET_assert (NULL == lcf_proc_task_id);
1318 GNUNET_CONTAINER_DLL_insert_tail (lcfq_head, lcfq_tail, lcfq); 1318 GNUNET_CONTAINER_DLL_insert_tail (lcfq_head, lcfq_tail, lcfq);
1319 lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcfq->lcf); 1319 lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcfq->lcf);
1320 } 1320 }
@@ -1354,20 +1354,20 @@ GST_free_lcfq ()
1354 1354
1355 if (NULL != lcfq_head) 1355 if (NULL != lcfq_head)
1356 { 1356 {
1357 if (GNUNET_SCHEDULER_NO_TASK != lcf_proc_task_id) 1357 if (NULL != lcf_proc_task_id)
1358 { 1358 {
1359 GNUNET_SCHEDULER_cancel (lcf_proc_task_id); 1359 GNUNET_SCHEDULER_cancel (lcf_proc_task_id);
1360 lcf_proc_task_id = GNUNET_SCHEDULER_NO_TASK; 1360 lcf_proc_task_id = NULL;
1361 } 1361 }
1362 } 1362 }
1363 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id); 1363 GNUNET_assert (NULL == lcf_proc_task_id);
1364 for (lcfq = lcfq_head; NULL != lcfq; lcfq = lcfq_head) 1364 for (lcfq = lcfq_head; NULL != lcfq; lcfq = lcfq_head)
1365 { 1365 {
1366 lcf = lcfq->lcf; 1366 lcf = lcfq->lcf;
1367 GNUNET_SERVER_client_drop (lcf->client); 1367 GNUNET_SERVER_client_drop (lcf->client);
1368 if (NULL != lcf->op) 1368 if (NULL != lcf->op)
1369 GNUNET_TESTBED_operation_done (lcf->op); 1369 GNUNET_TESTBED_operation_done (lcf->op);
1370 if (GNUNET_SCHEDULER_NO_TASK != lcf->timeout_task) 1370 if (NULL != lcf->timeout_task)
1371 GNUNET_SCHEDULER_cancel (lcf->timeout_task); 1371 GNUNET_SCHEDULER_cancel (lcf->timeout_task);
1372 GNUNET_free (lcf); 1372 GNUNET_free (lcf);
1373 GNUNET_CONTAINER_DLL_remove (lcfq_head, lcfq_tail, lcfq); 1373 GNUNET_CONTAINER_DLL_remove (lcfq_head, lcfq_tail, lcfq);
diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c
index c2978728c..c331fb8f0 100644
--- a/src/testbed/gnunet-service-testbed_oc.c
+++ b/src/testbed/gnunet-service-testbed_oc.c
@@ -65,7 +65,7 @@ struct TryConnectContext
65 /** 65 /**
66 * The task handle 66 * The task handle
67 */ 67 */
68 GNUNET_SCHEDULER_TaskIdentifier task; 68 struct GNUNET_SCHEDULER_Task * task;
69 69
70 /** 70 /**
71 * The id of the operation which is resposible for this context 71 * The id of the operation which is resposible for this context
@@ -250,17 +250,17 @@ struct OverlayConnectContext
250 * The id of the task for sending HELLO of peer 2 to peer 1 and ask peer 1 to 250 * The id of the task for sending HELLO of peer 2 to peer 1 and ask peer 1 to
251 * connect to peer 2 251 * connect to peer 2
252 */ 252 */
253 GNUNET_SCHEDULER_TaskIdentifier send_hello_task; 253 struct GNUNET_SCHEDULER_Task * send_hello_task;
254 254
255 /** 255 /**
256 * The id of the overlay connect timeout task 256 * The id of the overlay connect timeout task
257 */ 257 */
258 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 258 struct GNUNET_SCHEDULER_Task * timeout_task;
259 259
260 /** 260 /**
261 * The id of the cleanup task 261 * The id of the cleanup task
262 */ 262 */
263 GNUNET_SCHEDULER_TaskIdentifier cleanup_task; 263 struct GNUNET_SCHEDULER_Task * cleanup_task;
264 264
265 /** 265 /**
266 * The type of this context information 266 * The type of this context information
@@ -321,12 +321,12 @@ struct RemoteOverlayConnectCtx
321 /** 321 /**
322 * Task for offering HELLO of A to B and doing try_connect 322 * Task for offering HELLO of A to B and doing try_connect
323 */ 323 */
324 GNUNET_SCHEDULER_TaskIdentifier attempt_connect_task_id; 324 struct GNUNET_SCHEDULER_Task * attempt_connect_task_id;
325 325
326 /** 326 /**
327 * Task to timeout RequestOverlayConnect 327 * Task to timeout RequestOverlayConnect
328 */ 328 */
329 GNUNET_SCHEDULER_TaskIdentifier timeout_rocc_task_id; 329 struct GNUNET_SCHEDULER_Task * timeout_rocc_task_id;
330 330
331 /** 331 /**
332 * The id of the operation responsible for creating this context 332 * The id of the operation responsible for creating this context
@@ -478,7 +478,7 @@ cleanup_occ_lp2c (struct LocalPeer2Context *lp2c)
478 GST_connection_pool_get_handle_done (lp2c->tcc.cgh_th); 478 GST_connection_pool_get_handle_done (lp2c->tcc.cgh_th);
479 if (NULL != lp2c->tcc.tch) 479 if (NULL != lp2c->tcc.tch)
480 GNUNET_TRANSPORT_try_connect_cancel (lp2c->tcc.tch); 480 GNUNET_TRANSPORT_try_connect_cancel (lp2c->tcc.tch);
481 if (GNUNET_SCHEDULER_NO_TASK != lp2c->tcc.task) 481 if (NULL != lp2c->tcc.task)
482 GNUNET_SCHEDULER_cancel (lp2c->tcc.task); 482 GNUNET_SCHEDULER_cancel (lp2c->tcc.task);
483} 483}
484 484
@@ -523,11 +523,11 @@ cleanup_occ (struct OverlayConnectContext *occ)
523 GNUNET_free_non_null (occ->emsg); 523 GNUNET_free_non_null (occ->emsg);
524 GNUNET_free_non_null (occ->hello); 524 GNUNET_free_non_null (occ->hello);
525 GNUNET_SERVER_client_drop (occ->client); 525 GNUNET_SERVER_client_drop (occ->client);
526 if (GNUNET_SCHEDULER_NO_TASK != occ->send_hello_task) 526 if (NULL != occ->send_hello_task)
527 GNUNET_SCHEDULER_cancel (occ->send_hello_task); 527 GNUNET_SCHEDULER_cancel (occ->send_hello_task);
528 if (GNUNET_SCHEDULER_NO_TASK != occ->cleanup_task) 528 if (NULL != occ->cleanup_task)
529 GNUNET_SCHEDULER_cancel (occ->cleanup_task); 529 GNUNET_SCHEDULER_cancel (occ->cleanup_task);
530 if (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task) 530 if (NULL != occ->timeout_task)
531 GNUNET_SCHEDULER_cancel (occ->timeout_task); 531 GNUNET_SCHEDULER_cancel (occ->timeout_task);
532 if (NULL != occ->cgh_ch) 532 if (NULL != occ->cgh_ch)
533 GST_connection_pool_get_handle_done (occ->cgh_ch); 533 GST_connection_pool_get_handle_done (occ->cgh_ch);
@@ -571,7 +571,7 @@ do_cleanup_occ (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
571{ 571{
572 struct OverlayConnectContext *occ = cls; 572 struct OverlayConnectContext *occ = cls;
573 573
574 occ->cleanup_task = GNUNET_SCHEDULER_NO_TASK; 574 occ->cleanup_task = NULL;
575 cleanup_occ (occ); 575 cleanup_occ (occ);
576} 576}
577 577
@@ -588,8 +588,8 @@ timeout_overlay_connect (void *cls,
588{ 588{
589 struct OverlayConnectContext *occ = cls; 589 struct OverlayConnectContext *occ = cls;
590 590
591 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task); 591 GNUNET_assert (NULL != occ->timeout_task);
592 occ->timeout_task = GNUNET_SCHEDULER_NO_TASK; 592 occ->timeout_task = NULL;
593 /* LOG (GNUNET_ERROR_TYPE_WARNING, */ 593 /* LOG (GNUNET_ERROR_TYPE_WARNING, */
594 /* "0x%llx: Timeout while connecting peers %u and %u: %s\n", occ->op_id, */ 594 /* "0x%llx: Timeout while connecting peers %u and %u: %s\n", occ->op_id, */
595 /* occ->peer->id, occ->other_peer_id, occ->emsg); */ 595 /* occ->peer->id, occ->other_peer_id, occ->emsg); */
@@ -653,21 +653,21 @@ overlay_connect_notify (void *cls, const struct GNUNET_PeerIdentity *new_peer)
653 LOG_DEBUG ("0x%llx: Peer %4s connected to peer %4s\n", occ->op_id, 653 LOG_DEBUG ("0x%llx: Peer %4s connected to peer %4s\n", occ->op_id,
654 other_peer_str, GNUNET_i2s (&occ->peer_identity)); 654 other_peer_str, GNUNET_i2s (&occ->peer_identity));
655 GNUNET_free (other_peer_str); 655 GNUNET_free (other_peer_str);
656 if (GNUNET_SCHEDULER_NO_TASK != occ->send_hello_task) 656 if (NULL != occ->send_hello_task)
657 { 657 {
658 GNUNET_SCHEDULER_cancel (occ->send_hello_task); 658 GNUNET_SCHEDULER_cancel (occ->send_hello_task);
659 occ->send_hello_task = GNUNET_SCHEDULER_NO_TASK; 659 occ->send_hello_task = NULL;
660 } 660 }
661 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task); 661 GNUNET_assert (NULL != occ->timeout_task);
662 GNUNET_SCHEDULER_cancel (occ->timeout_task); 662 GNUNET_SCHEDULER_cancel (occ->timeout_task);
663 occ->timeout_task = GNUNET_SCHEDULER_NO_TASK; 663 occ->timeout_task = NULL;
664 if (OCC_TYPE_LOCAL == occ->type) 664 if (OCC_TYPE_LOCAL == occ->type)
665 { 665 {
666 lp2c = &occ->p2ctx.local; 666 lp2c = &occ->p2ctx.local;
667 if (GNUNET_SCHEDULER_NO_TASK != lp2c->tcc.task) 667 if (NULL != lp2c->tcc.task)
668 { 668 {
669 GNUNET_SCHEDULER_cancel (lp2c->tcc.task); 669 GNUNET_SCHEDULER_cancel (lp2c->tcc.task);
670 lp2c->tcc.task = GNUNET_SCHEDULER_NO_TASK; 670 lp2c->tcc.task = NULL;
671 } 671 }
672 } 672 }
673 GNUNET_free_non_null (occ->emsg); 673 GNUNET_free_non_null (occ->emsg);
@@ -700,7 +700,7 @@ try_connect_cb (void *cls, const int result)
700 struct TryConnectContext *tcc = cls; 700 struct TryConnectContext *tcc = cls;
701 701
702 tcc->tch = NULL; 702 tcc->tch = NULL;
703 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == tcc->task); 703 GNUNET_assert (NULL == tcc->task);
704 tcc->task = 704 tcc->task =
705 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 705 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
706 (GNUNET_TIME_UNIT_MILLISECONDS, 706 (GNUNET_TIME_UNIT_MILLISECONDS,
@@ -720,7 +720,7 @@ try_connect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
720{ 720{
721 struct TryConnectContext *tcc = cls; 721 struct TryConnectContext *tcc = cls;
722 722
723 tcc->task = GNUNET_SCHEDULER_NO_TASK; 723 tcc->task = NULL;
724 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 724 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
725 return; 725 return;
726 GNUNET_assert (NULL == tcc->tch); 726 GNUNET_assert (NULL == tcc->tch);
@@ -762,7 +762,7 @@ occ_hello_sent_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
762 GNUNET_assert (OCC_TYPE_LOCAL == occ->type); 762 GNUNET_assert (OCC_TYPE_LOCAL == occ->type);
763 lp2c = &occ->p2ctx.local; 763 lp2c = &occ->p2ctx.local;
764 lp2c->ohh = NULL; 764 lp2c->ohh = NULL;
765 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == occ->send_hello_task); 765 GNUNET_assert (NULL == occ->send_hello_task);
766 if (GNUNET_SCHEDULER_REASON_TIMEOUT == tc->reason) 766 if (GNUNET_SCHEDULER_REASON_TIMEOUT == tc->reason)
767 { 767 {
768 GNUNET_free_non_null (occ->emsg); 768 GNUNET_free_non_null (occ->emsg);
@@ -839,7 +839,7 @@ send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
839 struct LocalPeer2Context *lp2c; 839 struct LocalPeer2Context *lp2c;
840 char *other_peer_str; 840 char *other_peer_str;
841 841
842 occ->send_hello_task = GNUNET_SCHEDULER_NO_TASK; 842 occ->send_hello_task = NULL;
843 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 843 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
844 return; 844 return;
845 GNUNET_assert (NULL != occ->hello); 845 GNUNET_assert (NULL != occ->hello);
@@ -1048,7 +1048,7 @@ occ_cache_get_handle_core_cb (void *cls, struct GNUNET_CORE_Handle *ch,
1048 struct OverlayConnectContext *occ = cls; 1048 struct OverlayConnectContext *occ = cls;
1049 const struct GNUNET_MessageHeader *hello; 1049 const struct GNUNET_MessageHeader *hello;
1050 1050
1051 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task); 1051 GNUNET_assert (NULL != occ->timeout_task);
1052 GNUNET_free_non_null (occ->emsg); 1052 GNUNET_free_non_null (occ->emsg);
1053 if ((NULL == ch) || (NULL == my_identity)) 1053 if ((NULL == ch) || (NULL == my_identity))
1054 { 1054 {
@@ -1066,7 +1066,7 @@ occ_cache_get_handle_core_cb (void *cls, struct GNUNET_CORE_Handle *ch,
1066 { 1066 {
1067 LOG_DEBUG ("0x%llx: Target peer already connected\n", occ->op_id); 1067 LOG_DEBUG ("0x%llx: Target peer already connected\n", occ->op_id);
1068 GNUNET_SCHEDULER_cancel (occ->timeout_task); 1068 GNUNET_SCHEDULER_cancel (occ->timeout_task);
1069 occ->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1069 occ->timeout_task = NULL;
1070 send_overlay_connect_success_msg (occ); 1070 send_overlay_connect_success_msg (occ);
1071 occ->cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup_occ, occ); 1071 occ->cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup_occ, occ);
1072 return; 1072 return;
@@ -1114,7 +1114,7 @@ overlay_connect_get_config (void *cls, const struct GNUNET_MessageHeader *msg)
1114 GNUNET_assert (OCC_TYPE_LOCAL != occ->type); 1114 GNUNET_assert (OCC_TYPE_LOCAL != occ->type);
1115 rp2c = &occ->p2ctx.remote; 1115 rp2c = &occ->p2ctx.remote;
1116 rp2c->opc = NULL; 1116 rp2c->opc = NULL;
1117 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task); 1117 GNUNET_assert (NULL != occ->timeout_task);
1118 if (GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION != ntohs (msg->type)) 1118 if (GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION != ntohs (msg->type))
1119 { 1119 {
1120 GNUNET_SCHEDULER_cancel (occ->timeout_task); 1120 GNUNET_SCHEDULER_cancel (occ->timeout_task);
@@ -1462,7 +1462,7 @@ GST_handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client,
1462 GST_peer_list[p1]->reference_cnt++; 1462 GST_peer_list[p1]->reference_cnt++;
1463 occ->peer = GST_peer_list[p1]; 1463 occ->peer = GST_peer_list[p1];
1464 occ->op_id = operation_id; 1464 occ->op_id = operation_id;
1465 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == occ->timeout_task); 1465 GNUNET_assert (NULL == occ->timeout_task);
1466 occ->timeout_task = 1466 occ->timeout_task =
1467 GNUNET_SCHEDULER_add_delayed (GST_timeout, &timeout_overlay_connect, occ); 1467 GNUNET_SCHEDULER_add_delayed (GST_timeout, &timeout_overlay_connect, occ);
1468 switch (occ->type) 1468 switch (occ->type)
@@ -1508,15 +1508,15 @@ static void
1508cleanup_rocc (struct RemoteOverlayConnectCtx *rocc) 1508cleanup_rocc (struct RemoteOverlayConnectCtx *rocc)
1509{ 1509{
1510 LOG_DEBUG ("0x%llx: Cleaning up rocc\n", rocc->op_id); 1510 LOG_DEBUG ("0x%llx: Cleaning up rocc\n", rocc->op_id);
1511 if (GNUNET_SCHEDULER_NO_TASK != rocc->attempt_connect_task_id) 1511 if (NULL != rocc->attempt_connect_task_id)
1512 GNUNET_SCHEDULER_cancel (rocc->attempt_connect_task_id); 1512 GNUNET_SCHEDULER_cancel (rocc->attempt_connect_task_id);
1513 if (GNUNET_SCHEDULER_NO_TASK != rocc->timeout_rocc_task_id) 1513 if (NULL != rocc->timeout_rocc_task_id)
1514 GNUNET_SCHEDULER_cancel (rocc->timeout_rocc_task_id); 1514 GNUNET_SCHEDULER_cancel (rocc->timeout_rocc_task_id);
1515 if (NULL != rocc->ohh) 1515 if (NULL != rocc->ohh)
1516 GNUNET_TRANSPORT_offer_hello_cancel (rocc->ohh); 1516 GNUNET_TRANSPORT_offer_hello_cancel (rocc->ohh);
1517 if (NULL != rocc->tcc.tch) 1517 if (NULL != rocc->tcc.tch)
1518 GNUNET_TRANSPORT_try_connect_cancel (rocc->tcc.tch); 1518 GNUNET_TRANSPORT_try_connect_cancel (rocc->tcc.tch);
1519 if (GNUNET_SCHEDULER_NO_TASK != rocc->tcc.task) 1519 if (NULL != rocc->tcc.task)
1520 GNUNET_SCHEDULER_cancel (rocc->tcc.task); 1520 GNUNET_SCHEDULER_cancel (rocc->tcc.task);
1521 GST_connection_pool_get_handle_done (rocc->tcc.cgh_th); 1521 GST_connection_pool_get_handle_done (rocc->tcc.cgh_th);
1522 GNUNET_assert (rocc->peer->reference_cnt > 0); 1522 GNUNET_assert (rocc->peer->reference_cnt > 0);
@@ -1541,8 +1541,8 @@ timeout_rocc_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1541{ 1541{
1542 struct RemoteOverlayConnectCtx *rocc = cls; 1542 struct RemoteOverlayConnectCtx *rocc = cls;
1543 1543
1544 GNUNET_assert (rocc->timeout_rocc_task_id != GNUNET_SCHEDULER_NO_TASK); 1544 GNUNET_assert (rocc->timeout_rocc_task_id != NULL);
1545 rocc->timeout_rocc_task_id = GNUNET_SCHEDULER_NO_TASK; 1545 rocc->timeout_rocc_task_id = NULL;
1546 LOG_DEBUG ("0x%llx: rocc timed out\n", rocc->op_id); 1546 LOG_DEBUG ("0x%llx: rocc timed out\n", rocc->op_id);
1547 cleanup_rocc (rocc); 1547 cleanup_rocc (rocc);
1548} 1548}
@@ -1596,7 +1596,7 @@ rocc_hello_sent_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1596 struct RemoteOverlayConnectCtx *rocc = cls; 1596 struct RemoteOverlayConnectCtx *rocc = cls;
1597 1597
1598 rocc->ohh = NULL; 1598 rocc->ohh = NULL;
1599 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rocc->attempt_connect_task_id); 1599 GNUNET_assert (NULL == rocc->attempt_connect_task_id);
1600 LOG_DEBUG ("0x%llx: HELLO of peer %4s sent to local peer with id: %u\n", 1600 LOG_DEBUG ("0x%llx: HELLO of peer %4s sent to local peer with id: %u\n",
1601 rocc->op_id, GNUNET_i2s (&rocc->a_id), rocc->peer->id); 1601 rocc->op_id, GNUNET_i2s (&rocc->a_id), rocc->peer->id);
1602 if (GNUNET_SCHEDULER_REASON_TIMEOUT == tc->reason) 1602 if (GNUNET_SCHEDULER_REASON_TIMEOUT == tc->reason)
@@ -1627,8 +1627,8 @@ attempt_connect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1627{ 1627{
1628 struct RemoteOverlayConnectCtx *rocc = cls; 1628 struct RemoteOverlayConnectCtx *rocc = cls;
1629 1629
1630 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != rocc->attempt_connect_task_id); 1630 GNUNET_assert (NULL != rocc->attempt_connect_task_id);
1631 rocc->attempt_connect_task_id = GNUNET_SCHEDULER_NO_TASK; 1631 rocc->attempt_connect_task_id = NULL;
1632 LOG_DEBUG ("0x%llx: Offering HELLO of peer %4s to local peer with id: %u\n", 1632 LOG_DEBUG ("0x%llx: Offering HELLO of peer %4s to local peer with id: %u\n",
1633 rocc->op_id, GNUNET_i2s (&rocc->a_id), rocc->peer->id); 1633 rocc->op_id, GNUNET_i2s (&rocc->a_id), rocc->peer->id);
1634 rocc->ohh = 1634 rocc->ohh =
diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c
index 17f1d6ba9..c45a6b0e2 100644
--- a/src/testbed/gnunet-testbed-profiler.c
+++ b/src/testbed/gnunet-testbed-profiler.c
@@ -55,12 +55,12 @@ static char *hosts_file;
55/** 55/**
56 * Abort task identifier 56 * Abort task identifier
57 */ 57 */
58static GNUNET_SCHEDULER_TaskIdentifier abort_task; 58static struct GNUNET_SCHEDULER_Task * abort_task;
59 59
60/** 60/**
61 * Shutdown task identifier 61 * Shutdown task identifier
62 */ 62 */
63static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 63static struct GNUNET_SCHEDULER_Task * shutdown_task;
64 64
65/** 65/**
66 * Global event mask for all testbed events 66 * Global event mask for all testbed events
@@ -112,11 +112,11 @@ static int noninteractive;
112static void 112static void
113do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 113do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
114{ 114{
115 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 115 shutdown_task = NULL;
116 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 116 if (NULL != abort_task)
117 { 117 {
118 GNUNET_SCHEDULER_cancel (abort_task); 118 GNUNET_SCHEDULER_cancel (abort_task);
119 abort_task = GNUNET_SCHEDULER_NO_TASK; 119 abort_task = NULL;
120 } 120 }
121 if (NULL != cfg) 121 if (NULL != cfg)
122 { 122 {
@@ -137,9 +137,9 @@ static void
137do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 137do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
138{ 138{
139 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n"); 139 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
140 abort_task = GNUNET_SCHEDULER_NO_TASK; 140 abort_task = NULL;
141 result = GNUNET_SYSERR; 141 result = GNUNET_SYSERR;
142 if (GNUNET_SCHEDULER_NO_TASK != shutdown_task) 142 if (NULL != shutdown_task)
143 GNUNET_SCHEDULER_cancel (shutdown_task); 143 GNUNET_SCHEDULER_cancel (shutdown_task);
144 shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 144 shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
145} 145}
@@ -185,7 +185,7 @@ controller_event_cb (void *cls,
185 { 185 {
186 printf ("\nAborting due to very high failure rate\n"); 186 printf ("\nAborting due to very high failure rate\n");
187 print_overlay_links_summary (); 187 print_overlay_links_summary ();
188 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 188 if (NULL != abort_task)
189 GNUNET_SCHEDULER_cancel (abort_task); 189 GNUNET_SCHEDULER_cancel (abort_task);
190 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); 190 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
191 return; 191 return;
@@ -233,7 +233,7 @@ test_run (void *cls,
233 if (noninteractive) 233 if (noninteractive)
234 { 234 {
235 GNUNET_SCHEDULER_cancel (abort_task); 235 GNUNET_SCHEDULER_cancel (abort_task);
236 abort_task = GNUNET_SCHEDULER_NO_TASK; 236 abort_task = NULL;
237 shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 237 shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
238 &do_shutdown, NULL); 238 &do_shutdown, NULL);
239 return; 239 return;
diff --git a/src/testbed/gnunet_testbed_mpi_spawn.c b/src/testbed/gnunet_testbed_mpi_spawn.c
index 41d805471..3fb50cb8f 100644
--- a/src/testbed/gnunet_testbed_mpi_spawn.c
+++ b/src/testbed/gnunet_testbed_mpi_spawn.c
@@ -58,17 +58,17 @@ static enum GNUNET_OS_ProcessStatusType child_status;
58/** 58/**
59 * The shutdown task 59 * The shutdown task
60 */ 60 */
61static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id; 61static struct GNUNET_SCHEDULER_Task * shutdown_task_id;
62 62
63/** 63/**
64 * Task to kill the child 64 * Task to kill the child
65 */ 65 */
66static GNUNET_SCHEDULER_TaskIdentifier terminate_task_id; 66static struct GNUNET_SCHEDULER_Task * terminate_task_id;
67 67
68/** 68/**
69 * Task to kill the child 69 * Task to kill the child
70 */ 70 */
71static GNUNET_SCHEDULER_TaskIdentifier child_death_task_id; 71static struct GNUNET_SCHEDULER_Task * child_death_task_id;
72 72
73/** 73/**
74 * The shutdown task 74 * The shutdown task
@@ -76,7 +76,7 @@ static GNUNET_SCHEDULER_TaskIdentifier child_death_task_id;
76static void 76static void
77shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 77shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
78{ 78{
79 shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; 79 shutdown_task_id = NULL;
80 if (0 != child_exit_code) 80 if (0 != child_exit_code)
81 { 81 {
82 LOG (GNUNET_ERROR_TYPE_WARNING, "Child exited with error code: %lu\n", 82 LOG (GNUNET_ERROR_TYPE_WARNING, "Child exited with error code: %lu\n",
@@ -140,7 +140,7 @@ child_death_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
140 char c[16]; 140 char c[16];
141 141
142 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ); 142 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
143 child_death_task_id = GNUNET_SCHEDULER_NO_TASK; 143 child_death_task_id = NULL;
144 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 144 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
145 { 145 {
146 child_death_task_id = 146 child_death_task_id =
@@ -152,7 +152,7 @@ child_death_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
152 GNUNET_break (0 < GNUNET_DISK_file_read (pr, &c, sizeof (c))); 152 GNUNET_break (0 < GNUNET_DISK_file_read (pr, &c, sizeof (c)));
153 LOG_DEBUG ("Child died\n"); 153 LOG_DEBUG ("Child died\n");
154 GNUNET_SCHEDULER_cancel (terminate_task_id); 154 GNUNET_SCHEDULER_cancel (terminate_task_id);
155 terminate_task_id = GNUNET_SCHEDULER_NO_TASK; 155 terminate_task_id = NULL;
156 GNUNET_assert (GNUNET_OK == GNUNET_OS_process_status (child, &child_status, 156 GNUNET_assert (GNUNET_OK == GNUNET_OS_process_status (child, &child_status,
157 &child_exit_code)); 157 &child_exit_code));
158 GNUNET_OS_process_destroy (child); 158 GNUNET_OS_process_destroy (child);
diff --git a/src/testbed/test_gnunet_helper_testbed.c b/src/testbed/test_gnunet_helper_testbed.c
index cf4559c26..43177c894 100644
--- a/src/testbed/test_gnunet_helper_testbed.c
+++ b/src/testbed/test_gnunet_helper_testbed.c
@@ -58,12 +58,12 @@ static struct GNUNET_HELPER_SendHandle *shandle;
58/** 58/**
59 * Abort task identifier 59 * Abort task identifier
60 */ 60 */
61static GNUNET_SCHEDULER_TaskIdentifier abort_task; 61static struct GNUNET_SCHEDULER_Task * abort_task;
62 62
63/** 63/**
64 * Shutdown task identifier 64 * Shutdown task identifier
65 */ 65 */
66static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 66static struct GNUNET_SCHEDULER_Task * shutdown_task;
67 67
68/** 68/**
69 * Configuratin handler 69 * Configuratin handler
@@ -85,7 +85,7 @@ static int result;
85static void 85static void
86do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 86do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
87{ 87{
88 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 88 if (NULL != abort_task)
89 GNUNET_SCHEDULER_cancel (abort_task); 89 GNUNET_SCHEDULER_cancel (abort_task);
90 if (NULL != helper) 90 if (NULL != helper)
91 GNUNET_HELPER_stop (helper, GNUNET_NO); 91 GNUNET_HELPER_stop (helper, GNUNET_NO);
@@ -104,12 +104,12 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
104static void 104static void
105do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 105do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
106{ 106{
107 abort_task = GNUNET_SCHEDULER_NO_TASK; 107 abort_task = NULL;
108 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); 108 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
109 result = GNUNET_SYSERR; 109 result = GNUNET_SYSERR;
110 if (NULL != shandle) 110 if (NULL != shandle)
111 GNUNET_HELPER_send_cancel (shandle); 111 GNUNET_HELPER_send_cancel (shandle);
112 if (GNUNET_SCHEDULER_NO_TASK == shutdown_task) 112 if (NULL == shutdown_task)
113 shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 113 shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
114} 114}
115 115
@@ -167,7 +167,7 @@ mst_cb (void *cls, void *client, const struct GNUNET_MessageHeader *message)
167 uncompress ((Bytef *) config, &config_size, 167 uncompress ((Bytef *) config, &config_size,
168 (const Bytef *) &msg[1], xconfig_size)); 168 (const Bytef *) &msg[1], xconfig_size));
169 GNUNET_free (config); 169 GNUNET_free (config);
170 if (GNUNET_SCHEDULER_NO_TASK == shutdown_task) 170 if (NULL == shutdown_task)
171 shutdown_task = 171 shutdown_task =
172 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply 172 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
173 (GNUNET_TIME_UNIT_SECONDS, 1), 173 (GNUNET_TIME_UNIT_SECONDS, 1),
diff --git a/src/testbed/test_testbed_api.c b/src/testbed/test_testbed_api.c
index 47caa06f3..980b3725f 100644
--- a/src/testbed/test_testbed_api.c
+++ b/src/testbed/test_testbed_api.c
@@ -90,7 +90,7 @@ static struct GNUNET_ARM_Handle *arm_handle;
90/** 90/**
91 * Abort task identifier 91 * Abort task identifier
92 */ 92 */
93static GNUNET_SCHEDULER_TaskIdentifier abort_task; 93static struct GNUNET_SCHEDULER_Task * abort_task;
94 94
95/** 95/**
96 * The testing result 96 * The testing result
@@ -139,7 +139,7 @@ static void
139do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 139do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
140{ 140{
141 LOG (GNUNET_ERROR_TYPE_DEBUG, "Shutting down...\n"); 141 LOG (GNUNET_ERROR_TYPE_DEBUG, "Shutting down...\n");
142 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 142 if (NULL != abort_task)
143 GNUNET_SCHEDULER_cancel (abort_task); 143 GNUNET_SCHEDULER_cancel (abort_task);
144 if (NULL != reg_handle) 144 if (NULL != reg_handle)
145 GNUNET_TESTBED_cancel_registration (reg_handle); 145 GNUNET_TESTBED_cancel_registration (reg_handle);
@@ -162,9 +162,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
162#define FAIL_TEST(cond, ret) do { \ 162#define FAIL_TEST(cond, ret) do { \
163 if (!(cond)) { \ 163 if (!(cond)) { \
164 GNUNET_break(0); \ 164 GNUNET_break(0); \
165 if (GNUNET_SCHEDULER_NO_TASK != abort_task) \ 165 if (NULL != abort_task) \
166 GNUNET_SCHEDULER_cancel (abort_task); \ 166 GNUNET_SCHEDULER_cancel (abort_task); \
167 abort_task = GNUNET_SCHEDULER_NO_TASK; \ 167 abort_task = NULL; \
168 GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \ 168 GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \
169 ret; \ 169 ret; \
170 } \ 170 } \
@@ -181,7 +181,7 @@ static void
181do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 181do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
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 = GNUNET_SCHEDULER_NO_TASK; 184 abort_task = NULL;
185 do_shutdown (cls, tc); 185 do_shutdown (cls, tc);
186} 186}
187 187
diff --git a/src/testbed/test_testbed_api_2peers_1controller.c b/src/testbed/test_testbed_api_2peers_1controller.c
index 18bff91e9..64963c1a7 100644
--- a/src/testbed/test_testbed_api_2peers_1controller.c
+++ b/src/testbed/test_testbed_api_2peers_1controller.c
@@ -112,12 +112,12 @@ static struct GNUNET_TESTBED_Operation *common_operation;
112/** 112/**
113 * Abort task identifier 113 * Abort task identifier
114 */ 114 */
115static GNUNET_SCHEDULER_TaskIdentifier abort_task; 115static struct GNUNET_SCHEDULER_Task * abort_task;
116 116
117/** 117/**
118 * Delayed connect job identifier 118 * Delayed connect job identifier
119 */ 119 */
120static GNUNET_SCHEDULER_TaskIdentifier delayed_connect_task; 120static struct GNUNET_SCHEDULER_Task * delayed_connect_task;
121 121
122/** 122/**
123 * Different stages in testing 123 * Different stages in testing
@@ -173,9 +173,9 @@ static enum Stage result;
173#define FAIL_TEST(cond) do { \ 173#define FAIL_TEST(cond) do { \
174 if (!(cond)) { \ 174 if (!(cond)) { \
175 GNUNET_break(0); \ 175 GNUNET_break(0); \
176 if (GNUNET_SCHEDULER_NO_TASK != abort_task) \ 176 if (NULL != abort_task) \
177 GNUNET_SCHEDULER_cancel (abort_task); \ 177 GNUNET_SCHEDULER_cancel (abort_task); \
178 abort_task = GNUNET_SCHEDULER_NO_TASK; \ 178 abort_task = NULL; \
179 GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \ 179 GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \
180 return; \ 180 return; \
181 } \ 181 } \
@@ -191,9 +191,9 @@ static enum Stage result;
191static void 191static void
192do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 192do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
193{ 193{
194 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 194 if (NULL != abort_task)
195 GNUNET_SCHEDULER_cancel (abort_task); 195 GNUNET_SCHEDULER_cancel (abort_task);
196 if (GNUNET_SCHEDULER_NO_TASK != delayed_connect_task) 196 if (NULL != delayed_connect_task)
197 GNUNET_SCHEDULER_cancel (delayed_connect_task); 197 GNUNET_SCHEDULER_cancel (delayed_connect_task);
198 if (NULL != reg_handle) 198 if (NULL != reg_handle)
199 GNUNET_TESTBED_cancel_registration (reg_handle); 199 GNUNET_TESTBED_cancel_registration (reg_handle);
@@ -216,7 +216,7 @@ static void
216do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 216do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
217{ 217{
218 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); 218 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
219 abort_task = GNUNET_SCHEDULER_NO_TASK; 219 abort_task = NULL;
220 do_shutdown (cls, tc); 220 do_shutdown (cls, tc);
221} 221}
222 222
@@ -242,7 +242,7 @@ op_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg);
242static void 242static void
243do_delayed_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 243do_delayed_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
244{ 244{
245 delayed_connect_task = GNUNET_SCHEDULER_NO_TASK; 245 delayed_connect_task = NULL;
246 FAIL_TEST (NULL == common_operation); 246 FAIL_TEST (NULL == common_operation);
247 common_operation = 247 common_operation =
248 GNUNET_TESTBED_overlay_connect (NULL, &op_comp_cb, NULL, peer1.peer, 248 GNUNET_TESTBED_overlay_connect (NULL, &op_comp_cb, NULL, peer1.peer,
diff --git a/src/testbed/test_testbed_api_3peers_3controllers.c b/src/testbed/test_testbed_api_3peers_3controllers.c
index 6d88490c1..8a44029d4 100644
--- a/src/testbed/test_testbed_api_3peers_3controllers.c
+++ b/src/testbed/test_testbed_api_3peers_3controllers.c
@@ -151,12 +151,12 @@ struct GNUNET_TESTBED_HostHabitableCheckHandle *hc_handle;
151/** 151/**
152 * Abort task identifier 152 * Abort task identifier
153 */ 153 */
154static GNUNET_SCHEDULER_TaskIdentifier abort_task; 154static struct GNUNET_SCHEDULER_Task * abort_task;
155 155
156/** 156/**
157 * Delayed connect job identifier 157 * Delayed connect job identifier
158 */ 158 */
159static GNUNET_SCHEDULER_TaskIdentifier delayed_connect_task; 159static struct GNUNET_SCHEDULER_Task * delayed_connect_task;
160 160
161/** 161/**
162 * Different stages in testing 162 * Different stages in testing
@@ -259,11 +259,11 @@ static enum Stage result;
259static void 259static void
260do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 260do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
261{ 261{
262 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 262 if (NULL != abort_task)
263 GNUNET_SCHEDULER_cancel (abort_task); 263 GNUNET_SCHEDULER_cancel (abort_task);
264 if (NULL != hc_handle) 264 if (NULL != hc_handle)
265 GNUNET_TESTBED_is_host_habitable_cancel (hc_handle); 265 GNUNET_TESTBED_is_host_habitable_cancel (hc_handle);
266 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == delayed_connect_task); 266 GNUNET_assert (NULL == delayed_connect_task);
267 if (NULL != common_operation) 267 if (NULL != common_operation)
268 GNUNET_TESTBED_operation_done (common_operation); 268 GNUNET_TESTBED_operation_done (common_operation);
269 if (NULL != reg_handle) 269 if (NULL != reg_handle)
@@ -294,11 +294,11 @@ static void
294do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 294do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
295{ 295{
296 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); 296 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
297 abort_task = GNUNET_SCHEDULER_NO_TASK; 297 abort_task = NULL;
298 if (GNUNET_SCHEDULER_NO_TASK != delayed_connect_task) 298 if (NULL != delayed_connect_task)
299 { 299 {
300 GNUNET_SCHEDULER_cancel (delayed_connect_task); 300 GNUNET_SCHEDULER_cancel (delayed_connect_task);
301 delayed_connect_task = GNUNET_SCHEDULER_NO_TASK; 301 delayed_connect_task = NULL;
302 } 302 }
303 do_shutdown (cls, tc); 303 do_shutdown (cls, tc);
304} 304}
@@ -306,7 +306,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
306static void 306static void
307abort_test () 307abort_test ()
308{ 308{
309 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 309 if (NULL != abort_task)
310 GNUNET_SCHEDULER_cancel (abort_task); 310 GNUNET_SCHEDULER_cancel (abort_task);
311 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); 311 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
312} 312}
@@ -333,7 +333,7 @@ op_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg);
333static void 333static void
334do_delayed_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 334do_delayed_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
335{ 335{
336 delayed_connect_task = GNUNET_SCHEDULER_NO_TASK; 336 delayed_connect_task = NULL;
337 if (NULL != common_operation) 337 if (NULL != common_operation)
338 { 338 {
339 GNUNET_break (0); 339 GNUNET_break (0);
@@ -859,7 +859,7 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *_host,
859 "to use password less SSH logins to localhost.\n" 859 "to use password less SSH logins to localhost.\n"
860 "Skipping test\n"); 860 "Skipping test\n");
861 GNUNET_SCHEDULER_cancel (abort_task); 861 GNUNET_SCHEDULER_cancel (abort_task);
862 abort_task = GNUNET_SCHEDULER_NO_TASK; 862 abort_task = NULL;
863 (void) GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 863 (void) GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
864 result = SKIP; 864 result = SKIP;
865 return; 865 return;
diff --git a/src/testbed/test_testbed_api_barriers.c b/src/testbed/test_testbed_api_barriers.c
index 648af792b..dec1b3898 100644
--- a/src/testbed/test_testbed_api_barriers.c
+++ b/src/testbed/test_testbed_api_barriers.c
@@ -50,7 +50,7 @@ struct GNUNET_TESTBED_Barrier *barrier;
50/** 50/**
51 * Identifier for the shutdown task 51 * Identifier for the shutdown task
52 */ 52 */
53static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 53static struct GNUNET_SCHEDULER_Task * shutdown_task;
54 54
55/** 55/**
56 * Result of this test case 56 * Result of this test case
@@ -67,7 +67,7 @@ static int result;
67static void 67static void
68do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 68do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
69{ 69{
70 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 70 shutdown_task = NULL;
71 if (NULL != barrier) 71 if (NULL != barrier)
72 { 72 {
73 GNUNET_TESTBED_barrier_cancel (barrier); 73 GNUNET_TESTBED_barrier_cancel (barrier);
diff --git a/src/testbed/test_testbed_api_controllerlink.c b/src/testbed/test_testbed_api_controllerlink.c
index 471ab3a94..2834ea713 100644
--- a/src/testbed/test_testbed_api_controllerlink.c
+++ b/src/testbed/test_testbed_api_controllerlink.c
@@ -244,7 +244,7 @@ static struct GNUNET_CONFIGURATION_Handle *cfg3;
244/** 244/**
245 * Abort task 245 * Abort task
246 */ 246 */
247static GNUNET_SCHEDULER_TaskIdentifier abort_task; 247static struct GNUNET_SCHEDULER_Task * abort_task;
248 248
249/** 249/**
250 * Operation handle for linking controllers 250 * Operation handle for linking controllers
@@ -279,7 +279,7 @@ struct GNUNET_TESTBED_HostHabitableCheckHandle *hc_handle;
279/** 279/**
280 * The task handle for the delay task 280 * The task handle for the delay task
281 */ 281 */
282GNUNET_SCHEDULER_TaskIdentifier delay_task_id; 282struct GNUNET_SCHEDULER_Task * delay_task_id;
283 283
284/** 284/**
285 * Event mask 285 * Event mask
@@ -297,9 +297,9 @@ static enum Stage result;
297#define FAIL_TEST(cond) do { \ 297#define FAIL_TEST(cond) do { \
298 if (!(cond)) { \ 298 if (!(cond)) { \
299 GNUNET_break(0); \ 299 GNUNET_break(0); \
300 if (GNUNET_SCHEDULER_NO_TASK != abort_task) \ 300 if (NULL != abort_task) \
301 GNUNET_SCHEDULER_cancel (abort_task); \ 301 GNUNET_SCHEDULER_cancel (abort_task); \
302 abort_task = GNUNET_SCHEDULER_NO_TASK; \ 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 } \
@@ -315,12 +315,12 @@ static enum Stage result;
315static void 315static void
316do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 316do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
317{ 317{
318 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 318 if (NULL != abort_task)
319 GNUNET_SCHEDULER_cancel (abort_task); 319 GNUNET_SCHEDULER_cancel (abort_task);
320 if (GNUNET_SCHEDULER_NO_TASK != delay_task_id) 320 if (NULL != delay_task_id)
321 { 321 {
322 GNUNET_SCHEDULER_cancel (delay_task_id); 322 GNUNET_SCHEDULER_cancel (delay_task_id);
323 delay_task_id = GNUNET_SCHEDULER_NO_TASK; 323 delay_task_id = NULL;
324 } 324 }
325 if (NULL != hc_handle) 325 if (NULL != hc_handle)
326 GNUNET_TESTBED_is_host_habitable_cancel (hc_handle); 326 GNUNET_TESTBED_is_host_habitable_cancel (hc_handle);
@@ -355,7 +355,7 @@ static void
355do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 355do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
356{ 356{
357 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n"); 357 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
358 abort_task = GNUNET_SCHEDULER_NO_TASK; 358 abort_task = NULL;
359 do_shutdown (cls, tc); 359 do_shutdown (cls, tc);
360} 360}
361 361
@@ -369,7 +369,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
369static void 369static void
370do_abort_now (void *cls) 370do_abort_now (void *cls)
371{ 371{
372 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 372 if (NULL != abort_task)
373 GNUNET_SCHEDULER_cancel (abort_task); 373 GNUNET_SCHEDULER_cancel (abort_task);
374 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); 374 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
375} 375}
@@ -394,7 +394,7 @@ registration_cont (void *cls, const char *emsg);
394static void 394static void
395delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 395delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
396{ 396{
397 delay_task_id = GNUNET_SCHEDULER_NO_TASK; 397 delay_task_id = NULL;
398 switch (result) 398 switch (result)
399 { 399 {
400 case SLAVE2_PEER_CREATE_SUCCESS: 400 case SLAVE2_PEER_CREATE_SUCCESS:
@@ -756,7 +756,7 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *_host,
756 "to use password less SSH logins to localhost.\n" 756 "to use password less SSH logins to localhost.\n"
757 "Skipping test\n"); 757 "Skipping test\n");
758 GNUNET_SCHEDULER_cancel (abort_task); 758 GNUNET_SCHEDULER_cancel (abort_task);
759 abort_task = GNUNET_SCHEDULER_NO_TASK; 759 abort_task = NULL;
760 (void) GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 760 (void) GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
761 result = SKIP; 761 result = SKIP;
762 return; 762 return;
diff --git a/src/testbed/test_testbed_api_hosts.c b/src/testbed/test_testbed_api_hosts.c
index 4d96b2303..6a589e0e8 100644
--- a/src/testbed/test_testbed_api_hosts.c
+++ b/src/testbed/test_testbed_api_hosts.c
@@ -61,7 +61,7 @@ static int status;
61/** 61/**
62 * Shutdown task identifier 62 * Shutdown task identifier
63 */ 63 */
64GNUNET_SCHEDULER_TaskIdentifier shutdown_id; 64struct GNUNET_SCHEDULER_Task * shutdown_id;
65 65
66/** 66/**
67 * The shutdown task 67 * The shutdown task
diff --git a/src/testbed/test_testbed_api_operations.c b/src/testbed/test_testbed_api_operations.c
index ceae76cd4..b3402868a 100644
--- a/src/testbed/test_testbed_api_operations.c
+++ b/src/testbed/test_testbed_api_operations.c
@@ -115,7 +115,7 @@ struct GNUNET_TESTBED_Operation *op9;
115/** 115/**
116 * The delay task identifier 116 * The delay task identifier
117 */ 117 */
118GNUNET_SCHEDULER_TaskIdentifier step_task; 118struct GNUNET_SCHEDULER_Task * step_task;
119 119
120 120
121/** 121/**
@@ -267,8 +267,8 @@ release_cb (void *cls);
267static void 267static void
268step (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 268step (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
269{ 269{
270 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != step_task); 270 GNUNET_assert (NULL != step_task);
271 step_task = GNUNET_SCHEDULER_NO_TASK; 271 step_task = NULL;
272 switch (result) 272 switch (result)
273 { 273 {
274 case TEST_OP1_STARTED: 274 case TEST_OP1_STARTED:
@@ -344,28 +344,28 @@ start_cb (void *cls)
344 case TEST_INIT: 344 case TEST_INIT:
345 GNUNET_assert (&op1 == cls); 345 GNUNET_assert (&op1 == cls);
346 result = TEST_OP1_STARTED; 346 result = TEST_OP1_STARTED;
347 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task); 347 GNUNET_assert (NULL == step_task);
348 step_task = 348 step_task =
349 GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL); 349 GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL);
350 break; 350 break;
351 case TEST_PAUSE: 351 case TEST_PAUSE:
352 GNUNET_assert (&op2 == cls); 352 GNUNET_assert (&op2 == cls);
353 result = TEST_OP2_STARTED; 353 result = TEST_OP2_STARTED;
354 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task); 354 GNUNET_assert (NULL == step_task);
355 step_task = 355 step_task =
356 GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL); 356 GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL);
357 break; 357 break;
358 case TEST_OP2_RELEASED: 358 case TEST_OP2_RELEASED:
359 GNUNET_assert (&op3 == cls); 359 GNUNET_assert (&op3 == cls);
360 result = TEST_OP3_STARTED; 360 result = TEST_OP3_STARTED;
361 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task); 361 GNUNET_assert (NULL == step_task);
362 step_task = 362 step_task =
363 GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL); 363 GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL);
364 break; 364 break;
365 case TEST_OP3_RELEASED: 365 case TEST_OP3_RELEASED:
366 GNUNET_assert (&op4 == cls); 366 GNUNET_assert (&op4 == cls);
367 result = TEST_OP4_STARTED; 367 result = TEST_OP4_STARTED;
368 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task); 368 GNUNET_assert (NULL == step_task);
369 step_task = 369 step_task =
370 GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL); 370 GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL);
371 break; 371 break;
@@ -422,17 +422,17 @@ release_cb (void *cls)
422 case TEST_OP2_STARTED: 422 case TEST_OP2_STARTED:
423 GNUNET_assert (&op2 == cls); 423 GNUNET_assert (&op2 == cls);
424 result = TEST_OP2_RELEASED; 424 result = TEST_OP2_RELEASED;
425 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task); 425 GNUNET_assert (NULL == step_task);
426 break; 426 break;
427 case TEST_OP3_STARTED: 427 case TEST_OP3_STARTED:
428 GNUNET_assert (&op3 == cls); 428 GNUNET_assert (&op3 == cls);
429 result = TEST_OP3_RELEASED; 429 result = TEST_OP3_RELEASED;
430 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task); 430 GNUNET_assert (NULL == step_task);
431 break; 431 break;
432 case TEST_OP4_STARTED: 432 case TEST_OP4_STARTED:
433 GNUNET_assert (&op4 == cls); 433 GNUNET_assert (&op4 == cls);
434 result = TEST_OP4_RELEASED; 434 result = TEST_OP4_RELEASED;
435 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task); 435 GNUNET_assert (NULL == step_task);
436 op5 = GNUNET_TESTBED_operation_create_ (&op5, &start_cb, &release_cb); 436 op5 = GNUNET_TESTBED_operation_create_ (&op5, &start_cb, &release_cb);
437 GNUNET_TESTBED_operation_queue_insert2_ (q1, op5, 1); 437 GNUNET_TESTBED_operation_queue_insert2_ (q1, op5, 1);
438 GNUNET_TESTBED_operation_begin_wait_ (op5); 438 GNUNET_TESTBED_operation_begin_wait_ (op5);
diff --git a/src/testbed/test_testbed_api_peer_reconfiguration.c b/src/testbed/test_testbed_api_peer_reconfiguration.c
index 6b5f3e117..3928274de 100644
--- a/src/testbed/test_testbed_api_peer_reconfiguration.c
+++ b/src/testbed/test_testbed_api_peer_reconfiguration.c
@@ -47,7 +47,7 @@ static struct GNUNET_TESTBED_Operation *op;
47/** 47/**
48 * Abort task identifier 48 * Abort task identifier
49 */ 49 */
50static GNUNET_SCHEDULER_TaskIdentifier abort_task; 50static struct GNUNET_SCHEDULER_Task * abort_task;
51 51
52/** 52/**
53 * States in this test 53 * States in this test
@@ -77,7 +77,7 @@ enum {
77#define FAIL_TEST(cond, ret) do { \ 77#define FAIL_TEST(cond, ret) do { \
78 if (!(cond)) { \ 78 if (!(cond)) { \
79 GNUNET_break(0); \ 79 GNUNET_break(0); \
80 if (GNUNET_SCHEDULER_NO_TASK != abort_task) \ 80 if (NULL != abort_task) \
81 GNUNET_SCHEDULER_cancel (abort_task); \ 81 GNUNET_SCHEDULER_cancel (abort_task); \
82 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \ 82 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \
83 ret; \ 83 ret; \
@@ -95,7 +95,7 @@ static void
95do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 95do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
96{ 96{
97 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n"); 97 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n");
98 abort_task = GNUNET_SCHEDULER_NO_TASK; 98 abort_task = NULL;
99 if (NULL != op) 99 if (NULL != op)
100 { 100 {
101 GNUNET_TESTBED_operation_done (op); 101 GNUNET_TESTBED_operation_done (op);
@@ -134,7 +134,7 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
134 GNUNET_TESTBED_operation_done (op); 134 GNUNET_TESTBED_operation_done (op);
135 state = STATE_PEER_RECONFIGURED; 135 state = STATE_PEER_RECONFIGURED;
136 GNUNET_SCHEDULER_cancel (abort_task); 136 GNUNET_SCHEDULER_cancel (abort_task);
137 abort_task = GNUNET_SCHEDULER_NO_TASK; 137 abort_task = NULL;
138 GNUNET_SCHEDULER_shutdown (); 138 GNUNET_SCHEDULER_shutdown ();
139} 139}
140 140
diff --git a/src/testbed/test_testbed_api_peers_manage_services.c b/src/testbed/test_testbed_api_peers_manage_services.c
index 63c089e19..fedaae295 100644
--- a/src/testbed/test_testbed_api_peers_manage_services.c
+++ b/src/testbed/test_testbed_api_peers_manage_services.c
@@ -52,7 +52,7 @@ static void *dummy_cls = (void *) 0xDEAD0001;
52/** 52/**
53 * Abort task identifier 53 * Abort task identifier
54 */ 54 */
55static GNUNET_SCHEDULER_TaskIdentifier abort_task; 55static struct GNUNET_SCHEDULER_Task * abort_task;
56 56
57/** 57/**
58 * States in this test 58 * States in this test
@@ -91,7 +91,7 @@ enum {
91#define FAIL_TEST(cond, ret) do { \ 91#define FAIL_TEST(cond, ret) do { \
92 if (!(cond)) { \ 92 if (!(cond)) { \
93 GNUNET_break(0); \ 93 GNUNET_break(0); \
94 if (GNUNET_SCHEDULER_NO_TASK != abort_task) \ 94 if (NULL != abort_task) \
95 GNUNET_SCHEDULER_cancel (abort_task); \ 95 GNUNET_SCHEDULER_cancel (abort_task); \
96 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \ 96 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \
97 ret; \ 97 ret; \
@@ -109,7 +109,7 @@ static void
109do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 109do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
110{ 110{
111 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n"); 111 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n");
112 abort_task = GNUNET_SCHEDULER_NO_TASK; 112 abort_task = NULL;
113 if (NULL != op) 113 if (NULL != op)
114 { 114 {
115 GNUNET_TESTBED_operation_done (op); 115 GNUNET_TESTBED_operation_done (op);
@@ -151,7 +151,7 @@ op_comp_cb (void *cls,
151 case STATE_SERVICE_DOWN: 151 case STATE_SERVICE_DOWN:
152 state = STATE_SERVICE_UP; 152 state = STATE_SERVICE_UP;
153 GNUNET_SCHEDULER_cancel (abort_task); 153 GNUNET_SCHEDULER_cancel (abort_task);
154 abort_task = GNUNET_SCHEDULER_NO_TASK; 154 abort_task = NULL;
155 state = STATE_OK; 155 state = STATE_OK;
156 GNUNET_SCHEDULER_shutdown (); 156 GNUNET_SCHEDULER_shutdown ();
157 break; 157 break;
diff --git a/src/testbed/test_testbed_api_statistics.c b/src/testbed/test_testbed_api_statistics.c
index 73c7f9734..158f21e07 100644
--- a/src/testbed/test_testbed_api_statistics.c
+++ b/src/testbed/test_testbed_api_statistics.c
@@ -51,7 +51,7 @@ static void *dummy_cls = (void *) 0xDEAD0001;
51/** 51/**
52 * Abort task identifier 52 * Abort task identifier
53 */ 53 */
54static GNUNET_SCHEDULER_TaskIdentifier abort_task; 54static struct GNUNET_SCHEDULER_Task * abort_task;
55 55
56/** 56/**
57 * Global testing result 57 * Global testing result
@@ -75,7 +75,7 @@ static unsigned int num_seen_peers;
75#define FAIL_TEST(cond, ret) do { \ 75#define FAIL_TEST(cond, ret) do { \
76 if (!(cond)) { \ 76 if (!(cond)) { \
77 GNUNET_break(0); \ 77 GNUNET_break(0); \
78 if (GNUNET_SCHEDULER_NO_TASK != abort_task) \ 78 if (NULL != abort_task) \
79 GNUNET_SCHEDULER_cancel (abort_task); \ 79 GNUNET_SCHEDULER_cancel (abort_task); \
80 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \ 80 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \
81 ret; \ 81 ret; \
@@ -93,7 +93,7 @@ static void
93do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 93do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
94{ 94{
95 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test timed out -- Aborting\n"); 95 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test timed out -- Aborting\n");
96 abort_task = GNUNET_SCHEDULER_NO_TASK; 96 abort_task = NULL;
97 if (NULL != op) 97 if (NULL != op)
98 { 98 {
99 GNUNET_TESTBED_operation_done (op); 99 GNUNET_TESTBED_operation_done (op);
diff --git a/src/testbed/test_testbed_api_test.c b/src/testbed/test_testbed_api_test.c
index 7016ad843..4f52d6638 100644
--- a/src/testbed/test_testbed_api_test.c
+++ b/src/testbed/test_testbed_api_test.c
@@ -53,12 +53,12 @@ static struct GNUNET_TESTBED_Operation *op;
53/** 53/**
54 * Abort task identifier 54 * Abort task identifier
55 */ 55 */
56static GNUNET_SCHEDULER_TaskIdentifier abort_task; 56static struct GNUNET_SCHEDULER_Task * abort_task;
57 57
58/** 58/**
59 * shutdown task identifier 59 * shutdown task identifier
60 */ 60 */
61static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 61static struct GNUNET_SCHEDULER_Task * shutdown_task;
62 62
63/** 63/**
64 * Testing result 64 * Testing result
@@ -75,8 +75,8 @@ static int result;
75static void 75static void
76do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 76do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
77{ 77{
78 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 78 shutdown_task = NULL;
79 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 79 if (NULL != abort_task)
80 GNUNET_SCHEDULER_cancel (abort_task); 80 GNUNET_SCHEDULER_cancel (abort_task);
81 if (NULL != op) 81 if (NULL != op)
82 GNUNET_TESTBED_operation_done (op); 82 GNUNET_TESTBED_operation_done (op);
@@ -89,10 +89,10 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
89#define FAIL_TEST(cond) do { \ 89#define FAIL_TEST(cond) do { \
90 if (!(cond)) { \ 90 if (!(cond)) { \
91 GNUNET_break(0); \ 91 GNUNET_break(0); \
92 if (GNUNET_SCHEDULER_NO_TASK != abort_task) \ 92 if (NULL != abort_task) \
93 GNUNET_SCHEDULER_cancel (abort_task); \ 93 GNUNET_SCHEDULER_cancel (abort_task); \
94 abort_task = GNUNET_SCHEDULER_NO_TASK; \ 94 abort_task = NULL; \
95 if (GNUNET_SCHEDULER_NO_TASK == shutdown_task) \ 95 if (NULL == shutdown_task) \
96 shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \ 96 shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \
97 return; \ 97 return; \
98 } \ 98 } \
@@ -109,8 +109,8 @@ static void
109do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 109do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
110{ 110{
111 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); 111 LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
112 abort_task = GNUNET_SCHEDULER_NO_TASK; 112 abort_task = NULL;
113 if (GNUNET_SCHEDULER_NO_TASK != shutdown_task) 113 if (NULL != shutdown_task)
114 GNUNET_SCHEDULER_cancel (shutdown_task); 114 GNUNET_SCHEDULER_cancel (shutdown_task);
115 do_shutdown (cls, tc); 115 do_shutdown (cls, tc);
116} 116}
diff --git a/src/testbed/test_testbed_api_testbed_run.c b/src/testbed/test_testbed_api_testbed_run.c
index dd8a249e9..14e0d4fa4 100644
--- a/src/testbed/test_testbed_api_testbed_run.c
+++ b/src/testbed/test_testbed_api_testbed_run.c
@@ -46,7 +46,7 @@ static struct GNUNET_TESTBED_Operation *op;
46/** 46/**
47 * Abort task identifier 47 * Abort task identifier
48 */ 48 */
49static GNUNET_SCHEDULER_TaskIdentifier abort_task; 49static struct GNUNET_SCHEDULER_Task * abort_task;
50 50
51/** 51/**
52 * Current peer id 52 * Current peer id
@@ -73,7 +73,7 @@ static int wait_forever;
73static void 73static void
74do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 74do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
75{ 75{
76 if (GNUNET_SCHEDULER_NO_TASK != abort_task) 76 if (NULL != abort_task)
77 GNUNET_SCHEDULER_cancel (abort_task); 77 GNUNET_SCHEDULER_cancel (abort_task);
78 GNUNET_SCHEDULER_shutdown (); /* Stop scheduler to shutdown testbed run */ 78 GNUNET_SCHEDULER_shutdown (); /* Stop scheduler to shutdown testbed run */
79} 79}
@@ -89,7 +89,7 @@ static void
89do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 89do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
90{ 90{
91 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n"); 91 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
92 abort_task = GNUNET_SCHEDULER_NO_TASK; 92 abort_task = NULL;
93 (void) GNUNET_SCHEDULER_add_now (&do_shutdown, NULL); 93 (void) GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
94} 94}
95 95
@@ -117,10 +117,10 @@ test_master (void *cls,
117 result = GNUNET_OK; 117 result = GNUNET_OK;
118 if (GNUNET_YES == wait_forever) 118 if (GNUNET_YES == wait_forever)
119 { 119 {
120 if (GNUNET_SCHEDULER_NO_TASK == abort_task) 120 if (NULL == abort_task)
121 return; /* abort already scheduled */ 121 return; /* abort already scheduled */
122 GNUNET_SCHEDULER_cancel (abort_task); 122 GNUNET_SCHEDULER_cancel (abort_task);
123 abort_task = GNUNET_SCHEDULER_NO_TASK; 123 abort_task = NULL;
124 (void) GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, 124 (void) GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
125 &do_shutdown, NULL); 125 &do_shutdown, NULL);
126 return; 126 return;
diff --git a/src/testbed/test_testbed_api_topology.c b/src/testbed/test_testbed_api_topology.c
index bdd29bfbf..9c3e1c7a8 100644
--- a/src/testbed/test_testbed_api_topology.c
+++ b/src/testbed/test_testbed_api_topology.c
@@ -46,7 +46,7 @@ static struct GNUNET_TESTBED_Operation *op;
46/** 46/**
47 * Shutdown task 47 * Shutdown task
48 */ 48 */
49static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 49static struct GNUNET_SCHEDULER_Task * shutdown_task;
50 50
51/** 51/**
52 * Testing result 52 * Testing result
@@ -68,7 +68,7 @@ static unsigned int overlay_connects;
68static void 68static void
69do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 69do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
70{ 70{
71 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 71 shutdown_task = NULL;
72 if (NULL != op) 72 if (NULL != op)
73 { 73 {
74 GNUNET_TESTBED_operation_done (op); 74 GNUNET_TESTBED_operation_done (op);
diff --git a/src/testbed/test_testbed_api_topology_clique.c b/src/testbed/test_testbed_api_topology_clique.c
index 658e33ab9..d08efcc97 100644
--- a/src/testbed/test_testbed_api_topology_clique.c
+++ b/src/testbed/test_testbed_api_topology_clique.c
@@ -46,7 +46,7 @@ static struct GNUNET_TESTBED_Operation *op;
46/** 46/**
47 * Shutdown task 47 * Shutdown task
48 */ 48 */
49static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 49static struct GNUNET_SCHEDULER_Task * shutdown_task;
50 50
51/** 51/**
52 * Testing result 52 * Testing result
@@ -68,7 +68,7 @@ static unsigned int overlay_connects;
68static void 68static void
69do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 69do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
70{ 70{
71 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 71 shutdown_task = NULL;
72 if (NULL != op) 72 if (NULL != op)
73 { 73 {
74 GNUNET_TESTBED_operation_done (op); 74 GNUNET_TESTBED_operation_done (op);
diff --git a/src/testbed/test_testbed_logger_api.c b/src/testbed/test_testbed_logger_api.c
index 11ba7270b..0a6b31426 100644
--- a/src/testbed/test_testbed_logger_api.c
+++ b/src/testbed/test_testbed_logger_api.c
@@ -53,16 +53,16 @@ static char *search_dir;
53/** 53/**
54 * Abort task identifier 54 * Abort task identifier
55 */ 55 */
56static GNUNET_SCHEDULER_TaskIdentifier abort_task; 56static struct GNUNET_SCHEDULER_Task * abort_task;
57static GNUNET_SCHEDULER_TaskIdentifier write_task; 57static struct GNUNET_SCHEDULER_Task * write_task;
58 58
59static int result; 59static int result;
60 60
61#define CANCEL_TASK(task) do { \ 61#define CANCEL_TASK(task) do { \
62 if (GNUNET_SCHEDULER_NO_TASK != task) \ 62 if (NULL != task) \
63 { \ 63 { \
64 GNUNET_SCHEDULER_cancel (task); \ 64 GNUNET_SCHEDULER_cancel (task); \
65 task = GNUNET_SCHEDULER_NO_TASK; \ 65 task = NULL; \
66 } \ 66 } \
67 } while (0) 67 } while (0)
68 68
@@ -100,7 +100,7 @@ static void
100do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 100do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
101{ 101{
102 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n"); 102 LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
103 abort_task = GNUNET_SCHEDULER_NO_TASK; 103 abort_task = NULL;
104 shutdown_now (); 104 shutdown_now ();
105} 105}
106 106
@@ -178,7 +178,7 @@ do_write (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
178 static int i; 178 static int i;
179 char buf[BSIZE]; 179 char buf[BSIZE];
180 180
181 write_task = GNUNET_SCHEDULER_NO_TASK; 181 write_task = NULL;
182 if (0 == i) 182 if (0 == i)
183 write_task = GNUNET_SCHEDULER_add_delayed (TIME_REL_SECS(1), &do_write, NULL); 183 write_task = GNUNET_SCHEDULER_add_delayed (TIME_REL_SECS(1), &do_write, NULL);
184 (void) memset (buf, i, BSIZE); 184 (void) memset (buf, i, BSIZE);
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c
index ed3379d88..292dafadf 100644
--- a/src/testbed/testbed_api_hosts.c
+++ b/src/testbed/testbed_api_hosts.c
@@ -1239,7 +1239,7 @@ struct GNUNET_TESTBED_HostHabitableCheckHandle
1239 /** 1239 /**
1240 * Task id for the habitability check task 1240 * Task id for the habitability check task
1241 */ 1241 */
1242 GNUNET_SCHEDULER_TaskIdentifier habitability_check_task; 1242 struct GNUNET_SCHEDULER_Task * habitability_check_task;
1243 1243
1244 /** 1244 /**
1245 * How long we wait before checking the process status. Should grow 1245 * How long we wait before checking the process status. Should grow
@@ -1267,7 +1267,7 @@ habitability_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1267 enum GNUNET_OS_ProcessStatusType type; 1267 enum GNUNET_OS_ProcessStatusType type;
1268 int ret; 1268 int ret;
1269 1269
1270 h->habitability_check_task = GNUNET_SCHEDULER_NO_TASK; 1270 h->habitability_check_task = NULL;
1271 ret = GNUNET_OS_process_status (h->auxp, &type, &code); 1271 ret = GNUNET_OS_process_status (h->auxp, &type, &code);
1272 if (GNUNET_SYSERR == ret) 1272 if (GNUNET_SYSERR == ret)
1273 { 1273 {
diff --git a/src/testbed/testbed_api_operations.c b/src/testbed/testbed_api_operations.c
index 8bc38747c..469d44fe5 100644
--- a/src/testbed/testbed_api_operations.c
+++ b/src/testbed/testbed_api_operations.c
@@ -400,7 +400,7 @@ static unsigned int n_expired_opqs;
400/** 400/**
401 * The id of the task to process the ready queue 401 * The id of the task to process the ready queue
402 */ 402 */
403GNUNET_SCHEDULER_TaskIdentifier process_rq_task_id; 403struct GNUNET_SCHEDULER_Task * process_rq_task_id;
404 404
405 405
406/** 406/**
@@ -534,10 +534,10 @@ rq_remove (struct GNUNET_TESTBED_Operation *op)
534 GNUNET_CONTAINER_DLL_remove (rq_head, rq_tail, op->rq_entry); 534 GNUNET_CONTAINER_DLL_remove (rq_head, rq_tail, op->rq_entry);
535 GNUNET_free (op->rq_entry); 535 GNUNET_free (op->rq_entry);
536 op->rq_entry = NULL; 536 op->rq_entry = NULL;
537 if ( (NULL == rq_head) && (GNUNET_SCHEDULER_NO_TASK != process_rq_task_id) ) 537 if ( (NULL == rq_head) && (NULL != process_rq_task_id) )
538 { 538 {
539 GNUNET_SCHEDULER_cancel (process_rq_task_id); 539 GNUNET_SCHEDULER_cancel (process_rq_task_id);
540 process_rq_task_id = GNUNET_SCHEDULER_NO_TASK; 540 process_rq_task_id = NULL;
541 } 541 }
542} 542}
543 543
@@ -558,7 +558,7 @@ process_rq_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
558 struct OperationQueue *queue; 558 struct OperationQueue *queue;
559 unsigned int cnt; 559 unsigned int cnt;
560 560
561 process_rq_task_id = GNUNET_SCHEDULER_NO_TASK; 561 process_rq_task_id = NULL;
562 GNUNET_assert (NULL != rq_head); 562 GNUNET_assert (NULL != rq_head);
563 GNUNET_assert (NULL != (op = rq_head->op)); 563 GNUNET_assert (NULL != (op = rq_head->op));
564 rq_remove (op); 564 rq_remove (op);
@@ -592,7 +592,7 @@ rq_add (struct GNUNET_TESTBED_Operation *op)
592 rq_entry->op = op; 592 rq_entry->op = op;
593 GNUNET_CONTAINER_DLL_insert_tail (rq_head, rq_tail, rq_entry); 593 GNUNET_CONTAINER_DLL_insert_tail (rq_head, rq_tail, rq_entry);
594 op->rq_entry = rq_entry; 594 op->rq_entry = rq_entry;
595 if (GNUNET_SCHEDULER_NO_TASK == process_rq_task_id) 595 if (NULL == process_rq_task_id)
596 process_rq_task_id = GNUNET_SCHEDULER_add_now (&process_rq_task, NULL); 596 process_rq_task_id = GNUNET_SCHEDULER_add_now (&process_rq_task, NULL);
597} 597}
598 598
diff --git a/src/testbed/testbed_api_statistics.c b/src/testbed/testbed_api_statistics.c
index e6efc1fb0..6087a0c14 100644
--- a/src/testbed/testbed_api_statistics.c
+++ b/src/testbed/testbed_api_statistics.c
@@ -94,7 +94,7 @@ struct GetStatsContext
94 /** 94 /**
95 * The task for calling the continuation callback 95 * The task for calling the continuation callback
96 */ 96 */
97 GNUNET_SCHEDULER_TaskIdentifier call_completion_task_id; 97 struct GNUNET_SCHEDULER_Task * call_completion_task_id;
98 98
99 /** 99 /**
100 * The number of peers present in the peers array. This number also 100 * The number of peers present in the peers array. This number also
@@ -128,7 +128,7 @@ struct PeerGetStatsContext
128 /** 128 /**
129 * Task to mark the statistics service connect operation as done 129 * Task to mark the statistics service connect operation as done
130 */ 130 */
131 GNUNET_SCHEDULER_TaskIdentifier op_done_task_id; 131 struct GNUNET_SCHEDULER_Task * op_done_task_id;
132 132
133 /** 133 /**
134 * The index of this peer in the peers array of GetStatsContext 134 * The index of this peer in the peers array of GetStatsContext
@@ -157,8 +157,8 @@ call_completion_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
157{ 157{
158 struct GetStatsContext *sc = cls; 158 struct GetStatsContext *sc = cls;
159 159
160 GNUNET_assert (sc->call_completion_task_id != GNUNET_SCHEDULER_NO_TASK); 160 GNUNET_assert (sc->call_completion_task_id != NULL);
161 sc->call_completion_task_id = GNUNET_SCHEDULER_NO_TASK; 161 sc->call_completion_task_id = NULL;
162 LOG_DEBUG ("Calling get_statistics() continuation callback\n"); 162 LOG_DEBUG ("Calling get_statistics() continuation callback\n");
163 sc->cont (sc->cb_cls, sc->main_op, NULL); 163 sc->cont (sc->cb_cls, sc->main_op, NULL);
164} 164}
@@ -179,7 +179,7 @@ op_done_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
179 struct GNUNET_TESTBED_Operation **op; 179 struct GNUNET_TESTBED_Operation **op;
180 180
181 sc = peer_sc->sc; 181 sc = peer_sc->sc;
182 peer_sc->op_done_task_id = GNUNET_SCHEDULER_NO_TASK; 182 peer_sc->op_done_task_id = NULL;
183 op = &sc->ops[peer_sc->peer_index]; 183 op = &sc->ops[peer_sc->peer_index];
184 GNUNET_assert (NULL != *op); 184 GNUNET_assert (NULL != *op);
185 GNUNET_TESTBED_operation_done (*op); 185 GNUNET_TESTBED_operation_done (*op);
@@ -312,7 +312,7 @@ statistics_da (void *cls, void *op_result)
312 peer_sc->get_handle = NULL; 312 peer_sc->get_handle = NULL;
313 } 313 }
314 GNUNET_STATISTICS_destroy (sh, GNUNET_NO); 314 GNUNET_STATISTICS_destroy (sh, GNUNET_NO);
315 if (GNUNET_SCHEDULER_NO_TASK != peer_sc->op_done_task_id) 315 if (NULL != peer_sc->op_done_task_id)
316 GNUNET_SCHEDULER_cancel (peer_sc->op_done_task_id); 316 GNUNET_SCHEDULER_cancel (peer_sc->op_done_task_id);
317 GNUNET_free (peer_sc); 317 GNUNET_free (peer_sc);
318} 318}
@@ -366,7 +366,7 @@ oprelease_get_stats (void *cls)
366 unsigned int peer; 366 unsigned int peer;
367 367
368 LOG_DEBUG ("Cleaning up get_statistics operation\n"); 368 LOG_DEBUG ("Cleaning up get_statistics operation\n");
369 if (GNUNET_SCHEDULER_NO_TASK != sc->call_completion_task_id) 369 if (NULL != sc->call_completion_task_id)
370 GNUNET_SCHEDULER_cancel (sc->call_completion_task_id); 370 GNUNET_SCHEDULER_cancel (sc->call_completion_task_id);
371 if (NULL != sc->ops) 371 if (NULL != sc->ops)
372 { 372 {
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c
index 2be565e63..981a6a9e5 100644
--- a/src/testbed/testbed_api_testbed.c
+++ b/src/testbed/testbed_api_testbed.c
@@ -253,17 +253,17 @@ struct GNUNET_TESTBED_RunHandle
253 /** 253 /**
254 * Host registration task 254 * Host registration task
255 */ 255 */
256 GNUNET_SCHEDULER_TaskIdentifier register_hosts_task; 256 struct GNUNET_SCHEDULER_Task * register_hosts_task;
257 257
258 /** 258 /**
259 * Task to be run of a timeout 259 * Task to be run of a timeout
260 */ 260 */
261 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 261 struct GNUNET_SCHEDULER_Task * timeout_task;
262 262
263 /** 263 /**
264 * Task run upon shutdown interrupts 264 * Task run upon shutdown interrupts
265 */ 265 */
266 GNUNET_SCHEDULER_TaskIdentifier interrupt_task; 266 struct GNUNET_SCHEDULER_Task * interrupt_task;
267 267
268 /** 268 /**
269 * The event mask for the controller 269 * The event mask for the controller
@@ -455,7 +455,7 @@ cleanup (struct GNUNET_TESTBED_RunHandle *rc)
455{ 455{
456 unsigned int hid; 456 unsigned int hid;
457 457
458 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rc->register_hosts_task); 458 GNUNET_assert (NULL == rc->register_hosts_task);
459 GNUNET_assert (NULL == rc->reg_handle); 459 GNUNET_assert (NULL == rc->reg_handle);
460 GNUNET_assert (NULL == rc->peers); 460 GNUNET_assert (NULL == rc->peers);
461 GNUNET_assert (NULL == rc->hclist); 461 GNUNET_assert (NULL == rc->hclist);
@@ -524,15 +524,15 @@ rc_cleanup_operations (struct GNUNET_TESTBED_RunHandle *rc)
524 rc->hclist = NULL; 524 rc->hclist = NULL;
525 } 525 }
526 /* Stop register hosts task if it is running */ 526 /* Stop register hosts task if it is running */
527 if (GNUNET_SCHEDULER_NO_TASK != rc->register_hosts_task) 527 if (NULL != rc->register_hosts_task)
528 { 528 {
529 GNUNET_SCHEDULER_cancel (rc->register_hosts_task); 529 GNUNET_SCHEDULER_cancel (rc->register_hosts_task);
530 rc->register_hosts_task = GNUNET_SCHEDULER_NO_TASK; 530 rc->register_hosts_task = NULL;
531 } 531 }
532 if (GNUNET_SCHEDULER_NO_TASK != rc->timeout_task) 532 if (NULL != rc->timeout_task)
533 { 533 {
534 GNUNET_SCHEDULER_cancel (rc->timeout_task); 534 GNUNET_SCHEDULER_cancel (rc->timeout_task);
535 rc->timeout_task = GNUNET_SCHEDULER_NO_TASK; 535 rc->timeout_task = NULL;
536 } 536 }
537 if (NULL != rc->reg_handle) 537 if (NULL != rc->reg_handle)
538 { 538 {
@@ -561,7 +561,7 @@ static void
561cancel_interrupt_task (struct GNUNET_TESTBED_RunHandle *rc) 561cancel_interrupt_task (struct GNUNET_TESTBED_RunHandle *rc)
562{ 562{
563 GNUNET_SCHEDULER_cancel (rc->interrupt_task); 563 GNUNET_SCHEDULER_cancel (rc->interrupt_task);
564 rc->interrupt_task = GNUNET_SCHEDULER_NO_TASK; 564 rc->interrupt_task = NULL;
565} 565}
566 566
567 567
@@ -730,7 +730,7 @@ static void
730call_master (struct GNUNET_TESTBED_RunHandle *rc) 730call_master (struct GNUNET_TESTBED_RunHandle *rc)
731{ 731{
732 GNUNET_SCHEDULER_cancel (rc->timeout_task); 732 GNUNET_SCHEDULER_cancel (rc->timeout_task);
733 rc->timeout_task = GNUNET_SCHEDULER_NO_TASK; 733 rc->timeout_task = NULL;
734 if (NULL != rc->test_master) 734 if (NULL != rc->test_master)
735 rc->test_master (rc->test_master_cls, rc, rc->num_peers, rc->peers, 735 rc->test_master (rc->test_master_cls, rc, rc->num_peers, rc->peers,
736 rc->links_succeeded, rc->links_failed); 736 rc->links_succeeded, rc->links_failed);
@@ -1006,7 +1006,7 @@ register_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1006 struct RunContextOperation *rcop; 1006 struct RunContextOperation *rcop;
1007 unsigned int slave; 1007 unsigned int slave;
1008 1008
1009 rc->register_hosts_task = GNUNET_SCHEDULER_NO_TASK; 1009 rc->register_hosts_task = NULL;
1010 if (rc->reg_hosts == rc->num_hosts) 1010 if (rc->reg_hosts == rc->num_hosts)
1011 { 1011 {
1012 DEBUG ("All hosts successfully registered\n"); 1012 DEBUG ("All hosts successfully registered\n");
@@ -1199,7 +1199,7 @@ timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1199{ 1199{
1200 struct GNUNET_TESTBED_RunHandle *rc = cls; 1200 struct GNUNET_TESTBED_RunHandle *rc = cls;
1201 1201
1202 rc->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1202 rc->timeout_task = NULL;
1203 LOG (GNUNET_ERROR_TYPE_ERROR, _("Shutting down testbed due to timeout while setup.\n")); 1203 LOG (GNUNET_ERROR_TYPE_ERROR, _("Shutting down testbed due to timeout while setup.\n"));
1204 GNUNET_SCHEDULER_shutdown (); 1204 GNUNET_SCHEDULER_shutdown ();
1205 if (NULL != rc->test_master) 1205 if (NULL != rc->test_master)
diff --git a/src/testbed/testbed_logger_api.c b/src/testbed/testbed_logger_api.c
index dab9d6600..091645de3 100644
--- a/src/testbed/testbed_logger_api.c
+++ b/src/testbed/testbed_logger_api.c
@@ -144,12 +144,12 @@ struct GNUNET_TESTBED_LOGGER_Handle
144 /** 144 /**
145 * Task to call the flush completion callback 145 * Task to call the flush completion callback
146 */ 146 */
147 GNUNET_SCHEDULER_TaskIdentifier flush_completion_task; 147 struct GNUNET_SCHEDULER_Task * flush_completion_task;
148 148
149 /** 149 /**
150 * Task to be executed when flushing takes too long 150 * Task to be executed when flushing takes too long
151 */ 151 */
152 GNUNET_SCHEDULER_TaskIdentifier timeout_flush_task; 152 struct GNUNET_SCHEDULER_Task * timeout_flush_task;
153}; 153};
154 154
155 155
@@ -162,7 +162,7 @@ static void
162cancel_timeout_flush (struct GNUNET_TESTBED_LOGGER_Handle *h) 162cancel_timeout_flush (struct GNUNET_TESTBED_LOGGER_Handle *h)
163{ 163{
164 GNUNET_SCHEDULER_cancel (h->timeout_flush_task); 164 GNUNET_SCHEDULER_cancel (h->timeout_flush_task);
165 h->timeout_flush_task = GNUNET_SCHEDULER_NO_TASK; 165 h->timeout_flush_task = NULL;
166} 166}
167 167
168 168
@@ -180,14 +180,14 @@ call_flush_completion (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
180 void *cb_cls; 180 void *cb_cls;
181 size_t bw; 181 size_t bw;
182 182
183 h->flush_completion_task = GNUNET_SCHEDULER_NO_TASK; 183 h->flush_completion_task = NULL;
184 bw = h->bwrote; 184 bw = h->bwrote;
185 h->bwrote = 0; 185 h->bwrote = 0;
186 cb = h->cb; 186 cb = h->cb;
187 h->cb = NULL; 187 h->cb = NULL;
188 cb_cls = h->cb_cls; 188 cb_cls = h->cb_cls;
189 h->cb_cls = NULL; 189 h->cb_cls = NULL;
190 if (GNUNET_SCHEDULER_NO_TASK != h->timeout_flush_task) 190 if (NULL != h->timeout_flush_task)
191 cancel_timeout_flush (h); 191 cancel_timeout_flush (h);
192 if (NULL != cb) 192 if (NULL != cb)
193 cb (cb_cls, bw); 193 cb (cb_cls, bw);
@@ -202,7 +202,7 @@ call_flush_completion (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
202static void 202static void
203trigger_flush_notification (struct GNUNET_TESTBED_LOGGER_Handle *h) 203trigger_flush_notification (struct GNUNET_TESTBED_LOGGER_Handle *h)
204{ 204{
205 if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task) 205 if (NULL != h->flush_completion_task)
206 GNUNET_SCHEDULER_cancel (h->flush_completion_task); 206 GNUNET_SCHEDULER_cancel (h->flush_completion_task);
207 h->flush_completion_task = GNUNET_SCHEDULER_add_now (&call_flush_completion, h); 207 h->flush_completion_task = GNUNET_SCHEDULER_add_now (&call_flush_completion, h);
208} 208}
@@ -354,7 +354,7 @@ GNUNET_TESTBED_LOGGER_disconnect (struct GNUNET_TESTBED_LOGGER_Handle *h)
354 struct MessageQueue *mq; 354 struct MessageQueue *mq;
355 unsigned int lost; 355 unsigned int lost;
356 356
357 if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task) 357 if (NULL != h->flush_completion_task)
358 GNUNET_SCHEDULER_cancel (h->flush_completion_task); 358 GNUNET_SCHEDULER_cancel (h->flush_completion_task);
359 lost = 0; 359 lost = 0;
360 while (NULL != (mq = h->mq_head)) 360 while (NULL != (mq = h->mq_head))
@@ -425,15 +425,15 @@ timeout_flush (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
425 GNUNET_TESTBED_LOGGER_FlushCompletion cb; 425 GNUNET_TESTBED_LOGGER_FlushCompletion cb;
426 void *cb_cls; 426 void *cb_cls;
427 427
428 h->timeout_flush_task = GNUNET_SCHEDULER_NO_TASK; 428 h->timeout_flush_task = NULL;
429 cb = h->cb; 429 cb = h->cb;
430 h->cb = NULL; 430 h->cb = NULL;
431 cb_cls = h->cb_cls; 431 cb_cls = h->cb_cls;
432 h->cb_cls = NULL; 432 h->cb_cls = NULL;
433 if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task) 433 if (NULL != h->flush_completion_task)
434 { 434 {
435 GNUNET_SCHEDULER_cancel (h->flush_completion_task); 435 GNUNET_SCHEDULER_cancel (h->flush_completion_task);
436 h->flush_completion_task = GNUNET_SCHEDULER_NO_TASK; 436 h->flush_completion_task = NULL;
437 } 437 }
438 if (NULL != cb) 438 if (NULL != cb)
439 cb (cb_cls, 0); 439 cb (cb_cls, 0);
@@ -456,7 +456,7 @@ GNUNET_TESTBED_LOGGER_flush (struct GNUNET_TESTBED_LOGGER_Handle *h,
456{ 456{
457 h->cb = cb; 457 h->cb = cb;
458 h->cb_cls = cb_cls; 458 h->cb_cls = cb_cls;
459 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->timeout_flush_task); 459 GNUNET_assert (NULL == h->timeout_flush_task);
460 h->timeout_flush_task = 460 h->timeout_flush_task =
461 GNUNET_SCHEDULER_add_delayed (timeout, &timeout_flush, h); 461 GNUNET_SCHEDULER_add_delayed (timeout, &timeout_flush, h);
462 if (NULL == h->buf) 462 if (NULL == h->buf)
@@ -478,12 +478,12 @@ GNUNET_TESTBED_LOGGER_flush (struct GNUNET_TESTBED_LOGGER_Handle *h,
478void 478void
479GNUNET_TESTBED_LOGGER_flush_cancel (struct GNUNET_TESTBED_LOGGER_Handle *h) 479GNUNET_TESTBED_LOGGER_flush_cancel (struct GNUNET_TESTBED_LOGGER_Handle *h)
480{ 480{
481 if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task) 481 if (NULL != h->flush_completion_task)
482 { 482 {
483 GNUNET_SCHEDULER_cancel (h->flush_completion_task); 483 GNUNET_SCHEDULER_cancel (h->flush_completion_task);
484 h->flush_completion_task = GNUNET_SCHEDULER_NO_TASK; 484 h->flush_completion_task = NULL;
485 } 485 }
486 if (GNUNET_SCHEDULER_NO_TASK != h->timeout_flush_task) 486 if (NULL != h->timeout_flush_task)
487 cancel_timeout_flush (h); 487 cancel_timeout_flush (h);
488 h->cb = NULL; 488 h->cb = NULL;
489 h->cb_cls = NULL; 489 h->cb_cls = NULL;
diff --git a/src/testing/gnunet-testing.c b/src/testing/gnunet-testing.c
index a79e836c7..2db2fd737 100644
--- a/src/testing/gnunet-testing.c
+++ b/src/testing/gnunet-testing.c
@@ -76,7 +76,7 @@ static char *tmpfilename;
76/** 76/**
77 * Task identifier of the task that waits for stdin. 77 * Task identifier of the task that waits for stdin.
78 */ 78 */
79static GNUNET_SCHEDULER_TaskIdentifier tid; 79static struct GNUNET_SCHEDULER_Task * tid;
80 80
81/** 81/**
82 * Peer started for '-r'. 82 * Peer started for '-r'.
@@ -207,10 +207,10 @@ cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
207 if (0 != UNLINK (tmpfilename)) 207 if (0 != UNLINK (tmpfilename))
208 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", tmpfilename); 208 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", tmpfilename);
209 } 209 }
210 if (GNUNET_SCHEDULER_NO_TASK != tid) 210 if (NULL != tid)
211 { 211 {
212 GNUNET_SCHEDULER_cancel (tid); 212 GNUNET_SCHEDULER_cancel (tid);
213 tid = GNUNET_SCHEDULER_NO_TASK; 213 tid = NULL;
214 } 214 }
215 if (NULL != fh) 215 if (NULL != fh)
216 { 216 {
@@ -231,7 +231,7 @@ stdin_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
231{ 231{
232 int c; 232 int c;
233 233
234 tid = GNUNET_SCHEDULER_NO_TASK; 234 tid = NULL;
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/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index 640b0fbc0..87b899892 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -135,17 +135,17 @@ struct Peer
135 * ID of task we use to wait for the time to send the next HELLO 135 * ID of task we use to wait for the time to send the next HELLO
136 * to this peer. 136 * to this peer.
137 */ 137 */
138 GNUNET_SCHEDULER_TaskIdentifier hello_delay_task; 138 struct GNUNET_SCHEDULER_Task * hello_delay_task;
139 139
140 /** 140 /**
141 * Task for issuing GNUNET_TRANSPORT_try_connect for this peer. 141 * Task for issuing GNUNET_TRANSPORT_try_connect for this peer.
142 */ 142 */
143 GNUNET_SCHEDULER_TaskIdentifier attempt_connect_task; 143 struct GNUNET_SCHEDULER_Task * attempt_connect_task;
144 144
145 /** 145 /**
146 * ID of task we use to clear peers from the greylist. 146 * ID of task we use to clear peers from the greylist.
147 */ 147 */
148 GNUNET_SCHEDULER_TaskIdentifier greylist_clean_task; 148 struct GNUNET_SCHEDULER_Task * greylist_clean_task;
149 149
150 /** 150 /**
151 * How often have we tried so far? 151 * How often have we tried so far?
@@ -216,7 +216,7 @@ static struct GNUNET_TIME_Absolute next_connect_attempt;
216/** 216/**
217 * Task scheduled to try to add peers. 217 * Task scheduled to try to add peers.
218 */ 218 */
219static GNUNET_SCHEDULER_TaskIdentifier add_task; 219static struct GNUNET_SCHEDULER_Task * add_task;
220 220
221/** 221/**
222 * Flag to disallow non-friend connections (pure F2F mode). 222 * Flag to disallow non-friend connections (pure F2F mode).
@@ -331,11 +331,11 @@ free_peer (void *cls, const struct GNUNET_PeerIdentity * pid, void *value)
331 GNUNET_CONTAINER_multipeermap_remove (peers, pid, pos)); 331 GNUNET_CONTAINER_multipeermap_remove (peers, pid, pos));
332 if (pos->hello_req != NULL) 332 if (pos->hello_req != NULL)
333 GNUNET_CORE_notify_transmit_ready_cancel (pos->hello_req); 333 GNUNET_CORE_notify_transmit_ready_cancel (pos->hello_req);
334 if (pos->hello_delay_task != GNUNET_SCHEDULER_NO_TASK) 334 if (pos->hello_delay_task != NULL)
335 GNUNET_SCHEDULER_cancel (pos->hello_delay_task); 335 GNUNET_SCHEDULER_cancel (pos->hello_delay_task);
336 if (pos->attempt_connect_task != GNUNET_SCHEDULER_NO_TASK) 336 if (pos->attempt_connect_task != NULL)
337 GNUNET_SCHEDULER_cancel (pos->attempt_connect_task); 337 GNUNET_SCHEDULER_cancel (pos->attempt_connect_task);
338 if (pos->greylist_clean_task != GNUNET_SCHEDULER_NO_TASK) 338 if (pos->greylist_clean_task != NULL)
339 GNUNET_SCHEDULER_cancel (pos->greylist_clean_task); 339 GNUNET_SCHEDULER_cancel (pos->greylist_clean_task);
340 GNUNET_free_non_null (pos->hello); 340 GNUNET_free_non_null (pos->hello);
341 if (pos->filter != NULL) 341 if (pos->filter != NULL)
@@ -395,7 +395,7 @@ attempt_connect (struct Peer *pos)
395 pos->next_connect_attempt = GNUNET_TIME_absolute_min (pos->next_connect_attempt, 395 pos->next_connect_attempt = GNUNET_TIME_absolute_min (pos->next_connect_attempt,
396 GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get(), MIN_CONNECT_FREQUENCY_DELAY)); 396 GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get(), MIN_CONNECT_FREQUENCY_DELAY));
397 397
398 if (pos->greylist_clean_task != GNUNET_SCHEDULER_NO_TASK) 398 if (pos->greylist_clean_task != NULL)
399 GNUNET_SCHEDULER_cancel (pos->greylist_clean_task); 399 GNUNET_SCHEDULER_cancel (pos->greylist_clean_task);
400 pos->greylist_clean_task = 400 pos->greylist_clean_task =
401 GNUNET_SCHEDULER_add_delayed (rem, &remove_from_greylist, pos); 401 GNUNET_SCHEDULER_add_delayed (rem, &remove_from_greylist, pos);
@@ -422,7 +422,7 @@ do_attempt_connect (void *cls,
422 struct Peer *pos = cls; 422 struct Peer *pos = cls;
423 struct GNUNET_TIME_Relative delay; 423 struct GNUNET_TIME_Relative delay;
424 424
425 pos->attempt_connect_task = GNUNET_SCHEDULER_NO_TASK; 425 pos->attempt_connect_task = NULL;
426 if (GNUNET_YES == pos->is_connected) 426 if (GNUNET_YES == pos->is_connected)
427 return; 427 return;
428 428
@@ -454,7 +454,7 @@ do_attempt_connect (void *cls,
454static void 454static void
455schedule_attempt_connect (struct Peer *pos) 455schedule_attempt_connect (struct Peer *pos)
456{ 456{
457 if (GNUNET_SCHEDULER_NO_TASK != pos->attempt_connect_task) 457 if (NULL != pos->attempt_connect_task)
458 return; 458 return;
459 pos->attempt_connect_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining (next_connect_attempt), 459 pos->attempt_connect_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining (next_connect_attempt),
460 &do_attempt_connect, 460 &do_attempt_connect,
@@ -475,7 +475,7 @@ remove_from_greylist (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
475 struct Peer *pos = cls; 475 struct Peer *pos = cls;
476 struct GNUNET_TIME_Relative rem; 476 struct GNUNET_TIME_Relative rem;
477 477
478 pos->greylist_clean_task = GNUNET_SCHEDULER_NO_TASK; 478 pos->greylist_clean_task = NULL;
479 rem = GNUNET_TIME_absolute_get_remaining (pos->greylisted_until); 479 rem = GNUNET_TIME_absolute_get_remaining (pos->greylisted_until);
480 if (0 == rem.rel_value_us) 480 if (0 == rem.rel_value_us)
481 { 481 {
@@ -646,7 +646,7 @@ schedule_next_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
646 size_t next_want; 646 size_t next_want;
647 struct GNUNET_TIME_Relative delay; 647 struct GNUNET_TIME_Relative delay;
648 648
649 pl->hello_delay_task = GNUNET_SCHEDULER_NO_TASK; 649 pl->hello_delay_task = NULL;
650 GNUNET_assert (GNUNET_YES == pl->is_connected); 650 GNUNET_assert (GNUNET_YES == pl->is_connected);
651 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 651 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
652 return; /* we're out of here */ 652 return; /* we're out of here */
@@ -702,10 +702,10 @@ reschedule_hellos (void *cls, const struct GNUNET_PeerIdentity * pid, void *valu
702 GNUNET_CORE_notify_transmit_ready_cancel (peer->hello_req); 702 GNUNET_CORE_notify_transmit_ready_cancel (peer->hello_req);
703 peer->hello_req = NULL; 703 peer->hello_req = NULL;
704 } 704 }
705 if (peer->hello_delay_task != GNUNET_SCHEDULER_NO_TASK) 705 if (peer->hello_delay_task != NULL)
706 { 706 {
707 GNUNET_SCHEDULER_cancel (peer->hello_delay_task); 707 GNUNET_SCHEDULER_cancel (peer->hello_delay_task);
708 peer->hello_delay_task = GNUNET_SCHEDULER_NO_TASK; 708 peer->hello_delay_task = NULL;
709 } 709 }
710 peer->hello_delay_task = 710 peer->hello_delay_task =
711 GNUNET_SCHEDULER_add_now (&schedule_next_hello, peer); 711 GNUNET_SCHEDULER_add_now (&schedule_next_hello, peer);
@@ -787,7 +787,7 @@ try_add_peers (void *cls, const struct GNUNET_PeerIdentity * pid, void *value)
787static void 787static void
788add_peer_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 788add_peer_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
789{ 789{
790 add_task = GNUNET_SCHEDULER_NO_TASK; 790 add_task = NULL;
791 791
792 GNUNET_CONTAINER_multipeermap_iterate (peers, &try_add_peers, NULL); 792 GNUNET_CONTAINER_multipeermap_iterate (peers, &try_add_peers, NULL);
793} 793}
@@ -827,10 +827,10 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
827 GNUNET_CORE_notify_transmit_ready_cancel (pos->hello_req); 827 GNUNET_CORE_notify_transmit_ready_cancel (pos->hello_req);
828 pos->hello_req = NULL; 828 pos->hello_req = NULL;
829 } 829 }
830 if (GNUNET_SCHEDULER_NO_TASK != pos->hello_delay_task) 830 if (NULL != pos->hello_delay_task)
831 { 831 {
832 GNUNET_SCHEDULER_cancel (pos->hello_delay_task); 832 GNUNET_SCHEDULER_cancel (pos->hello_delay_task);
833 pos->hello_delay_task = GNUNET_SCHEDULER_NO_TASK; 833 pos->hello_delay_task = NULL;
834 } 834 }
835 GNUNET_STATISTICS_set (stats, gettext_noop ("# peers connected"), 835 GNUNET_STATISTICS_set (stats, gettext_noop ("# peers connected"),
836 connection_count, GNUNET_NO); 836 connection_count, GNUNET_NO);
@@ -842,7 +842,7 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
842 } 842 }
843 if (((connection_count < target_connection_count) || 843 if (((connection_count < target_connection_count) ||
844 (friend_count < minimum_friend_count)) && 844 (friend_count < minimum_friend_count)) &&
845 (GNUNET_SCHEDULER_NO_TASK == add_task)) 845 (NULL == add_task))
846 add_task = GNUNET_SCHEDULER_add_now (&add_peer_task, NULL); 846 add_task = GNUNET_SCHEDULER_add_now (&add_peer_task, NULL);
847 if ((friend_count < minimum_friend_count) && (blacklist == NULL)) 847 if ((friend_count < minimum_friend_count) && (blacklist == NULL))
848 blacklist = GNUNET_TRANSPORT_blacklist (cfg, &blacklist_check, NULL); 848 blacklist = GNUNET_TRANSPORT_blacklist (cfg, &blacklist_check, NULL);
@@ -1179,7 +1179,7 @@ hello_advertising_ready (void *cls, size_t size, void *buf)
1179 GNUNET_NO); 1179 GNUNET_NO);
1180 } 1180 }
1181 1181
1182 if (pl->hello_delay_task != GNUNET_SCHEDULER_NO_TASK) 1182 if (pl->hello_delay_task != NULL)
1183 GNUNET_SCHEDULER_cancel (pl->hello_delay_task); 1183 GNUNET_SCHEDULER_cancel (pl->hello_delay_task);
1184 pl->next_hello_allowed = 1184 pl->next_hello_allowed =
1185 GNUNET_TIME_relative_to_absolute (HELLO_ADVERTISEMENT_MIN_FREQUENCY); 1185 GNUNET_TIME_relative_to_absolute (HELLO_ADVERTISEMENT_MIN_FREQUENCY);
@@ -1211,10 +1211,10 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1211 handle = NULL; 1211 handle = NULL;
1212 } 1212 }
1213 whitelist_peers (); 1213 whitelist_peers ();
1214 if (GNUNET_SCHEDULER_NO_TASK != add_task) 1214 if (NULL != add_task)
1215 { 1215 {
1216 GNUNET_SCHEDULER_cancel (add_task); 1216 GNUNET_SCHEDULER_cancel (add_task);
1217 add_task = GNUNET_SCHEDULER_NO_TASK; 1217 add_task = NULL;
1218 } 1218 }
1219 GNUNET_CONTAINER_multipeermap_iterate (peers, &free_peer, NULL); 1219 GNUNET_CONTAINER_multipeermap_iterate (peers, &free_peer, NULL);
1220 GNUNET_CONTAINER_multipeermap_destroy (peers); 1220 GNUNET_CONTAINER_multipeermap_destroy (peers);
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index 63f8f9f68..cd131ae39 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -68,7 +68,7 @@ struct SessionKiller
68 /** 68 /**
69 * The kill task. 69 * The kill task.
70 */ 70 */
71 GNUNET_SCHEDULER_TaskIdentifier task; 71 struct GNUNET_SCHEDULER_Task * task;
72}; 72};
73 73
74struct BlacklistCheckContext 74struct BlacklistCheckContext
@@ -246,7 +246,7 @@ kill_session_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
246{ 246{
247 struct SessionKiller *sk = cls; 247 struct SessionKiller *sk = cls;
248 248
249 sk->task = GNUNET_SCHEDULER_NO_TASK; 249 sk->task = NULL;
250 GNUNET_CONTAINER_DLL_remove(sk_head, sk_tail, sk); 250 GNUNET_CONTAINER_DLL_remove(sk_head, sk_tail, sk);
251 sk->plugin->disconnect_session (sk->plugin->cls, sk->session); 251 sk->plugin->disconnect_session (sk->plugin->cls, sk->session);
252 GNUNET_free(sk); 252 GNUNET_free(sk);
diff --git a/src/transport/gnunet-service-transport_blacklist.c b/src/transport/gnunet-service-transport_blacklist.c
index b7303f8eb..f1904a5d3 100644
--- a/src/transport/gnunet-service-transport_blacklist.c
+++ b/src/transport/gnunet-service-transport_blacklist.c
@@ -159,7 +159,7 @@ struct GST_BlacklistCheck
159 /** 159 /**
160 * Current task performing the check. 160 * Current task performing the check.
161 */ 161 */
162 GNUNET_SCHEDULER_TaskIdentifier task; 162 struct GNUNET_SCHEDULER_Task * task;
163 163
164}; 164};
165 165
@@ -230,7 +230,7 @@ client_disconnect_notification (void *cls, struct GNUNET_SERVER_Client *client)
230 GNUNET_SERVER_notify_transmit_ready_cancel (bc->th); 230 GNUNET_SERVER_notify_transmit_ready_cancel (bc->th);
231 bc->th = NULL; 231 bc->th = NULL;
232 } 232 }
233 if (bc->task == GNUNET_SCHEDULER_NO_TASK) 233 if (bc->task == NULL)
234 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, bc); 234 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, bc);
235 } 235 }
236 GNUNET_CONTAINER_DLL_remove (bl_head, bl_tail, bl); 236 GNUNET_CONTAINER_DLL_remove (bl_head, bl_tail, bl);
@@ -392,7 +392,7 @@ transmit_blacklist_message (void *cls, size_t size, void *buf)
392 bc->th = NULL; 392 bc->th = NULL;
393 if (size == 0) 393 if (size == 0)
394 { 394 {
395 GNUNET_assert (bc->task == GNUNET_SCHEDULER_NO_TASK); 395 GNUNET_assert (bc->task == NULL);
396 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, bc); 396 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, bc);
397 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 397 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
398 "Failed to send blacklist test for peer `%s' to client\n", 398 "Failed to send blacklist test for peer `%s' to client\n",
@@ -432,7 +432,7 @@ do_blacklist_check (void *cls,
432 struct GST_BlacklistCheck *bc = cls; 432 struct GST_BlacklistCheck *bc = cls;
433 struct Blacklisters *bl; 433 struct Blacklisters *bl;
434 434
435 bc->task = GNUNET_SCHEDULER_NO_TASK; 435 bc->task = NULL;
436 bl = bc->bl_pos; 436 bl = bc->bl_pos;
437 if (bl == NULL) 437 if (bl == NULL)
438 { 438 {
@@ -642,7 +642,7 @@ GST_blacklist_handle_reply (void *cls, struct GNUNET_SERVER_Client *client,
642 } 642 }
643 /* check if any other blacklist checks are waiting for this blacklister */ 643 /* check if any other blacklist checks are waiting for this blacklister */
644 for (bc = bc_head; bc != NULL; bc = bc->next) 644 for (bc = bc_head; bc != NULL; bc = bc->next)
645 if ((bc->bl_pos == bl) && (GNUNET_SCHEDULER_NO_TASK == bc->task)) 645 if ((bc->bl_pos == bl) && (NULL == bc->task))
646 { 646 {
647 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, bc); 647 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, bc);
648 break; 648 break;
@@ -817,10 +817,10 @@ GST_blacklist_test_cancel (struct GST_BlacklistCheck *bc)
817 bc->bl_pos->bc = NULL; 817 bc->bl_pos->bc = NULL;
818 } 818 }
819 } 819 }
820 if (GNUNET_SCHEDULER_NO_TASK != bc->task) 820 if (NULL != bc->task)
821 { 821 {
822 GNUNET_SCHEDULER_cancel (bc->task); 822 GNUNET_SCHEDULER_cancel (bc->task);
823 bc->task = GNUNET_SCHEDULER_NO_TASK; 823 bc->task = NULL;
824 } 824 }
825 if (NULL != bc->th) 825 if (NULL != bc->th)
826 { 826 {
diff --git a/src/transport/gnunet-service-transport_hello.c b/src/transport/gnunet-service-transport_hello.c
index 49992222d..43c938a5e 100644
--- a/src/transport/gnunet-service-transport_hello.c
+++ b/src/transport/gnunet-service-transport_hello.c
@@ -107,7 +107,7 @@ struct OwnAddressList *oal_tail;
107/** 107/**
108 * Identifier of 'refresh_hello' task. 108 * Identifier of 'refresh_hello' task.
109 */ 109 */
110static GNUNET_SCHEDULER_TaskIdentifier hello_task; 110static struct GNUNET_SCHEDULER_Task * hello_task;
111 111
112 112
113/** 113/**
@@ -164,7 +164,7 @@ refresh_hello_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
164 struct GeneratorContext gc; 164 struct GeneratorContext gc;
165 int friend_only; 165 int friend_only;
166 166
167 hello_task = GNUNET_SCHEDULER_NO_TASK; 167 hello_task = NULL;
168 gc.addr_pos = oal_head; 168 gc.addr_pos = oal_head;
169 gc.expiration = GNUNET_TIME_relative_to_absolute (hello_expiration); 169 gc.expiration = GNUNET_TIME_relative_to_absolute (hello_expiration);
170 170
@@ -198,7 +198,7 @@ refresh_hello_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
198static void 198static void
199refresh_hello () 199refresh_hello ()
200{ 200{
201 if (hello_task != GNUNET_SCHEDULER_NO_TASK) 201 if (hello_task != NULL)
202 GNUNET_SCHEDULER_cancel (hello_task); 202 GNUNET_SCHEDULER_cancel (hello_task);
203 hello_task = GNUNET_SCHEDULER_add_now (&refresh_hello_task, NULL); 203 hello_task = GNUNET_SCHEDULER_add_now (&refresh_hello_task, NULL);
204} 204}
@@ -231,10 +231,10 @@ GST_hello_stop ()
231{ 231{
232 hello_cb = NULL; 232 hello_cb = NULL;
233 hello_cb_cls = NULL; 233 hello_cb_cls = NULL;
234 if (GNUNET_SCHEDULER_NO_TASK != hello_task) 234 if (NULL != hello_task)
235 { 235 {
236 GNUNET_SCHEDULER_cancel (hello_task); 236 GNUNET_SCHEDULER_cancel (hello_task);
237 hello_task = GNUNET_SCHEDULER_NO_TASK; 237 hello_task = NULL;
238 } 238 }
239 if (NULL != our_hello) 239 if (NULL != our_hello)
240 { 240 {
diff --git a/src/transport/gnunet-service-transport_manipulation.c b/src/transport/gnunet-service-transport_manipulation.c
index bfd2594a8..0d0249bc2 100644
--- a/src/transport/gnunet-service-transport_manipulation.c
+++ b/src/transport/gnunet-service-transport_manipulation.c
@@ -92,7 +92,7 @@ struct TM_Peer
92 /** 92 /**
93 * Task to schedule delayed sendding 93 * Task to schedule delayed sendding
94 */ 94 */
95 GNUNET_SCHEDULER_TaskIdentifier send_delay_task; 95 struct GNUNET_SCHEDULER_Task * send_delay_task;
96 96
97 /** 97 /**
98 * Send queue DLL head 98 * Send queue DLL head
@@ -191,7 +191,7 @@ struct DelayQueueEntry *generic_dqe_tail;
191/** 191/**
192 * Task to schedule delayed sending based on general delay 192 * Task to schedule delayed sending based on general delay
193 */ 193 */
194GNUNET_SCHEDULER_TaskIdentifier generic_send_delay_task; 194struct GNUNET_SCHEDULER_Task * generic_send_delay_task;
195 195
196static void 196static void
197set_metric(struct TM_Peer *dest, int direction, uint32_t type, uint32_t value) 197set_metric(struct TM_Peer *dest, int direction, uint32_t type, uint32_t value)
@@ -358,7 +358,7 @@ send_delayed(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
358 if (NULL != tmp) 358 if (NULL != tmp)
359 { 359 {
360 GNUNET_break(GNUNET_YES == GST_neighbours_test_connected (&dqe->id)); 360 GNUNET_break(GNUNET_YES == GST_neighbours_test_connected (&dqe->id));
361 tmp->send_delay_task = GNUNET_SCHEDULER_NO_TASK; 361 tmp->send_delay_task = NULL;
362 GNUNET_CONTAINER_DLL_remove(tmp->send_head, tmp->send_tail, dqe); 362 GNUNET_CONTAINER_DLL_remove(tmp->send_head, tmp->send_tail, dqe);
363 GST_neighbours_send(&dqe->id, dqe->msg, dqe->msg_size, dqe->timeout, 363 GST_neighbours_send(&dqe->id, dqe->msg, dqe->msg_size, dqe->timeout,
364 dqe->cont, dqe->cont_cls); 364 dqe->cont, dqe->cont_cls);
@@ -376,7 +376,7 @@ send_delayed(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
376 { 376 {
377 /* Remove from generic queue */ 377 /* Remove from generic queue */
378 GNUNET_break(GNUNET_YES == GST_neighbours_test_connected (&dqe->id)); 378 GNUNET_break(GNUNET_YES == GST_neighbours_test_connected (&dqe->id));
379 generic_send_delay_task = GNUNET_SCHEDULER_NO_TASK; 379 generic_send_delay_task = NULL;
380 GNUNET_CONTAINER_DLL_remove(generic_dqe_head, generic_dqe_tail, dqe); 380 GNUNET_CONTAINER_DLL_remove(generic_dqe_head, generic_dqe_tail, dqe);
381 GST_neighbours_send(&dqe->id, dqe->msg, dqe->msg_size, dqe->timeout, 381 GST_neighbours_send(&dqe->id, dqe->msg, dqe->msg_size, dqe->timeout,
382 dqe->cont, dqe->cont_cls); 382 dqe->cont, dqe->cont_cls);
@@ -434,7 +434,7 @@ GST_manipulation_send(const struct GNUNET_PeerIdentity *target, const void *msg,
434 dqe->timeout = timeout; 434 dqe->timeout = timeout;
435 memcpy(dqe->msg, msg, msg_size); 435 memcpy(dqe->msg, msg, msg_size);
436 GNUNET_CONTAINER_DLL_insert_tail(tmp->send_head, tmp->send_tail, dqe); 436 GNUNET_CONTAINER_DLL_insert_tail(tmp->send_head, tmp->send_tail, dqe);
437 if (GNUNET_SCHEDULER_NO_TASK == tmp->send_delay_task) 437 if (NULL == tmp->send_delay_task)
438 tmp->send_delay_task = GNUNET_SCHEDULER_add_delayed(delay, 438 tmp->send_delay_task = GNUNET_SCHEDULER_add_delayed(delay,
439 &send_delayed, dqe); 439 &send_delayed, dqe);
440 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, 440 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
@@ -462,7 +462,7 @@ GST_manipulation_send(const struct GNUNET_PeerIdentity *target, const void *msg,
462 dqe->timeout = timeout; 462 dqe->timeout = timeout;
463 memcpy(dqe->msg, msg, msg_size); 463 memcpy(dqe->msg, msg, msg_size);
464 GNUNET_CONTAINER_DLL_insert_tail(generic_dqe_head, generic_dqe_tail, dqe); 464 GNUNET_CONTAINER_DLL_insert_tail(generic_dqe_head, generic_dqe_tail, dqe);
465 if (GNUNET_SCHEDULER_NO_TASK == generic_send_delay_task) 465 if (NULL == generic_send_delay_task)
466 { 466 {
467 generic_send_delay_task = GNUNET_SCHEDULER_add_delayed(delay, 467 generic_send_delay_task = GNUNET_SCHEDULER_add_delayed(delay,
468 &send_delayed, dqe); 468 &send_delayed, dqe);
@@ -642,10 +642,10 @@ free_tmps(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
642 dqe->cont(dqe->cont_cls, GNUNET_SYSERR, dqe->msg_size, 0); 642 dqe->cont(dqe->cont_cls, GNUNET_SYSERR, dqe->msg_size, 0);
643 GNUNET_free(dqe); 643 GNUNET_free(dqe);
644 } 644 }
645 if (GNUNET_SCHEDULER_NO_TASK != tmp->send_delay_task) 645 if (NULL != tmp->send_delay_task)
646 { 646 {
647 GNUNET_SCHEDULER_cancel(tmp->send_delay_task); 647 GNUNET_SCHEDULER_cancel(tmp->send_delay_task);
648 tmp->send_delay_task = GNUNET_SCHEDULER_NO_TASK; 648 tmp->send_delay_task = NULL;
649 } 649 }
650 GNUNET_free(tmp); 650 GNUNET_free(tmp);
651 } 651 }
@@ -693,10 +693,10 @@ GST_manipulation_peer_disconnect(const struct GNUNET_PeerIdentity *peer)
693 GNUNET_free(dqe); 693 GNUNET_free(dqe);
694 } 694 }
695 } 695 }
696 if (GNUNET_SCHEDULER_NO_TASK != generic_send_delay_task) 696 if (NULL != generic_send_delay_task)
697 { 697 {
698 GNUNET_SCHEDULER_cancel(generic_send_delay_task); 698 GNUNET_SCHEDULER_cancel(generic_send_delay_task);
699 generic_send_delay_task = GNUNET_SCHEDULER_NO_TASK; 699 generic_send_delay_task = NULL;
700 if (NULL != generic_dqe_head) 700 if (NULL != generic_dqe_head)
701 generic_send_delay_task = GNUNET_SCHEDULER_add_delayed( 701 generic_send_delay_task = GNUNET_SCHEDULER_add_delayed(
702 GNUNET_TIME_absolute_get_remaining(generic_dqe_head->sent_at), 702 GNUNET_TIME_absolute_get_remaining(generic_dqe_head->sent_at),
@@ -725,10 +725,10 @@ GST_manipulation_stop()
725 cur->cont(cur->cont_cls, GNUNET_SYSERR, cur->msg_size, 0); 725 cur->cont(cur->cont_cls, GNUNET_SYSERR, cur->msg_size, 0);
726 GNUNET_free(cur); 726 GNUNET_free(cur);
727 } 727 }
728 if (GNUNET_SCHEDULER_NO_TASK != generic_send_delay_task) 728 if (NULL != generic_send_delay_task)
729 { 729 {
730 GNUNET_SCHEDULER_cancel(generic_send_delay_task); 730 GNUNET_SCHEDULER_cancel(generic_send_delay_task);
731 generic_send_delay_task = GNUNET_SCHEDULER_NO_TASK; 731 generic_send_delay_task = NULL;
732 } 732 }
733 733
734 free_metric(&man_handle.general); 734 free_metric(&man_handle.general);
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 695adedc9..b4db4c2cb 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -344,12 +344,12 @@ struct NeighbourMapEntry
344 * Main task that drives this peer (timeouts, keepalives, etc.). 344 * Main task that drives this peer (timeouts, keepalives, etc.).
345 * Always runs the 'master_task'. 345 * Always runs the 'master_task'.
346 */ 346 */
347 GNUNET_SCHEDULER_TaskIdentifier task; 347 struct GNUNET_SCHEDULER_Task * task;
348 348
349 /** 349 /**
350 * Task to disconnect neighbour after we received a DISCONNECT message 350 * Task to disconnect neighbour after we received a DISCONNECT message
351 */ 351 */
352 GNUNET_SCHEDULER_TaskIdentifier delayed_disconnect_task; 352 struct GNUNET_SCHEDULER_Task * delayed_disconnect_task;
353 353
354 /** 354 /**
355 * At what time should we sent the next keep-alive message? 355 * At what time should we sent the next keep-alive message?
@@ -539,7 +539,7 @@ static unsigned long long bytes_in_send_queue;
539/** 539/**
540 * Task transmitting utilization data 540 * Task transmitting utilization data
541 */ 541 */
542static GNUNET_SCHEDULER_TaskIdentifier util_transmission_tk; 542static struct GNUNET_SCHEDULER_Task * util_transmission_tk;
543 543
544 544
545static struct GNUNET_CONTAINER_MultiPeerMap *registered_quota_notifications; 545static struct GNUNET_CONTAINER_MultiPeerMap *registered_quota_notifications;
@@ -956,17 +956,17 @@ free_neighbour (struct NeighbourMapEntry *n,
956 } 956 }
957 957
958 /* Cancel the disconnect task */ 958 /* Cancel the disconnect task */
959 if (GNUNET_SCHEDULER_NO_TASK != n->delayed_disconnect_task) 959 if (NULL != n->delayed_disconnect_task)
960 { 960 {
961 GNUNET_SCHEDULER_cancel (n->delayed_disconnect_task); 961 GNUNET_SCHEDULER_cancel (n->delayed_disconnect_task);
962 n->delayed_disconnect_task = GNUNET_SCHEDULER_NO_TASK; 962 n->delayed_disconnect_task = NULL;
963 } 963 }
964 964
965 /* Cancel the master task */ 965 /* Cancel the master task */
966 if (GNUNET_SCHEDULER_NO_TASK != n->task) 966 if (NULL != n->task)
967 { 967 {
968 GNUNET_SCHEDULER_cancel (n->task); 968 GNUNET_SCHEDULER_cancel (n->task);
969 n->task = GNUNET_SCHEDULER_NO_TASK; 969 n->task = NULL;
970 } 970 }
971 /* free rest of memory */ 971 /* free rest of memory */
972 GNUNET_free (n); 972 GNUNET_free (n);
@@ -1054,7 +1054,7 @@ send_disconnect_cont (void *cls, const struct GNUNET_PeerIdentity *target,
1054 return; /* already gone */ 1054 return; /* already gone */
1055 if (GNUNET_TRANSPORT_PS_DISCONNECT != n->state) 1055 if (GNUNET_TRANSPORT_PS_DISCONNECT != n->state)
1056 return; /* have created a fresh entry since */ 1056 return; /* have created a fresh entry since */
1057 if (GNUNET_SCHEDULER_NO_TASK != n->task) 1057 if (NULL != n->task)
1058 GNUNET_SCHEDULER_cancel (n->task); 1058 GNUNET_SCHEDULER_cancel (n->task);
1059 n->task = GNUNET_SCHEDULER_add_now (&master_task, n); 1059 n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
1060} 1060}
@@ -1168,7 +1168,7 @@ disconnect_neighbour (struct NeighbourMapEntry *n)
1168 break; 1168 break;
1169 } 1169 }
1170 /* schedule timeout to clean up */ 1170 /* schedule timeout to clean up */
1171 if (GNUNET_SCHEDULER_NO_TASK != n->task) 1171 if (NULL != n->task)
1172 GNUNET_SCHEDULER_cancel (n->task); 1172 GNUNET_SCHEDULER_cancel (n->task);
1173 n->task = GNUNET_SCHEDULER_add_delayed (DISCONNECT_SENT_TIMEOUT, 1173 n->task = GNUNET_SCHEDULER_add_delayed (DISCONNECT_SENT_TIMEOUT,
1174 &master_task, n); 1174 &master_task, n);
@@ -1202,7 +1202,7 @@ transmit_send_continuation (void *cls,
1202 /* this is still "our" neighbour, remove us from its queue 1202 /* this is still "our" neighbour, remove us from its queue
1203 and allow it to send the next message now */ 1203 and allow it to send the next message now */
1204 n->is_active = NULL; 1204 n->is_active = NULL;
1205 if (GNUNET_SCHEDULER_NO_TASK != n->task) 1205 if (NULL != n->task)
1206 GNUNET_SCHEDULER_cancel (n->task); 1206 GNUNET_SCHEDULER_cancel (n->task);
1207 n->task = GNUNET_SCHEDULER_add_now (&master_task, n); 1207 n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
1208 } 1208 }
@@ -1650,7 +1650,7 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg,
1650 msg_size, GNUNET_i2s (target)); 1650 msg_size, GNUNET_i2s (target));
1651 1651
1652 GNUNET_CONTAINER_DLL_insert_tail (n->messages_head, n->messages_tail, mq); 1652 GNUNET_CONTAINER_DLL_insert_tail (n->messages_head, n->messages_tail, mq);
1653 if (GNUNET_SCHEDULER_NO_TASK != n->task) 1653 if (NULL != n->task)
1654 GNUNET_SCHEDULER_cancel (n->task); 1654 GNUNET_SCHEDULER_cancel (n->task);
1655 n->task = GNUNET_SCHEDULER_add_now (&master_task, n); 1655 n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
1656} 1656}
@@ -2862,7 +2862,7 @@ static void
2862utilization_transmission (void *cls, 2862utilization_transmission (void *cls,
2863 const struct GNUNET_SCHEDULER_TaskContext *tc) 2863 const struct GNUNET_SCHEDULER_TaskContext *tc)
2864{ 2864{
2865 util_transmission_tk = GNUNET_SCHEDULER_NO_TASK; 2865 util_transmission_tk = NULL;
2866 2866
2867 if (0 < GNUNET_CONTAINER_multipeermap_size (neighbours)) 2867 if (0 < GNUNET_CONTAINER_multipeermap_size (neighbours))
2868 GNUNET_CONTAINER_multipeermap_iterate (neighbours, send_utilization_data, NULL); 2868 GNUNET_CONTAINER_multipeermap_iterate (neighbours, send_utilization_data, NULL);
@@ -2945,7 +2945,7 @@ master_task (void *cls,
2945 struct NeighbourMapEntry *n = cls; 2945 struct NeighbourMapEntry *n = cls;
2946 struct GNUNET_TIME_Relative delay; 2946 struct GNUNET_TIME_Relative delay;
2947 2947
2948 n->task = GNUNET_SCHEDULER_NO_TASK; 2948 n->task = NULL;
2949 delay = GNUNET_TIME_absolute_get_remaining (n->timeout); 2949 delay = GNUNET_TIME_absolute_get_remaining (n->timeout);
2950 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2950 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
2951 "Master task runs for neighbour `%s' in state %s with timeout in %s\n", 2951 "Master task runs for neighbour `%s' in state %s with timeout in %s\n",
@@ -3081,7 +3081,7 @@ master_task (void *cls,
3081 delay = GNUNET_TIME_relative_min (GNUNET_TIME_absolute_get_remaining (n->keep_alive_time), 3081 delay = GNUNET_TIME_relative_min (GNUNET_TIME_absolute_get_remaining (n->keep_alive_time),
3082 delay); 3082 delay);
3083 } 3083 }
3084 if (GNUNET_SCHEDULER_NO_TASK == n->task) 3084 if (NULL == n->task)
3085 n->task = GNUNET_SCHEDULER_add_delayed (delay, 3085 n->task = GNUNET_SCHEDULER_add_delayed (delay,
3086 &master_task, 3086 &master_task,
3087 n); 3087 n);
@@ -3405,7 +3405,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
3405 GNUNET_break (0); 3405 GNUNET_break (0);
3406 break; 3406 break;
3407 } 3407 }
3408 if (GNUNET_SCHEDULER_NO_TASK != n->task) 3408 if (NULL != n->task)
3409 GNUNET_SCHEDULER_cancel (n->task); 3409 GNUNET_SCHEDULER_cancel (n->task);
3410 n->task = GNUNET_SCHEDULER_add_now (&master_task, n); 3410 n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
3411 return GNUNET_YES; 3411 return GNUNET_YES;
@@ -3577,7 +3577,7 @@ void delayed_disconnect (void *cls,
3577{ 3577{
3578 struct NeighbourMapEntry *n = cls; 3578 struct NeighbourMapEntry *n = cls;
3579 3579
3580 n->delayed_disconnect_task = GNUNET_SCHEDULER_NO_TASK; 3580 n->delayed_disconnect_task = NULL;
3581 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 3581 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
3582 "Disconnecting by request from peer %s\n", 3582 "Disconnecting by request from peer %s\n",
3583 GNUNET_i2s (&n->id)); 3583 GNUNET_i2s (&n->id));
@@ -3884,10 +3884,10 @@ GST_neighbours_stop ()
3884 3884
3885 if (NULL == neighbours) 3885 if (NULL == neighbours)
3886 return; 3886 return;
3887 if (GNUNET_SCHEDULER_NO_TASK != util_transmission_tk) 3887 if (NULL != util_transmission_tk)
3888 { 3888 {
3889 GNUNET_SCHEDULER_cancel (util_transmission_tk); 3889 GNUNET_SCHEDULER_cancel (util_transmission_tk);
3890 util_transmission_tk = GNUNET_SCHEDULER_NO_TASK; 3890 util_transmission_tk = NULL;
3891 } 3891 }
3892 3892
3893 GNUNET_CONTAINER_multipeermap_iterate (neighbours, &disconnect_all_neighbours, 3893 GNUNET_CONTAINER_multipeermap_iterate (neighbours, &disconnect_all_neighbours,
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index 3c7edd140..a6a591c84 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -206,12 +206,12 @@ struct ValidationEntry
206 /** 206 /**
207 * ID of task that will clean up this entry if nothing happens. 207 * ID of task that will clean up this entry if nothing happens.
208 */ 208 */
209 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 209 struct GNUNET_SCHEDULER_Task * timeout_task;
210 210
211 /** 211 /**
212 * ID of task that will trigger address revalidation. 212 * ID of task that will trigger address revalidation.
213 */ 213 */
214 GNUNET_SCHEDULER_TaskIdentifier revalidation_task; 214 struct GNUNET_SCHEDULER_Task * revalidation_task;
215 215
216 /** 216 /**
217 * At what time did we send the latest validation request (PING)? 217 * At what time did we send the latest validation request (PING)?
@@ -441,15 +441,15 @@ cleanup_validation_entry (void *cls,
441 GNUNET_CONTAINER_multipeermap_remove (validation_map, 441 GNUNET_CONTAINER_multipeermap_remove (validation_map,
442 &ve->pid, ve)); 442 &ve->pid, ve));
443 GNUNET_HELLO_address_free (ve->address); 443 GNUNET_HELLO_address_free (ve->address);
444 if (GNUNET_SCHEDULER_NO_TASK != ve->timeout_task) 444 if (NULL != ve->timeout_task)
445 { 445 {
446 GNUNET_SCHEDULER_cancel (ve->timeout_task); 446 GNUNET_SCHEDULER_cancel (ve->timeout_task);
447 ve->timeout_task = GNUNET_SCHEDULER_NO_TASK; 447 ve->timeout_task = NULL;
448 } 448 }
449 if (GNUNET_SCHEDULER_NO_TASK != ve->revalidation_task) 449 if (NULL != ve->revalidation_task)
450 { 450 {
451 GNUNET_SCHEDULER_cancel (ve->revalidation_task); 451 GNUNET_SCHEDULER_cancel (ve->revalidation_task);
452 ve->revalidation_task = GNUNET_SCHEDULER_NO_TASK; 452 ve->revalidation_task = NULL;
453 } 453 }
454 if ((GNUNET_YES == ve->expecting_pong) && 454 if ((GNUNET_YES == ve->expecting_pong) &&
455 (validations_running > 0)) 455 (validations_running > 0))
@@ -479,7 +479,7 @@ timeout_hello_validation (void *cls,
479 struct GNUNET_TIME_Absolute max; 479 struct GNUNET_TIME_Absolute max;
480 struct GNUNET_TIME_Relative left; 480 struct GNUNET_TIME_Relative left;
481 481
482 ve->timeout_task = GNUNET_SCHEDULER_NO_TASK; 482 ve->timeout_task = NULL;
483 max = GNUNET_TIME_absolute_max (ve->valid_until, ve->revalidation_block); 483 max = GNUNET_TIME_absolute_max (ve->valid_until, ve->revalidation_block);
484 left = GNUNET_TIME_absolute_get_remaining (max); 484 left = GNUNET_TIME_absolute_get_remaining (max);
485 if (left.rel_value_us > 0) 485 if (left.rel_value_us > 0)
@@ -653,7 +653,7 @@ revalidate_address (void *cls,
653 struct GST_BlacklistCheck *bc; 653 struct GST_BlacklistCheck *bc;
654 uint32_t rdelay; 654 uint32_t rdelay;
655 655
656 ve->revalidation_task = GNUNET_SCHEDULER_NO_TASK; 656 ve->revalidation_task = NULL;
657 delay = GNUNET_TIME_absolute_get_remaining (ve->revalidation_block); 657 delay = GNUNET_TIME_absolute_get_remaining (ve->revalidation_block);
658 /* How long until we can possibly permit the next PING? */ 658 /* How long until we can possibly permit the next PING? */
659 if (GNUNET_YES == ve->in_use) 659 if (GNUNET_YES == ve->in_use)
@@ -816,7 +816,7 @@ add_valid_address (void *cls,
816 ve = find_validation_entry (&public_key, address); 816 ve = find_validation_entry (&public_key, address);
817 ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until, expiration); 817 ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until, expiration);
818 818
819 if (GNUNET_SCHEDULER_NO_TASK == ve->revalidation_task) 819 if (NULL == ve->revalidation_task)
820 { 820 {
821 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 821 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
822 "Starting revalidations for valid address `%s'\n", 822 "Starting revalidations for valid address `%s'\n",
@@ -1270,7 +1270,7 @@ validate_address_iterator (void *cls,
1270 if (papi == NULL) 1270 if (papi == NULL)
1271 { 1271 {
1272 /* This plugin is currently unvailable ... retry later */ 1272 /* This plugin is currently unvailable ... retry later */
1273 if (GNUNET_SCHEDULER_NO_TASK == ve->revalidation_task) 1273 if (NULL == ve->revalidation_task)
1274 { 1274 {
1275 if (GNUNET_YES == ve->in_use) 1275 if (GNUNET_YES == ve->in_use)
1276 canonical_delay = CONNECTED_PING_FREQUENCY; 1276 canonical_delay = CONNECTED_PING_FREQUENCY;
@@ -1292,7 +1292,7 @@ validate_address_iterator (void *cls,
1292 } 1292 }
1293 1293
1294 1294
1295 if (GNUNET_SCHEDULER_NO_TASK == ve->revalidation_task) 1295 if (NULL == ve->revalidation_task)
1296 { 1296 {
1297 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 1297 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
1298 "Validation process started for fresh address `%s'\n", 1298 "Validation process started for fresh address `%s'\n",
diff --git a/src/transport/gnunet-transport-profiler.c b/src/transport/gnunet-transport-profiler.c
index fc3c32a40..c785653c8 100644
--- a/src/transport/gnunet-transport-profiler.c
+++ b/src/transport/gnunet-transport-profiler.c
@@ -142,7 +142,7 @@ static struct GNUNET_PeerIdentity pid;
142/** 142/**
143 * Task scheduled for cleanup / termination of the process. 143 * Task scheduled for cleanup / termination of the process.
144 */ 144 */
145static GNUNET_SCHEDULER_TaskIdentifier end; 145static struct GNUNET_SCHEDULER_Task * end;
146 146
147/** 147/**
148 * Selected level of verbosity. 148 * Selected level of verbosity.
@@ -370,7 +370,7 @@ iteration_done ()
370 if (it_count == benchmark_iterations) 370 if (it_count == benchmark_iterations)
371 { 371 {
372 benchmark_running = GNUNET_NO; 372 benchmark_running = GNUNET_NO;
373 if (GNUNET_SCHEDULER_NO_TASK != end) 373 if (NULL != end)
374 GNUNET_SCHEDULER_cancel (end); 374 GNUNET_SCHEDULER_cancel (end);
375 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 375 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
376 return; 376 return;
@@ -490,7 +490,7 @@ try_connect_cb (void *cls,
490 FPRINTF (stderr, 490 FPRINTF (stderr,
491 "%s", 491 "%s",
492 _("Failed to send connect request to transport service\n")); 492 _("Failed to send connect request to transport service\n"));
493 if (GNUNET_SCHEDULER_NO_TASK != end) 493 if (NULL != end)
494 GNUNET_SCHEDULER_cancel (end); 494 GNUNET_SCHEDULER_cancel (end);
495 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 495 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
496 ret = 1; 496 ret = 1;
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c
index cd74abde7..635213c29 100644
--- a/src/transport/gnunet-transport.c
+++ b/src/transport/gnunet-transport.c
@@ -208,7 +208,7 @@ struct TestContext
208 /** 208 /**
209 * Task identifier for the timeout. 209 * Task identifier for the timeout.
210 */ 210 */
211 GNUNET_SCHEDULER_TaskIdentifier tsk; 211 struct GNUNET_SCHEDULER_Task * tsk;
212 212
213 /** 213 /**
214 * Name of plugin under test. 214 * Name of plugin under test.
@@ -424,12 +424,12 @@ static struct GNUNET_PeerIdentity pid;
424/** 424/**
425 * Task scheduled for cleanup / termination of the process. 425 * Task scheduled for cleanup / termination of the process.
426 */ 426 */
427static GNUNET_SCHEDULER_TaskIdentifier end; 427static struct GNUNET_SCHEDULER_Task * end;
428 428
429/** 429/**
430 * Task for operation timeout 430 * Task for operation timeout
431 */ 431 */
432static GNUNET_SCHEDULER_TaskIdentifier op_timeout; 432static struct GNUNET_SCHEDULER_Task * op_timeout;
433 433
434/** 434/**
435 * Selected level of verbosity. 435 * Selected level of verbosity.
@@ -522,11 +522,11 @@ shutdown_task (void *cls,
522 struct ValidationResolutionContext *cur; 522 struct ValidationResolutionContext *cur;
523 struct ValidationResolutionContext *next; 523 struct ValidationResolutionContext *next;
524 524
525 end = GNUNET_SCHEDULER_NO_TASK; 525 end = NULL;
526 if (GNUNET_SCHEDULER_NO_TASK != op_timeout) 526 if (NULL != op_timeout)
527 { 527 {
528 GNUNET_SCHEDULER_cancel (op_timeout); 528 GNUNET_SCHEDULER_cancel (op_timeout);
529 op_timeout = GNUNET_SCHEDULER_NO_TASK; 529 op_timeout = NULL;
530 } 530 }
531 if (NULL != tc_handle) 531 if (NULL != tc_handle)
532 { 532 {
@@ -612,13 +612,13 @@ operation_timeout (void *cls,
612{ 612{
613 struct PeerResolutionContext *cur; 613 struct PeerResolutionContext *cur;
614 struct PeerResolutionContext *next; 614 struct PeerResolutionContext *next;
615 op_timeout = GNUNET_SCHEDULER_NO_TASK; 615 op_timeout = NULL;
616 if ((try_connect) || (benchmark_send) || (benchmark_receive)) 616 if ((try_connect) || (benchmark_send) || (benchmark_receive))
617 { 617 {
618 FPRINTF (stdout, 618 FPRINTF (stdout,
619 _("Failed to connect to `%s'\n"), 619 _("Failed to connect to `%s'\n"),
620 GNUNET_i2s_full (&pid)); 620 GNUNET_i2s_full (&pid));
621 if (GNUNET_SCHEDULER_NO_TASK != end) 621 if (NULL != end)
622 GNUNET_SCHEDULER_cancel (end); 622 GNUNET_SCHEDULER_cancel (end);
623 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 623 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
624 ret = 1; 624 ret = 1;
@@ -644,7 +644,7 @@ operation_timeout (void *cls,
644 FPRINTF (stdout, 644 FPRINTF (stdout,
645 "%s", 645 "%s",
646 _("Failed to list connections, timeout occured\n")); 646 _("Failed to list connections, timeout occured\n"));
647 if (GNUNET_SCHEDULER_NO_TASK != end) 647 if (NULL != end)
648 GNUNET_SCHEDULER_cancel (end); 648 GNUNET_SCHEDULER_cancel (end);
649 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 649 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
650 ret = 1; 650 ret = 1;
@@ -709,10 +709,10 @@ display_test_result (struct TestContext *tc,
709 _("Configuration for plugin `%s' is working!\n"), 709 _("Configuration for plugin `%s' is working!\n"),
710 tc->name); 710 tc->name);
711 } 711 }
712 if (GNUNET_SCHEDULER_NO_TASK != tc->tsk) 712 if (NULL != tc->tsk)
713 { 713 {
714 GNUNET_SCHEDULER_cancel (tc->tsk); 714 GNUNET_SCHEDULER_cancel (tc->tsk);
715 tc->tsk = GNUNET_SCHEDULER_NO_TASK; 715 tc->tsk = NULL;
716 } 716 }
717 if (NULL != tc->tst) 717 if (NULL != tc->tst)
718 { 718 {
@@ -873,15 +873,15 @@ process_validation_string (void *cls,
873 GNUNET_free (vc); 873 GNUNET_free (vc);
874 if ((0 == address_resolutions) && (iterate_validation)) 874 if ((0 == address_resolutions) && (iterate_validation))
875 { 875 {
876 if (GNUNET_SCHEDULER_NO_TASK != end) 876 if (NULL != end)
877 { 877 {
878 GNUNET_SCHEDULER_cancel (end); 878 GNUNET_SCHEDULER_cancel (end);
879 end = GNUNET_SCHEDULER_NO_TASK; 879 end = NULL;
880 } 880 }
881 if (GNUNET_SCHEDULER_NO_TASK != op_timeout) 881 if (NULL != op_timeout)
882 { 882 {
883 GNUNET_SCHEDULER_cancel (op_timeout); 883 GNUNET_SCHEDULER_cancel (op_timeout);
884 op_timeout = GNUNET_SCHEDULER_NO_TASK; 884 op_timeout = NULL;
885 } 885 }
886 ret = 0; 886 ret = 0;
887 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 887 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
@@ -966,7 +966,7 @@ process_validation_cb (void *cls,
966 966
967 /* done */ 967 /* done */
968 vic = NULL; 968 vic = NULL;
969 if (GNUNET_SCHEDULER_NO_TASK != end) 969 if (NULL != end)
970 GNUNET_SCHEDULER_cancel (end); 970 GNUNET_SCHEDULER_cancel (end);
971 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 971 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
972 return; 972 return;
@@ -975,7 +975,7 @@ process_validation_cb (void *cls,
975 { 975 {
976 /* invalid response */ 976 /* invalid response */
977 vic = NULL; 977 vic = NULL;
978 if (GNUNET_SCHEDULER_NO_TASK != end) 978 if (NULL != end)
979 GNUNET_SCHEDULER_cancel (end); 979 GNUNET_SCHEDULER_cancel (end);
980 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 980 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
981 return; 981 return;
@@ -1140,23 +1140,23 @@ notify_connect (void *cls,
1140 GNUNET_i2s_full (peer)); 1140 GNUNET_i2s_full (peer));
1141 ret = 0; 1141 ret = 0;
1142 1142
1143 if (GNUNET_SCHEDULER_NO_TASK != op_timeout) 1143 if (NULL != op_timeout)
1144 { 1144 {
1145 GNUNET_SCHEDULER_cancel (op_timeout); 1145 GNUNET_SCHEDULER_cancel (op_timeout);
1146 op_timeout = GNUNET_SCHEDULER_NO_TASK; 1146 op_timeout = NULL;
1147 } 1147 }
1148 1148
1149 if (GNUNET_SCHEDULER_NO_TASK != end) 1149 if (NULL != end)
1150 GNUNET_SCHEDULER_cancel (end); 1150 GNUNET_SCHEDULER_cancel (end);
1151 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 1151 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
1152 return; 1152 return;
1153 } 1153 }
1154 if (benchmark_send) 1154 if (benchmark_send)
1155 { 1155 {
1156 if (GNUNET_SCHEDULER_NO_TASK != op_timeout) 1156 if (NULL != op_timeout)
1157 { 1157 {
1158 GNUNET_SCHEDULER_cancel (op_timeout); 1158 GNUNET_SCHEDULER_cancel (op_timeout);
1159 op_timeout = GNUNET_SCHEDULER_NO_TASK; 1159 op_timeout = NULL;
1160 } 1160 }
1161 if (verbosity > 0) 1161 if (verbosity > 0)
1162 FPRINTF (stdout, 1162 FPRINTF (stdout,
@@ -1197,13 +1197,13 @@ notify_disconnect (void *cls,
1197 GNUNET_i2s_full (peer)); 1197 GNUNET_i2s_full (peer));
1198 ret = 0; 1198 ret = 0;
1199 1199
1200 if (GNUNET_SCHEDULER_NO_TASK != op_timeout) 1200 if (NULL != op_timeout)
1201 { 1201 {
1202 GNUNET_SCHEDULER_cancel (op_timeout); 1202 GNUNET_SCHEDULER_cancel (op_timeout);
1203 op_timeout = GNUNET_SCHEDULER_NO_TASK; 1203 op_timeout = NULL;
1204 } 1204 }
1205 1205
1206 if (GNUNET_SCHEDULER_NO_TASK != end) 1206 if (NULL != end)
1207 GNUNET_SCHEDULER_cancel (end); 1207 GNUNET_SCHEDULER_cancel (end);
1208 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 1208 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
1209 return; 1209 return;
@@ -1218,7 +1218,7 @@ notify_disconnect (void *cls,
1218 { 1218 {
1219 FPRINTF (stdout, _("Disconnected from peer `%s' while benchmarking\n"), 1219 FPRINTF (stdout, _("Disconnected from peer `%s' while benchmarking\n"),
1220 GNUNET_i2s (&pid)); 1220 GNUNET_i2s (&pid));
1221 if (GNUNET_SCHEDULER_NO_TASK != end) 1221 if (NULL != end)
1222 GNUNET_SCHEDULER_cancel (end); 1222 GNUNET_SCHEDULER_cancel (end);
1223 return; 1223 return;
1224 } 1224 }
@@ -1431,15 +1431,15 @@ process_peer_string (void *cls,
1431 GNUNET_free (rc); 1431 GNUNET_free (rc);
1432 if ((0 == address_resolutions) && (iterate_connections)) 1432 if ((0 == address_resolutions) && (iterate_connections))
1433 { 1433 {
1434 if (GNUNET_SCHEDULER_NO_TASK != end) 1434 if (NULL != end)
1435 { 1435 {
1436 GNUNET_SCHEDULER_cancel (end); 1436 GNUNET_SCHEDULER_cancel (end);
1437 end = GNUNET_SCHEDULER_NO_TASK; 1437 end = NULL;
1438 } 1438 }
1439 if (GNUNET_SCHEDULER_NO_TASK != op_timeout) 1439 if (NULL != op_timeout)
1440 { 1440 {
1441 GNUNET_SCHEDULER_cancel (op_timeout); 1441 GNUNET_SCHEDULER_cancel (op_timeout);
1442 op_timeout = GNUNET_SCHEDULER_NO_TASK; 1442 op_timeout = NULL;
1443 } 1443 }
1444 ret = 0; 1444 ret = 0;
1445 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 1445 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
@@ -1498,7 +1498,7 @@ process_peer_iteration_cb (void *cls,
1498 /* done */ 1498 /* done */
1499 address_resolution_in_progress = GNUNET_NO; 1499 address_resolution_in_progress = GNUNET_NO;
1500 pic = NULL; 1500 pic = NULL;
1501 if (GNUNET_SCHEDULER_NO_TASK != end) 1501 if (NULL != end)
1502 GNUNET_SCHEDULER_cancel (end); 1502 GNUNET_SCHEDULER_cancel (end);
1503 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 1503 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
1504 return; 1504 return;
@@ -1508,7 +1508,7 @@ process_peer_iteration_cb (void *cls,
1508 (GNUNET_NO == GNUNET_TRANSPORT_is_connected(state))) 1508 (GNUNET_NO == GNUNET_TRANSPORT_is_connected(state)))
1509 return; /* Display only connected peers */ 1509 return; /* Display only connected peers */
1510 1510
1511 if (GNUNET_SCHEDULER_NO_TASK != op_timeout) 1511 if (NULL != op_timeout)
1512 GNUNET_SCHEDULER_cancel (op_timeout); 1512 GNUNET_SCHEDULER_cancel (op_timeout);
1513 op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT, 1513 op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT,
1514 &operation_timeout, 1514 &operation_timeout,
@@ -1713,7 +1713,7 @@ process_peer_monitoring_cb (void *cls,
1713 return; 1713 return;
1714 } 1714 }
1715 1715
1716 if (GNUNET_SCHEDULER_NO_TASK != op_timeout) 1716 if (NULL != op_timeout)
1717 GNUNET_SCHEDULER_cancel (op_timeout); 1717 GNUNET_SCHEDULER_cancel (op_timeout);
1718 op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT, 1718 op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT,
1719 &operation_timeout, 1719 &operation_timeout,
@@ -1792,7 +1792,7 @@ try_connect_cb (void *cls,
1792 FPRINTF (stderr, 1792 FPRINTF (stderr,
1793 "%s", 1793 "%s",
1794 _("Failed to send connect request to transport service\n")); 1794 _("Failed to send connect request to transport service\n"));
1795 if (GNUNET_SCHEDULER_NO_TASK != end) 1795 if (NULL != end)
1796 GNUNET_SCHEDULER_cancel (end); 1796 GNUNET_SCHEDULER_cancel (end);
1797 ret = 1; 1797 ret = 1;
1798 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 1798 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
@@ -1827,7 +1827,7 @@ try_disconnect_cb (void *cls,
1827 } 1827 }
1828 FPRINTF (stderr, "%s", 1828 FPRINTF (stderr, "%s",
1829 _("Failed to send disconnect request to transport service\n")); 1829 _("Failed to send disconnect request to transport service\n"));
1830 if (GNUNET_SCHEDULER_NO_TASK != end) 1830 if (NULL != end)
1831 GNUNET_SCHEDULER_cancel (end); 1831 GNUNET_SCHEDULER_cancel (end);
1832 ret = 1; 1832 ret = 1;
1833 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); 1833 end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
diff --git a/src/transport/plugin_transport_http.h b/src/transport/plugin_transport_http.h
index d43eb9bab..9a0edb719 100644
--- a/src/transport/plugin_transport_http.h
+++ b/src/transport/plugin_transport_http.h
@@ -118,7 +118,7 @@ struct Plugin
118 /** 118 /**
119 * Task calling transport service about external address 119 * Task calling transport service about external address
120 */ 120 */
121 GNUNET_SCHEDULER_TaskIdentifier notify_ext_task; 121 struct GNUNET_SCHEDULER_Task * notify_ext_task;
122 122
123 /** 123 /**
124 * Plugin name. 124 * Plugin name.
@@ -206,7 +206,7 @@ struct Plugin
206 /** 206 /**
207 * MHD IPv4 task 207 * MHD IPv4 task
208 */ 208 */
209 GNUNET_SCHEDULER_TaskIdentifier server_v4_task; 209 struct GNUNET_SCHEDULER_Task * server_v4_task;
210 210
211 /** 211 /**
212 * The IPv4 server is scheduled to run asap 212 * The IPv4 server is scheduled to run asap
@@ -221,7 +221,7 @@ struct Plugin
221 /** 221 /**
222 * MHD IPv4 task 222 * MHD IPv4 task
223 */ 223 */
224 GNUNET_SCHEDULER_TaskIdentifier server_v6_task; 224 struct GNUNET_SCHEDULER_Task * server_v6_task;
225 225
226 /** 226 /**
227 * The IPv6 server is scheduled to run asap 227 * The IPv6 server is scheduled to run asap
@@ -260,7 +260,7 @@ struct Plugin
260 /** 260 /**
261 * curl perform task 261 * curl perform task
262 */ 262 */
263 GNUNET_SCHEDULER_TaskIdentifier client_perform_task; 263 struct GNUNET_SCHEDULER_Task * client_perform_task;
264 264
265}; 265};
266 266
@@ -426,12 +426,12 @@ struct Session
426 /** 426 /**
427 * Task to wake up client receive handle when receiving is allowed again 427 * Task to wake up client receive handle when receiving is allowed again
428 */ 428 */
429 GNUNET_SCHEDULER_TaskIdentifier recv_wakeup_task; 429 struct GNUNET_SCHEDULER_Task * recv_wakeup_task;
430 430
431 /** 431 /**
432 * Session timeout task 432 * Session timeout task
433 */ 433 */
434 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 434 struct GNUNET_SCHEDULER_Task * timeout_task;
435 435
436 /** 436 /**
437 * Is client send handle paused since there are no data to send? 437 * Is client send handle paused since there are no data to send?
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index 4cafaf2c0..cc1f39e9a 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -222,17 +222,17 @@ struct Session
222 /** 222 /**
223 * Session timeout task 223 * Session timeout task
224 */ 224 */
225 GNUNET_SCHEDULER_TaskIdentifier put_disconnect_task; 225 struct GNUNET_SCHEDULER_Task * put_disconnect_task;
226 226
227 /** 227 /**
228 * Session timeout task 228 * Session timeout task
229 */ 229 */
230 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 230 struct GNUNET_SCHEDULER_Task * timeout_task;
231 231
232 /** 232 /**
233 * Task to wake up client receive handle when receiving is allowed again 233 * Task to wake up client receive handle when receiving is allowed again
234 */ 234 */
235 GNUNET_SCHEDULER_TaskIdentifier recv_wakeup_task; 235 struct GNUNET_SCHEDULER_Task * recv_wakeup_task;
236 236
237 /** 237 /**
238 * Absolute time when to receive data again. 238 * Absolute time when to receive data again.
@@ -326,7 +326,7 @@ struct HTTP_Client_Plugin
326 /** 326 /**
327 * curl perform task 327 * curl perform task
328 */ 328 */
329 GNUNET_SCHEDULER_TaskIdentifier client_perform_task; 329 struct GNUNET_SCHEDULER_Task * client_perform_task;
330 330
331 /** 331 /**
332 * Type of proxy server: 332 * Type of proxy server:
@@ -440,21 +440,21 @@ client_delete_session (struct Session *s)
440 struct HTTP_Message *next; 440 struct HTTP_Message *next;
441 CURLMcode mret; 441 CURLMcode mret;
442 442
443 if (GNUNET_SCHEDULER_NO_TASK != s->timeout_task) 443 if (NULL != s->timeout_task)
444 { 444 {
445 GNUNET_SCHEDULER_cancel (s->timeout_task); 445 GNUNET_SCHEDULER_cancel (s->timeout_task);
446 s->timeout_task = GNUNET_SCHEDULER_NO_TASK; 446 s->timeout_task = NULL;
447 s->timeout = GNUNET_TIME_UNIT_ZERO_ABS; 447 s->timeout = GNUNET_TIME_UNIT_ZERO_ABS;
448 } 448 }
449 if (GNUNET_SCHEDULER_NO_TASK != s->put_disconnect_task) 449 if (NULL != s->put_disconnect_task)
450 { 450 {
451 GNUNET_SCHEDULER_cancel (s->put_disconnect_task); 451 GNUNET_SCHEDULER_cancel (s->put_disconnect_task);
452 s->put_disconnect_task = GNUNET_SCHEDULER_NO_TASK; 452 s->put_disconnect_task = NULL;
453 } 453 }
454 if (GNUNET_SCHEDULER_NO_TASK != s->recv_wakeup_task) 454 if (NULL != s->recv_wakeup_task)
455 { 455 {
456 GNUNET_SCHEDULER_cancel (s->recv_wakeup_task); 456 GNUNET_SCHEDULER_cancel (s->recv_wakeup_task);
457 s->recv_wakeup_task = GNUNET_SCHEDULER_NO_TASK; 457 s->recv_wakeup_task = NULL;
458 } 458 }
459 GNUNET_assert (GNUNET_OK == 459 GNUNET_assert (GNUNET_OK ==
460 GNUNET_CONTAINER_multipeermap_remove (plugin->sessions, 460 GNUNET_CONTAINER_multipeermap_remove (plugin->sessions,
@@ -541,7 +541,7 @@ client_delete_session (struct Session *s)
541static void 541static void
542client_reschedule_session_timeout (struct Session *s) 542client_reschedule_session_timeout (struct Session *s)
543{ 543{
544 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != s->timeout_task); 544 GNUNET_assert (NULL != s->timeout_task);
545 s->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); 545 s->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
546} 546}
547 547
@@ -579,10 +579,10 @@ client_schedule (struct HTTP_Client_Plugin *plugin,
579 struct GNUNET_TIME_Relative timeout; 579 struct GNUNET_TIME_Relative timeout;
580 580
581 /* Cancel previous scheduled task */ 581 /* Cancel previous scheduled task */
582 if (plugin->client_perform_task != GNUNET_SCHEDULER_NO_TASK) 582 if (plugin->client_perform_task != NULL)
583 { 583 {
584 GNUNET_SCHEDULER_cancel (plugin->client_perform_task); 584 GNUNET_SCHEDULER_cancel (plugin->client_perform_task);
585 plugin->client_perform_task = GNUNET_SCHEDULER_NO_TASK; 585 plugin->client_perform_task = NULL;
586 } 586 }
587 max = -1; 587 max = -1;
588 FD_ZERO (&rs); 588 FD_ZERO (&rs);
@@ -802,9 +802,9 @@ http_client_plugin_send (void *cls,
802 if (H_PAUSED == s->put.state) 802 if (H_PAUSED == s->put.state)
803 { 803 {
804 /* PUT request was paused, unpause */ 804 /* PUT request was paused, unpause */
805 GNUNET_assert (s->put_disconnect_task != GNUNET_SCHEDULER_NO_TASK); 805 GNUNET_assert (s->put_disconnect_task != NULL);
806 GNUNET_SCHEDULER_cancel (s->put_disconnect_task); 806 GNUNET_SCHEDULER_cancel (s->put_disconnect_task);
807 s->put_disconnect_task = GNUNET_SCHEDULER_NO_TASK; 807 s->put_disconnect_task = NULL;
808 LOG (GNUNET_ERROR_TYPE_DEBUG, 808 LOG (GNUNET_ERROR_TYPE_DEBUG,
809 "Session %p/request %p: unpausing request\n", 809 "Session %p/request %p: unpausing request\n",
810 s, s->put.easyhandle); 810 s, s->put.easyhandle);
@@ -851,10 +851,10 @@ http_client_plugin_session_disconnect (void *cls,
851 client_delete_session (s); 851 client_delete_session (s);
852 852
853 /* Re-schedule since handles have changed */ 853 /* Re-schedule since handles have changed */
854 if (plugin->client_perform_task != GNUNET_SCHEDULER_NO_TASK) 854 if (plugin->client_perform_task != NULL)
855 { 855 {
856 GNUNET_SCHEDULER_cancel (plugin->client_perform_task); 856 GNUNET_SCHEDULER_cancel (plugin->client_perform_task);
857 plugin->client_perform_task = GNUNET_SCHEDULER_NO_TASK; 857 plugin->client_perform_task = NULL;
858 } 858 }
859 client_schedule (plugin, GNUNET_YES); 859 client_schedule (plugin, GNUNET_YES);
860 860
@@ -1001,7 +1001,7 @@ client_put_disconnect (void *cls,
1001{ 1001{
1002 struct Session *s = cls; 1002 struct Session *s = cls;
1003 1003
1004 s->put_disconnect_task = GNUNET_SCHEDULER_NO_TASK; 1004 s->put_disconnect_task = NULL;
1005 LOG (GNUNET_ERROR_TYPE_DEBUG, 1005 LOG (GNUNET_ERROR_TYPE_DEBUG,
1006 "Session %p/request %p: will be disconnected due to no activity\n", 1006 "Session %p/request %p: will be disconnected due to no activity\n",
1007 s, s->put.easyhandle); 1007 s, s->put.easyhandle);
@@ -1132,7 +1132,7 @@ client_wake_up (void *cls,
1132{ 1132{
1133 struct Session *s = cls; 1133 struct Session *s = cls;
1134 1134
1135 s->recv_wakeup_task = GNUNET_SCHEDULER_NO_TASK; 1135 s->recv_wakeup_task = NULL;
1136 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1136 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1137 return; 1137 return;
1138 LOG (GNUNET_ERROR_TYPE_DEBUG, 1138 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1141,9 +1141,9 @@ client_wake_up (void *cls,
1141 if (H_PAUSED == s->put.state) 1141 if (H_PAUSED == s->put.state)
1142 { 1142 {
1143 /* PUT request was paused, unpause */ 1143 /* PUT request was paused, unpause */
1144 GNUNET_assert (s->put_disconnect_task != GNUNET_SCHEDULER_NO_TASK); 1144 GNUNET_assert (s->put_disconnect_task != NULL);
1145 GNUNET_SCHEDULER_cancel (s->put_disconnect_task); 1145 GNUNET_SCHEDULER_cancel (s->put_disconnect_task);
1146 s->put_disconnect_task = GNUNET_SCHEDULER_NO_TASK; 1146 s->put_disconnect_task = NULL;
1147 s->put.state = H_CONNECTED; 1147 s->put.state = H_CONNECTED;
1148 if (NULL != s->put.easyhandle) 1148 if (NULL != s->put.easyhandle)
1149 curl_easy_pause (s->put.easyhandle, CURLPAUSE_CONT); 1149 curl_easy_pause (s->put.easyhandle, CURLPAUSE_CONT);
@@ -1271,10 +1271,10 @@ client_receive (void *stream,
1271 s->get.easyhandle, 1271 s->get.easyhandle,
1272 GNUNET_STRINGS_relative_time_to_string (delta, 1272 GNUNET_STRINGS_relative_time_to_string (delta,
1273 GNUNET_YES)); 1273 GNUNET_YES));
1274 if (s->recv_wakeup_task != GNUNET_SCHEDULER_NO_TASK) 1274 if (s->recv_wakeup_task != NULL)
1275 { 1275 {
1276 GNUNET_SCHEDULER_cancel (s->recv_wakeup_task); 1276 GNUNET_SCHEDULER_cancel (s->recv_wakeup_task);
1277 s->recv_wakeup_task = GNUNET_SCHEDULER_NO_TASK; 1277 s->recv_wakeup_task = NULL;
1278 } 1278 }
1279 s->recv_wakeup_task 1279 s->recv_wakeup_task
1280 = GNUNET_SCHEDULER_add_delayed (delta, 1280 = GNUNET_SCHEDULER_add_delayed (delta,
@@ -1313,7 +1313,7 @@ client_run (void *cls,
1313 int put_request; /* GNUNET_YES if easy handle is put, GNUNET_NO for get */ 1313 int put_request; /* GNUNET_YES if easy handle is put, GNUNET_NO for get */
1314 int msgs_left; 1314 int msgs_left;
1315 1315
1316 plugin->client_perform_task = GNUNET_SCHEDULER_NO_TASK; 1316 plugin->client_perform_task = NULL;
1317 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1317 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1318 return; 1318 return;
1319 1319
@@ -1918,10 +1918,10 @@ client_connect (struct Session *s)
1918 plugin->cur_requests, 1918 plugin->cur_requests,
1919 GNUNET_NO); 1919 GNUNET_NO);
1920 /* Re-schedule since handles have changed */ 1920 /* Re-schedule since handles have changed */
1921 if (plugin->client_perform_task != GNUNET_SCHEDULER_NO_TASK) 1921 if (plugin->client_perform_task != NULL)
1922 { 1922 {
1923 GNUNET_SCHEDULER_cancel (plugin->client_perform_task); 1923 GNUNET_SCHEDULER_cancel (plugin->client_perform_task);
1924 plugin->client_perform_task = GNUNET_SCHEDULER_NO_TASK; 1924 plugin->client_perform_task = NULL;
1925 } 1925 }
1926 1926
1927 /* Schedule task to run immediately */ 1927 /* Schedule task to run immediately */
@@ -1958,7 +1958,7 @@ client_session_timeout (void *cls,
1958 struct Session *s = cls; 1958 struct Session *s = cls;
1959 struct GNUNET_TIME_Relative left; 1959 struct GNUNET_TIME_Relative left;
1960 1960
1961 s->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1961 s->timeout_task = NULL;
1962 left = GNUNET_TIME_absolute_get_remaining (s->timeout); 1962 left = GNUNET_TIME_absolute_get_remaining (s->timeout);
1963 if (0 != left.rel_value_us) 1963 if (0 != left.rel_value_us)
1964 { 1964 {
@@ -2166,10 +2166,10 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
2166 GNUNET_CONTAINER_multipeermap_iterate (plugin->sessions, 2166 GNUNET_CONTAINER_multipeermap_iterate (plugin->sessions,
2167 &destroy_session_cb, 2167 &destroy_session_cb,
2168 plugin); 2168 plugin);
2169 if (GNUNET_SCHEDULER_NO_TASK != plugin->client_perform_task) 2169 if (NULL != plugin->client_perform_task)
2170 { 2170 {
2171 GNUNET_SCHEDULER_cancel (plugin->client_perform_task); 2171 GNUNET_SCHEDULER_cancel (plugin->client_perform_task);
2172 plugin->client_perform_task = GNUNET_SCHEDULER_NO_TASK; 2172 plugin->client_perform_task = NULL;
2173 } 2173 }
2174 if (NULL != plugin->curl_multi_handle) 2174 if (NULL != plugin->curl_multi_handle)
2175 { 2175 {
@@ -2368,7 +2368,7 @@ http_client_plugin_update_inbound_delay (void *cls,
2368 "New inbound delay %s\n", 2368 "New inbound delay %s\n",
2369 GNUNET_STRINGS_relative_time_to_string (delay, 2369 GNUNET_STRINGS_relative_time_to_string (delay,
2370 GNUNET_NO)); 2370 GNUNET_NO));
2371 if (s->recv_wakeup_task != GNUNET_SCHEDULER_NO_TASK) 2371 if (s->recv_wakeup_task != NULL)
2372 { 2372 {
2373 GNUNET_SCHEDULER_cancel (s->recv_wakeup_task); 2373 GNUNET_SCHEDULER_cancel (s->recv_wakeup_task);
2374 s->recv_wakeup_task = GNUNET_SCHEDULER_add_delayed (delay, 2374 s->recv_wakeup_task = GNUNET_SCHEDULER_add_delayed (delay,
diff --git a/src/transport/plugin_transport_http_common.c b/src/transport/plugin_transport_http_common.c
index acccf39f8..bd6838e1c 100644
--- a/src/transport/plugin_transport_http_common.c
+++ b/src/transport/plugin_transport_http_common.c
@@ -205,7 +205,7 @@ struct PrettyPrinterContext
205 /** 205 /**
206 * Timeout task 206 * Timeout task
207 */ 207 */
208 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 208 struct GNUNET_SCHEDULER_Task * timeout_task;
209 209
210 /** 210 /**
211 * Splitted Address 211 * Splitted Address
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 31bd7ba4f..aaa17b2cf 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -232,12 +232,12 @@ struct Session
232 /** 232 /**
233 * Session timeout task 233 * Session timeout task
234 */ 234 */
235 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 235 struct GNUNET_SCHEDULER_Task * timeout_task;
236 236
237 /** 237 /**
238 * Task to resume MHD handling when receiving is allowed again 238 * Task to resume MHD handling when receiving is allowed again
239 */ 239 */
240 GNUNET_SCHEDULER_TaskIdentifier recv_wakeup_task; 240 struct GNUNET_SCHEDULER_Task * recv_wakeup_task;
241 241
242 /** 242 /**
243 * Number of bytes waiting for transmission to this peer. 243 * Number of bytes waiting for transmission to this peer.
@@ -374,17 +374,17 @@ struct HTTP_Server_Plugin
374 /** 374 /**
375 * MHD IPv4 task 375 * MHD IPv4 task
376 */ 376 */
377 GNUNET_SCHEDULER_TaskIdentifier server_v4_task; 377 struct GNUNET_SCHEDULER_Task * server_v4_task;
378 378
379 /** 379 /**
380 * MHD IPv6 task 380 * MHD IPv6 task
381 */ 381 */
382 GNUNET_SCHEDULER_TaskIdentifier server_v6_task; 382 struct GNUNET_SCHEDULER_Task * server_v6_task;
383 383
384 /** 384 /**
385 * Task calling transport service about external address 385 * Task calling transport service about external address
386 */ 386 */
387 GNUNET_SCHEDULER_TaskIdentifier notify_ext_task; 387 struct GNUNET_SCHEDULER_Task * notify_ext_task;
388 388
389 /** 389 /**
390 * Notify transport only about external address 390 * Notify transport only about external address
@@ -499,7 +499,7 @@ server_wake_up (void *cls,
499{ 499{
500 struct Session *s = cls; 500 struct Session *s = cls;
501 501
502 s->recv_wakeup_task = GNUNET_SCHEDULER_NO_TASK; 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;
505 LOG (GNUNET_ERROR_TYPE_DEBUG, 505 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -534,16 +534,16 @@ server_delete_session (struct Session *s)
534 struct HTTP_Server_Plugin *plugin = s->plugin; 534 struct HTTP_Server_Plugin *plugin = s->plugin;
535 struct HTTP_Message *msg; 535 struct HTTP_Message *msg;
536 536
537 if (GNUNET_SCHEDULER_NO_TASK != s->timeout_task) 537 if (NULL != s->timeout_task)
538 { 538 {
539 GNUNET_SCHEDULER_cancel (s->timeout_task); 539 GNUNET_SCHEDULER_cancel (s->timeout_task);
540 s->timeout_task = GNUNET_SCHEDULER_NO_TASK; 540 s->timeout_task = NULL;
541 s->timeout = GNUNET_TIME_UNIT_ZERO_ABS; 541 s->timeout = GNUNET_TIME_UNIT_ZERO_ABS;
542 } 542 }
543 if (GNUNET_SCHEDULER_NO_TASK != s->recv_wakeup_task) 543 if (NULL != s->recv_wakeup_task)
544 { 544 {
545 GNUNET_SCHEDULER_cancel (s->recv_wakeup_task); 545 GNUNET_SCHEDULER_cancel (s->recv_wakeup_task);
546 s->recv_wakeup_task = GNUNET_SCHEDULER_NO_TASK; 546 s->recv_wakeup_task = NULL;
547 if (NULL != s->server_recv) 547 if (NULL != s->server_recv)
548 MHD_resume_connection (s->server_recv->mhd_conn); 548 MHD_resume_connection (s->server_recv->mhd_conn);
549 } 549 }
@@ -649,7 +649,7 @@ server_session_timeout (void *cls,
649 struct Session *s = cls; 649 struct Session *s = cls;
650 struct GNUNET_TIME_Relative left; 650 struct GNUNET_TIME_Relative left;
651 651
652 s->timeout_task = GNUNET_SCHEDULER_NO_TASK; 652 s->timeout_task = NULL;
653 left = GNUNET_TIME_absolute_get_remaining (s->timeout); 653 left = GNUNET_TIME_absolute_get_remaining (s->timeout);
654 if (0 != left.rel_value_us) 654 if (0 != left.rel_value_us)
655 { 655 {
@@ -680,7 +680,7 @@ server_session_timeout (void *cls,
680static void 680static void
681server_reschedule_session_timeout (struct Session *s) 681server_reschedule_session_timeout (struct Session *s)
682{ 682{
683 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != s->timeout_task); 683 GNUNET_assert (NULL != s->timeout_task);
684 s->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); 684 s->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
685} 685}
686 686
@@ -917,7 +917,7 @@ server_v4_run (void *cls,
917{ 917{
918 struct HTTP_Server_Plugin *plugin = cls; 918 struct HTTP_Server_Plugin *plugin = cls;
919 919
920 plugin->server_v4_task = GNUNET_SCHEDULER_NO_TASK; 920 plugin->server_v4_task = NULL;
921 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 921 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
922 return; 922 return;
923 plugin->server_v4_immediately = GNUNET_NO; 923 plugin->server_v4_immediately = GNUNET_NO;
@@ -939,7 +939,7 @@ server_v6_run (void *cls,
939{ 939{
940 struct HTTP_Server_Plugin *plugin = cls; 940 struct HTTP_Server_Plugin *plugin = cls;
941 941
942 plugin->server_v6_task = GNUNET_SCHEDULER_NO_TASK; 942 plugin->server_v6_task = NULL;
943 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 943 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
944 return; 944 return;
945 plugin->server_v6_immediately = GNUNET_NO; 945 plugin->server_v6_immediately = GNUNET_NO;
@@ -957,12 +957,12 @@ server_v6_run (void *cls,
957 * @param now schedule now 957 * @param now schedule now
958 * @return gnunet task identifier 958 * @return gnunet task identifier
959 */ 959 */
960static GNUNET_SCHEDULER_TaskIdentifier 960static struct GNUNET_SCHEDULER_Task *
961server_schedule (struct HTTP_Server_Plugin *plugin, 961server_schedule (struct HTTP_Server_Plugin *plugin,
962 struct MHD_Daemon *daemon_handle, 962 struct MHD_Daemon *daemon_handle,
963 int now) 963 int now)
964{ 964{
965 GNUNET_SCHEDULER_TaskIdentifier ret; 965 struct GNUNET_SCHEDULER_Task * ret;
966 fd_set rs; 966 fd_set rs;
967 fd_set ws; 967 fd_set ws;
968 fd_set es; 968 fd_set es;
@@ -975,9 +975,9 @@ server_schedule (struct HTTP_Server_Plugin *plugin,
975 struct GNUNET_TIME_Relative tv; 975 struct GNUNET_TIME_Relative tv;
976 976
977 if (GNUNET_YES == plugin->in_shutdown) 977 if (GNUNET_YES == plugin->in_shutdown)
978 return GNUNET_SCHEDULER_NO_TASK; 978 return NULL;
979 979
980 ret = GNUNET_SCHEDULER_NO_TASK; 980 ret = NULL;
981 FD_ZERO (&rs); 981 FD_ZERO (&rs);
982 FD_ZERO (&ws); 982 FD_ZERO (&ws);
983 FD_ZERO (&es); 983 FD_ZERO (&es);
@@ -1015,10 +1015,10 @@ server_schedule (struct HTTP_Server_Plugin *plugin,
1015 1015
1016 if (daemon_handle == plugin->server_v4) 1016 if (daemon_handle == plugin->server_v4)
1017 { 1017 {
1018 if (plugin->server_v4_task != GNUNET_SCHEDULER_NO_TASK) 1018 if (plugin->server_v4_task != NULL)
1019 { 1019 {
1020 GNUNET_SCHEDULER_cancel (plugin->server_v4_task); 1020 GNUNET_SCHEDULER_cancel (plugin->server_v4_task);
1021 plugin->server_v4_task = GNUNET_SCHEDULER_NO_TASK; 1021 plugin->server_v4_task = NULL;
1022 } 1022 }
1023#if 0 1023#if 0
1024 LOG (GNUNET_ERROR_TYPE_DEBUG, 1024 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1032,10 +1032,10 @@ server_schedule (struct HTTP_Server_Plugin *plugin,
1032 } 1032 }
1033 if (daemon_handle == plugin->server_v6) 1033 if (daemon_handle == plugin->server_v6)
1034 { 1034 {
1035 if (plugin->server_v6_task != GNUNET_SCHEDULER_NO_TASK) 1035 if (plugin->server_v6_task != NULL)
1036 { 1036 {
1037 GNUNET_SCHEDULER_cancel (plugin->server_v6_task); 1037 GNUNET_SCHEDULER_cancel (plugin->server_v6_task);
1038 plugin->server_v6_task = GNUNET_SCHEDULER_NO_TASK; 1038 plugin->server_v6_task = NULL;
1039 } 1039 }
1040#if 0 1040#if 0
1041 LOG (GNUNET_ERROR_TYPE_DEBUG, 1041 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1073,10 +1073,10 @@ server_reschedule (struct HTTP_Server_Plugin *plugin,
1073 if (GNUNET_YES == now) 1073 if (GNUNET_YES == now)
1074 plugin->server_v4_immediately = GNUNET_YES; 1074 plugin->server_v4_immediately = GNUNET_YES;
1075 1075
1076 if (plugin->server_v4_task != GNUNET_SCHEDULER_NO_TASK) 1076 if (plugin->server_v4_task != NULL)
1077 { 1077 {
1078 GNUNET_SCHEDULER_cancel (plugin->server_v4_task); 1078 GNUNET_SCHEDULER_cancel (plugin->server_v4_task);
1079 plugin->server_v4_task = GNUNET_SCHEDULER_NO_TASK; 1079 plugin->server_v4_task = NULL;
1080 } 1080 }
1081 plugin->server_v4_task = server_schedule (plugin, plugin->server_v4, now); 1081 plugin->server_v4_task = server_schedule (plugin, plugin->server_v4, now);
1082 } 1082 }
@@ -1089,10 +1089,10 @@ server_reschedule (struct HTTP_Server_Plugin *plugin,
1089 if (GNUNET_YES == now) 1089 if (GNUNET_YES == now)
1090 plugin->server_v6_immediately = GNUNET_YES; 1090 plugin->server_v6_immediately = GNUNET_YES;
1091 1091
1092 if (plugin->server_v6_task != GNUNET_SCHEDULER_NO_TASK) 1092 if (plugin->server_v6_task != NULL)
1093 { 1093 {
1094 GNUNET_SCHEDULER_cancel (plugin->server_v6_task); 1094 GNUNET_SCHEDULER_cancel (plugin->server_v6_task);
1095 plugin->server_v6_task = GNUNET_SCHEDULER_NO_TASK; 1095 plugin->server_v6_task = NULL;
1096 } 1096 }
1097 plugin->server_v6_task = server_schedule (plugin, plugin->server_v6, now); 1097 plugin->server_v6_task = server_schedule (plugin, plugin->server_v6, now);
1098 } 1098 }
@@ -1895,7 +1895,7 @@ server_access_cb (void *cls,
1895 s, sc, GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES)); 1895 s, sc, GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
1896 GNUNET_assert(s->server_recv->mhd_conn == mhd_connection); 1896 GNUNET_assert(s->server_recv->mhd_conn == mhd_connection);
1897 MHD_suspend_connection (s->server_recv->mhd_conn); 1897 MHD_suspend_connection (s->server_recv->mhd_conn);
1898 if (GNUNET_SCHEDULER_NO_TASK == s->recv_wakeup_task) 1898 if (NULL == s->recv_wakeup_task)
1899 s->recv_wakeup_task = GNUNET_SCHEDULER_add_delayed (delay, 1899 s->recv_wakeup_task = GNUNET_SCHEDULER_add_delayed (delay,
1900 &server_wake_up, s); 1900 &server_wake_up, s);
1901 } 1901 }
@@ -2881,7 +2881,7 @@ server_notify_external_hostname (void *cls,
2881 unsigned int urlen; 2881 unsigned int urlen;
2882 char *url; 2882 char *url;
2883 2883
2884 plugin->notify_ext_task = GNUNET_SCHEDULER_NO_TASK; 2884 plugin->notify_ext_task = NULL;
2885 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 2885 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
2886 return; 2886 return;
2887 2887
@@ -3175,10 +3175,10 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
3175 _("Shutting down plugin `%s'\n"), 3175 _("Shutting down plugin `%s'\n"),
3176 plugin->name); 3176 plugin->name);
3177 3177
3178 if (GNUNET_SCHEDULER_NO_TASK != plugin->notify_ext_task) 3178 if (NULL != plugin->notify_ext_task)
3179 { 3179 {
3180 GNUNET_SCHEDULER_cancel (plugin->notify_ext_task); 3180 GNUNET_SCHEDULER_cancel (plugin->notify_ext_task);
3181 plugin->notify_ext_task = GNUNET_SCHEDULER_NO_TASK; 3181 plugin->notify_ext_task = NULL;
3182 } 3182 }
3183 3183
3184 if (NULL != plugin->ext_addr) 3184 if (NULL != plugin->ext_addr)
@@ -3213,16 +3213,16 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
3213 MHD_stop_daemon (plugin->server_v6); 3213 MHD_stop_daemon (plugin->server_v6);
3214 plugin->server_v6 = NULL; 3214 plugin->server_v6 = NULL;
3215 } 3215 }
3216 if (GNUNET_SCHEDULER_NO_TASK != plugin->server_v4_task) 3216 if (NULL != plugin->server_v4_task)
3217 { 3217 {
3218 GNUNET_SCHEDULER_cancel (plugin->server_v4_task); 3218 GNUNET_SCHEDULER_cancel (plugin->server_v4_task);
3219 plugin->server_v4_task = GNUNET_SCHEDULER_NO_TASK; 3219 plugin->server_v4_task = NULL;
3220 } 3220 }
3221 3221
3222 if (GNUNET_SCHEDULER_NO_TASK != plugin->server_v6_task) 3222 if (NULL != plugin->server_v6_task)
3223 { 3223 {
3224 GNUNET_SCHEDULER_cancel (plugin->server_v6_task); 3224 GNUNET_SCHEDULER_cancel (plugin->server_v6_task);
3225 plugin->server_v6_task = GNUNET_SCHEDULER_NO_TASK; 3225 plugin->server_v6_task = NULL;
3226 } 3226 }
3227#if BUILD_HTTPS 3227#if BUILD_HTTPS
3228 GNUNET_free_non_null (plugin->crypto_init); 3228 GNUNET_free_non_null (plugin->crypto_init);
@@ -3309,7 +3309,7 @@ http_server_plugin_update_inbound_delay (void *cls,
3309 "New inbound delay %s\n", 3309 "New inbound delay %s\n",
3310 GNUNET_STRINGS_relative_time_to_string (delay, 3310 GNUNET_STRINGS_relative_time_to_string (delay,
3311 GNUNET_NO)); 3311 GNUNET_NO));
3312 if (GNUNET_SCHEDULER_NO_TASK != session->recv_wakeup_task) 3312 if (NULL != session->recv_wakeup_task)
3313 { 3313 {
3314 GNUNET_SCHEDULER_cancel (session->recv_wakeup_task); 3314 GNUNET_SCHEDULER_cancel (session->recv_wakeup_task);
3315 session->recv_wakeup_task 3315 session->recv_wakeup_task
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 021a647ad..4f7b57641 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -269,7 +269,7 @@ struct Session
269 /** 269 /**
270 * Task cleaning up a NAT client connection establishment attempt; 270 * Task cleaning up a NAT client connection establishment attempt;
271 */ 271 */
272 GNUNET_SCHEDULER_TaskIdentifier nat_connection_timeout; 272 struct GNUNET_SCHEDULER_Task * nat_connection_timeout;
273 273
274 /** 274 /**
275 * Messages currently pending for transmission 275 * Messages currently pending for transmission
@@ -296,12 +296,12 @@ struct Session
296 /** 296 /**
297 * ID of task used to delay receiving more to throttle sender. 297 * ID of task used to delay receiving more to throttle sender.
298 */ 298 */
299 GNUNET_SCHEDULER_TaskIdentifier receive_delay_task; 299 struct GNUNET_SCHEDULER_Task * receive_delay_task;
300 300
301 /** 301 /**
302 * Session timeout task 302 * Session timeout task
303 */ 303 */
304 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 304 struct GNUNET_SCHEDULER_Task * timeout_task;
305 305
306 /** 306 /**
307 * When will this session time out? 307 * When will this session time out?
@@ -435,7 +435,7 @@ struct Plugin
435 /** 435 /**
436 * ID of task used to update our addresses when one expires. 436 * ID of task used to update our addresses when one expires.
437 */ 437 */
438 GNUNET_SCHEDULER_TaskIdentifier address_update_task; 438 struct GNUNET_SCHEDULER_Task * address_update_task;
439 439
440 /** 440 /**
441 * Address options 441 * Address options
@@ -480,7 +480,7 @@ notify_session_monitor (struct Plugin *plugin,
480 : GNUNET_NO; 480 : GNUNET_NO;
481 info.num_msg_pending = session->msgs_in_queue; 481 info.num_msg_pending = session->msgs_in_queue;
482 info.num_bytes_pending = session->bytes_in_queue; 482 info.num_bytes_pending = session->bytes_in_queue;
483 if (GNUNET_SCHEDULER_NO_TASK != session->receive_delay_task) 483 if (NULL != session->receive_delay_task)
484 info.receive_delay = session->receive_delay; 484 info.receive_delay = session->receive_delay;
485 info.session_timeout = session->timeout; 485 info.session_timeout = session->timeout;
486 info.address = session->address; 486 info.address = session->address;
@@ -813,10 +813,10 @@ tcp_plugin_disconnect_session (void *cls,
813 session->address->address, 813 session->address->address,
814 session->address->address_length)); 814 session->address->address_length));
815 815
816 if (GNUNET_SCHEDULER_NO_TASK != session->timeout_task) 816 if (NULL != session->timeout_task)
817 { 817 {
818 GNUNET_SCHEDULER_cancel (session->timeout_task); 818 GNUNET_SCHEDULER_cancel (session->timeout_task);
819 session->timeout_task = GNUNET_SCHEDULER_NO_TASK; 819 session->timeout_task = NULL;
820 session->timeout = GNUNET_TIME_UNIT_ZERO_ABS; 820 session->timeout = GNUNET_TIME_UNIT_ZERO_ABS;
821 } 821 }
822 822
@@ -853,10 +853,10 @@ tcp_plugin_disconnect_session (void *cls,
853 session->address, 853 session->address,
854 session); 854 session);
855 855
856 if (GNUNET_SCHEDULER_NO_TASK != session->nat_connection_timeout) 856 if (NULL != session->nat_connection_timeout)
857 { 857 {
858 GNUNET_SCHEDULER_cancel (session->nat_connection_timeout); 858 GNUNET_SCHEDULER_cancel (session->nat_connection_timeout);
859 session->nat_connection_timeout = GNUNET_SCHEDULER_NO_TASK; 859 session->nat_connection_timeout = NULL;
860 } 860 }
861 861
862 while (NULL != (pm = session->pending_messages_head)) 862 while (NULL != (pm = session->pending_messages_head))
@@ -894,7 +894,7 @@ tcp_plugin_disconnect_session (void *cls,
894 session, 894 session,
895 GNUNET_TRANSPORT_SS_DONE); 895 GNUNET_TRANSPORT_SS_DONE);
896 896
897 if (session->receive_delay_task != GNUNET_SCHEDULER_NO_TASK) 897 if (session->receive_delay_task != NULL)
898 { 898 {
899 GNUNET_SCHEDULER_cancel (session->receive_delay_task); 899 GNUNET_SCHEDULER_cancel (session->receive_delay_task);
900 if (NULL != session->client) 900 if (NULL != session->client)
@@ -941,7 +941,7 @@ session_timeout (void *cls,
941 struct Session *s = cls; 941 struct Session *s = cls;
942 struct GNUNET_TIME_Relative left; 942 struct GNUNET_TIME_Relative left;
943 943
944 s->timeout_task = GNUNET_SCHEDULER_NO_TASK; 944 s->timeout_task = NULL;
945 left = GNUNET_TIME_absolute_get_remaining (s->timeout); 945 left = GNUNET_TIME_absolute_get_remaining (s->timeout);
946 if (0 != left.rel_value_us) 946 if (0 != left.rel_value_us)
947 { 947 {
@@ -973,7 +973,7 @@ session_timeout (void *cls,
973static void 973static void
974reschedule_session_timeout (struct Session *s) 974reschedule_session_timeout (struct Session *s)
975{ 975{
976 GNUNET_assert(GNUNET_SCHEDULER_NO_TASK != s->timeout_task); 976 GNUNET_assert(NULL != s->timeout_task);
977 s->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); 977 s->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
978} 978}
979 979
@@ -1417,7 +1417,7 @@ nat_connect_timeout (void *cls,
1417{ 1417{
1418 struct Session *session = cls; 1418 struct Session *session = cls;
1419 1419
1420 session->nat_connection_timeout = GNUNET_SCHEDULER_NO_TASK; 1420 session->nat_connection_timeout = NULL;
1421 LOG (GNUNET_ERROR_TYPE_DEBUG, 1421 LOG (GNUNET_ERROR_TYPE_DEBUG,
1422 "NAT WAIT connection to `%4s' at `%s' could not be established, removing session\n", 1422 "NAT WAIT connection to `%4s' at `%s' could not be established, removing session\n",
1423 GNUNET_i2s (&session->target), 1423 GNUNET_i2s (&session->target),
@@ -1460,7 +1460,7 @@ delayed_done (void *cls,
1460{ 1460{
1461 struct Session *session = cls; 1461 struct Session *session = cls;
1462 1462
1463 session->receive_delay_task = GNUNET_SCHEDULER_NO_TASK; 1463 session->receive_delay_task = NULL;
1464 reschedule_session_timeout (session); 1464 reschedule_session_timeout (session);
1465 1465
1466 GNUNET_SERVER_receive_done (session->client, GNUNET_OK); 1466 GNUNET_SERVER_receive_done (session->client, GNUNET_OK);
@@ -1483,7 +1483,7 @@ tcp_plugin_update_inbound_delay (void *cls,
1483 struct Session *session, 1483 struct Session *session,
1484 struct GNUNET_TIME_Relative delay) 1484 struct GNUNET_TIME_Relative delay)
1485{ 1485{
1486 if (GNUNET_SCHEDULER_NO_TASK == session->receive_delay_task) 1486 if (NULL == session->receive_delay_task)
1487 return; 1487 return;
1488 LOG (GNUNET_ERROR_TYPE_DEBUG, 1488 LOG (GNUNET_ERROR_TYPE_DEBUG,
1489 "New inbound delay %s\n", 1489 "New inbound delay %s\n",
@@ -1846,7 +1846,7 @@ struct PrettyPrinterContext
1846 /** 1846 /**
1847 * Timeout task 1847 * Timeout task
1848 */ 1848 */
1849 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 1849 struct GNUNET_SCHEDULER_Task * timeout_task;
1850 1850
1851 /** 1851 /**
1852 * Resolver handle 1852 * Resolver handle
@@ -2166,10 +2166,10 @@ handle_tcp_nat_probe (void *cls,
2166 LOG (GNUNET_ERROR_TYPE_DEBUG, 2166 LOG (GNUNET_ERROR_TYPE_DEBUG,
2167 "Found session for NAT probe!\n"); 2167 "Found session for NAT probe!\n");
2168 2168
2169 if (session->nat_connection_timeout != GNUNET_SCHEDULER_NO_TASK) 2169 if (session->nat_connection_timeout != NULL)
2170 { 2170 {
2171 GNUNET_SCHEDULER_cancel (session->nat_connection_timeout); 2171 GNUNET_SCHEDULER_cancel (session->nat_connection_timeout);
2172 session->nat_connection_timeout = GNUNET_SCHEDULER_NO_TASK; 2172 session->nat_connection_timeout = NULL;
2173 } 2173 }
2174 2174
2175 if (GNUNET_OK != GNUNET_SERVER_client_get_address (client, &vaddr, &alen)) 2175 if (GNUNET_OK != GNUNET_SERVER_client_get_address (client, &vaddr, &alen))
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 900cb1580..48535f28b 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -102,7 +102,7 @@ struct PrettyPrinterContext
102 /** 102 /**
103 * Timeout task 103 * Timeout task
104 */ 104 */
105 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 105 struct GNUNET_SCHEDULER_Task * timeout_task;
106 106
107 /** 107 /**
108 * IPv6 address 108 * IPv6 address
@@ -155,7 +155,7 @@ struct Session
155 /** 155 /**
156 * Session timeout task 156 * Session timeout task
157 */ 157 */
158 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 158 struct GNUNET_SCHEDULER_Task * timeout_task;
159 159
160 /** 160 /**
161 * When does this session time out? 161 * When does this session time out?
@@ -566,7 +566,7 @@ schedule_select (struct Plugin *plugin)
566 GNUNET_TIME_absolute_get_remaining ( 566 GNUNET_TIME_absolute_get_remaining (
567 udpw->session->flow_delay_from_other_peer)); 567 udpw->session->flow_delay_from_other_peer));
568 568
569 if (plugin->select_task != GNUNET_SCHEDULER_NO_TASK ) 569 if (plugin->select_task != NULL )
570 GNUNET_SCHEDULER_cancel (plugin->select_task); 570 GNUNET_SCHEDULER_cancel (plugin->select_task);
571 571
572 /* Schedule with: 572 /* Schedule with:
@@ -587,7 +587,7 @@ schedule_select (struct Plugin *plugin)
587 GNUNET_TIME_absolute_get_remaining ( 587 GNUNET_TIME_absolute_get_remaining (
588 udpw->session->flow_delay_from_other_peer)); 588 udpw->session->flow_delay_from_other_peer));
589 589
590 if (GNUNET_SCHEDULER_NO_TASK != plugin->select_task_v6) 590 if (NULL != plugin->select_task_v6)
591 GNUNET_SCHEDULER_cancel (plugin->select_task_v6); 591 GNUNET_SCHEDULER_cancel (plugin->select_task_v6);
592 plugin->select_task_v6 = GNUNET_SCHEDULER_add_select ( 592 plugin->select_task_v6 = GNUNET_SCHEDULER_add_select (
593 GNUNET_SCHEDULER_PRIORITY_DEFAULT, 593 GNUNET_SCHEDULER_PRIORITY_DEFAULT,
@@ -1332,10 +1332,10 @@ udp_disconnect_session (void *cls,
1332 GNUNET_i2s (&s->target), 1332 GNUNET_i2s (&s->target),
1333 udp_address_to_string (NULL, s->address->address, s->address->address_length)); 1333 udp_address_to_string (NULL, s->address->address, s->address->address_length));
1334 /* stop timeout task */ 1334 /* stop timeout task */
1335 if (GNUNET_SCHEDULER_NO_TASK != s->timeout_task) 1335 if (NULL != s->timeout_task)
1336 { 1336 {
1337 GNUNET_SCHEDULER_cancel (s->timeout_task); 1337 GNUNET_SCHEDULER_cancel (s->timeout_task);
1338 s->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1338 s->timeout_task = NULL;
1339 } 1339 }
1340 if (NULL != s->frag_ctx) 1340 if (NULL != s->frag_ctx)
1341 { 1341 {
@@ -1500,7 +1500,7 @@ session_timeout (void *cls,
1500 struct Plugin *plugin = s->plugin; 1500 struct Plugin *plugin = s->plugin;
1501 struct GNUNET_TIME_Relative left; 1501 struct GNUNET_TIME_Relative left;
1502 1502
1503 s->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1503 s->timeout_task = NULL;
1504 left = GNUNET_TIME_absolute_get_remaining (s->timeout); 1504 left = GNUNET_TIME_absolute_get_remaining (s->timeout);
1505 if (left.rel_value_us > 0) 1505 if (left.rel_value_us > 0)
1506 { 1506 {
@@ -1534,7 +1534,7 @@ reschedule_session_timeout (struct Session *s)
1534{ 1534{
1535 if (GNUNET_YES == s->in_destroy) 1535 if (GNUNET_YES == s->in_destroy)
1536 return; 1536 return;
1537 GNUNET_assert(GNUNET_SCHEDULER_NO_TASK != s->timeout_task); 1537 GNUNET_assert(NULL != s->timeout_task);
1538 s->timeout = GNUNET_TIME_relative_to_absolute (UDP_SESSION_TIME_OUT); 1538 s->timeout = GNUNET_TIME_relative_to_absolute (UDP_SESSION_TIME_OUT);
1539} 1539}
1540 1540
@@ -3027,7 +3027,7 @@ udp_plugin_select (void *cls,
3027{ 3027{
3028 struct Plugin *plugin = cls; 3028 struct Plugin *plugin = cls;
3029 3029
3030 plugin->select_task = GNUNET_SCHEDULER_NO_TASK; 3030 plugin->select_task = NULL;
3031 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 3031 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
3032 return; 3032 return;
3033 if ((0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 3033 if ((0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
@@ -3056,7 +3056,7 @@ udp_plugin_select_v6 (void *cls,
3056{ 3056{
3057 struct Plugin *plugin = cls; 3057 struct Plugin *plugin = cls;
3058 3058
3059 plugin->select_task_v6 = GNUNET_SCHEDULER_NO_TASK; 3059 plugin->select_task_v6 = NULL;
3060 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 3060 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
3061 return; 3061 return;
3062 if (((tc->reason & GNUNET_SCHEDULER_REASON_READ_READY) != 0) 3062 if (((tc->reason & GNUNET_SCHEDULER_REASON_READ_READY) != 0)
@@ -3610,15 +3610,15 @@ libgnunet_plugin_transport_udp_done (void *cls)
3610 return NULL; 3610 return NULL;
3611 } 3611 }
3612 stop_broadcast (plugin); 3612 stop_broadcast (plugin);
3613 if (plugin->select_task != GNUNET_SCHEDULER_NO_TASK ) 3613 if (plugin->select_task != NULL )
3614 { 3614 {
3615 GNUNET_SCHEDULER_cancel (plugin->select_task); 3615 GNUNET_SCHEDULER_cancel (plugin->select_task);
3616 plugin->select_task = GNUNET_SCHEDULER_NO_TASK; 3616 plugin->select_task = NULL;
3617 } 3617 }
3618 if (plugin->select_task_v6 != GNUNET_SCHEDULER_NO_TASK ) 3618 if (plugin->select_task_v6 != NULL )
3619 { 3619 {
3620 GNUNET_SCHEDULER_cancel (plugin->select_task_v6); 3620 GNUNET_SCHEDULER_cancel (plugin->select_task_v6);
3621 plugin->select_task_v6 = GNUNET_SCHEDULER_NO_TASK; 3621 plugin->select_task_v6 = NULL;
3622 } 3622 }
3623 3623
3624 /* Closing sockets */ 3624 /* Closing sockets */
diff --git a/src/transport/plugin_transport_udp.h b/src/transport/plugin_transport_udp.h
index 3770b3b70..2e77b9010 100644
--- a/src/transport/plugin_transport_udp.h
+++ b/src/transport/plugin_transport_udp.h
@@ -155,12 +155,12 @@ struct Plugin
155 /** 155 /**
156 * ID of select task for IPv4 156 * ID of select task for IPv4
157 */ 157 */
158 GNUNET_SCHEDULER_TaskIdentifier select_task; 158 struct GNUNET_SCHEDULER_Task * select_task;
159 159
160 /** 160 /**
161 * ID of select task for IPv6 161 * ID of select task for IPv6
162 */ 162 */
163 GNUNET_SCHEDULER_TaskIdentifier select_task_v6; 163 struct GNUNET_SCHEDULER_Task * select_task_v6;
164 164
165 /** 165 /**
166 * Tokenizer for inbound messages. 166 * Tokenizer for inbound messages.
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index 9ed1bff65..6566245cd 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -84,7 +84,7 @@ struct BroadcastAddress
84 /** 84 /**
85 * ID of select broadcast task 85 * ID of select broadcast task
86 */ 86 */
87 GNUNET_SCHEDULER_TaskIdentifier broadcast_task; 87 struct GNUNET_SCHEDULER_Task * broadcast_task;
88 88
89 struct Plugin *plugin; 89 struct Plugin *plugin;
90 90
@@ -302,7 +302,7 @@ udp_ipv4_broadcast_send (void *cls,
302 uint16_t msg_size; 302 uint16_t msg_size;
303 char buf[65536] GNUNET_ALIGN; 303 char buf[65536] GNUNET_ALIGN;
304 304
305 baddr->broadcast_task = GNUNET_SCHEDULER_NO_TASK; 305 baddr->broadcast_task = NULL;
306 306
307 msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf); 307 msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf);
308 if (0 != msg_size) 308 if (0 != msg_size)
@@ -379,7 +379,7 @@ udp_ipv6_broadcast_send (void *cls,
379 char buf[65536] GNUNET_ALIGN; 379 char buf[65536] GNUNET_ALIGN;
380 const struct sockaddr_in6 *s6 = (const struct sockaddr_in6 *) baddr->addr; 380 const struct sockaddr_in6 *s6 = (const struct sockaddr_in6 *) baddr->addr;
381 381
382 baddr->broadcast_task = GNUNET_SCHEDULER_NO_TASK; 382 baddr->broadcast_task = NULL;
383 383
384 msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf); 384 msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf);
385 /* Note: unclear if this actually works to limit the multicast to 385 /* Note: unclear if this actually works to limit the multicast to
@@ -651,10 +651,10 @@ stop_broadcast (struct Plugin *plugin)
651 { 651 {
652 struct BroadcastAddress *p = plugin->broadcast_head; 652 struct BroadcastAddress *p = plugin->broadcast_head;
653 653
654 if (p->broadcast_task != GNUNET_SCHEDULER_NO_TASK) 654 if (p->broadcast_task != NULL)
655 { 655 {
656 GNUNET_SCHEDULER_cancel (p->broadcast_task); 656 GNUNET_SCHEDULER_cancel (p->broadcast_task);
657 p->broadcast_task = GNUNET_SCHEDULER_NO_TASK; 657 p->broadcast_task = NULL;
658 } 658 }
659 if ((GNUNET_YES == plugin->enable_ipv6) && 659 if ((GNUNET_YES == plugin->enable_ipv6) &&
660 (NULL != plugin->sockv6) && 660 (NULL != plugin->sockv6) &&
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 7e2601aed..460869181 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -218,7 +218,7 @@ struct Session
218 /** 218 /**
219 * Session timeout task. 219 * Session timeout task.
220 */ 220 */
221 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 221 struct GNUNET_SCHEDULER_Task * timeout_task;
222 222
223 /** 223 /**
224 * Number of messages we currently have in our write queue. 224 * Number of messages we currently have in our write queue.
@@ -255,17 +255,17 @@ struct Plugin
255 /** 255 /**
256 * ID of task used to update our addresses when one expires. 256 * ID of task used to update our addresses when one expires.
257 */ 257 */
258 GNUNET_SCHEDULER_TaskIdentifier address_update_task; 258 struct GNUNET_SCHEDULER_Task * address_update_task;
259 259
260 /** 260 /**
261 * ID of read task 261 * ID of read task
262 */ 262 */
263 GNUNET_SCHEDULER_TaskIdentifier read_task; 263 struct GNUNET_SCHEDULER_Task * read_task;
264 264
265 /** 265 /**
266 * ID of write task 266 * ID of write task
267 */ 267 */
268 GNUNET_SCHEDULER_TaskIdentifier write_task; 268 struct GNUNET_SCHEDULER_Task * write_task;
269 269
270 /** 270 /**
271 * Number of bytes we currently have in our write queues. 271 * Number of bytes we currently have in our write queues.
@@ -482,10 +482,10 @@ unix_plugin_session_disconnect (void *cls,
482 "# UNIX sessions active", 482 "# UNIX sessions active",
483 GNUNET_CONTAINER_multipeermap_size (plugin->session_map), 483 GNUNET_CONTAINER_multipeermap_size (plugin->session_map),
484 GNUNET_NO); 484 GNUNET_NO);
485 if (GNUNET_SCHEDULER_NO_TASK != session->timeout_task) 485 if (NULL != session->timeout_task)
486 { 486 {
487 GNUNET_SCHEDULER_cancel (session->timeout_task); 487 GNUNET_SCHEDULER_cancel (session->timeout_task);
488 session->timeout_task = GNUNET_SCHEDULER_NO_TASK; 488 session->timeout_task = NULL;
489 session->timeout = GNUNET_TIME_UNIT_ZERO_ABS; 489 session->timeout = GNUNET_TIME_UNIT_ZERO_ABS;
490 } 490 }
491 notify_session_monitor (plugin, 491 notify_session_monitor (plugin,
@@ -512,7 +512,7 @@ session_timeout (void *cls,
512 struct Session *session = cls; 512 struct Session *session = cls;
513 struct GNUNET_TIME_Relative left; 513 struct GNUNET_TIME_Relative left;
514 514
515 session->timeout_task = GNUNET_SCHEDULER_NO_TASK; 515 session->timeout_task = NULL;
516 left = GNUNET_TIME_absolute_get_remaining (session->timeout); 516 left = GNUNET_TIME_absolute_get_remaining (session->timeout);
517 if (0 != left.rel_value_us) 517 if (0 != left.rel_value_us)
518 { 518 {
@@ -545,7 +545,7 @@ session_timeout (void *cls,
545static void 545static void
546reschedule_session_timeout (struct Session *session) 546reschedule_session_timeout (struct Session *session)
547{ 547{
548 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != session->timeout_task); 548 GNUNET_assert (NULL != session->timeout_task);
549 session->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); 549 session->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
550} 550}
551 551
@@ -1226,7 +1226,7 @@ unix_plugin_select_read (void *cls,
1226{ 1226{
1227 struct Plugin *plugin = cls; 1227 struct Plugin *plugin = cls;
1228 1228
1229 plugin->read_task = GNUNET_SCHEDULER_NO_TASK; 1229 plugin->read_task = NULL;
1230 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1230 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1231 return; 1231 return;
1232 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 1232 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
@@ -1251,7 +1251,7 @@ unix_plugin_select_write (void *cls,
1251{ 1251{
1252 struct Plugin *plugin = cls; 1252 struct Plugin *plugin = cls;
1253 1253
1254 plugin->write_task = GNUNET_SCHEDULER_NO_TASK; 1254 plugin->write_task = NULL;
1255 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1255 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1256 return; 1256 return;
1257 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_WRITE_READY)) 1257 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_WRITE_READY))
@@ -1358,7 +1358,7 @@ unix_plugin_send (void *cls,
1358 notify_session_monitor (plugin, 1358 notify_session_monitor (plugin,
1359 session, 1359 session,
1360 GNUNET_TRANSPORT_SS_UPDATE); 1360 GNUNET_TRANSPORT_SS_UPDATE);
1361 if (GNUNET_SCHEDULER_NO_TASK == plugin->write_task) 1361 if (NULL == plugin->write_task)
1362 plugin->write_task = 1362 plugin->write_task =
1363 GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL, 1363 GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
1364 plugin->unix_sock.desc, 1364 plugin->unix_sock.desc,
@@ -1629,7 +1629,7 @@ address_notification (void *cls,
1629 unix_path = (char *) &ua[1]; 1629 unix_path = (char *) &ua[1];
1630 memcpy (unix_path, plugin->unix_socket_path, strlen (plugin->unix_socket_path) + 1); 1630 memcpy (unix_path, plugin->unix_socket_path, strlen (plugin->unix_socket_path) + 1);
1631 1631
1632 plugin->address_update_task = GNUNET_SCHEDULER_NO_TASK; 1632 plugin->address_update_task = NULL;
1633 address = GNUNET_HELLO_address_allocate (plugin->env->my_identity, 1633 address = GNUNET_HELLO_address_allocate (plugin->env->my_identity,
1634 PLUGIN_NAME, 1634 PLUGIN_NAME,
1635 ua, 1635 ua,
@@ -1886,20 +1886,20 @@ libgnunet_plugin_transport_unix_done (void *cls)
1886 GNUNET_free (msgw); 1886 GNUNET_free (msgw);
1887 } 1887 }
1888 1888
1889 if (GNUNET_SCHEDULER_NO_TASK != plugin->read_task) 1889 if (NULL != plugin->read_task)
1890 { 1890 {
1891 GNUNET_SCHEDULER_cancel (plugin->read_task); 1891 GNUNET_SCHEDULER_cancel (plugin->read_task);
1892 plugin->read_task = GNUNET_SCHEDULER_NO_TASK; 1892 plugin->read_task = NULL;
1893 } 1893 }
1894 if (GNUNET_SCHEDULER_NO_TASK != plugin->write_task) 1894 if (NULL != plugin->write_task)
1895 { 1895 {
1896 GNUNET_SCHEDULER_cancel (plugin->write_task); 1896 GNUNET_SCHEDULER_cancel (plugin->write_task);
1897 plugin->write_task = GNUNET_SCHEDULER_NO_TASK; 1897 plugin->write_task = NULL;
1898 } 1898 }
1899 if (GNUNET_SCHEDULER_NO_TASK != plugin->address_update_task) 1899 if (NULL != plugin->address_update_task)
1900 { 1900 {
1901 GNUNET_SCHEDULER_cancel (plugin->address_update_task); 1901 GNUNET_SCHEDULER_cancel (plugin->address_update_task);
1902 plugin->address_update_task = GNUNET_SCHEDULER_NO_TASK; 1902 plugin->address_update_task = NULL;
1903 } 1903 }
1904 if (NULL != plugin->unix_sock.desc) 1904 if (NULL != plugin->unix_sock.desc)
1905 { 1905 {
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c
index ab9fa4a74..b0be34346 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -204,7 +204,7 @@ struct PendingMessage
204 /** 204 /**
205 * Timeout task (for this message). 205 * Timeout task (for this message).
206 */ 206 */
207 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 207 struct GNUNET_SCHEDULER_Task * timeout_task;
208 208
209}; 209};
210 210
@@ -250,7 +250,7 @@ struct Session
250 /** 250 /**
251 * Timeout task (for the session). 251 * Timeout task (for the session).
252 */ 252 */
253 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 253 struct GNUNET_SCHEDULER_Task * timeout_task;
254 254
255}; 255};
256 256
@@ -300,7 +300,7 @@ struct FragmentMessage
300 /** 300 /**
301 * Timeout task. 301 * Timeout task.
302 */ 302 */
303 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 303 struct GNUNET_SCHEDULER_Task * timeout_task;
304 304
305 /** 305 /**
306 * Continuation to call when we're done with this message. 306 * Continuation to call when we're done with this message.
@@ -379,7 +379,7 @@ struct MacEndpoint
379 /** 379 /**
380 * Timeout task. 380 * Timeout task.
381 */ 381 */
382 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 382 struct GNUNET_SCHEDULER_Task * timeout_task;
383 383
384 /** 384 /**
385 * count of messages in the fragment out queue for this mac endpoint 385 * count of messages in the fragment out queue for this mac endpoint
@@ -484,7 +484,7 @@ struct Plugin
484 /** 484 /**
485 * Task that periodically sends a HELLO beacon via the helper. 485 * Task that periodically sends a HELLO beacon via the helper.
486 */ 486 */
487 GNUNET_SCHEDULER_TaskIdentifier beacon_task; 487 struct GNUNET_SCHEDULER_Task * beacon_task;
488 488
489 /** 489 /**
490 * Tracker for bandwidth limit 490 * Tracker for bandwidth limit
@@ -777,10 +777,10 @@ wlan_plugin_disconnect_session (void *cls,
777 GNUNET_CONTAINER_DLL_remove (endpoint->sessions_head, 777 GNUNET_CONTAINER_DLL_remove (endpoint->sessions_head,
778 endpoint->sessions_tail, 778 endpoint->sessions_tail,
779 session); 779 session);
780 if (session->timeout_task != GNUNET_SCHEDULER_NO_TASK) 780 if (session->timeout_task != NULL)
781 { 781 {
782 GNUNET_SCHEDULER_cancel (session->timeout_task); 782 GNUNET_SCHEDULER_cancel (session->timeout_task);
783 session->timeout_task = GNUNET_SCHEDULER_NO_TASK; 783 session->timeout_task = NULL;
784 } 784 }
785 GNUNET_STATISTICS_update (plugin->env->stats, 785 GNUNET_STATISTICS_update (plugin->env->stats,
786 _("# Sessions allocated"), 786 _("# Sessions allocated"),
@@ -820,7 +820,7 @@ session_timeout (void *cls,
820 struct Session *session = cls; 820 struct Session *session = cls;
821 struct GNUNET_TIME_Relative left; 821 struct GNUNET_TIME_Relative left;
822 822
823 session->timeout_task = GNUNET_SCHEDULER_NO_TASK; 823 session->timeout_task = NULL;
824 left = GNUNET_TIME_absolute_get_remaining (session->timeout); 824 left = GNUNET_TIME_absolute_get_remaining (session->timeout);
825 if (0 != left.rel_value_us) 825 if (0 != left.rel_value_us)
826 { 826 {
@@ -1025,10 +1025,10 @@ free_fragment_message (struct FragmentMessage *fm)
1025 GNUNET_FRAGMENT_context_destroy (fm->fragcontext, 1025 GNUNET_FRAGMENT_context_destroy (fm->fragcontext,
1026 &endpoint->msg_delay, 1026 &endpoint->msg_delay,
1027 &endpoint->ack_delay); 1027 &endpoint->ack_delay);
1028 if (fm->timeout_task != GNUNET_SCHEDULER_NO_TASK) 1028 if (fm->timeout_task != NULL)
1029 { 1029 {
1030 GNUNET_SCHEDULER_cancel (fm->timeout_task); 1030 GNUNET_SCHEDULER_cancel (fm->timeout_task);
1031 fm->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1031 fm->timeout_task = NULL;
1032 } 1032 }
1033 GNUNET_free (fm); 1033 GNUNET_free (fm);
1034} 1034}
@@ -1046,7 +1046,7 @@ fragmentmessage_timeout (void *cls,
1046{ 1046{
1047 struct FragmentMessage *fm = cls; 1047 struct FragmentMessage *fm = cls;
1048 1048
1049 fm->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1049 fm->timeout_task = NULL;
1050 if (NULL != fm->cont) 1050 if (NULL != fm->cont)
1051 { 1051 {
1052 fm->cont (fm->cont_cls, 1052 fm->cont (fm->cont_cls,
@@ -1145,10 +1145,10 @@ free_macendpoint (struct MacEndpoint *endpoint)
1145 } 1145 }
1146 1146
1147 plugin->mac_count--; 1147 plugin->mac_count--;
1148 if (GNUNET_SCHEDULER_NO_TASK != endpoint->timeout_task) 1148 if (NULL != endpoint->timeout_task)
1149 { 1149 {
1150 GNUNET_SCHEDULER_cancel (endpoint->timeout_task); 1150 GNUNET_SCHEDULER_cancel (endpoint->timeout_task);
1151 endpoint->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1151 endpoint->timeout_task = NULL;
1152 } 1152 }
1153 GNUNET_free (endpoint); 1153 GNUNET_free (endpoint);
1154} 1154}
@@ -1167,7 +1167,7 @@ macendpoint_timeout (void *cls,
1167 struct MacEndpoint *endpoint = cls; 1167 struct MacEndpoint *endpoint = cls;
1168 struct GNUNET_TIME_Relative timeout; 1168 struct GNUNET_TIME_Relative timeout;
1169 1169
1170 endpoint->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1170 endpoint->timeout_task = NULL;
1171 timeout = GNUNET_TIME_absolute_get_remaining (endpoint->timeout); 1171 timeout = GNUNET_TIME_absolute_get_remaining (endpoint->timeout);
1172 if (0 == timeout.rel_value_us) 1172 if (0 == timeout.rel_value_us)
1173 { 1173 {
@@ -1923,10 +1923,10 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
1923 GNUNET_HELLO_address_free (address); 1923 GNUNET_HELLO_address_free (address);
1924 } 1924 }
1925 1925
1926 if (GNUNET_SCHEDULER_NO_TASK != plugin->beacon_task) 1926 if (NULL != plugin->beacon_task)
1927 { 1927 {
1928 GNUNET_SCHEDULER_cancel (plugin->beacon_task); 1928 GNUNET_SCHEDULER_cancel (plugin->beacon_task);
1929 plugin->beacon_task = GNUNET_SCHEDULER_NO_TASK; 1929 plugin->beacon_task = NULL;
1930 } 1930 }
1931 if (NULL != plugin->suid_helper) 1931 if (NULL != plugin->suid_helper)
1932 { 1932 {
@@ -2077,7 +2077,7 @@ wlan_plugin_update_session_timeout (void *cls,
2077 const struct GNUNET_PeerIdentity *peer, 2077 const struct GNUNET_PeerIdentity *peer,
2078 struct Session *session) 2078 struct Session *session)
2079{ 2079{
2080 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != session->timeout_task); 2080 GNUNET_assert (NULL != session->timeout_task);
2081 session->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT); 2081 session->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
2082} 2082}
2083 2083
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c
index 83ff7f1c4..e9942cff9 100644
--- a/src/transport/test_plugin_transport.c
+++ b/src/transport/test_plugin_transport.c
@@ -89,12 +89,12 @@ struct GNUNET_HELPER_Handle *suid_helper;
89/** 89/**
90 * Timeout task 90 * Timeout task
91 */ 91 */
92static GNUNET_SCHEDULER_TaskIdentifier timeout_endbadly; 92static struct GNUNET_SCHEDULER_Task * timeout_endbadly;
93 93
94/** 94/**
95 * Timeout task 95 * Timeout task
96 */ 96 */
97static GNUNET_SCHEDULER_TaskIdentifier timeout_wait; 97static struct GNUNET_SCHEDULER_Task * timeout_wait;
98 98
99/** 99/**
100 * Library name 100 * Library name
@@ -138,10 +138,10 @@ end ()
138 int c = 0; 138 int c = 0;
139 ok = 0; 139 ok = 0;
140 140
141 if (GNUNET_SCHEDULER_NO_TASK != timeout_endbadly) 141 if (NULL != timeout_endbadly)
142 { 142 {
143 GNUNET_SCHEDULER_cancel (timeout_endbadly); 143 GNUNET_SCHEDULER_cancel (timeout_endbadly);
144 timeout_endbadly = GNUNET_SCHEDULER_NO_TASK; 144 timeout_endbadly = NULL;
145 } 145 }
146 if (NULL != api) 146 if (NULL != api)
147 GNUNET_PLUGIN_unload (libname, api); 147 GNUNET_PLUGIN_unload (libname, api);
@@ -183,11 +183,11 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
183 struct AddressWrapper *w; 183 struct AddressWrapper *w;
184 int c = 0; 184 int c = 0;
185 185
186 timeout_endbadly = GNUNET_SCHEDULER_NO_TASK; 186 timeout_endbadly = NULL;
187 if (GNUNET_SCHEDULER_NO_TASK != timeout_wait) 187 if (NULL != timeout_wait)
188 { 188 {
189 GNUNET_SCHEDULER_cancel (timeout_wait); 189 GNUNET_SCHEDULER_cancel (timeout_wait);
190 timeout_wait = GNUNET_SCHEDULER_NO_TASK; 190 timeout_wait = NULL;
191 } 191 }
192 192
193 if (pretty_printers_running > 0) 193 if (pretty_printers_running > 0)
@@ -249,7 +249,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
249static void 249static void
250wait_end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 250wait_end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
251{ 251{
252 timeout_wait = GNUNET_SCHEDULER_NO_TASK; 252 timeout_wait = NULL;
253 if (0 == addresses_reported) 253 if (0 == addresses_reported)
254 GNUNET_log(GNUNET_ERROR_TYPE_WARNING, 254 GNUNET_log(GNUNET_ERROR_TYPE_WARNING,
255 "Plugin did not report any addresses, could not check address conversion functions\n"); 255 "Plugin did not report any addresses, could not check address conversion functions\n");
@@ -260,15 +260,15 @@ wait_end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
260static void 260static void
261end_badly_now () 261end_badly_now ()
262{ 262{
263 if (GNUNET_SCHEDULER_NO_TASK != timeout_wait) 263 if (NULL != timeout_wait)
264 { 264 {
265 GNUNET_SCHEDULER_cancel (timeout_wait); 265 GNUNET_SCHEDULER_cancel (timeout_wait);
266 timeout_wait = GNUNET_SCHEDULER_NO_TASK; 266 timeout_wait = NULL;
267 } 267 }
268 if (GNUNET_SCHEDULER_NO_TASK != timeout_endbadly) 268 if (NULL != timeout_endbadly)
269 { 269 {
270 GNUNET_SCHEDULER_cancel (timeout_endbadly); 270 GNUNET_SCHEDULER_cancel (timeout_endbadly);
271 timeout_endbadly = GNUNET_SCHEDULER_NO_TASK; 271 timeout_endbadly = NULL;
272 } 272 }
273 timeout_endbadly = GNUNET_SCHEDULER_add_now (&end_badly, NULL ); 273 timeout_endbadly = GNUNET_SCHEDULER_add_now (&end_badly, NULL );
274} 274}
@@ -418,10 +418,10 @@ env_notify_address (void *cls,
418 end_badly_now (); 418 end_badly_now ();
419 return; 419 return;
420 } 420 }
421 if (GNUNET_SCHEDULER_NO_TASK != timeout_wait) 421 if (NULL != timeout_wait)
422 { 422 {
423 GNUNET_SCHEDULER_cancel (timeout_wait); 423 GNUNET_SCHEDULER_cancel (timeout_wait);
424 timeout_wait = GNUNET_SCHEDULER_NO_TASK; 424 timeout_wait = NULL;
425 } 425 }
426 426
427 timeout_wait = GNUNET_SCHEDULER_add_delayed (WAIT, &wait_end, NULL ); 427 timeout_wait = GNUNET_SCHEDULER_add_delayed (WAIT, &wait_end, NULL );
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index ac43b8d05..250d3279f 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -47,9 +47,9 @@ static char *test_plugin;
47 47
48static char *test_name; 48static char *test_name;
49 49
50static GNUNET_SCHEDULER_TaskIdentifier die_task; 50static struct GNUNET_SCHEDULER_Task * die_task;
51 51
52static GNUNET_SCHEDULER_TaskIdentifier measure_task; 52static struct GNUNET_SCHEDULER_Task * measure_task;
53 53
54struct PeerContext *p1; 54struct PeerContext *p1;
55 55
@@ -153,7 +153,7 @@ end ()
153 datarate, quota_out_p1, quota_in_p2); 153 datarate, quota_out_p1, quota_in_p2);
154 } 154 }
155 155
156 if (die_task != GNUNET_SCHEDULER_NO_TASK) 156 if (die_task != NULL)
157 GNUNET_SCHEDULER_cancel (die_task); 157 GNUNET_SCHEDULER_cancel (die_task);
158 158
159 if (th != NULL) 159 if (th != NULL)
@@ -171,10 +171,10 @@ end ()
171static void 171static void
172end_badly () 172end_badly ()
173{ 173{
174 die_task = GNUNET_SCHEDULER_NO_TASK; 174 die_task = NULL;
175 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 175 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
176 176
177 if (measure_task != GNUNET_SCHEDULER_NO_TASK) 177 if (measure_task != NULL)
178 GNUNET_SCHEDULER_cancel (measure_task); 178 GNUNET_SCHEDULER_cancel (measure_task);
179 179
180 if (test_connected == GNUNET_YES) 180 if (test_connected == GNUNET_YES)
@@ -244,7 +244,7 @@ notify_ready (void *cls, size_t size, void *buf)
244 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 244 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
245 "Timeout occurred while waiting for transmit_ready for message %u of %u\n", 245 "Timeout occurred while waiting for transmit_ready for message %u of %u\n",
246 msg_scheduled, TOTAL_MSGS); 246 msg_scheduled, TOTAL_MSGS);
247 if (GNUNET_SCHEDULER_NO_TASK != die_task) 247 if (NULL != die_task)
248 GNUNET_SCHEDULER_cancel (die_task); 248 GNUNET_SCHEDULER_cancel (die_task);
249 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 249 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
250 test_failed = 1; 250 test_failed = 1;
@@ -348,7 +348,7 @@ measure (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
348{ 348{
349 static int counter; 349 static int counter;
350 350
351 measure_task = GNUNET_SCHEDULER_NO_TASK; 351 measure_task = NULL;
352 352
353 counter++; 353 counter++;
354 if ((DURATION.rel_value_us / 1000 / 1000LL) < counter) 354 if ((DURATION.rel_value_us / 1000 / 1000LL) < counter)
@@ -472,7 +472,7 @@ run_measurement (unsigned long long p1_quota_in,
472 if ((p1 == NULL) || (p2 == NULL)) 472 if ((p1 == NULL) || (p2 == NULL))
473 { 473 {
474 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 474 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
475 if (die_task != GNUNET_SCHEDULER_NO_TASK) 475 if (die_task != NULL)
476 GNUNET_SCHEDULER_cancel (die_task); 476 GNUNET_SCHEDULER_cancel (die_task);
477 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 477 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
478 return; 478 return;
diff --git a/src/transport/test_transport_address_switch.c b/src/transport/test_transport_address_switch.c
index fcbd798d0..10815c7ab 100644
--- a/src/transport/test_transport_address_switch.c
+++ b/src/transport/test_transport_address_switch.c
@@ -67,11 +67,11 @@ GNUNET_NETWORK_STRUCT_END
67#define DURATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 67#define DURATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
68#define DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) 68#define DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
69 69
70static GNUNET_SCHEDULER_TaskIdentifier die_task; 70static struct GNUNET_SCHEDULER_Task * die_task;
71 71
72static GNUNET_SCHEDULER_TaskIdentifier delayed_end_task; 72static struct GNUNET_SCHEDULER_Task * delayed_end_task;
73 73
74static GNUNET_SCHEDULER_TaskIdentifier measure_task; 74static struct GNUNET_SCHEDULER_Task * measure_task;
75 75
76struct PeerContext *p1; 76struct PeerContext *p1;
77char *cfg_file_p1; 77char *cfg_file_p1;
@@ -142,7 +142,7 @@ stat_start_attempt_cb (void *cls, const char *subsystem, const char *name,
142 else 142 else
143 return GNUNET_OK; 143 return GNUNET_OK;
144 144
145 if (GNUNET_SCHEDULER_NO_TASK == delayed_end_task) 145 if (NULL == delayed_end_task)
146 delayed_end_task = GNUNET_SCHEDULER_add_delayed (DELAY, &end, NULL ); 146 delayed_end_task = GNUNET_SCHEDULER_add_delayed (DELAY, &end, NULL );
147 return GNUNET_OK; 147 return GNUNET_OK;
148} 148}
@@ -207,22 +207,22 @@ stat_addresses_available (void *cls, const char *subsystem, const char *name,
207static void 207static void
208clean_up () 208clean_up ()
209{ 209{
210 if (measure_task != GNUNET_SCHEDULER_NO_TASK ) 210 if (measure_task != NULL )
211 { 211 {
212 GNUNET_SCHEDULER_cancel (measure_task); 212 GNUNET_SCHEDULER_cancel (measure_task);
213 measure_task = GNUNET_SCHEDULER_NO_TASK; 213 measure_task = NULL;
214 } 214 }
215 215
216 if (delayed_end_task != GNUNET_SCHEDULER_NO_TASK ) 216 if (delayed_end_task != NULL )
217 { 217 {
218 GNUNET_SCHEDULER_cancel (delayed_end_task); 218 GNUNET_SCHEDULER_cancel (delayed_end_task);
219 delayed_end_task = GNUNET_SCHEDULER_NO_TASK; 219 delayed_end_task = NULL;
220 } 220 }
221 221
222 if (die_task != GNUNET_SCHEDULER_NO_TASK ) 222 if (die_task != NULL )
223 { 223 {
224 GNUNET_SCHEDULER_cancel (die_task); 224 GNUNET_SCHEDULER_cancel (die_task);
225 die_task = GNUNET_SCHEDULER_NO_TASK; 225 die_task = NULL;
226 } 226 }
227 227
228 if (NULL != p1_stat) 228 if (NULL != p1_stat)
@@ -270,10 +270,10 @@ clean_up ()
270 p2_stat = NULL; 270 p2_stat = NULL;
271 } 271 }
272 272
273 if (die_task != GNUNET_SCHEDULER_NO_TASK ) 273 if (die_task != NULL )
274 { 274 {
275 GNUNET_SCHEDULER_cancel (die_task); 275 GNUNET_SCHEDULER_cancel (die_task);
276 die_task = GNUNET_SCHEDULER_NO_TASK; 276 die_task = NULL;
277 } 277 }
278 278
279 if (th != NULL ) 279 if (th != NULL )
@@ -308,7 +308,7 @@ end ()
308 int result = 0; 308 int result = 0;
309 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 309 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
310 310
311 delayed_end_task = GNUNET_SCHEDULER_NO_TASK; 311 delayed_end_task = NULL;
312 FPRINTF (stderr, "\n"); 312 FPRINTF (stderr, "\n");
313 if (p1_switch_attempts > 0) 313 if (p1_switch_attempts > 0)
314 { 314 {
@@ -365,7 +365,7 @@ end ()
365static void 365static void
366end_badly () 366end_badly ()
367{ 367{
368 die_task = GNUNET_SCHEDULER_NO_TASK; 368 die_task = NULL;
369 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 369 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
370 370
371 FPRINTF (stderr, "Peer 1 had %u addresses available, but did not try to switch\n", 371 FPRINTF (stderr, "Peer 1 had %u addresses available, but did not try to switch\n",
@@ -432,7 +432,7 @@ notify_ready (void *cls, size_t size, void *buf)
432 { 432 {
433 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, 433 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
434 "Timeout occurred while waiting for transmit_ready for message\n"); 434 "Timeout occurred while waiting for transmit_ready for message\n");
435 if (GNUNET_SCHEDULER_NO_TASK != die_task) 435 if (NULL != die_task)
436 GNUNET_SCHEDULER_cancel (die_task); 436 GNUNET_SCHEDULER_cancel (die_task);
437 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL ); 437 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL );
438 res = 1; 438 res = 1;
@@ -534,7 +534,7 @@ measure (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
534{ 534{
535 static int counter; 535 static int counter;
536 536
537 measure_task = GNUNET_SCHEDULER_NO_TASK; 537 measure_task = NULL;
538 538
539 counter++; 539 counter++;
540 if ((DURATION.rel_value_us / 1000 / 1000LL) < counter) 540 if ((DURATION.rel_value_us / 1000 / 1000LL) < counter)
@@ -608,7 +608,7 @@ run (void *cls, char * const *args, const char *cfgfile,
608 if ((p1 == NULL )|| (p2 == NULL)) 608 if ((p1 == NULL )|| (p2 == NULL))
609 { 609 {
610 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 610 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
611 if (die_task != GNUNET_SCHEDULER_NO_TASK) 611 if (die_task != NULL)
612 GNUNET_SCHEDULER_cancel (die_task); 612 GNUNET_SCHEDULER_cancel (die_task);
613 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 613 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
614 return; 614 return;
@@ -657,7 +657,7 @@ run (void *cls, char * const *args, const char *cfgfile,
657 if ((p1_stat == NULL )|| (p2_stat == NULL)) 657 if ((p1_stat == NULL )|| (p2_stat == NULL))
658 { 658 {
659 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not create statistics for peers!\n"); 659 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not create statistics for peers!\n");
660 if (die_task != GNUNET_SCHEDULER_NO_TASK) 660 if (die_task != NULL)
661 GNUNET_SCHEDULER_cancel (die_task); 661 GNUNET_SCHEDULER_cancel (die_task);
662 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 662 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
663 return; 663 return;
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c
index 4456c1dbf..ce6db8ad1 100644
--- a/src/transport/test_transport_api.c
+++ b/src/transport/test_transport_api.c
@@ -58,9 +58,9 @@ static int s_connected;
58 58
59static int s_sending; 59static int s_sending;
60 60
61static GNUNET_SCHEDULER_TaskIdentifier die_task; 61static struct GNUNET_SCHEDULER_Task * die_task;
62 62
63static GNUNET_SCHEDULER_TaskIdentifier send_task; 63static struct GNUNET_SCHEDULER_Task * send_task;
64 64
65static struct PeerContext *p1; 65static struct PeerContext *p1;
66 66
@@ -82,10 +82,10 @@ end ()
82{ 82{
83 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stopping peers\n"); 83 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stopping peers\n");
84 84
85 if (send_task != GNUNET_SCHEDULER_NO_TASK) 85 if (send_task != NULL)
86 GNUNET_SCHEDULER_cancel (send_task); 86 GNUNET_SCHEDULER_cancel (send_task);
87 87
88 if (die_task != GNUNET_SCHEDULER_NO_TASK) 88 if (die_task != NULL)
89 GNUNET_SCHEDULER_cancel (die_task); 89 GNUNET_SCHEDULER_cancel (die_task);
90 90
91 if (th != NULL) 91 if (th != NULL)
@@ -99,12 +99,12 @@ end ()
99static void 99static void
100end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 100end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
101{ 101{
102 die_task = GNUNET_SCHEDULER_NO_TASK; 102 die_task = NULL;
103 103
104 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fail! Stopping peers\n"); 104 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fail! Stopping peers\n");
105 105
106 106
107 if (send_task != GNUNET_SCHEDULER_NO_TASK) 107 if (send_task != NULL)
108 GNUNET_SCHEDULER_cancel (send_task); 108 GNUNET_SCHEDULER_cancel (send_task);
109 109
110 if (cc != NULL) 110 if (cc != NULL)
@@ -197,7 +197,7 @@ notify_ready (void *cls, size_t size, void *buf)
197 { 197 {
198 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 198 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
199 "Timeout occurred while waiting for transmit_ready\n"); 199 "Timeout occurred while waiting for transmit_ready\n");
200 if (GNUNET_SCHEDULER_NO_TASK != die_task) 200 if (NULL != die_task)
201 GNUNET_SCHEDULER_cancel (die_task); 201 GNUNET_SCHEDULER_cancel (die_task);
202 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 202 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
203 ok = 42; 203 ok = 42;
@@ -227,7 +227,7 @@ notify_ready (void *cls, size_t size, void *buf)
227static void 227static void
228sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 228sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
229{ 229{
230 send_task = GNUNET_SCHEDULER_NO_TASK; 230 send_task = NULL;
231 231
232 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 232 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
233 return; 233 return;
@@ -351,7 +351,7 @@ run (void *cls, char *const *args, const char *cfgfile,
351 if ((p1 == NULL) || (p2 == NULL)) 351 if ((p1 == NULL) || (p2 == NULL))
352 { 352 {
353 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 353 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
354 if (die_task != GNUNET_SCHEDULER_NO_TASK) 354 if (die_task != NULL)
355 GNUNET_SCHEDULER_cancel (die_task); 355 GNUNET_SCHEDULER_cancel (die_task);
356 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 356 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
357 return; 357 return;
@@ -371,7 +371,7 @@ check ()
371 GNUNET_GETOPT_OPTION_END 371 GNUNET_GETOPT_OPTION_END
372 }; 372 };
373 373
374 send_task = GNUNET_SCHEDULER_NO_TASK; 374 send_task = NULL;
375 375
376 ok = 1; 376 ok = 1;
377 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name, 377 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_bidirectional_connect.c b/src/transport/test_transport_api_bidirectional_connect.c
index 64f39a4d8..032bf2b6e 100644
--- a/src/transport/test_transport_api_bidirectional_connect.c
+++ b/src/transport/test_transport_api_bidirectional_connect.c
@@ -49,9 +49,9 @@ static char *test_name;
49 49
50static int ok; 50static int ok;
51 51
52static GNUNET_SCHEDULER_TaskIdentifier die_task; 52static struct GNUNET_SCHEDULER_Task * die_task;
53 53
54static GNUNET_SCHEDULER_TaskIdentifier send_task; 54static struct GNUNET_SCHEDULER_Task * send_task;
55 55
56static struct PeerContext *p1; 56static struct PeerContext *p1;
57 57
@@ -74,13 +74,13 @@ end ()
74{ 74{
75 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 75 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
76 76
77 if (send_task != GNUNET_SCHEDULER_NO_TASK) 77 if (send_task != NULL)
78 { 78 {
79 GNUNET_SCHEDULER_cancel (send_task); 79 GNUNET_SCHEDULER_cancel (send_task);
80 send_task = GNUNET_SCHEDULER_NO_TASK; 80 send_task = NULL;
81 } 81 }
82 82
83 if (die_task != GNUNET_SCHEDULER_NO_TASK) 83 if (die_task != NULL)
84 GNUNET_SCHEDULER_cancel (die_task); 84 GNUNET_SCHEDULER_cancel (die_task);
85 85
86 if (NULL != th) 86 if (NULL != th)
@@ -97,12 +97,12 @@ end ()
97static void 97static void
98end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 98end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
99{ 99{
100 die_task = GNUNET_SCHEDULER_NO_TASK; 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");
102 if (send_task != GNUNET_SCHEDULER_NO_TASK) 102 if (send_task != NULL)
103 { 103 {
104 GNUNET_SCHEDULER_cancel (send_task); 104 GNUNET_SCHEDULER_cancel (send_task);
105 send_task = GNUNET_SCHEDULER_NO_TASK; 105 send_task = NULL;
106 } 106 }
107 107
108 if (NULL != cc2) 108 if (NULL != cc2)
@@ -177,7 +177,7 @@ notify_ready (void *cls, size_t size, void *buf)
177 { 177 {
178 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 178 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
179 "Timeout occurred while waiting for transmit_ready\n"); 179 "Timeout occurred while waiting for transmit_ready\n");
180 if (GNUNET_SCHEDULER_NO_TASK != die_task) 180 if (NULL != die_task)
181 GNUNET_SCHEDULER_cancel (die_task); 181 GNUNET_SCHEDULER_cancel (die_task);
182 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 182 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
183 ok = 42; 183 ok = 42;
@@ -206,7 +206,7 @@ notify_ready (void *cls, size_t size, void *buf)
206static void 206static void
207sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 207sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
208{ 208{
209 send_task = GNUNET_SCHEDULER_NO_TASK; 209 send_task = NULL;
210 210
211 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 211 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
212 return; 212 return;
@@ -260,11 +260,11 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
260 GNUNET_i2s (peer)); 260 GNUNET_i2s (peer));
261 GNUNET_free (ps); 261 GNUNET_free (ps);
262 262
263 if (GNUNET_SCHEDULER_NO_TASK != send_task) 263 if (NULL != send_task)
264 { 264 {
265 GNUNET_SCHEDULER_cancel(send_task); 265 GNUNET_SCHEDULER_cancel(send_task);
266 GNUNET_break (0); 266 GNUNET_break (0);
267 send_task = GNUNET_SCHEDULER_NO_TASK; 267 send_task = NULL;
268 } 268 }
269 if (NULL != th) 269 if (NULL != th)
270 { 270 {
@@ -350,7 +350,7 @@ run (void *cls, char *const *args, const char *cfgfile,
350 if ((p1 == NULL) || (p2 == NULL)) 350 if ((p1 == NULL) || (p2 == NULL))
351 { 351 {
352 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 352 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
353 if (die_task != GNUNET_SCHEDULER_NO_TASK) 353 if (die_task != NULL)
354 GNUNET_SCHEDULER_cancel (die_task); 354 GNUNET_SCHEDULER_cancel (die_task);
355 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 355 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
356 return; 356 return;
@@ -373,7 +373,7 @@ check ()
373#if WRITECONFIG 373#if WRITECONFIG
374 setTransportOptions ("test_transport_api_data.conf"); 374 setTransportOptions ("test_transport_api_data.conf");
375#endif 375#endif
376 send_task = GNUNET_SCHEDULER_NO_TASK; 376 send_task = NULL;
377 377
378 ok = 1; 378 ok = 1;
379 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name, 379 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_blacklisting.c b/src/transport/test_transport_api_blacklisting.c
index 2c3ab125a..09a12cef8 100644
--- a/src/transport/test_transport_api_blacklisting.c
+++ b/src/transport/test_transport_api_blacklisting.c
@@ -62,11 +62,11 @@ static struct GNUNET_TRANSPORT_Blacklist * blacklist_p1;
62 62
63static struct GNUNET_TRANSPORT_Blacklist * blacklist_p2; 63static struct GNUNET_TRANSPORT_Blacklist * blacklist_p2;
64 64
65static GNUNET_SCHEDULER_TaskIdentifier die_task; 65static struct GNUNET_SCHEDULER_Task * die_task;
66 66
67static GNUNET_SCHEDULER_TaskIdentifier send_task; 67static struct GNUNET_SCHEDULER_Task * send_task;
68 68
69static GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 69static struct GNUNET_SCHEDULER_Task * shutdown_task;
70 70
71#if VERBOSE 71#if VERBOSE
72#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) 72#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
@@ -80,13 +80,13 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
80{ 80{
81 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping\n"); 81 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping\n");
82 82
83 if (send_task != GNUNET_SCHEDULER_NO_TASK) 83 if (send_task != NULL)
84 GNUNET_SCHEDULER_cancel (send_task); 84 GNUNET_SCHEDULER_cancel (send_task);
85 85
86 if (die_task != GNUNET_SCHEDULER_NO_TASK) 86 if (die_task != NULL)
87 { 87 {
88 GNUNET_SCHEDULER_cancel (die_task); 88 GNUNET_SCHEDULER_cancel (die_task);
89 die_task = GNUNET_SCHEDULER_NO_TASK; 89 die_task = NULL;
90 } 90 }
91 91
92 if (cc != NULL) 92 if (cc != NULL)
@@ -139,16 +139,16 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
139static void 139static void
140end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 140end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
141{ 141{
142 if (send_task != GNUNET_SCHEDULER_NO_TASK) 142 if (send_task != NULL)
143 { 143 {
144 GNUNET_SCHEDULER_cancel (send_task); 144 GNUNET_SCHEDULER_cancel (send_task);
145 send_task = GNUNET_SCHEDULER_NO_TASK; 145 send_task = NULL;
146 } 146 }
147 147
148 if (shutdown_task != GNUNET_SCHEDULER_NO_TASK) 148 if (shutdown_task != NULL)
149 { 149 {
150 GNUNET_SCHEDULER_cancel (shutdown_task); 150 GNUNET_SCHEDULER_cancel (shutdown_task);
151 shutdown_task = GNUNET_SCHEDULER_NO_TASK; 151 shutdown_task = NULL;
152 } 152 }
153 153
154 if (cc != NULL) 154 if (cc != NULL)
@@ -225,10 +225,10 @@ notify_ready (void *cls, size_t size, void *buf)
225 { 225 {
226 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 226 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
227 "Timeout occurred while waiting for transmit_ready\n"); 227 "Timeout occurred while waiting for transmit_ready\n");
228 if (GNUNET_SCHEDULER_NO_TASK != die_task) 228 if (NULL != die_task)
229 { 229 {
230 GNUNET_SCHEDULER_cancel (die_task); 230 GNUNET_SCHEDULER_cancel (die_task);
231 die_task = GNUNET_SCHEDULER_NO_TASK; 231 die_task = NULL;
232 } 232 }
233 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 233 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
234 ok = 42; 234 ok = 42;
@@ -257,7 +257,7 @@ notify_ready (void *cls, size_t size, void *buf)
257static void 257static void
258sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 258sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
259{ 259{
260 send_task = GNUNET_SCHEDULER_NO_TASK; 260 send_task = NULL;
261 261
262 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 262 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
263 return; 263 return;
@@ -359,7 +359,7 @@ blacklist_cb (void *cls,
359 res = GNUNET_SYSERR; 359 res = GNUNET_SYSERR;
360 } 360 }
361 361
362 if (((blacklist_request_p2 == GNUNET_YES) && (blacklist_request_p1 == GNUNET_YES)) && (shutdown_task == GNUNET_SCHEDULER_NO_TASK)) 362 if (((blacklist_request_p2 == GNUNET_YES) && (blacklist_request_p1 == GNUNET_YES)) && (shutdown_task == NULL))
363 { 363 {
364 shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 3), &end, NULL); 364 shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 3), &end, NULL);
365 } 365 }
diff --git a/src/transport/test_transport_api_disconnect.c b/src/transport/test_transport_api_disconnect.c
index 3f8246142..607b3480b 100644
--- a/src/transport/test_transport_api_disconnect.c
+++ b/src/transport/test_transport_api_disconnect.c
@@ -47,9 +47,9 @@ static char *test_name;
47 47
48static int ok; 48static int ok;
49 49
50static GNUNET_SCHEDULER_TaskIdentifier die_task; 50static struct GNUNET_SCHEDULER_Task * die_task;
51 51
52static GNUNET_SCHEDULER_TaskIdentifier send_task; 52static struct GNUNET_SCHEDULER_Task * send_task;
53 53
54struct PeerContext *p1; 54struct PeerContext *p1;
55 55
@@ -79,16 +79,16 @@ end ()
79{ 79{
80 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 80 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
81 81
82 if (send_task != GNUNET_SCHEDULER_NO_TASK) 82 if (send_task != NULL)
83 { 83 {
84 GNUNET_SCHEDULER_cancel (send_task); 84 GNUNET_SCHEDULER_cancel (send_task);
85 send_task = GNUNET_SCHEDULER_NO_TASK; 85 send_task = NULL;
86 } 86 }
87 87
88 if (die_task != GNUNET_SCHEDULER_NO_TASK) 88 if (die_task != NULL)
89 { 89 {
90 GNUNET_SCHEDULER_cancel (die_task); 90 GNUNET_SCHEDULER_cancel (die_task);
91 die_task = GNUNET_SCHEDULER_NO_TASK; 91 die_task = NULL;
92 } 92 }
93 93
94 if (th != NULL) 94 if (th != NULL)
@@ -110,7 +110,7 @@ end ()
110static void 110static void
111end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 111end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
112{ 112{
113 die_task = GNUNET_SCHEDULER_NO_TASK; 113 die_task = NULL;
114 114
115 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 115 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
116 116
@@ -120,10 +120,10 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
120 cc = NULL; 120 cc = NULL;
121 } 121 }
122 122
123 if (send_task != GNUNET_SCHEDULER_NO_TASK) 123 if (send_task != NULL)
124 { 124 {
125 GNUNET_SCHEDULER_cancel (send_task); 125 GNUNET_SCHEDULER_cancel (send_task);
126 send_task = GNUNET_SCHEDULER_NO_TASK; 126 send_task = NULL;
127 } 127 }
128 128
129 if (th != NULL) 129 if (th != NULL)
@@ -221,7 +221,7 @@ notify_ready (void *cls, size_t size, void *buf)
221 { 221 {
222 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 222 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
223 "Timeout occurred while waiting for transmit_ready\n"); 223 "Timeout occurred while waiting for transmit_ready\n");
224 if (GNUNET_SCHEDULER_NO_TASK != die_task) 224 if (NULL != die_task)
225 GNUNET_SCHEDULER_cancel (die_task); 225 GNUNET_SCHEDULER_cancel (die_task);
226 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 226 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
227 ok = 42; 227 ok = 42;
@@ -250,7 +250,7 @@ notify_ready (void *cls, size_t size, void *buf)
250static void 250static void
251sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 251sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
252{ 252{
253 send_task = GNUNET_SCHEDULER_NO_TASK; 253 send_task = NULL;
254 254
255 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 255 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
256 return; 256 return;
@@ -347,7 +347,7 @@ run (void *cls, char *const *args, const char *cfgfile,
347 if ((p1 == NULL) || (p2 == NULL)) 347 if ((p1 == NULL) || (p2 == NULL))
348 { 348 {
349 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 349 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
350 if (die_task != GNUNET_SCHEDULER_NO_TASK) 350 if (die_task != NULL)
351 GNUNET_SCHEDULER_cancel (die_task); 351 GNUNET_SCHEDULER_cancel (die_task);
352 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 352 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
353 return; 353 return;
@@ -367,7 +367,7 @@ check ()
367 GNUNET_GETOPT_OPTION_END 367 GNUNET_GETOPT_OPTION_END
368 }; 368 };
369 369
370 send_task = GNUNET_SCHEDULER_NO_TASK; 370 send_task = NULL;
371 371
372 ok = 1; 372 ok = 1;
373 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name, 373 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_limited_sockets.c b/src/transport/test_transport_api_limited_sockets.c
index 617be38d4..cc1953f77 100644
--- a/src/transport/test_transport_api_limited_sockets.c
+++ b/src/transport/test_transport_api_limited_sockets.c
@@ -55,9 +55,9 @@ static char *test_name;
55 55
56static int ok; 56static int ok;
57 57
58static GNUNET_SCHEDULER_TaskIdentifier die_task; 58static struct GNUNET_SCHEDULER_Task * die_task;
59 59
60static GNUNET_SCHEDULER_TaskIdentifier send_task; 60static struct GNUNET_SCHEDULER_Task * send_task;
61 61
62static struct PeerContext *p1; 62static struct PeerContext *p1;
63 63
@@ -85,10 +85,10 @@ end ()
85{ 85{
86 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 86 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
87 87
88 if (send_task != GNUNET_SCHEDULER_NO_TASK) 88 if (send_task != NULL)
89 GNUNET_SCHEDULER_cancel (send_task); 89 GNUNET_SCHEDULER_cancel (send_task);
90 90
91 if (die_task != GNUNET_SCHEDULER_NO_TASK) 91 if (die_task != NULL)
92 GNUNET_SCHEDULER_cancel (die_task); 92 GNUNET_SCHEDULER_cancel (die_task);
93 93
94 if (th != NULL) 94 if (th != NULL)
@@ -104,11 +104,11 @@ end ()
104static void 104static void
105end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 105end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
106{ 106{
107 die_task = GNUNET_SCHEDULER_NO_TASK; 107 die_task = NULL;
108 108
109 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 109 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
110 110
111 if (send_task != GNUNET_SCHEDULER_NO_TASK) 111 if (send_task != NULL)
112 GNUNET_SCHEDULER_cancel (send_task); 112 GNUNET_SCHEDULER_cancel (send_task);
113 113
114 if (cc != NULL) 114 if (cc != NULL)
@@ -197,7 +197,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
197static void 197static void
198sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 198sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
199{ 199{
200 send_task = GNUNET_SCHEDULER_NO_TASK; 200 send_task = NULL;
201 201
202 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 202 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
203 return; 203 return;
@@ -259,7 +259,7 @@ run (void *cls, char *const *args, const char *cfgfile,
259 if ((p1 == NULL) || (p2 == NULL)) 259 if ((p1 == NULL) || (p2 == NULL))
260 { 260 {
261 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 261 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
262 if (die_task != GNUNET_SCHEDULER_NO_TASK) 262 if (die_task != NULL)
263 GNUNET_SCHEDULER_cancel (die_task); 263 GNUNET_SCHEDULER_cancel (die_task);
264 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 264 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
265 return; 265 return;
@@ -282,7 +282,7 @@ check ()
282#if WRITECONFIG 282#if WRITECONFIG
283 setTransportOptions ("test_transport_api_data.conf"); 283 setTransportOptions ("test_transport_api_data.conf");
284#endif 284#endif
285 send_task = GNUNET_SCHEDULER_NO_TASK; 285 send_task = NULL;
286 286
287 ok = 1; 287 ok = 1;
288 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name, 288 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_manipulation_cfg.c b/src/transport/test_transport_api_manipulation_cfg.c
index 49e74ffaf..e7cccb812 100644
--- a/src/transport/test_transport_api_manipulation_cfg.c
+++ b/src/transport/test_transport_api_manipulation_cfg.c
@@ -67,9 +67,9 @@ static int s_connected;
67 67
68static int s_sending; 68static int s_sending;
69 69
70static GNUNET_SCHEDULER_TaskIdentifier die_task; 70static struct GNUNET_SCHEDULER_Task * die_task;
71 71
72static GNUNET_SCHEDULER_TaskIdentifier send_task; 72static struct GNUNET_SCHEDULER_Task * send_task;
73 73
74static struct PeerContext *p1; 74static struct PeerContext *p1;
75 75
@@ -93,10 +93,10 @@ end ()
93{ 93{
94 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 94 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
95 95
96 if (send_task != GNUNET_SCHEDULER_NO_TASK) 96 if (send_task != NULL)
97 GNUNET_SCHEDULER_cancel (send_task); 97 GNUNET_SCHEDULER_cancel (send_task);
98 98
99 if (die_task != GNUNET_SCHEDULER_NO_TASK) 99 if (die_task != NULL)
100 GNUNET_SCHEDULER_cancel (die_task); 100 GNUNET_SCHEDULER_cancel (die_task);
101 101
102 if (th != NULL) 102 if (th != NULL)
@@ -110,12 +110,12 @@ end ()
110static void 110static void
111end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 111end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
112{ 112{
113 die_task = GNUNET_SCHEDULER_NO_TASK; 113 die_task = NULL;
114 114
115 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 115 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
116 116
117 117
118 if (send_task != GNUNET_SCHEDULER_NO_TASK) 118 if (send_task != NULL)
119 GNUNET_SCHEDULER_cancel (send_task); 119 GNUNET_SCHEDULER_cancel (send_task);
120 120
121 if (cc != NULL) 121 if (cc != NULL)
@@ -172,7 +172,7 @@ notify_request_ready (void *cls, size_t size, void *buf)
172 { 172 {
173 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 173 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
174 "Timeout occurred while waiting for transmit_ready\n"); 174 "Timeout occurred while waiting for transmit_ready\n");
175 if (GNUNET_SCHEDULER_NO_TASK != die_task) 175 if (NULL != die_task)
176 GNUNET_SCHEDULER_cancel (die_task); 176 GNUNET_SCHEDULER_cancel (die_task);
177 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 177 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
178 ok = 42; 178 ok = 42;
@@ -201,7 +201,7 @@ notify_request_ready (void *cls, size_t size, void *buf)
201static void 201static void
202sendtask_request_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 202sendtask_request_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
203{ 203{
204 send_task = GNUNET_SCHEDULER_NO_TASK; 204 send_task = NULL;
205 205
206 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 206 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
207 return; 207 return;
@@ -232,7 +232,7 @@ notify_response_ready (void *cls, size_t size, void *buf)
232 { 232 {
233 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 233 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
234 "Timeout occurred while waiting for transmit_ready\n"); 234 "Timeout occurred while waiting for transmit_ready\n");
235 if (GNUNET_SCHEDULER_NO_TASK != die_task) 235 if (NULL != die_task)
236 GNUNET_SCHEDULER_cancel (die_task); 236 GNUNET_SCHEDULER_cancel (die_task);
237 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 237 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
238 ok = 42; 238 ok = 42;
@@ -261,7 +261,7 @@ notify_response_ready (void *cls, size_t size, void *buf)
261static void 261static void
262sendtask_response_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 262sendtask_response_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
263{ 263{
264 send_task = GNUNET_SCHEDULER_NO_TASK; 264 send_task = NULL;
265 265
266 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 266 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
267 return; 267 return;
@@ -458,7 +458,7 @@ run (void *cls, char *const *args, const char *cfgfile,
458 if ((p1 == NULL) || (p2 == NULL)) 458 if ((p1 == NULL) || (p2 == NULL))
459 { 459 {
460 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 460 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
461 if (die_task != GNUNET_SCHEDULER_NO_TASK) 461 if (die_task != NULL)
462 GNUNET_SCHEDULER_cancel (die_task); 462 GNUNET_SCHEDULER_cancel (die_task);
463 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 463 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
464 return; 464 return;
@@ -478,7 +478,7 @@ check ()
478 GNUNET_GETOPT_OPTION_END 478 GNUNET_GETOPT_OPTION_END
479 }; 479 };
480 480
481 send_task = GNUNET_SCHEDULER_NO_TASK; 481 send_task = NULL;
482 482
483 ok = 1; 483 ok = 1;
484 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name, 484 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_manipulation_recv_tcp.c b/src/transport/test_transport_api_manipulation_recv_tcp.c
index 6b86e9ff1..76bd360ab 100644
--- a/src/transport/test_transport_api_manipulation_recv_tcp.c
+++ b/src/transport/test_transport_api_manipulation_recv_tcp.c
@@ -59,9 +59,9 @@ static int s_connected;
59 59
60static int s_sending; 60static int s_sending;
61 61
62static GNUNET_SCHEDULER_TaskIdentifier die_task; 62static struct GNUNET_SCHEDULER_Task * die_task;
63 63
64static GNUNET_SCHEDULER_TaskIdentifier send_task; 64static struct GNUNET_SCHEDULER_Task * send_task;
65 65
66static struct PeerContext *p1; 66static struct PeerContext *p1;
67 67
@@ -90,10 +90,10 @@ end ()
90{ 90{
91 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 91 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
92 92
93 if (send_task != GNUNET_SCHEDULER_NO_TASK) 93 if (send_task != NULL)
94 GNUNET_SCHEDULER_cancel (send_task); 94 GNUNET_SCHEDULER_cancel (send_task);
95 95
96 if (die_task != GNUNET_SCHEDULER_NO_TASK) 96 if (die_task != NULL)
97 GNUNET_SCHEDULER_cancel (die_task); 97 GNUNET_SCHEDULER_cancel (die_task);
98 98
99 if (th != NULL) 99 if (th != NULL)
@@ -107,12 +107,12 @@ end ()
107static void 107static void
108end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 108end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
109{ 109{
110 die_task = GNUNET_SCHEDULER_NO_TASK; 110 die_task = NULL;
111 111
112 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 112 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
113 113
114 114
115 if (send_task != GNUNET_SCHEDULER_NO_TASK) 115 if (send_task != NULL)
116 GNUNET_SCHEDULER_cancel (send_task); 116 GNUNET_SCHEDULER_cancel (send_task);
117 117
118 if (cc != NULL) 118 if (cc != NULL)
@@ -252,7 +252,7 @@ notify_ready (void *cls, size_t size, void *buf)
252 { 252 {
253 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 253 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
254 "Timeout occurred while waiting for transmit_ready\n"); 254 "Timeout occurred while waiting for transmit_ready\n");
255 if (GNUNET_SCHEDULER_NO_TASK != die_task) 255 if (NULL != die_task)
256 GNUNET_SCHEDULER_cancel (die_task); 256 GNUNET_SCHEDULER_cancel (die_task);
257 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 257 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
258 ok = 42; 258 ok = 42;
@@ -282,7 +282,7 @@ notify_ready (void *cls, size_t size, void *buf)
282static void 282static void
283sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 283sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
284{ 284{
285 send_task = GNUNET_SCHEDULER_NO_TASK; 285 send_task = NULL;
286 286
287 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 287 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
288 return; 288 return;
@@ -416,7 +416,7 @@ run (void *cls, char *const *args, const char *cfgfile,
416 if ((p1 == NULL) || (p2 == NULL)) 416 if ((p1 == NULL) || (p2 == NULL))
417 { 417 {
418 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 418 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
419 if (die_task != GNUNET_SCHEDULER_NO_TASK) 419 if (die_task != NULL)
420 GNUNET_SCHEDULER_cancel (die_task); 420 GNUNET_SCHEDULER_cancel (die_task);
421 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 421 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
422 return; 422 return;
@@ -436,7 +436,7 @@ check ()
436 GNUNET_GETOPT_OPTION_END 436 GNUNET_GETOPT_OPTION_END
437 }; 437 };
438 438
439 send_task = GNUNET_SCHEDULER_NO_TASK; 439 send_task = NULL;
440 440
441 ok = 1; 441 ok = 1;
442 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name, 442 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_manipulation_send_tcp.c b/src/transport/test_transport_api_manipulation_send_tcp.c
index 381d7d38a..f1ead389c 100644
--- a/src/transport/test_transport_api_manipulation_send_tcp.c
+++ b/src/transport/test_transport_api_manipulation_send_tcp.c
@@ -59,9 +59,9 @@ static int s_connected;
59 59
60static int s_sending; 60static int s_sending;
61 61
62static GNUNET_SCHEDULER_TaskIdentifier die_task; 62static struct GNUNET_SCHEDULER_Task * die_task;
63 63
64static GNUNET_SCHEDULER_TaskIdentifier send_task; 64static struct GNUNET_SCHEDULER_Task * send_task;
65 65
66static struct PeerContext *p1; 66static struct PeerContext *p1;
67 67
@@ -90,10 +90,10 @@ end ()
90{ 90{
91 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 91 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
92 92
93 if (send_task != GNUNET_SCHEDULER_NO_TASK) 93 if (send_task != NULL)
94 GNUNET_SCHEDULER_cancel (send_task); 94 GNUNET_SCHEDULER_cancel (send_task);
95 95
96 if (die_task != GNUNET_SCHEDULER_NO_TASK) 96 if (die_task != NULL)
97 GNUNET_SCHEDULER_cancel (die_task); 97 GNUNET_SCHEDULER_cancel (die_task);
98 98
99 if (th != NULL) 99 if (th != NULL)
@@ -107,12 +107,12 @@ end ()
107static void 107static void
108end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 108end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
109{ 109{
110 die_task = GNUNET_SCHEDULER_NO_TASK; 110 die_task = NULL;
111 111
112 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 112 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
113 113
114 114
115 if (send_task != GNUNET_SCHEDULER_NO_TASK) 115 if (send_task != NULL)
116 GNUNET_SCHEDULER_cancel (send_task); 116 GNUNET_SCHEDULER_cancel (send_task);
117 117
118 if (cc != NULL) 118 if (cc != NULL)
@@ -244,7 +244,7 @@ notify_ready (void *cls, size_t size, void *buf)
244 { 244 {
245 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 245 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
246 "Timeout occurred while waiting for transmit_ready\n"); 246 "Timeout occurred while waiting for transmit_ready\n");
247 if (GNUNET_SCHEDULER_NO_TASK != die_task) 247 if (NULL != die_task)
248 GNUNET_SCHEDULER_cancel (die_task); 248 GNUNET_SCHEDULER_cancel (die_task);
249 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 249 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
250 ok = 42; 250 ok = 42;
@@ -275,7 +275,7 @@ static void
275sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 275sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
276{ 276{
277 struct GNUNET_ATS_Information ats[1]; 277 struct GNUNET_ATS_Information ats[1];
278 send_task = GNUNET_SCHEDULER_NO_TASK; 278 send_task = NULL;
279 279
280 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 280 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
281 return; 281 return;
@@ -424,7 +424,7 @@ run (void *cls, char *const *args, const char *cfgfile,
424 if ((p1 == NULL) || (p2 == NULL)) 424 if ((p1 == NULL) || (p2 == NULL))
425 { 425 {
426 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 426 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
427 if (die_task != GNUNET_SCHEDULER_NO_TASK) 427 if (die_task != NULL)
428 GNUNET_SCHEDULER_cancel (die_task); 428 GNUNET_SCHEDULER_cancel (die_task);
429 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 429 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
430 return; 430 return;
@@ -444,7 +444,7 @@ check ()
444 GNUNET_GETOPT_OPTION_END 444 GNUNET_GETOPT_OPTION_END
445 }; 445 };
446 446
447 send_task = GNUNET_SCHEDULER_NO_TASK; 447 send_task = NULL;
448 448
449 ok = 1; 449 ok = 1;
450 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name, 450 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_monitor_peers.c b/src/transport/test_transport_api_monitor_peers.c
index fd6abe53b..ef425d444 100644
--- a/src/transport/test_transport_api_monitor_peers.c
+++ b/src/transport/test_transport_api_monitor_peers.c
@@ -53,9 +53,9 @@ static int s_connected;
53 53
54static int s_sending; 54static int s_sending;
55 55
56static GNUNET_SCHEDULER_TaskIdentifier die_task; 56static struct GNUNET_SCHEDULER_Task * die_task;
57 57
58static GNUNET_SCHEDULER_TaskIdentifier send_task; 58static struct GNUNET_SCHEDULER_Task * send_task;
59 59
60static struct PeerContext *p1; 60static struct PeerContext *p1;
61 61
@@ -90,13 +90,13 @@ end ()
90 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 90 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
91 "Stopping peers\n"); 91 "Stopping peers\n");
92 92
93 if (send_task != GNUNET_SCHEDULER_NO_TASK) 93 if (send_task != NULL)
94 GNUNET_SCHEDULER_cancel (send_task); 94 GNUNET_SCHEDULER_cancel (send_task);
95 95
96 if (die_task != GNUNET_SCHEDULER_NO_TASK) 96 if (die_task != NULL)
97 { 97 {
98 GNUNET_SCHEDULER_cancel (die_task); 98 GNUNET_SCHEDULER_cancel (die_task);
99 die_task = GNUNET_SCHEDULER_NO_TASK; 99 die_task = NULL;
100 } 100 }
101 101
102 if (th != NULL) 102 if (th != NULL)
@@ -131,12 +131,12 @@ static void
131end_badly (void *cls, 131end_badly (void *cls,
132 const struct GNUNET_SCHEDULER_TaskContext *tc) 132 const struct GNUNET_SCHEDULER_TaskContext *tc)
133{ 133{
134 die_task = GNUNET_SCHEDULER_NO_TASK; 134 die_task = NULL;
135 135
136 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fail! Stopping peers\n"); 136 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fail! Stopping peers\n");
137 137
138 138
139 if (send_task != GNUNET_SCHEDULER_NO_TASK) 139 if (send_task != NULL)
140 GNUNET_SCHEDULER_cancel (send_task); 140 GNUNET_SCHEDULER_cancel (send_task);
141 141
142 if (cc != NULL) 142 if (cc != NULL)
@@ -227,7 +227,7 @@ notify_ready (void *cls, size_t size, void *buf)
227 { 227 {
228 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 228 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
229 "Timeout occurred while waiting for transmit_ready\n"); 229 "Timeout occurred while waiting for transmit_ready\n");
230 if (GNUNET_SCHEDULER_NO_TASK != die_task) 230 if (NULL != die_task)
231 GNUNET_SCHEDULER_cancel (die_task); 231 GNUNET_SCHEDULER_cancel (die_task);
232 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 232 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
233 ok = 42; 233 ok = 42;
@@ -257,7 +257,7 @@ notify_ready (void *cls, size_t size, void *buf)
257static void 257static void
258sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 258sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
259{ 259{
260 send_task = GNUNET_SCHEDULER_NO_TASK; 260 send_task = NULL;
261 261
262 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 262 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
263 return; 263 return;
@@ -460,7 +460,7 @@ run (void *cls, char *const *args, const char *cfgfile,
460 if ((p1 == NULL) || (p2 == NULL)) 460 if ((p1 == NULL) || (p2 == NULL))
461 { 461 {
462 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 462 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
463 if (die_task != GNUNET_SCHEDULER_NO_TASK) 463 if (die_task != NULL)
464 GNUNET_SCHEDULER_cancel (die_task); 464 GNUNET_SCHEDULER_cancel (die_task);
465 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 465 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
466 return; 466 return;
@@ -480,7 +480,7 @@ check ()
480 GNUNET_GETOPT_OPTION_END 480 GNUNET_GETOPT_OPTION_END
481 }; 481 };
482 482
483 send_task = GNUNET_SCHEDULER_NO_TASK; 483 send_task = NULL;
484 484
485 ok = 1; 485 ok = 1;
486 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name, 486 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_monitor_validation.c b/src/transport/test_transport_api_monitor_validation.c
index 11839b20c..261f1a7d0 100644
--- a/src/transport/test_transport_api_monitor_validation.c
+++ b/src/transport/test_transport_api_monitor_validation.c
@@ -56,9 +56,9 @@ static int s_connected;
56 56
57static int s_sending; 57static int s_sending;
58 58
59static GNUNET_SCHEDULER_TaskIdentifier die_task; 59static struct GNUNET_SCHEDULER_Task * die_task;
60 60
61static GNUNET_SCHEDULER_TaskIdentifier send_task; 61static struct GNUNET_SCHEDULER_Task * send_task;
62 62
63static struct PeerContext *p1; 63static struct PeerContext *p1;
64 64
@@ -92,10 +92,10 @@ end ()
92 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stopping peers\n"); 92 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stopping peers\n");
93 93
94 94
95 if (send_task != GNUNET_SCHEDULER_NO_TASK) 95 if (send_task != NULL)
96 GNUNET_SCHEDULER_cancel (send_task); 96 GNUNET_SCHEDULER_cancel (send_task);
97 97
98 if (die_task != GNUNET_SCHEDULER_NO_TASK) 98 if (die_task != NULL)
99 GNUNET_SCHEDULER_cancel (die_task); 99 GNUNET_SCHEDULER_cancel (die_task);
100 100
101 if (th != NULL) 101 if (th != NULL)
@@ -124,12 +124,12 @@ end ()
124static void 124static void
125end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 125end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
126{ 126{
127 die_task = GNUNET_SCHEDULER_NO_TASK; 127 die_task = NULL;
128 128
129 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fail! Stopping peers\n"); 129 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fail! Stopping peers\n");
130 130
131 131
132 if (send_task != GNUNET_SCHEDULER_NO_TASK) 132 if (send_task != NULL)
133 GNUNET_SCHEDULER_cancel (send_task); 133 GNUNET_SCHEDULER_cancel (send_task);
134 134
135 if (cc != NULL) 135 if (cc != NULL)
@@ -219,7 +219,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
219 219
220 if ((0 >= p1_c) || (0 >= p2_c)) 220 if ((0 >= p1_c) || (0 >= p2_c))
221 { 221 {
222 if (GNUNET_SCHEDULER_NO_TASK != die_task) 222 if (NULL != die_task)
223 GNUNET_SCHEDULER_cancel (die_task); 223 GNUNET_SCHEDULER_cancel (die_task);
224 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 224 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
225 } 225 }
@@ -240,7 +240,7 @@ notify_ready (void *cls, size_t size, void *buf)
240 { 240 {
241 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 241 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
242 "Timeout occurred while waiting for transmit_ready\n"); 242 "Timeout occurred while waiting for transmit_ready\n");
243 if (GNUNET_SCHEDULER_NO_TASK != die_task) 243 if (NULL != die_task)
244 GNUNET_SCHEDULER_cancel (die_task); 244 GNUNET_SCHEDULER_cancel (die_task);
245 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 245 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
246 ok = 42; 246 ok = 42;
@@ -270,7 +270,7 @@ notify_ready (void *cls, size_t size, void *buf)
270static void 270static void
271sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 271sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
272{ 272{
273 send_task = GNUNET_SCHEDULER_NO_TASK; 273 send_task = NULL;
274 274
275 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 275 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
276 return; 276 return;
@@ -454,7 +454,7 @@ run (void *cls, char *const *args, const char *cfgfile,
454 if ((p1 == NULL) || (p2 == NULL)) 454 if ((p1 == NULL) || (p2 == NULL))
455 { 455 {
456 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 456 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
457 if (die_task != GNUNET_SCHEDULER_NO_TASK) 457 if (die_task != NULL)
458 GNUNET_SCHEDULER_cancel (die_task); 458 GNUNET_SCHEDULER_cancel (die_task);
459 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 459 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
460 return; 460 return;
@@ -474,7 +474,7 @@ check ()
474 GNUNET_GETOPT_OPTION_END 474 GNUNET_GETOPT_OPTION_END
475 }; 475 };
476 476
477 send_task = GNUNET_SCHEDULER_NO_TASK; 477 send_task = NULL;
478 478
479 ok = 1; 479 ok = 1;
480 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name, 480 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c
index 07213722e..a727d3e6a 100644
--- a/src/transport/test_transport_api_reliability.c
+++ b/src/transport/test_transport_api_reliability.c
@@ -107,7 +107,7 @@ char *cfg_file_p2;
107/** 107/**
108 * Timeout task 108 * Timeout task
109 */ 109 */
110static GNUNET_SCHEDULER_TaskIdentifier die_task; 110static struct GNUNET_SCHEDULER_Task * die_task;
111 111
112/** 112/**
113 * Transport transmit handle used 113 * Transport transmit handle used
@@ -190,7 +190,7 @@ end ()
190 "kb/s"); 190 "kb/s");
191 GNUNET_free (value_name); 191 GNUNET_free (value_name);
192 192
193 if (die_task != GNUNET_SCHEDULER_NO_TASK) 193 if (die_task != NULL)
194 GNUNET_SCHEDULER_cancel (die_task); 194 GNUNET_SCHEDULER_cancel (die_task);
195 195
196 if (th != NULL) 196 if (th != NULL)
@@ -224,7 +224,7 @@ static void
224end_badly () 224end_badly ()
225{ 225{
226 int i; 226 int i;
227 die_task = GNUNET_SCHEDULER_NO_TASK; 227 die_task = NULL;
228 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 228 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
229 229
230 if (test_connected == GNUNET_YES) 230 if (test_connected == GNUNET_YES)
@@ -347,7 +347,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
347 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 347 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
348 "Expected message %u of size %u, got %u bytes of message %u\n", 348 "Expected message %u of size %u, got %u bytes of message %u\n",
349 ntohl (hdr->num), s, ntohs (message->size), ntohl (hdr->num)); 349 ntohl (hdr->num), s, ntohs (message->size), ntohl (hdr->num));
350 if (GNUNET_SCHEDULER_NO_TASK != die_task) 350 if (NULL != die_task)
351 GNUNET_SCHEDULER_cancel (die_task); 351 GNUNET_SCHEDULER_cancel (die_task);
352 test_sending = GNUNET_YES; 352 test_sending = GNUNET_YES;
353 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 353 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
@@ -360,7 +360,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
360 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 360 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
361 "Expected message %u with bits %u, but body did not match\n", 361 "Expected message %u with bits %u, but body did not match\n",
362 ntohl (hdr->num), (unsigned char) n); 362 ntohl (hdr->num), (unsigned char) n);
363 if (GNUNET_SCHEDULER_NO_TASK != die_task) 363 if (NULL != die_task)
364 GNUNET_SCHEDULER_cancel (die_task); 364 GNUNET_SCHEDULER_cancel (die_task);
365 test_sending = GNUNET_YES; 365 test_sending = GNUNET_YES;
366 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 366 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
@@ -384,7 +384,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
384 if (0 == (n % (TOTAL_MSGS / 100))) 384 if (0 == (n % (TOTAL_MSGS / 100)))
385 { 385 {
386 FPRINTF (stderr, "%s", "."); 386 FPRINTF (stderr, "%s", ".");
387 if (GNUNET_SCHEDULER_NO_TASK != die_task) 387 if (NULL != die_task)
388 GNUNET_SCHEDULER_cancel (die_task); 388 GNUNET_SCHEDULER_cancel (die_task);
389 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); 389 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
390 } 390 }
@@ -412,7 +412,7 @@ notify_ready (void *cls, size_t size, void *buf)
412 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 412 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
413 "Timeout occurred while waiting for transmit_ready for msg %u of %u\n", 413 "Timeout occurred while waiting for transmit_ready for msg %u of %u\n",
414 msg_scheduled, TOTAL_MSGS); 414 msg_scheduled, TOTAL_MSGS);
415 if (GNUNET_SCHEDULER_NO_TASK != die_task) 415 if (NULL != die_task)
416 GNUNET_SCHEDULER_cancel (die_task); 416 GNUNET_SCHEDULER_cancel (die_task);
417 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 417 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
418 ok = 42; 418 ok = 42;
@@ -460,7 +460,7 @@ notify_ready (void *cls, size_t size, void *buf)
460 { 460 {
461 FPRINTF (stderr, "%s", "\n"); 461 FPRINTF (stderr, "%s", "\n");
462 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All messages scheduled to be sent\n"); 462 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All messages scheduled to be sent\n");
463 if (GNUNET_SCHEDULER_NO_TASK != die_task) 463 if (NULL != die_task)
464 GNUNET_SCHEDULER_cancel (die_task); 464 GNUNET_SCHEDULER_cancel (die_task);
465 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); 465 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
466 } 466 }
@@ -554,7 +554,7 @@ run (void *cls, char *const *args, const char *cfgfile,
554 if ((p1 == NULL) || (p2 == NULL)) 554 if ((p1 == NULL) || (p2 == NULL))
555 { 555 {
556 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 556 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
557 if (die_task != GNUNET_SCHEDULER_NO_TASK) 557 if (die_task != NULL)
558 GNUNET_SCHEDULER_cancel (die_task); 558 GNUNET_SCHEDULER_cancel (die_task);
559 //die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 559 //die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
560 return; 560 return;
diff --git a/src/transport/test_transport_api_restart_1peer.c b/src/transport/test_transport_api_restart_1peer.c
index f0d5d5660..b77d8d0df 100644
--- a/src/transport/test_transport_api_restart_1peer.c
+++ b/src/transport/test_transport_api_restart_1peer.c
@@ -45,11 +45,11 @@ static char *test_name;
45 45
46static int ok; 46static int ok;
47 47
48static GNUNET_SCHEDULER_TaskIdentifier die_task; 48static struct GNUNET_SCHEDULER_Task * die_task;
49 49
50static GNUNET_SCHEDULER_TaskIdentifier send_task; 50static struct GNUNET_SCHEDULER_Task * send_task;
51 51
52static GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 52static struct GNUNET_SCHEDULER_Task * reconnect_task;
53 53
54static struct PeerContext *p1; 54static struct PeerContext *p1;
55 55
@@ -77,17 +77,17 @@ end ()
77{ 77{
78 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 78 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
79 79
80 if (send_task != GNUNET_SCHEDULER_NO_TASK) 80 if (send_task != NULL)
81 GNUNET_SCHEDULER_cancel (send_task); 81 GNUNET_SCHEDULER_cancel (send_task);
82 send_task = GNUNET_SCHEDULER_NO_TASK; 82 send_task = NULL;
83 83
84 if (reconnect_task != GNUNET_SCHEDULER_NO_TASK) 84 if (reconnect_task != NULL)
85 GNUNET_SCHEDULER_cancel (reconnect_task); 85 GNUNET_SCHEDULER_cancel (reconnect_task);
86 reconnect_task = GNUNET_SCHEDULER_NO_TASK; 86 reconnect_task = NULL;
87 87
88 if (die_task != GNUNET_SCHEDULER_NO_TASK) 88 if (die_task != NULL)
89 GNUNET_SCHEDULER_cancel (die_task); 89 GNUNET_SCHEDULER_cancel (die_task);
90 die_task = GNUNET_SCHEDULER_NO_TASK; 90 die_task = NULL;
91 91
92 if (th != NULL) 92 if (th != NULL)
93 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); 93 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
@@ -102,7 +102,7 @@ end ()
102static void 102static void
103end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 103end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
104{ 104{
105 die_task = GNUNET_SCHEDULER_NO_TASK; 105 die_task = NULL;
106 106
107 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 107 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
108 108
@@ -112,13 +112,13 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
112 if (restarted == GNUNET_NO) 112 if (restarted == GNUNET_NO)
113 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peer was NOT restarted\n"); 113 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peer was NOT restarted\n");
114 114
115 if (reconnect_task != GNUNET_SCHEDULER_NO_TASK) 115 if (reconnect_task != NULL)
116 GNUNET_SCHEDULER_cancel (reconnect_task); 116 GNUNET_SCHEDULER_cancel (reconnect_task);
117 reconnect_task = GNUNET_SCHEDULER_NO_TASK; 117 reconnect_task = NULL;
118 118
119 if (send_task != GNUNET_SCHEDULER_NO_TASK) 119 if (send_task != NULL)
120 GNUNET_SCHEDULER_cancel (send_task); 120 GNUNET_SCHEDULER_cancel (send_task);
121 send_task = GNUNET_SCHEDULER_NO_TASK; 121 send_task = NULL;
122 122
123 if (cc != NULL) 123 if (cc != NULL)
124 { 124 {
@@ -144,7 +144,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
144{ 144{
145 struct PeerContext *p = cls; 145 struct PeerContext *p = cls;
146 146
147 reconnect_task = GNUNET_SCHEDULER_NO_TASK; 147 reconnect_task = NULL;
148 148
149 GNUNET_TRANSPORT_try_connect (p->th, &p2->id, NULL, NULL); /*FIXME TRY_CONNECT change */ 149 GNUNET_TRANSPORT_try_connect (p->th, &p2->id, NULL, NULL); /*FIXME TRY_CONNECT change */
150 reconnect_task = 150 reconnect_task =
@@ -214,7 +214,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
214 { 214 {
215 GNUNET_break (0); 215 GNUNET_break (0);
216 ok = 1; 216 ok = 1;
217 if (die_task != GNUNET_SCHEDULER_NO_TASK) 217 if (die_task != NULL)
218 GNUNET_SCHEDULER_cancel (die_task); 218 GNUNET_SCHEDULER_cancel (die_task);
219 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 219 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
220 } 220 }
@@ -233,7 +233,7 @@ notify_ready (void *cls, size_t size, void *buf)
233 { 233 {
234 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 234 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
235 "Timeout occurred while waiting for transmit_ready\n"); 235 "Timeout occurred while waiting for transmit_ready\n");
236 if (GNUNET_SCHEDULER_NO_TASK != die_task) 236 if (NULL != die_task)
237 GNUNET_SCHEDULER_cancel (die_task); 237 GNUNET_SCHEDULER_cancel (die_task);
238 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 238 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
239 ok = 42; 239 ok = 42;
@@ -262,7 +262,7 @@ notify_ready (void *cls, size_t size, void *buf)
262static void 262static void
263sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 263sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
264{ 264{
265 send_task = GNUNET_SCHEDULER_NO_TASK; 265 send_task = NULL;
266 266
267 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 267 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
268 return; 268 return;
@@ -340,9 +340,9 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
340 if (th != NULL) 340 if (th != NULL)
341 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); 341 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
342 th = NULL; 342 th = NULL;
343 if (GNUNET_SCHEDULER_NO_TASK != send_task) 343 if (NULL != send_task)
344 GNUNET_SCHEDULER_cancel (send_task); 344 GNUNET_SCHEDULER_cancel (send_task);
345 send_task = GNUNET_SCHEDULER_NO_TASK; 345 send_task = NULL;
346} 346}
347 347
348static void 348static void
@@ -405,7 +405,7 @@ run (void *cls, char *const *args, const char *cfgfile,
405 if ((p1 == NULL) || (p2 == NULL)) 405 if ((p1 == NULL) || (p2 == NULL))
406 { 406 {
407 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 407 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
408 if (die_task != GNUNET_SCHEDULER_NO_TASK) 408 if (die_task != NULL)
409 GNUNET_SCHEDULER_cancel (die_task); 409 GNUNET_SCHEDULER_cancel (die_task);
410 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 410 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
411 return; 411 return;
@@ -425,7 +425,7 @@ check ()
425 GNUNET_GETOPT_OPTION_END 425 GNUNET_GETOPT_OPTION_END
426 }; 426 };
427 427
428 send_task = GNUNET_SCHEDULER_NO_TASK; 428 send_task = NULL;
429 429
430 ok = 1; 430 ok = 1;
431 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name, 431 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_restart_2peers.c b/src/transport/test_transport_api_restart_2peers.c
index 3b5d63bce..25054b536 100644
--- a/src/transport/test_transport_api_restart_2peers.c
+++ b/src/transport/test_transport_api_restart_2peers.c
@@ -45,11 +45,11 @@ static char *test_name;
45 45
46static int ok; 46static int ok;
47 47
48static GNUNET_SCHEDULER_TaskIdentifier die_task; 48static struct GNUNET_SCHEDULER_Task * die_task;
49 49
50static GNUNET_SCHEDULER_TaskIdentifier send_task; 50static struct GNUNET_SCHEDULER_Task * send_task;
51 51
52static GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 52static struct GNUNET_SCHEDULER_Task * reconnect_task;
53 53
54static struct PeerContext *p1; 54static struct PeerContext *p1;
55 55
@@ -72,17 +72,17 @@ static void
72end () 72end ()
73{ 73{
74 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 74 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
75 if (send_task != GNUNET_SCHEDULER_NO_TASK) 75 if (send_task != NULL)
76 GNUNET_SCHEDULER_cancel (send_task); 76 GNUNET_SCHEDULER_cancel (send_task);
77 send_task = GNUNET_SCHEDULER_NO_TASK; 77 send_task = NULL;
78 78
79 if (reconnect_task != GNUNET_SCHEDULER_NO_TASK) 79 if (reconnect_task != NULL)
80 GNUNET_SCHEDULER_cancel (reconnect_task); 80 GNUNET_SCHEDULER_cancel (reconnect_task);
81 reconnect_task = GNUNET_SCHEDULER_NO_TASK; 81 reconnect_task = NULL;
82 82
83 if (die_task != GNUNET_SCHEDULER_NO_TASK) 83 if (die_task != NULL)
84 GNUNET_SCHEDULER_cancel (die_task); 84 GNUNET_SCHEDULER_cancel (die_task);
85 die_task = GNUNET_SCHEDULER_NO_TASK; 85 die_task = NULL;
86 86
87 if (th != NULL) 87 if (th != NULL)
88 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); 88 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
@@ -96,7 +96,7 @@ end ()
96static void 96static void
97end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 97end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
98{ 98{
99 die_task = GNUNET_SCHEDULER_NO_TASK; 99 die_task = NULL;
100 100
101 if (restarted == GNUNET_YES) 101 if (restarted == GNUNET_YES)
102 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peer was restarted, but communication did not resume\n"); 102 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peer was restarted, but communication did not resume\n");
@@ -104,13 +104,13 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
104 if (restarted == GNUNET_NO) 104 if (restarted == GNUNET_NO)
105 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peer was NOT (even) restarted\n"); 105 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peer was NOT (even) restarted\n");
106 106
107 if (reconnect_task != GNUNET_SCHEDULER_NO_TASK) 107 if (reconnect_task != NULL)
108 GNUNET_SCHEDULER_cancel (reconnect_task); 108 GNUNET_SCHEDULER_cancel (reconnect_task);
109 reconnect_task = GNUNET_SCHEDULER_NO_TASK; 109 reconnect_task = NULL;
110 110
111 if (send_task != GNUNET_SCHEDULER_NO_TASK) 111 if (send_task != NULL)
112 GNUNET_SCHEDULER_cancel (send_task); 112 GNUNET_SCHEDULER_cancel (send_task);
113 send_task = GNUNET_SCHEDULER_NO_TASK; 113 send_task = NULL;
114 114
115 if (cc != NULL) 115 if (cc != NULL)
116 { 116 {
@@ -137,7 +137,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
137{ 137{
138 struct PeerContext *p = cls; 138 struct PeerContext *p = cls;
139 139
140 reconnect_task = GNUNET_SCHEDULER_NO_TASK; 140 reconnect_task = NULL;
141 GNUNET_TRANSPORT_try_connect (p1->th, &p2->id, NULL, NULL); /*FIXME TRY_CONNECT change */ 141 GNUNET_TRANSPORT_try_connect (p1->th, &p2->id, NULL, NULL); /*FIXME TRY_CONNECT change */
142 reconnect_task = 142 reconnect_task =
143 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &reconnect, p); 143 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &reconnect, p);
@@ -212,7 +212,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
212 { 212 {
213 GNUNET_break (0); 213 GNUNET_break (0);
214 ok = 1; 214 ok = 1;
215 if (die_task != GNUNET_SCHEDULER_NO_TASK) 215 if (die_task != NULL)
216 GNUNET_SCHEDULER_cancel (die_task); 216 GNUNET_SCHEDULER_cancel (die_task);
217 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 217 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
218 } 218 }
@@ -230,7 +230,7 @@ notify_ready (void *cls, size_t size, void *buf)
230 { 230 {
231 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 231 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
232 "Timeout occurred while waiting for transmit_ready\n"); 232 "Timeout occurred while waiting for transmit_ready\n");
233 if (GNUNET_SCHEDULER_NO_TASK != die_task) 233 if (NULL != die_task)
234 GNUNET_SCHEDULER_cancel (die_task); 234 GNUNET_SCHEDULER_cancel (die_task);
235 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 235 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
236 ok = 42; 236 ok = 42;
@@ -259,7 +259,7 @@ notify_ready (void *cls, size_t size, void *buf)
259static void 259static void
260sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 260sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
261{ 261{
262 send_task = GNUNET_SCHEDULER_NO_TASK; 262 send_task = NULL;
263 263
264 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 264 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
265 return; 265 return;
@@ -321,9 +321,9 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
321 if (th != NULL) 321 if (th != NULL)
322 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th); 322 GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
323 th = NULL; 323 th = NULL;
324 if (GNUNET_SCHEDULER_NO_TASK != send_task) 324 if (NULL != send_task)
325 GNUNET_SCHEDULER_cancel (send_task); 325 GNUNET_SCHEDULER_cancel (send_task);
326 send_task = GNUNET_SCHEDULER_NO_TASK; 326 send_task = NULL;
327} 327}
328 328
329 329
@@ -386,7 +386,7 @@ run (void *cls, char *const *args, const char *cfgfile,
386 if ((p1 == NULL) || (p2 == NULL)) 386 if ((p1 == NULL) || (p2 == NULL))
387 { 387 {
388 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 388 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
389 if (die_task != GNUNET_SCHEDULER_NO_TASK) 389 if (die_task != NULL)
390 GNUNET_SCHEDULER_cancel (die_task); 390 GNUNET_SCHEDULER_cancel (die_task);
391 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 391 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
392 return; 392 return;
@@ -406,7 +406,7 @@ check ()
406 GNUNET_GETOPT_OPTION_END 406 GNUNET_GETOPT_OPTION_END
407 }; 407 };
408 408
409 send_task = GNUNET_SCHEDULER_NO_TASK; 409 send_task = NULL;
410 410
411 ok = 1; 411 ok = 1;
412 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name, 412 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_timeout.c b/src/transport/test_transport_api_timeout.c
index 01af9f81b..d243e8fbe 100644
--- a/src/transport/test_transport_api_timeout.c
+++ b/src/transport/test_transport_api_timeout.c
@@ -48,9 +48,9 @@ static char *test_name;
48 48
49static int ok; 49static int ok;
50 50
51static GNUNET_SCHEDULER_TaskIdentifier die_task; 51static struct GNUNET_SCHEDULER_Task * die_task;
52 52
53static GNUNET_SCHEDULER_TaskIdentifier timer_task; 53static struct GNUNET_SCHEDULER_Task * timer_task;
54 54
55static struct GNUNET_TRANSPORT_TESTING_handle *tth; 55static struct GNUNET_TRANSPORT_TESTING_handle *tth;
56 56
@@ -85,16 +85,16 @@ end ()
85{ 85{
86 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 86 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
87 87
88 if (timer_task != GNUNET_SCHEDULER_NO_TASK) 88 if (timer_task != NULL)
89 { 89 {
90 GNUNET_SCHEDULER_cancel (timer_task); 90 GNUNET_SCHEDULER_cancel (timer_task);
91 timer_task = GNUNET_SCHEDULER_NO_TASK; 91 timer_task = NULL;
92 } 92 }
93 93
94 if (die_task != GNUNET_SCHEDULER_NO_TASK) 94 if (die_task != NULL)
95 { 95 {
96 GNUNET_SCHEDULER_cancel (die_task); 96 GNUNET_SCHEDULER_cancel (die_task);
97 die_task = GNUNET_SCHEDULER_NO_TASK; 97 die_task = NULL;
98 } 98 }
99 99
100 if (th != NULL) 100 if (th != NULL)
@@ -123,14 +123,14 @@ end ()
123static void 123static void
124end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 124end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
125{ 125{
126 die_task = GNUNET_SCHEDULER_NO_TASK; 126 die_task = NULL;
127 127
128 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 128 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
129 129
130 if (timer_task != GNUNET_SCHEDULER_NO_TASK) 130 if (timer_task != NULL)
131 { 131 {
132 GNUNET_SCHEDULER_cancel (timer_task); 132 GNUNET_SCHEDULER_cancel (timer_task);
133 timer_task = GNUNET_SCHEDULER_NO_TASK; 133 timer_task = NULL;
134 } 134 }
135 if (cc != NULL) 135 if (cc != NULL)
136 GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc); 136 GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc);
@@ -185,7 +185,7 @@ timer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
185{ 185{
186 static int percentage; 186 static int percentage;
187 187
188 timer_task = GNUNET_SCHEDULER_NO_TASK; 188 timer_task = NULL;
189 189
190 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 190 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
191 return; 191 return;
@@ -228,7 +228,7 @@ testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls)
228 GNUNET_STRINGS_relative_time_to_string (WAIT, 228 GNUNET_STRINGS_relative_time_to_string (WAIT,
229 GNUNET_YES)); 229 GNUNET_YES));
230 230
231 if (die_task != GNUNET_SCHEDULER_NO_TASK) 231 if (die_task != NULL)
232 GNUNET_SCHEDULER_cancel (die_task); 232 GNUNET_SCHEDULER_cancel (die_task);
233 die_task = GNUNET_SCHEDULER_add_delayed (WAIT, &end_badly, NULL); 233 die_task = GNUNET_SCHEDULER_add_delayed (WAIT, &end_badly, NULL);
234 234
@@ -279,7 +279,7 @@ run (void *cls, char *const *args, const char *cfgfile,
279 if ((p1 == NULL) || (p2 == NULL)) 279 if ((p1 == NULL) || (p2 == NULL))
280 { 280 {
281 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 281 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
282 if (die_task != GNUNET_SCHEDULER_NO_TASK) 282 if (die_task != NULL)
283 GNUNET_SCHEDULER_cancel (die_task); 283 GNUNET_SCHEDULER_cancel (die_task);
284 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 284 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
285 return; 285 return;
@@ -298,7 +298,7 @@ check ()
298 GNUNET_GETOPT_OPTION_END 298 GNUNET_GETOPT_OPTION_END
299 }; 299 };
300 300
301 timer_task = GNUNET_SCHEDULER_NO_TASK; 301 timer_task = NULL;
302 302
303 ok = 1; 303 ok = 1;
304 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, 304 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
diff --git a/src/transport/test_transport_api_unreliability_constant.c b/src/transport/test_transport_api_unreliability_constant.c
index 2ff1e4b0c..c859e802e 100644
--- a/src/transport/test_transport_api_unreliability_constant.c
+++ b/src/transport/test_transport_api_unreliability_constant.c
@@ -49,7 +49,7 @@ static char *test_name;
49 49
50static int ok; 50static int ok;
51 51
52static GNUNET_SCHEDULER_TaskIdentifier die_task; 52static struct GNUNET_SCHEDULER_Task * die_task;
53 53
54struct PeerContext *p1; 54struct PeerContext *p1;
55 55
@@ -134,7 +134,7 @@ end ()
134 "kb/s"); 134 "kb/s");
135 GNUNET_free (value_name); 135 GNUNET_free (value_name);
136 136
137 if (die_task != GNUNET_SCHEDULER_NO_TASK) 137 if (die_task != NULL)
138 GNUNET_SCHEDULER_cancel (die_task); 138 GNUNET_SCHEDULER_cancel (die_task);
139 139
140 if (th != NULL) 140 if (th != NULL)
@@ -160,7 +160,7 @@ end ()
160static void 160static void
161end_badly () 161end_badly ()
162{ 162{
163 die_task = GNUNET_SCHEDULER_NO_TASK; 163 die_task = NULL;
164 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 164 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
165 165
166 if (test_failed == GNUNET_NO) 166 if (test_failed == GNUNET_NO)
@@ -223,7 +223,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
223 { 223 {
224 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Expected message no %u, got %u\n", 224 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Expected message no %u, got %u\n",
225 msg_recv_expected, msg_recv); 225 msg_recv_expected, msg_recv);
226 if (GNUNET_SCHEDULER_NO_TASK != die_task) 226 if (NULL != die_task)
227 GNUNET_SCHEDULER_cancel (die_task); 227 GNUNET_SCHEDULER_cancel (die_task);
228 test_failed = GNUNET_YES; 228 test_failed = GNUNET_YES;
229 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 229 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
@@ -236,7 +236,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
236 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 236 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
237 "Expected message %u of size %u, got %u bytes of message %u\n", 237 "Expected message %u of size %u, got %u bytes of message %u\n",
238 ntohl (hdr->num), s, ntohs (message->size), ntohl (hdr->num)); 238 ntohl (hdr->num), s, ntohs (message->size), ntohl (hdr->num));
239 if (GNUNET_SCHEDULER_NO_TASK != die_task) 239 if (NULL != die_task)
240 GNUNET_SCHEDULER_cancel (die_task); 240 GNUNET_SCHEDULER_cancel (die_task);
241 test_failed = GNUNET_YES; 241 test_failed = GNUNET_YES;
242 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 242 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
@@ -249,7 +249,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
249 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 249 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
250 "Expected message %u with bits %u, but body did not match\n", 250 "Expected message %u with bits %u, but body did not match\n",
251 ntohl (hdr->num), (unsigned char) n); 251 ntohl (hdr->num), (unsigned char) n);
252 if (GNUNET_SCHEDULER_NO_TASK != die_task) 252 if (NULL != die_task)
253 GNUNET_SCHEDULER_cancel (die_task); 253 GNUNET_SCHEDULER_cancel (die_task);
254 test_failed = GNUNET_YES; 254 test_failed = GNUNET_YES;
255 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 255 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
@@ -266,7 +266,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
266 if (0 == (n % (TOTAL_MSGS / 100))) 266 if (0 == (n % (TOTAL_MSGS / 100)))
267 { 267 {
268 FPRINTF (stderr, "%s", "."); 268 FPRINTF (stderr, "%s", ".");
269 if (GNUNET_SCHEDULER_NO_TASK != die_task) 269 if (NULL != die_task)
270 GNUNET_SCHEDULER_cancel (die_task); 270 GNUNET_SCHEDULER_cancel (die_task);
271 test_failed = GNUNET_YES; 271 test_failed = GNUNET_YES;
272 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); 272 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
@@ -296,7 +296,7 @@ notify_ready (void *cls, size_t size, void *buf)
296 { 296 {
297 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 297 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
298 "Timeout occurred while waiting for transmit_ready\n"); 298 "Timeout occurred while waiting for transmit_ready\n");
299 if (GNUNET_SCHEDULER_NO_TASK != die_task) 299 if (NULL != die_task)
300 GNUNET_SCHEDULER_cancel (die_task); 300 GNUNET_SCHEDULER_cancel (die_task);
301 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 301 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
302 ok = 42; 302 ok = 42;
@@ -343,7 +343,7 @@ notify_ready (void *cls, size_t size, void *buf)
343 FPRINTF (stderr, "%s", "\n"); 343 FPRINTF (stderr, "%s", "\n");
344 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 344 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
345 "All messages scheduled to be sent!!\n"); 345 "All messages scheduled to be sent!!\n");
346 if (GNUNET_SCHEDULER_NO_TASK != die_task) 346 if (NULL != die_task)
347 GNUNET_SCHEDULER_cancel (die_task); 347 GNUNET_SCHEDULER_cancel (die_task);
348 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); 348 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
349 } 349 }
@@ -434,7 +434,7 @@ run (void *cls, char *const *args, const char *cfgfile,
434 if ((p1 == NULL) || (p2 == NULL)) 434 if ((p1 == NULL) || (p2 == NULL))
435 { 435 {
436 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n"); 436 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
437 if (die_task != GNUNET_SCHEDULER_NO_TASK) 437 if (die_task != NULL)
438 GNUNET_SCHEDULER_cancel (die_task); 438 GNUNET_SCHEDULER_cancel (die_task);
439 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 439 die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
440 return; 440 return;
diff --git a/src/transport/test_transport_blacklisting.c b/src/transport/test_transport_blacklisting.c
index fff27b69f..a14944a14 100644
--- a/src/transport/test_transport_blacklisting.c
+++ b/src/transport/test_transport_blacklisting.c
@@ -73,11 +73,11 @@ static int stage;
73static int ok; 73static int ok;
74static int connected; 74static int connected;
75 75
76static GNUNET_SCHEDULER_TaskIdentifier die_task; 76static struct GNUNET_SCHEDULER_Task * die_task;
77 77
78static GNUNET_SCHEDULER_TaskIdentifier timeout_task; 78static struct GNUNET_SCHEDULER_Task * timeout_task;
79 79
80static GNUNET_SCHEDULER_TaskIdentifier stage_task; 80static struct GNUNET_SCHEDULER_Task * stage_task;
81 81
82#if VERBOSE 82#if VERBOSE
83#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) 83#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
@@ -93,22 +93,22 @@ end(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
93{ 93{
94 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping\n"); 94 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping\n");
95 95
96 if (die_task != GNUNET_SCHEDULER_NO_TASK ) 96 if (die_task != NULL )
97 { 97 {
98 GNUNET_SCHEDULER_cancel (die_task); 98 GNUNET_SCHEDULER_cancel (die_task);
99 die_task = GNUNET_SCHEDULER_NO_TASK; 99 die_task = NULL;
100 } 100 }
101 101
102 if (timeout_task != GNUNET_SCHEDULER_NO_TASK ) 102 if (timeout_task != NULL )
103 { 103 {
104 GNUNET_SCHEDULER_cancel (timeout_task); 104 GNUNET_SCHEDULER_cancel (timeout_task);
105 timeout_task = GNUNET_SCHEDULER_NO_TASK; 105 timeout_task = NULL;
106 } 106 }
107 107
108 if (stage_task != GNUNET_SCHEDULER_NO_TASK ) 108 if (stage_task != NULL )
109 { 109 {
110 GNUNET_SCHEDULER_cancel (stage_task); 110 GNUNET_SCHEDULER_cancel (stage_task);
111 stage_task = GNUNET_SCHEDULER_NO_TASK; 111 stage_task = NULL;
112 } 112 }
113 113
114 if (cc != NULL ) 114 if (cc != NULL )
@@ -132,18 +132,18 @@ end(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
132static void 132static void
133end_badly(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 133end_badly(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
134{ 134{
135 die_task = GNUNET_SCHEDULER_NO_TASK; 135 die_task = NULL;
136 136
137 if (timeout_task != GNUNET_SCHEDULER_NO_TASK ) 137 if (timeout_task != NULL )
138 { 138 {
139 GNUNET_SCHEDULER_cancel (timeout_task); 139 GNUNET_SCHEDULER_cancel (timeout_task);
140 timeout_task = GNUNET_SCHEDULER_NO_TASK; 140 timeout_task = NULL;
141 } 141 }
142 142
143 if (stage_task != GNUNET_SCHEDULER_NO_TASK ) 143 if (stage_task != NULL )
144 { 144 {
145 GNUNET_SCHEDULER_cancel (stage_task); 145 GNUNET_SCHEDULER_cancel (stage_task);
146 stage_task = GNUNET_SCHEDULER_NO_TASK; 146 stage_task = NULL;
147 } 147 }
148 148
149 if (cc != NULL ) 149 if (cc != NULL )
@@ -176,7 +176,7 @@ static void
176connect_timeout(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 176connect_timeout(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
177{ 177{
178 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Peers not connected, next stage\n"); 178 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Peers not connected, next stage\n");
179 timeout_task = GNUNET_SCHEDULER_NO_TASK; 179 timeout_task = NULL;
180 stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL ); 180 stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL );
181} 181}
182 182
@@ -246,8 +246,8 @@ static int check_blacklist_config (char *cfg_file,
246static void 246static void
247run_stage(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 247run_stage(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
248{ 248{
249 stage_task = GNUNET_SCHEDULER_NO_TASK; 249 stage_task = NULL;
250 if (GNUNET_SCHEDULER_NO_TASK != die_task) 250 if (NULL != die_task)
251 GNUNET_SCHEDULER_cancel (die_task); 251 GNUNET_SCHEDULER_cancel (die_task);
252 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL ); 252 die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL );
253 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Running stage %u\n", stage); 253 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Running stage %u\n", stage);
diff --git a/src/transport/test_transport_startonly.c b/src/transport/test_transport_startonly.c
index 2deb3f58b..78ed825ac 100644
--- a/src/transport/test_transport_startonly.c
+++ b/src/transport/test_transport_startonly.c
@@ -37,7 +37,7 @@
37 37
38#define ITERATIONS 10 38#define ITERATIONS 10
39 39
40GNUNET_SCHEDULER_TaskIdentifier timeout_task; 40struct GNUNET_SCHEDULER_Task * timeout_task;
41 41
42static struct PeerContext *p1; 42static struct PeerContext *p1;
43 43
@@ -54,10 +54,10 @@ end ()
54{ 54{
55 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 55 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
56 56
57 if (timeout_task != GNUNET_SCHEDULER_NO_TASK) 57 if (timeout_task != NULL)
58 { 58 {
59 GNUNET_SCHEDULER_cancel (timeout_task); 59 GNUNET_SCHEDULER_cancel (timeout_task);
60 timeout_task = GNUNET_SCHEDULER_NO_TASK; 60 timeout_task = NULL;
61 } 61 }
62 GNUNET_TRANSPORT_TESTING_done (tth); 62 GNUNET_TRANSPORT_TESTING_done (tth);
63 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting\n"); 63 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting\n");
@@ -68,7 +68,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
68{ 68{
69 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 69 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
70 70
71 timeout_task = GNUNET_SCHEDULER_NO_TASK; 71 timeout_task = NULL;
72 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 72 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
73 return; 73 return;
74 74
diff --git a/src/transport/test_transport_testing.c b/src/transport/test_transport_testing.c
index 747168b17..fb5bf6068 100644
--- a/src/transport/test_transport_testing.c
+++ b/src/transport/test_transport_testing.c
@@ -34,7 +34,7 @@
34 */ 34 */
35#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 35#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
36 36
37GNUNET_SCHEDULER_TaskIdentifier timeout_task; 37struct GNUNET_SCHEDULER_Task * timeout_task;
38 38
39static struct PeerContext *p1; 39static struct PeerContext *p1;
40static struct PeerContext *p2; 40static struct PeerContext *p2;
@@ -52,7 +52,7 @@ end ()
52{ 52{
53 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 53 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
54 54
55 if (timeout_task != GNUNET_SCHEDULER_NO_TASK) 55 if (timeout_task != NULL)
56 GNUNET_SCHEDULER_cancel (timeout_task); 56 GNUNET_SCHEDULER_cancel (timeout_task);
57 57
58 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1); 58 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1);
@@ -64,7 +64,7 @@ end ()
64static void 64static void
65end_badly () 65end_badly ()
66{ 66{
67 timeout_task = GNUNET_SCHEDULER_NO_TASK; 67 timeout_task = NULL;
68 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 68 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
69 69
70 if (NULL != cc) 70 if (NULL != cc)
@@ -167,7 +167,7 @@ run (void *cls, char *const *args, const char *cfgfile,
167 { 167 {
168 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 168 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
169 "Peer1 was not started successfully\n"); 169 "Peer1 was not started successfully\n");
170 if (timeout_task != GNUNET_SCHEDULER_NO_TASK) 170 if (timeout_task != NULL)
171 GNUNET_SCHEDULER_cancel (timeout_task); 171 GNUNET_SCHEDULER_cancel (timeout_task);
172 timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 172 timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
173 } 173 }
@@ -175,7 +175,7 @@ run (void *cls, char *const *args, const char *cfgfile,
175 { 175 {
176 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 176 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
177 "Peer2 was not started successfully\n"); 177 "Peer2 was not started successfully\n");
178 if (timeout_task != GNUNET_SCHEDULER_NO_TASK) 178 if (timeout_task != NULL)
179 GNUNET_SCHEDULER_cancel (timeout_task); 179 GNUNET_SCHEDULER_cancel (timeout_task);
180 timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 180 timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
181 } 181 }
diff --git a/src/transport/test_transport_testing_restart.c b/src/transport/test_transport_testing_restart.c
index 8ca18f982..8a238cbd5 100644
--- a/src/transport/test_transport_testing_restart.c
+++ b/src/transport/test_transport_testing_restart.c
@@ -32,7 +32,7 @@
32 */ 32 */
33#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 33#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
34 34
35GNUNET_SCHEDULER_TaskIdentifier timeout_task; 35struct GNUNET_SCHEDULER_Task * timeout_task;
36 36
37static struct PeerContext *p; 37static struct PeerContext *p;
38 38
@@ -45,7 +45,7 @@ end ()
45{ 45{
46 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 46 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
47 47
48 if (timeout_task != GNUNET_SCHEDULER_NO_TASK) 48 if (timeout_task != NULL)
49 GNUNET_SCHEDULER_cancel (timeout_task); 49 GNUNET_SCHEDULER_cancel (timeout_task);
50 50
51 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p); 51 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p);
@@ -55,7 +55,7 @@ end ()
55static void 55static void
56end_badly () 56end_badly ()
57{ 57{
58 timeout_task = GNUNET_SCHEDULER_NO_TASK; 58 timeout_task = NULL;
59 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 59 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
60 60
61 if (NULL != p) 61 if (NULL != p)
@@ -119,7 +119,7 @@ run (void *cls, char *const *args, const char *cfgfile,
119 if (NULL == p) 119 if (NULL == p)
120 { 120 {
121 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to start peer\n"); 121 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to start peer\n");
122 if (timeout_task != GNUNET_SCHEDULER_NO_TASK) 122 if (timeout_task != NULL)
123 GNUNET_SCHEDULER_cancel (timeout_task); 123 GNUNET_SCHEDULER_cancel (timeout_task);
124 timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 124 timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
125 } 125 }
diff --git a/src/transport/test_transport_testing_startstop.c b/src/transport/test_transport_testing_startstop.c
index 22a4e5148..736c635e1 100644
--- a/src/transport/test_transport_testing_startstop.c
+++ b/src/transport/test_transport_testing_startstop.c
@@ -32,7 +32,7 @@
32 */ 32 */
33#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) 33#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
34 34
35GNUNET_SCHEDULER_TaskIdentifier timeout_task; 35struct GNUNET_SCHEDULER_Task * timeout_task;
36 36
37static struct PeerContext *p; 37static struct PeerContext *p;
38 38
@@ -45,7 +45,7 @@ end ()
45{ 45{
46 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); 46 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
47 47
48 if (timeout_task != GNUNET_SCHEDULER_NO_TASK) 48 if (timeout_task != NULL)
49 GNUNET_SCHEDULER_cancel (timeout_task); 49 GNUNET_SCHEDULER_cancel (timeout_task);
50 50
51 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p); 51 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p);
@@ -55,7 +55,7 @@ end ()
55static void 55static void
56end_badly () 56end_badly ()
57{ 57{
58 timeout_task = GNUNET_SCHEDULER_NO_TASK; 58 timeout_task = NULL;
59 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 59 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
60 60
61 if (NULL != p) 61 if (NULL != p)
@@ -100,7 +100,7 @@ run (void *cls, char *const *args, const char *cfgfile,
100 if (NULL == p) 100 if (NULL == p)
101 { 101 {
102 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to start peer\n"); 102 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to start peer\n");
103 if (timeout_task != GNUNET_SCHEDULER_NO_TASK) 103 if (timeout_task != NULL)
104 GNUNET_SCHEDULER_cancel (timeout_task); 104 GNUNET_SCHEDULER_cancel (timeout_task);
105 timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL); 105 timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
106 } 106 }
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c
index d25d3f4b7..517daf82a 100644
--- a/src/transport/transport-testing.c
+++ b/src/transport/transport-testing.c
@@ -193,7 +193,7 @@ try_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
193 struct PeerContext *p1 = cc->p1; 193 struct PeerContext *p1 = cc->p1;
194 struct PeerContext *p2 = cc->p2; 194 struct PeerContext *p2 = cc->p2;
195 195
196 cc->tct = GNUNET_SCHEDULER_NO_TASK; 196 cc->tct = NULL;
197 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 197 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
198 return; 198 return;
199 199
@@ -534,9 +534,9 @@ GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct
534 "Canceling connect request %p!\n", 534 "Canceling connect request %p!\n",
535 cc); 535 cc);
536 536
537 if (cc->tct != GNUNET_SCHEDULER_NO_TASK) 537 if (cc->tct != NULL)
538 GNUNET_SCHEDULER_cancel (cc->tct); 538 GNUNET_SCHEDULER_cancel (cc->tct);
539 cc->tct = GNUNET_SCHEDULER_NO_TASK; 539 cc->tct = NULL;
540 540
541 GNUNET_CONTAINER_DLL_remove (tth->cc_head, tth->cc_tail, cc); 541 GNUNET_CONTAINER_DLL_remove (tth->cc_head, tth->cc_tail, cc);
542 GNUNET_free (cc); 542 GNUNET_free (cc);
diff --git a/src/transport/transport-testing.h b/src/transport/transport-testing.h
index 99225936a..a010733e7 100644
--- a/src/transport/transport-testing.h
+++ b/src/transport/transport-testing.h
@@ -153,7 +153,7 @@ struct ConnectingContext
153 struct ConnectingContext *prev; 153 struct ConnectingContext *prev;
154 struct PeerContext *p1; 154 struct PeerContext *p1;
155 struct PeerContext *p2; 155 struct PeerContext *p2;
156 GNUNET_SCHEDULER_TaskIdentifier tct; 156 struct GNUNET_SCHEDULER_Task * tct;
157 GNUNET_TRANSPORT_TESTING_connect_cb cb; 157 GNUNET_TRANSPORT_TESTING_connect_cb cb;
158 void *cb_cls; 158 void *cb_cls;
159 struct GNUNET_TRANSPORT_Handle *th_p1; 159 struct GNUNET_TRANSPORT_Handle *th_p1;
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index 7fa035c06..fd352a1e5 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -84,7 +84,7 @@ struct GNUNET_TRANSPORT_TransmitHandle
84 * Task to trigger request timeout if the request is stalled due to 84 * Task to trigger request timeout if the request is stalled due to
85 * congestion. 85 * congestion.
86 */ 86 */
87 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 87 struct GNUNET_SCHEDULER_Task * timeout_task;
88 88
89 /** 89 /**
90 * How many bytes is our notify callback waiting for? 90 * How many bytes is our notify callback waiting for?
@@ -171,7 +171,7 @@ struct GNUNET_TRANSPORT_GetHelloHandle
171 /** 171 /**
172 * Task for calling the HelloUpdateCallback when we already have a HELLO 172 * Task for calling the HelloUpdateCallback when we already have a HELLO
173 */ 173 */
174 GNUNET_SCHEDULER_TaskIdentifier notify_task; 174 struct GNUNET_SCHEDULER_Task * notify_task;
175 175
176 /** 176 /**
177 * Closure for @e rec. 177 * Closure for @e rec.
@@ -295,7 +295,7 @@ struct GNUNET_TRANSPORT_OfferHelloHandle
295 /** 295 /**
296 * Function to call once we are done. 296 * Function to call once we are done.
297 */ 297 */
298 GNUNET_SCHEDULER_Task cont; 298 GNUNET_SCHEDULER_TaskCallback cont;
299 299
300 /** 300 /**
301 * Closure for @e cont 301 * Closure for @e cont
@@ -434,7 +434,7 @@ struct GNUNET_TRANSPORT_Handle
434 /** 434 /**
435 * ID of the task trying to reconnect to the service. 435 * ID of the task trying to reconnect to the service.
436 */ 436 */
437 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 437 struct GNUNET_SCHEDULER_Task * reconnect_task;
438 438
439 /** 439 /**
440 * ID of the task trying to trigger transmission for a peer while 440 * ID of the task trying to trigger transmission for a peer while
@@ -442,7 +442,7 @@ struct GNUNET_TRANSPORT_Handle
442 * messages and the smallest entry in the 'ready_heap' has a time 442 * messages and the smallest entry in the 'ready_heap' has a time
443 * stamp in the future. 443 * stamp in the future.
444 */ 444 */
445 GNUNET_SCHEDULER_TaskIdentifier quota_task; 445 struct GNUNET_SCHEDULER_Task * quota_task;
446 446
447 /** 447 /**
448 * Delay until we try to reconnect. 448 * Delay until we try to reconnect.
@@ -754,9 +754,9 @@ demultiplexer (void *cls,
754 n->is_ready = GNUNET_YES; 754 n->is_ready = GNUNET_YES;
755 if ((NULL != n->th) && (NULL == n->hn)) 755 if ((NULL != n->th) && (NULL == n->hn))
756 { 756 {
757 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != n->th->timeout_task); 757 GNUNET_assert (NULL != n->th->timeout_task);
758 GNUNET_SCHEDULER_cancel (n->th->timeout_task); 758 GNUNET_SCHEDULER_cancel (n->th->timeout_task);
759 n->th->timeout_task = GNUNET_SCHEDULER_NO_TASK; 759 n->th->timeout_task = NULL;
760 /* we've been waiting for this (congestion, not quota, 760 /* we've been waiting for this (congestion, not quota,
761 * caused delayed transmission) */ 761 * caused delayed transmission) */
762 n->hn = GNUNET_CONTAINER_heap_insert (h->ready_heap, n, 0); 762 n->hn = GNUNET_CONTAINER_heap_insert (h->ready_heap, n, 0);
@@ -835,7 +835,7 @@ timeout_request_due_to_congestion (void *cls,
835 struct GNUNET_TRANSPORT_TransmitHandle *th = cls; 835 struct GNUNET_TRANSPORT_TransmitHandle *th = cls;
836 struct Neighbour *n = th->neighbour; 836 struct Neighbour *n = th->neighbour;
837 837
838 n->th->timeout_task = GNUNET_SCHEDULER_NO_TASK; 838 n->th->timeout_task = NULL;
839 GNUNET_assert (th == n->th); 839 GNUNET_assert (th == n->th);
840 GNUNET_assert (NULL == n->hn); 840 GNUNET_assert (NULL == n->hn);
841 n->th = NULL; 841 n->th = NULL;
@@ -897,7 +897,7 @@ transport_notify_ready (void *cls, size_t size, void *buf)
897 /* peer not ready, wait for notification! */ 897 /* peer not ready, wait for notification! */
898 GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap)); 898 GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap));
899 n->hn = NULL; 899 n->hn = NULL;
900 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == n->th->timeout_task); 900 GNUNET_assert (NULL == n->th->timeout_task);
901 n->th->timeout_task = 901 n->th->timeout_task =
902 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining 902 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
903 (n->th->timeout), 903 (n->th->timeout),
@@ -963,7 +963,7 @@ schedule_transmission_task (void *cls,
963 struct GNUNET_TRANSPORT_TransmitHandle *th; 963 struct GNUNET_TRANSPORT_TransmitHandle *th;
964 struct Neighbour *n; 964 struct Neighbour *n;
965 965
966 h->quota_task = GNUNET_SCHEDULER_NO_TASK; 966 h->quota_task = NULL;
967 GNUNET_assert (NULL != h->client); 967 GNUNET_assert (NULL != h->client);
968 /* destroy all requests that have timed out */ 968 /* destroy all requests that have timed out */
969 while ((NULL != (n = GNUNET_CONTAINER_heap_peek (h->ready_heap))) && 969 while ((NULL != (n = GNUNET_CONTAINER_heap_peek (h->ready_heap))) &&
@@ -1018,10 +1018,10 @@ schedule_transmission (struct GNUNET_TRANSPORT_Handle *h)
1018 struct Neighbour *n; 1018 struct Neighbour *n;
1019 1019
1020 GNUNET_assert (NULL != h->client); 1020 GNUNET_assert (NULL != h->client);
1021 if (h->quota_task != GNUNET_SCHEDULER_NO_TASK) 1021 if (h->quota_task != NULL)
1022 { 1022 {
1023 GNUNET_SCHEDULER_cancel (h->quota_task); 1023 GNUNET_SCHEDULER_cancel (h->quota_task);
1024 h->quota_task = GNUNET_SCHEDULER_NO_TASK; 1024 h->quota_task = NULL;
1025 } 1025 }
1026 if (NULL != h->control_head) 1026 if (NULL != h->control_head)
1027 delay = GNUNET_TIME_UNIT_ZERO; 1027 delay = GNUNET_TIME_UNIT_ZERO;
@@ -1127,7 +1127,7 @@ reconnect (void *cls,
1127{ 1127{
1128 struct GNUNET_TRANSPORT_Handle *h = cls; 1128 struct GNUNET_TRANSPORT_Handle *h = cls;
1129 1129
1130 h->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1130 h->reconnect_task = NULL;
1131 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1131 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1132 { 1132 {
1133 /* shutdown, just give up */ 1133 /* shutdown, just give up */
@@ -1158,7 +1158,7 @@ disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h)
1158{ 1158{
1159 struct GNUNET_TRANSPORT_TransmitHandle *th; 1159 struct GNUNET_TRANSPORT_TransmitHandle *th;
1160 1160
1161 GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK); 1161 GNUNET_assert (h->reconnect_task == NULL);
1162 if (NULL != h->cth) 1162 if (NULL != h->cth)
1163 { 1163 {
1164 GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth); 1164 GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth);
@@ -1174,10 +1174,10 @@ disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h)
1174 /* Forget about all neighbours that we used to be connected to */ 1174 /* Forget about all neighbours that we used to be connected to */
1175 GNUNET_CONTAINER_multipeermap_iterate (h->neighbours, 1175 GNUNET_CONTAINER_multipeermap_iterate (h->neighbours,
1176 &neighbour_delete, h); 1176 &neighbour_delete, h);
1177 if (h->quota_task != GNUNET_SCHEDULER_NO_TASK) 1177 if (h->quota_task != NULL)
1178 { 1178 {
1179 GNUNET_SCHEDULER_cancel (h->quota_task); 1179 GNUNET_SCHEDULER_cancel (h->quota_task);
1180 h->quota_task = GNUNET_SCHEDULER_NO_TASK; 1180 h->quota_task = NULL;
1181 } 1181 }
1182 while ((NULL != (th = h->control_head))) 1182 while ((NULL != (th = h->control_head)))
1183 { 1183 {
@@ -1577,7 +1577,7 @@ GNUNET_TRANSPORT_set_traffic_metric (struct GNUNET_TRANSPORT_Handle *handle,
1577struct GNUNET_TRANSPORT_OfferHelloHandle * 1577struct GNUNET_TRANSPORT_OfferHelloHandle *
1578GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, 1578GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
1579 const struct GNUNET_MessageHeader *hello, 1579 const struct GNUNET_MessageHeader *hello,
1580 GNUNET_SCHEDULER_Task cont, void *cls) 1580 GNUNET_SCHEDULER_TaskCallback cont, void *cls)
1581{ 1581{
1582 struct GNUNET_TRANSPORT_OfferHelloHandle *ohh; 1582 struct GNUNET_TRANSPORT_OfferHelloHandle *ohh;
1583 struct GNUNET_MessageHeader *msg; 1583 struct GNUNET_MessageHeader *msg;
@@ -1663,8 +1663,8 @@ call_hello_update_cb_async (void *cls,
1663 struct GNUNET_TRANSPORT_GetHelloHandle *ghh = cls; 1663 struct GNUNET_TRANSPORT_GetHelloHandle *ghh = cls;
1664 1664
1665 GNUNET_assert (NULL != ghh->handle->my_hello); 1665 GNUNET_assert (NULL != ghh->handle->my_hello);
1666 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != ghh->notify_task); 1666 GNUNET_assert (NULL != ghh->notify_task);
1667 ghh->notify_task = GNUNET_SCHEDULER_NO_TASK; 1667 ghh->notify_task = NULL;
1668 ghh->rec (ghh->rec_cls, 1668 ghh->rec (ghh->rec_cls,
1669 (const struct GNUNET_MessageHeader *) ghh->handle->my_hello); 1669 (const struct GNUNET_MessageHeader *) ghh->handle->my_hello);
1670} 1670}
@@ -1711,7 +1711,7 @@ GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_GetHelloHandle *ghh)
1711{ 1711{
1712 struct GNUNET_TRANSPORT_Handle *handle = ghh->handle; 1712 struct GNUNET_TRANSPORT_Handle *handle = ghh->handle;
1713 1713
1714 if (GNUNET_SCHEDULER_NO_TASK != ghh->notify_task) 1714 if (NULL != ghh->notify_task)
1715 GNUNET_SCHEDULER_cancel (ghh->notify_task); 1715 GNUNET_SCHEDULER_cancel (ghh->notify_task);
1716 GNUNET_CONTAINER_DLL_remove (handle->hwl_head, handle->hwl_tail, ghh); 1716 GNUNET_CONTAINER_DLL_remove (handle->hwl_head, handle->hwl_tail, ghh);
1717 GNUNET_free (ghh); 1717 GNUNET_free (ghh);
@@ -1810,20 +1810,20 @@ GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle)
1810 LOG (GNUNET_ERROR_TYPE_DEBUG, 1810 LOG (GNUNET_ERROR_TYPE_DEBUG,
1811 "Transport disconnect called!\n"); 1811 "Transport disconnect called!\n");
1812 /* this disconnects all neighbours... */ 1812 /* this disconnects all neighbours... */
1813 if (handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK) 1813 if (handle->reconnect_task == NULL)
1814 disconnect_and_schedule_reconnect (handle); 1814 disconnect_and_schedule_reconnect (handle);
1815 /* and now we stop trying to connect again... */ 1815 /* and now we stop trying to connect again... */
1816 if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK) 1816 if (handle->reconnect_task != NULL)
1817 { 1817 {
1818 GNUNET_SCHEDULER_cancel (handle->reconnect_task); 1818 GNUNET_SCHEDULER_cancel (handle->reconnect_task);
1819 handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1819 handle->reconnect_task = NULL;
1820 } 1820 }
1821 GNUNET_CONTAINER_multipeermap_destroy (handle->neighbours); 1821 GNUNET_CONTAINER_multipeermap_destroy (handle->neighbours);
1822 handle->neighbours = NULL; 1822 handle->neighbours = NULL;
1823 if (handle->quota_task != GNUNET_SCHEDULER_NO_TASK) 1823 if (handle->quota_task != NULL)
1824 { 1824 {
1825 GNUNET_SCHEDULER_cancel (handle->quota_task); 1825 GNUNET_SCHEDULER_cancel (handle->quota_task);
1826 handle->quota_task = GNUNET_SCHEDULER_NO_TASK; 1826 handle->quota_task = NULL;
1827 } 1827 }
1828 GNUNET_free_non_null (handle->my_hello); 1828 GNUNET_free_non_null (handle->my_hello);
1829 handle->my_hello = NULL; 1829 handle->my_hello = NULL;
@@ -1926,9 +1926,9 @@ GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct GNUNET_TRANSPORT_TransmitH
1926 } 1926 }
1927 else 1927 else
1928 { 1928 {
1929 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != th->timeout_task); 1929 GNUNET_assert (NULL != th->timeout_task);
1930 GNUNET_SCHEDULER_cancel (th->timeout_task); 1930 GNUNET_SCHEDULER_cancel (th->timeout_task);
1931 th->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1931 th->timeout_task = NULL;
1932 } 1932 }
1933 GNUNET_free (th); 1933 GNUNET_free (th);
1934} 1934}
diff --git a/src/transport/transport_api_monitor_peers.c b/src/transport/transport_api_monitor_peers.c
index 611580f68..aaf1000f6 100644
--- a/src/transport/transport_api_monitor_peers.c
+++ b/src/transport/transport_api_monitor_peers.c
@@ -74,7 +74,7 @@ struct GNUNET_TRANSPORT_PeerMonitoringContext
74 /** 74 /**
75 * Task ID for reconnect. 75 * Task ID for reconnect.
76 */ 76 */
77 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 77 struct GNUNET_SCHEDULER_Task * reconnect_task;
78 78
79 /** 79 /**
80 * Identity of the peer to monitor. 80 * Identity of the peer to monitor.
@@ -212,7 +212,7 @@ do_peer_connect (void *cls,
212{ 212{
213 struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx = cls; 213 struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx = cls;
214 214
215 pal_ctx->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 215 pal_ctx->reconnect_task = NULL;
216 pal_ctx->client = GNUNET_CLIENT_connect ("transport", pal_ctx->cfg); 216 pal_ctx->client = GNUNET_CLIENT_connect ("transport", pal_ctx->cfg);
217 GNUNET_assert (NULL != pal_ctx->client); 217 GNUNET_assert (NULL != pal_ctx->client);
218 send_peer_mon_request (pal_ctx); 218 send_peer_mon_request (pal_ctx);
@@ -455,10 +455,10 @@ GNUNET_TRANSPORT_monitor_peers_cancel (struct GNUNET_TRANSPORT_PeerMonitoringCon
455 GNUNET_CLIENT_disconnect (pic->client); 455 GNUNET_CLIENT_disconnect (pic->client);
456 pic->client = NULL; 456 pic->client = NULL;
457 } 457 }
458 if (GNUNET_SCHEDULER_NO_TASK != pic->reconnect_task) 458 if (NULL != pic->reconnect_task)
459 { 459 {
460 GNUNET_SCHEDULER_cancel (pic->reconnect_task); 460 GNUNET_SCHEDULER_cancel (pic->reconnect_task);
461 pic->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 461 pic->reconnect_task = NULL;
462 } 462 }
463 GNUNET_free (pic); 463 GNUNET_free (pic);
464} 464}
diff --git a/src/transport/transport_api_monitor_plugins.c b/src/transport/transport_api_monitor_plugins.c
index 0c6cb9214..6ecee9c98 100644
--- a/src/transport/transport_api_monitor_plugins.c
+++ b/src/transport/transport_api_monitor_plugins.c
@@ -72,7 +72,7 @@ struct GNUNET_TRANSPORT_PluginMonitor
72 /** 72 /**
73 * Task ID for reconnect. 73 * Task ID for reconnect.
74 */ 74 */
75 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 75 struct GNUNET_SCHEDULER_Task * reconnect_task;
76 76
77}; 77};
78 78
@@ -141,7 +141,7 @@ do_plugin_connect (void *cls,
141{ 141{
142 struct GNUNET_TRANSPORT_PluginMonitor *pm = cls; 142 struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
143 143
144 pm->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 144 pm->reconnect_task = NULL;
145 pm->client = GNUNET_CLIENT_connect ("transport", pm->cfg); 145 pm->client = GNUNET_CLIENT_connect ("transport", pm->cfg);
146 GNUNET_assert (NULL != pm->client); 146 GNUNET_assert (NULL != pm->client);
147 send_plugin_mon_request (pm); 147 send_plugin_mon_request (pm);
@@ -442,10 +442,10 @@ GNUNET_TRANSPORT_monitor_plugins_cancel (struct GNUNET_TRANSPORT_PluginMonitor *
442 GNUNET_CLIENT_disconnect (pm->client); 442 GNUNET_CLIENT_disconnect (pm->client);
443 pm->client = NULL; 443 pm->client = NULL;
444 } 444 }
445 if (GNUNET_SCHEDULER_NO_TASK != pm->reconnect_task) 445 if (NULL != pm->reconnect_task)
446 { 446 {
447 GNUNET_SCHEDULER_cancel (pm->reconnect_task); 447 GNUNET_SCHEDULER_cancel (pm->reconnect_task);
448 pm->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 448 pm->reconnect_task = NULL;
449 } 449 }
450 clear_map (pm); 450 clear_map (pm);
451 GNUNET_CONTAINER_multihashmap32_destroy (pm->sessions); 451 GNUNET_CONTAINER_multihashmap32_destroy (pm->sessions);
diff --git a/src/transport/transport_api_monitor_validation.c b/src/transport/transport_api_monitor_validation.c
index 621a6b00e..a82e3c156 100644
--- a/src/transport/transport_api_monitor_validation.c
+++ b/src/transport/transport_api_monitor_validation.c
@@ -72,7 +72,7 @@ struct GNUNET_TRANSPORT_ValidationMonitoringContext
72 /** 72 /**
73 * Task ID for reconnect. 73 * Task ID for reconnect.
74 */ 74 */
75 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 75 struct GNUNET_SCHEDULER_Task * reconnect_task;
76 76
77 /** 77 /**
78 * Identity of the peer to monitor. 78 * Identity of the peer to monitor.
@@ -162,7 +162,7 @@ do_val_connect (void *cls,
162{ 162{
163 struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx = cls; 163 struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx = cls;
164 164
165 val_ctx->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 165 val_ctx->reconnect_task = NULL;
166 val_ctx->client = GNUNET_CLIENT_connect ("transport", val_ctx->cfg); 166 val_ctx->client = GNUNET_CLIENT_connect ("transport", val_ctx->cfg);
167 GNUNET_assert (NULL != val_ctx->client); 167 GNUNET_assert (NULL != val_ctx->client);
168 send_val_mon_request (val_ctx); 168 send_val_mon_request (val_ctx);
@@ -412,10 +412,10 @@ GNUNET_TRANSPORT_monitor_validation_entries_cancel (struct GNUNET_TRANSPORT_Vali
412 GNUNET_CLIENT_disconnect (vic->client); 412 GNUNET_CLIENT_disconnect (vic->client);
413 vic->client = NULL; 413 vic->client = NULL;
414 } 414 }
415 if (GNUNET_SCHEDULER_NO_TASK != vic->reconnect_task) 415 if (NULL != vic->reconnect_task)
416 { 416 {
417 GNUNET_SCHEDULER_cancel (vic->reconnect_task); 417 GNUNET_SCHEDULER_cancel (vic->reconnect_task);
418 vic->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 418 vic->reconnect_task = NULL;
419 } 419 }
420 GNUNET_free (vic); 420 GNUNET_free (vic);
421} 421}
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 6b671ad2a..a71dd76df 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -123,7 +123,7 @@ libgnunetutil_la_LIBADD = \
123 123
124libgnunetutil_la_LDFLAGS = \ 124libgnunetutil_la_LDFLAGS = \
125 $(GN_LIB_LDFLAGS) \ 125 $(GN_LIB_LDFLAGS) \
126 -version-info 12:0:0 126 -version-info 13:0:0
127 127
128if HAVE_TESTING 128if HAVE_TESTING
129 GNUNET_ECC = gnunet-ecc 129 GNUNET_ECC = gnunet-ecc
diff --git a/src/util/bandwidth.c b/src/util/bandwidth.c
index 18b846869..ceec09b52 100644
--- a/src/util/bandwidth.c
+++ b/src/util/bandwidth.c
@@ -131,7 +131,7 @@ excess_trigger (void *cls,
131{ 131{
132 struct GNUNET_BANDWIDTH_Tracker *av = cls; 132 struct GNUNET_BANDWIDTH_Tracker *av = cls;
133 133
134 av->excess_task = GNUNET_SCHEDULER_NO_TASK; 134 av->excess_task = NULL;
135 135
136 if (NULL != av->excess_cb) 136 if (NULL != av->excess_cb)
137 av->excess_cb (av->excess_cb_cls); 137 av->excess_cb (av->excess_cb_cls);
@@ -179,7 +179,7 @@ update_excess (struct GNUNET_BANDWIDTH_Tracker *av)
179 delay = GNUNET_TIME_relative_divide (delay, 179 delay = GNUNET_TIME_relative_divide (delay,
180 av->available_bytes_per_s__); 180 av->available_bytes_per_s__);
181 } 181 }
182 if (GNUNET_SCHEDULER_NO_TASK != av->excess_task) 182 if (NULL != av->excess_task)
183 GNUNET_SCHEDULER_cancel (av->excess_task); 183 GNUNET_SCHEDULER_cancel (av->excess_task);
184 av->excess_task = GNUNET_SCHEDULER_add_delayed (delay, 184 av->excess_task = GNUNET_SCHEDULER_add_delayed (delay,
185 &excess_trigger, 185 &excess_trigger,
@@ -273,9 +273,9 @@ GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av,
273void 273void
274GNUNET_BANDWIDTH_tracker_notification_stop (struct GNUNET_BANDWIDTH_Tracker *av) 274GNUNET_BANDWIDTH_tracker_notification_stop (struct GNUNET_BANDWIDTH_Tracker *av)
275{ 275{
276 if (GNUNET_SCHEDULER_NO_TASK != av->excess_task) 276 if (NULL != av->excess_task)
277 GNUNET_SCHEDULER_cancel (av->excess_task); 277 GNUNET_SCHEDULER_cancel (av->excess_task);
278 av->excess_task = GNUNET_SCHEDULER_NO_TASK; 278 av->excess_task = NULL;
279 av->excess_cb = NULL; 279 av->excess_cb = NULL;
280 av->excess_cb_cls = NULL; 280 av->excess_cb_cls = NULL;
281 av->update_cb = NULL; 281 av->update_cb = NULL;
diff --git a/src/util/client.c b/src/util/client.c
index c222a0ff7..7128a2de4 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -70,7 +70,7 @@ struct GNUNET_CLIENT_TransmitHandle
70 * If we are re-trying and are delaying to do so, 70 * If we are re-trying and are delaying to do so,
71 * handle to the scheduled task managing the delay. 71 * handle to the scheduled task managing the delay.
72 */ 72 */
73 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 73 struct GNUNET_SCHEDULER_Task * reconnect_task;
74 74
75 /** 75 /**
76 * Timeout for the operation overall. 76 * Timeout for the operation overall.
@@ -182,7 +182,7 @@ struct GNUNET_CLIENT_Connection
182 * If we are re-trying and are delaying to do so, 182 * If we are re-trying and are delaying to do so,
183 * handle to the scheduled task managing the delay. 183 * handle to the scheduled task managing the delay.
184 */ 184 */
185 GNUNET_SCHEDULER_TaskIdentifier receive_task; 185 struct GNUNET_SCHEDULER_Task * receive_task;
186 186
187 /** 187 /**
188 * Buffer for received message. 188 * Buffer for received message.
@@ -457,10 +457,10 @@ GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *client)
457 GNUNET_CONNECTION_destroy (client->connection); 457 GNUNET_CONNECTION_destroy (client->connection);
458 client->connection = NULL; 458 client->connection = NULL;
459 } 459 }
460 if (GNUNET_SCHEDULER_NO_TASK != client->receive_task) 460 if (NULL != client->receive_task)
461 { 461 {
462 GNUNET_SCHEDULER_cancel (client->receive_task); 462 GNUNET_SCHEDULER_cancel (client->receive_task);
463 client->receive_task = GNUNET_SCHEDULER_NO_TASK; 463 client->receive_task = NULL;
464 } 464 }
465 if (NULL != client->tag) 465 if (NULL != client->tag)
466 { 466 {
@@ -581,7 +581,7 @@ receive_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
581 ntohs (cmsg->type), 581 ntohs (cmsg->type),
582 msize, 582 msize,
583 client->service_name); 583 client->service_name);
584 client->receive_task = GNUNET_SCHEDULER_NO_TASK; 584 client->receive_task = NULL;
585 GNUNET_assert (GNUNET_YES == client->msg_complete); 585 GNUNET_assert (GNUNET_YES == client->msg_complete);
586 GNUNET_assert (client->received_pos >= msize); 586 GNUNET_assert (client->received_pos >= msize);
587 memcpy (msg, cmsg, msize); 587 memcpy (msg, cmsg, msize);
@@ -623,7 +623,7 @@ GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *client,
623 client->receive_timeout = GNUNET_TIME_relative_to_absolute (timeout); 623 client->receive_timeout = GNUNET_TIME_relative_to_absolute (timeout);
624 if (GNUNET_YES == client->msg_complete) 624 if (GNUNET_YES == client->msg_complete)
625 { 625 {
626 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == client->receive_task); 626 GNUNET_assert (NULL == client->receive_task);
627 client->receive_task = GNUNET_SCHEDULER_add_now (&receive_task, client); 627 client->receive_task = GNUNET_SCHEDULER_add_now (&receive_task, client);
628 } 628 }
629 else 629 else
@@ -670,7 +670,7 @@ struct GNUNET_CLIENT_TestHandle
670 /** 670 /**
671 * ID of task used for asynchronous operations. 671 * ID of task used for asynchronous operations.
672 */ 672 */
673 GNUNET_SCHEDULER_TaskIdentifier task; 673 struct GNUNET_SCHEDULER_Task * task;
674 674
675 /** 675 /**
676 * Final result to report back (once known). 676 * Final result to report back (once known).
@@ -697,10 +697,10 @@ GNUNET_CLIENT_service_test_cancel (struct GNUNET_CLIENT_TestHandle *th)
697 GNUNET_CLIENT_disconnect (th->client); 697 GNUNET_CLIENT_disconnect (th->client);
698 th->client = NULL; 698 th->client = NULL;
699 } 699 }
700 if (GNUNET_SCHEDULER_NO_TASK != th->task) 700 if (NULL != th->task)
701 { 701 {
702 GNUNET_SCHEDULER_cancel (th->task); 702 GNUNET_SCHEDULER_cancel (th->task);
703 th->task = GNUNET_SCHEDULER_NO_TASK; 703 th->task = NULL;
704 } 704 }
705 GNUNET_free (th); 705 GNUNET_free (th);
706} 706}
@@ -719,7 +719,7 @@ report_result (void *cls,
719{ 719{
720 struct GNUNET_CLIENT_TestHandle *th = cls; 720 struct GNUNET_CLIENT_TestHandle *th = cls;
721 721
722 th->task = GNUNET_SCHEDULER_NO_TASK; 722 th->task = NULL;
723 th->cb (th->cb_cls, th->result); 723 th->cb (th->cb_cls, th->result);
724 GNUNET_CLIENT_service_test_cancel (th); 724 GNUNET_CLIENT_service_test_cancel (th);
725} 725}
@@ -1053,7 +1053,7 @@ client_delayed_retry (void *cls,
1053 struct GNUNET_CLIENT_TransmitHandle *th = cls; 1053 struct GNUNET_CLIENT_TransmitHandle *th = cls;
1054 struct GNUNET_TIME_Relative delay; 1054 struct GNUNET_TIME_Relative delay;
1055 1055
1056 th->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1056 th->reconnect_task = NULL;
1057 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1057 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1058 { 1058 {
1059 /* give up, was shutdown */ 1059 /* give up, was shutdown */
@@ -1077,7 +1077,7 @@ client_delayed_retry (void *cls,
1077 "Transmission failed %u times, trying again in %s.\n", 1077 "Transmission failed %u times, trying again in %s.\n",
1078 MAX_ATTEMPTS - th->attempts_left, 1078 MAX_ATTEMPTS - th->attempts_left,
1079 GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES)); 1079 GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
1080 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == th->reconnect_task); 1080 GNUNET_assert (NULL == th->reconnect_task);
1081 th->reconnect_task = 1081 th->reconnect_task =
1082 GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th); 1082 GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th);
1083 return; 1083 return;
@@ -1155,7 +1155,7 @@ client_notify (void *cls, size_t size, void *buf)
1155 MAX_ATTEMPTS - th->attempts_left, 1155 MAX_ATTEMPTS - th->attempts_left,
1156 GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES)); 1156 GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
1157 client->th = th; 1157 client->th = th;
1158 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == th->reconnect_task); 1158 GNUNET_assert (NULL == th->reconnect_task);
1159 th->reconnect_task = 1159 th->reconnect_task =
1160 GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th); 1160 GNUNET_SCHEDULER_add_delayed (delay, &client_delayed_retry, th);
1161 return 0; 1161 return 0;
@@ -1224,7 +1224,7 @@ GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *client,
1224 client->th = th; 1224 client->th = th;
1225 if (NULL == client->connection) 1225 if (NULL == client->connection)
1226 { 1226 {
1227 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == th->reconnect_task); 1227 GNUNET_assert (NULL == th->reconnect_task);
1228 th->reconnect_task = 1228 th->reconnect_task =
1229 GNUNET_SCHEDULER_add_delayed (client->back_off, 1229 GNUNET_SCHEDULER_add_delayed (client->back_off,
1230 &client_delayed_retry, 1230 &client_delayed_retry,
@@ -1256,11 +1256,11 @@ GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *client,
1256void 1256void
1257GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle *th) 1257GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle *th)
1258{ 1258{
1259 if (GNUNET_SCHEDULER_NO_TASK != th->reconnect_task) 1259 if (NULL != th->reconnect_task)
1260 { 1260 {
1261 GNUNET_assert (NULL == th->th); 1261 GNUNET_assert (NULL == th->th);
1262 GNUNET_SCHEDULER_cancel (th->reconnect_task); 1262 GNUNET_SCHEDULER_cancel (th->reconnect_task);
1263 th->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 1263 th->reconnect_task = NULL;
1264 } 1264 }
1265 else 1265 else
1266 { 1266 {
diff --git a/src/util/client_manager.c b/src/util/client_manager.c
index f27c5e392..6a462cad6 100644
--- a/src/util/client_manager.c
+++ b/src/util/client_manager.c
@@ -119,7 +119,7 @@ struct GNUNET_CLIENT_MANAGER_Connection
119 /** 119 /**
120 * Task doing exponential back-off trying to reconnect. 120 * Task doing exponential back-off trying to reconnect.
121 */ 121 */
122 GNUNET_SCHEDULER_TaskIdentifier reconnect_task; 122 struct GNUNET_SCHEDULER_Task * reconnect_task;
123 123
124 /** 124 /**
125 * Time for next connect retry. 125 * Time for next connect retry.
@@ -304,7 +304,7 @@ static void
304schedule_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 304schedule_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
305{ 305{
306 struct GNUNET_CLIENT_MANAGER_Connection *mgr = cls; 306 struct GNUNET_CLIENT_MANAGER_Connection *mgr = cls;
307 mgr->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 307 mgr->reconnect_task = NULL;
308 308
309 LOG (GNUNET_ERROR_TYPE_DEBUG, 309 LOG (GNUNET_ERROR_TYPE_DEBUG,
310 "Connecting to %s service.\n", mgr->service_name); 310 "Connecting to %s service.\n", mgr->service_name);
@@ -382,10 +382,10 @@ GNUNET_CLIENT_MANAGER_disconnect (struct GNUNET_CLIENT_MANAGER_Connection *mgr,
382 GNUNET_CLIENT_MANAGER_drop_queue (mgr); 382 GNUNET_CLIENT_MANAGER_drop_queue (mgr);
383 } 383 }
384 } 384 }
385 if (mgr->reconnect_task != GNUNET_SCHEDULER_NO_TASK) 385 if (mgr->reconnect_task != NULL)
386 { 386 {
387 GNUNET_SCHEDULER_cancel (mgr->reconnect_task); 387 GNUNET_SCHEDULER_cancel (mgr->reconnect_task);
388 mgr->reconnect_task = GNUNET_SCHEDULER_NO_TASK; 388 mgr->reconnect_task = NULL;
389 } 389 }
390 if (NULL != mgr->client_tmit) 390 if (NULL != mgr->client_tmit)
391 { 391 {
@@ -413,7 +413,7 @@ GNUNET_CLIENT_MANAGER_disconnect (struct GNUNET_CLIENT_MANAGER_Connection *mgr,
413void 413void
414GNUNET_CLIENT_MANAGER_reconnect (struct GNUNET_CLIENT_MANAGER_Connection *mgr) 414GNUNET_CLIENT_MANAGER_reconnect (struct GNUNET_CLIENT_MANAGER_Connection *mgr)
415{ 415{
416 if (GNUNET_SCHEDULER_NO_TASK != mgr->reconnect_task) 416 if (NULL != mgr->reconnect_task)
417 return; 417 return;
418 418
419 if (NULL != mgr->client_tmit) 419 if (NULL != mgr->client_tmit)
diff --git a/src/util/connection.c b/src/util/connection.c
index 79d1c2d4c..f28beb34c 100644
--- a/src/util/connection.c
+++ b/src/util/connection.c
@@ -70,7 +70,7 @@ struct GNUNET_CONNECTION_TransmitHandle
70 /** 70 /**
71 * Task called on timeout. 71 * Task called on timeout.
72 */ 72 */
73 GNUNET_SCHEDULER_TaskIdentifier timeout_task; 73 struct GNUNET_SCHEDULER_Task * timeout_task;
74 74
75 /** 75 /**
76 * At what number of bytes available in the 76 * At what number of bytes available in the
@@ -121,7 +121,7 @@ struct AddressProbe
121 /** 121 /**
122 * Task waiting for the connection to finish connecting. 122 * Task waiting for the connection to finish connecting.
123 */ 123 */
124 GNUNET_SCHEDULER_TaskIdentifier task; 124 struct GNUNET_SCHEDULER_Task * task;
125}; 125};
126 126
127 127
@@ -204,12 +204,12 @@ struct GNUNET_CONNECTION_Handle
204 /** 204 /**
205 * Read task that we may need to wait for. 205 * Read task that we may need to wait for.
206 */ 206 */
207 GNUNET_SCHEDULER_TaskIdentifier read_task; 207 struct GNUNET_SCHEDULER_Task * read_task;
208 208
209 /** 209 /**
210 * Write task that we may need to wait for. 210 * Write task that we may need to wait for.
211 */ 211 */
212 GNUNET_SCHEDULER_TaskIdentifier write_task; 212 struct GNUNET_SCHEDULER_Task * write_task;
213 213
214 /** 214 /**
215 * Handle to a pending DNS lookup request. 215 * Handle to a pending DNS lookup request.
@@ -522,13 +522,13 @@ signal_transmit_error (struct GNUNET_CONNECTION_Handle *connection,
522 GNUNET_NETWORK_socket_shutdown (connection->sock, SHUT_RDWR); 522 GNUNET_NETWORK_socket_shutdown (connection->sock, SHUT_RDWR);
523 GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (connection->sock)); 523 GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (connection->sock));
524 connection->sock = NULL; 524 connection->sock = NULL;
525 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == connection->write_task); 525 GNUNET_assert (NULL == connection->write_task);
526 } 526 }
527 if (GNUNET_SCHEDULER_NO_TASK != connection->read_task) 527 if (NULL != connection->read_task)
528 { 528 {
529 /* send errors trigger read errors... */ 529 /* send errors trigger read errors... */
530 GNUNET_SCHEDULER_cancel (connection->read_task); 530 GNUNET_SCHEDULER_cancel (connection->read_task);
531 connection->read_task = GNUNET_SCHEDULER_NO_TASK; 531 connection->read_task = NULL;
532 signal_receive_timeout (connection); 532 signal_receive_timeout (connection);
533 return; 533 return;
534 } 534 }
@@ -556,7 +556,7 @@ connect_fail_continuation (struct GNUNET_CONNECTION_Handle *connection)
556 GNUNET_break (NULL == connection->ap_tail); 556 GNUNET_break (NULL == connection->ap_tail);
557 GNUNET_break (GNUNET_NO == connection->dns_active); 557 GNUNET_break (GNUNET_NO == connection->dns_active);
558 GNUNET_break (NULL == connection->sock); 558 GNUNET_break (NULL == connection->sock);
559 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == connection->write_task); 559 GNUNET_assert (NULL == connection->write_task);
560 560
561 /* signal errors for jobs that used to wait on the connection */ 561 /* signal errors for jobs that used to wait on the connection */
562 connection->destroy_later = 1; 562 connection->destroy_later = 1;
@@ -564,9 +564,9 @@ connect_fail_continuation (struct GNUNET_CONNECTION_Handle *connection)
564 signal_receive_error (connection, ECONNREFUSED); 564 signal_receive_error (connection, ECONNREFUSED);
565 if (NULL != connection->nth.notify_ready) 565 if (NULL != connection->nth.notify_ready)
566 { 566 {
567 GNUNET_assert (connection->nth.timeout_task != GNUNET_SCHEDULER_NO_TASK); 567 GNUNET_assert (connection->nth.timeout_task != NULL);
568 GNUNET_SCHEDULER_cancel (connection->nth.timeout_task); 568 GNUNET_SCHEDULER_cancel (connection->nth.timeout_task);
569 connection->nth.timeout_task = GNUNET_SCHEDULER_NO_TASK; 569 connection->nth.timeout_task = NULL;
570 signal_transmit_error (connection, ECONNREFUSED); 570 signal_transmit_error (connection, ECONNREFUSED);
571 } 571 }
572 if (-1 == connection->destroy_later) 572 if (-1 == connection->destroy_later)
@@ -618,7 +618,7 @@ connect_success_continuation (struct GNUNET_CONNECTION_Handle *connection)
618 LOG (GNUNET_ERROR_TYPE_DEBUG, 618 LOG (GNUNET_ERROR_TYPE_DEBUG,
619 "Connection succeeded, starting with receiving data (%p)\n", 619 "Connection succeeded, starting with receiving data (%p)\n",
620 connection); 620 connection);
621 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == connection->read_task); 621 GNUNET_assert (NULL == connection->read_task);
622 connection->read_task = 622 connection->read_task =
623 GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_absolute_get_remaining 623 GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_absolute_get_remaining
624 (connection->receive_timeout), connection->sock, 624 (connection->receive_timeout), connection->sock,
@@ -629,10 +629,10 @@ connect_success_continuation (struct GNUNET_CONNECTION_Handle *connection)
629 LOG (GNUNET_ERROR_TYPE_DEBUG, 629 LOG (GNUNET_ERROR_TYPE_DEBUG,
630 "Connection succeeded, starting with sending data (%p)\n", 630 "Connection succeeded, starting with sending data (%p)\n",
631 connection); 631 connection);
632 GNUNET_assert (connection->nth.timeout_task != GNUNET_SCHEDULER_NO_TASK); 632 GNUNET_assert (connection->nth.timeout_task != NULL);
633 GNUNET_SCHEDULER_cancel (connection->nth.timeout_task); 633 GNUNET_SCHEDULER_cancel (connection->nth.timeout_task);
634 connection->nth.timeout_task = GNUNET_SCHEDULER_NO_TASK; 634 connection->nth.timeout_task = NULL;
635 GNUNET_assert (connection->write_task == GNUNET_SCHEDULER_NO_TASK); 635 GNUNET_assert (connection->write_task == NULL);
636 connection->write_task = 636 connection->write_task =
637 GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_absolute_get_remaining 637 GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_absolute_get_remaining
638 (connection->nth.transmit_timeout), connection->sock, 638 (connection->nth.transmit_timeout), connection->sock,
@@ -982,21 +982,21 @@ GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *connection)
982 LOG (GNUNET_ERROR_TYPE_DEBUG, "Shutting down connection (%p)\n", connection); 982 LOG (GNUNET_ERROR_TYPE_DEBUG, "Shutting down connection (%p)\n", connection);
983 GNUNET_assert (NULL == connection->nth.notify_ready); 983 GNUNET_assert (NULL == connection->nth.notify_ready);
984 GNUNET_assert (NULL == connection->receiver); 984 GNUNET_assert (NULL == connection->receiver);
985 if (GNUNET_SCHEDULER_NO_TASK != connection->write_task) 985 if (NULL != connection->write_task)
986 { 986 {
987 GNUNET_SCHEDULER_cancel (connection->write_task); 987 GNUNET_SCHEDULER_cancel (connection->write_task);
988 connection->write_task = GNUNET_SCHEDULER_NO_TASK; 988 connection->write_task = NULL;
989 connection->write_buffer_off = 0; 989 connection->write_buffer_off = 0;
990 } 990 }
991 if (GNUNET_SCHEDULER_NO_TASK != connection->read_task) 991 if (NULL != connection->read_task)
992 { 992 {
993 GNUNET_SCHEDULER_cancel (connection->read_task); 993 GNUNET_SCHEDULER_cancel (connection->read_task);
994 connection->read_task = GNUNET_SCHEDULER_NO_TASK; 994 connection->read_task = NULL;
995 } 995 }
996 if (GNUNET_SCHEDULER_NO_TASK != connection->nth.timeout_task) 996 if (NULL != connection->nth.timeout_task)
997 { 997 {
998 GNUNET_SCHEDULER_cancel (connection->nth.timeout_task); 998 GNUNET_SCHEDULER_cancel (connection->nth.timeout_task);
999 connection->nth.timeout_task = GNUNET_SCHEDULER_NO_TASK; 999 connection->nth.timeout_task = NULL;
1000 } 1000 }
1001 connection->nth.notify_ready = NULL; 1001 connection->nth.notify_ready = NULL;
1002 if (NULL != connection->dns_active) 1002 if (NULL != connection->dns_active)
@@ -1051,7 +1051,7 @@ receive_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1051 ssize_t ret; 1051 ssize_t ret;
1052 GNUNET_CONNECTION_Receiver receiver; 1052 GNUNET_CONNECTION_Receiver receiver;
1053 1053
1054 connection->read_task = GNUNET_SCHEDULER_NO_TASK; 1054 connection->read_task = NULL;
1055 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1055 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1056 { 1056 {
1057 /* ignore shutdown request, go again immediately */ 1057 /* ignore shutdown request, go again immediately */
@@ -1115,7 +1115,7 @@ GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *connection, size_t m
1115 GNUNET_CONNECTION_Receiver receiver, 1115 GNUNET_CONNECTION_Receiver receiver,
1116 void *receiver_cls) 1116 void *receiver_cls)
1117{ 1117{
1118 GNUNET_assert ((GNUNET_SCHEDULER_NO_TASK == connection->read_task) && 1118 GNUNET_assert ((NULL == connection->read_task) &&
1119 (NULL == connection->receiver)); 1119 (NULL == connection->receiver));
1120 GNUNET_assert (NULL != receiver); 1120 GNUNET_assert (NULL != receiver);
1121 connection->receiver = receiver; 1121 connection->receiver = receiver;
@@ -1150,10 +1150,10 @@ GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *connection, size_t m
1150void * 1150void *
1151GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *connection) 1151GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *connection)
1152{ 1152{
1153 if (GNUNET_SCHEDULER_NO_TASK != connection->read_task) 1153 if (NULL != connection->read_task)
1154 { 1154 {
1155 GNUNET_assert (connection == GNUNET_SCHEDULER_cancel (connection->read_task)); 1155 GNUNET_assert (connection == GNUNET_SCHEDULER_cancel (connection->read_task));
1156 connection->read_task = GNUNET_SCHEDULER_NO_TASK; 1156 connection->read_task = NULL;
1157 } 1157 }
1158 connection->receiver = NULL; 1158 connection->receiver = NULL;
1159 return connection->receiver_cls; 1159 return connection->receiver_cls;
@@ -1177,7 +1177,7 @@ process_notify (struct GNUNET_CONNECTION_Handle *connection)
1177 1177
1178 LOG (GNUNET_ERROR_TYPE_DEBUG, "process_notify is running\n"); 1178 LOG (GNUNET_ERROR_TYPE_DEBUG, "process_notify is running\n");
1179 1179
1180 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == connection->write_task); 1180 GNUNET_assert (NULL == connection->write_task);
1181 if (NULL == (notify = connection->nth.notify_ready)) 1181 if (NULL == (notify = connection->nth.notify_ready))
1182 { 1182 {
1183 LOG (GNUNET_ERROR_TYPE_DEBUG, "Noone to notify\n"); 1183 LOG (GNUNET_ERROR_TYPE_DEBUG, "Noone to notify\n");
@@ -1229,7 +1229,7 @@ transmit_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1229 struct GNUNET_CONNECTION_Handle *connection = cls; 1229 struct GNUNET_CONNECTION_Handle *connection = cls;
1230 GNUNET_CONNECTION_TransmitReadyNotify notify; 1230 GNUNET_CONNECTION_TransmitReadyNotify notify;
1231 1231
1232 connection->nth.timeout_task = GNUNET_SCHEDULER_NO_TASK; 1232 connection->nth.timeout_task = NULL;
1233 LOG (GNUNET_ERROR_TYPE_DEBUG, 1233 LOG (GNUNET_ERROR_TYPE_DEBUG,
1234 "Transmit to `%s:%u/%s' fails, time out reached (%p).\n", 1234 "Transmit to `%s:%u/%s' fails, time out reached (%p).\n",
1235 connection->hostname, 1235 connection->hostname,
@@ -1259,7 +1259,7 @@ connect_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1259 LOG (GNUNET_ERROR_TYPE_DEBUG, 1259 LOG (GNUNET_ERROR_TYPE_DEBUG,
1260 "Transmission request of size %u fails (%s/%u), connection failed (%p).\n", 1260 "Transmission request of size %u fails (%s/%u), connection failed (%p).\n",
1261 connection->nth.notify_size, connection->hostname, connection->port, connection); 1261 connection->nth.notify_size, connection->hostname, connection->port, connection);
1262 connection->write_task = GNUNET_SCHEDULER_NO_TASK; 1262 connection->write_task = NULL;
1263 notify = connection->nth.notify_ready; 1263 notify = connection->nth.notify_ready;
1264 connection->nth.notify_ready = NULL; 1264 connection->nth.notify_ready = NULL;
1265 notify (connection->nth.notify_ready_cls, 0, NULL); 1265 notify (connection->nth.notify_ready_cls, 0, NULL);
@@ -1281,9 +1281,9 @@ transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1281 size_t have; 1281 size_t have;
1282 1282
1283 LOG (GNUNET_ERROR_TYPE_DEBUG, "transmit_ready running (%p).\n", connection); 1283 LOG (GNUNET_ERROR_TYPE_DEBUG, "transmit_ready running (%p).\n", connection);
1284 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != connection->write_task); 1284 GNUNET_assert (NULL != connection->write_task);
1285 connection->write_task = GNUNET_SCHEDULER_NO_TASK; 1285 connection->write_task = NULL;
1286 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == connection->nth.timeout_task); 1286 GNUNET_assert (NULL == connection->nth.timeout_task);
1287 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1287 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1288 { 1288 {
1289 if (NULL != connection->sock) 1289 if (NULL != connection->sock)
@@ -1320,7 +1320,7 @@ transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1320 } 1320 }
1321 if (!GNUNET_NETWORK_fdset_isset (tc->write_ready, connection->sock)) 1321 if (!GNUNET_NETWORK_fdset_isset (tc->write_ready, connection->sock))
1322 { 1322 {
1323 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == connection->write_task); 1323 GNUNET_assert (NULL == connection->write_task);
1324 /* special circumstances (in particular, shutdown): not yet ready 1324 /* special circumstances (in particular, shutdown): not yet ready
1325 * to write, but no "fatal" error either. Hence retry. */ 1325 * to write, but no "fatal" error either. Hence retry. */
1326 goto SCHEDULE_WRITE; 1326 goto SCHEDULE_WRITE;
@@ -1352,10 +1352,10 @@ RETRY:
1352 { 1352 {
1353 if (EINTR == errno) 1353 if (EINTR == errno)
1354 goto RETRY; 1354 goto RETRY;
1355 if (GNUNET_SCHEDULER_NO_TASK != connection->write_task) 1355 if (NULL != connection->write_task)
1356 { 1356 {
1357 GNUNET_SCHEDULER_cancel (connection->write_task); 1357 GNUNET_SCHEDULER_cancel (connection->write_task);
1358 connection->write_task = GNUNET_SCHEDULER_NO_TASK; 1358 connection->write_task = NULL;
1359 } 1359 }
1360 signal_transmit_error (connection, errno); 1360 signal_transmit_error (connection, errno);
1361 return; 1361 return;
@@ -1378,7 +1378,7 @@ SCHEDULE_WRITE:
1378 "Re-scheduling transmit_ready (more to do) (%p).\n", connection); 1378 "Re-scheduling transmit_ready (more to do) (%p).\n", connection);
1379 have = connection->write_buffer_off - connection->write_buffer_pos; 1379 have = connection->write_buffer_off - connection->write_buffer_pos;
1380 GNUNET_assert ((NULL != connection->nth.notify_ready) || (have > 0)); 1380 GNUNET_assert ((NULL != connection->nth.notify_ready) || (have > 0));
1381 if (GNUNET_SCHEDULER_NO_TASK == connection->write_task) 1381 if (NULL == connection->write_task)
1382 connection->write_task = 1382 connection->write_task =
1383 GNUNET_SCHEDULER_add_write_net ((connection->nth.notify_ready == 1383 GNUNET_SCHEDULER_add_write_net ((connection->nth.notify_ready ==
1384 NULL) ? GNUNET_TIME_UNIT_FOREVER_REL : 1384 NULL) ? GNUNET_TIME_UNIT_FOREVER_REL :
@@ -1424,17 +1424,17 @@ GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle *connec
1424 connection->nth.connection = connection; 1424 connection->nth.connection = connection;
1425 connection->nth.notify_size = size; 1425 connection->nth.notify_size = size;
1426 connection->nth.transmit_timeout = GNUNET_TIME_relative_to_absolute (timeout); 1426 connection->nth.transmit_timeout = GNUNET_TIME_relative_to_absolute (timeout);
1427 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == connection->nth.timeout_task); 1427 GNUNET_assert (NULL == connection->nth.timeout_task);
1428 if ((NULL == connection->sock) && 1428 if ((NULL == connection->sock) &&
1429 (NULL == connection->ap_head) && 1429 (NULL == connection->ap_head) &&
1430 (NULL == connection->dns_active)) 1430 (NULL == connection->dns_active))
1431 { 1431 {
1432 if (GNUNET_SCHEDULER_NO_TASK != connection->write_task) 1432 if (NULL != connection->write_task)
1433 GNUNET_SCHEDULER_cancel (connection->write_task); 1433 GNUNET_SCHEDULER_cancel (connection->write_task);
1434 connection->write_task = GNUNET_SCHEDULER_add_now (&connect_error, connection); 1434 connection->write_task = GNUNET_SCHEDULER_add_now (&connect_error, connection);
1435 return &connection->nth; 1435 return &connection->nth;
1436 } 1436 }
1437 if (GNUNET_SCHEDULER_NO_TASK != connection->write_task) 1437 if (NULL != connection->write_task)
1438 return &connection->nth; /* previous transmission still in progress */ 1438 return &connection->nth; /* previous transmission still in progress */
1439 if (NULL != connection->sock) 1439 if (NULL != connection->sock)
1440 { 1440 {
@@ -1467,15 +1467,15 @@ GNUNET_CONNECTION_notify_transmit_ready_cancel (struct
1467{ 1467{
1468 GNUNET_assert (NULL != th->notify_ready); 1468 GNUNET_assert (NULL != th->notify_ready);
1469 th->notify_ready = NULL; 1469 th->notify_ready = NULL;
1470 if (GNUNET_SCHEDULER_NO_TASK != th->timeout_task) 1470 if (NULL != th->timeout_task)
1471 { 1471 {
1472 GNUNET_SCHEDULER_cancel (th->timeout_task); 1472 GNUNET_SCHEDULER_cancel (th->timeout_task);
1473 th->timeout_task = GNUNET_SCHEDULER_NO_TASK; 1473 th->timeout_task = NULL;
1474 } 1474 }
1475 if (GNUNET_SCHEDULER_NO_TASK != th->connection->write_task) 1475 if (NULL != th->connection->write_task)
1476 { 1476 {
1477 GNUNET_SCHEDULER_cancel (th->connection->write_task); 1477 GNUNET_SCHEDULER_cancel (th->connection->write_task);
1478 th->connection->write_task = GNUNET_SCHEDULER_NO_TASK; 1478 th->connection->write_task = NULL;
1479 } 1479 }
1480} 1480}
1481 1481
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index ac64d68e1..d68e890a7 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -98,7 +98,7 @@ struct GNUNET_CRYPTO_FileHashContext
98 /** 98 /**
99 * Current task for hashing. 99 * Current task for hashing.
100 */ 100 */
101 GNUNET_SCHEDULER_TaskIdentifier task; 101 struct GNUNET_SCHEDULER_Task * task;
102 102
103 /** 103 /**
104 * Priority we use. 104 * Priority we use.
@@ -143,7 +143,7 @@ file_hash_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
143 struct GNUNET_HashCode *res; 143 struct GNUNET_HashCode *res;
144 size_t delta; 144 size_t delta;
145 145
146 fhc->task = GNUNET_SCHEDULER_NO_TASK; 146 fhc->task = NULL;
147 GNUNET_assert (fhc->offset <= fhc->fsize); 147 GNUNET_assert (fhc->offset <= fhc->fsize);
148 delta = fhc->bsize; 148 delta = fhc->bsize;
149 if (fhc->fsize - fhc->offset < delta) 149 if (fhc->fsize - fhc->offset < delta)
diff --git a/src/util/gnunet-scrypt.c b/src/util/gnunet-scrypt.c
index b6a9969da..6e3fcd33a 100644
--- a/src/util/gnunet-scrypt.c
+++ b/src/util/gnunet-scrypt.c
@@ -40,7 +40,7 @@ static struct GNUNET_CRYPTO_EddsaPublicKey pub;
40 40
41static uint64_t proof; 41static uint64_t proof;
42 42
43static GNUNET_SCHEDULER_TaskIdentifier proof_task; 43static struct GNUNET_SCHEDULER_Task * proof_task;
44 44
45static const struct GNUNET_CONFIGURATION_Handle *cfg; 45static const struct GNUNET_CONFIGURATION_Handle *cfg;
46 46
@@ -128,7 +128,7 @@ find_proof (void *cls,
128 return; 128 return;
129 } 129 }
130 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got Proof of Work %llu\n", proof); 130 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Got Proof of Work %llu\n", proof);
131 proof_task = GNUNET_SCHEDULER_NO_TASK; 131 proof_task = NULL;
132 memcpy (&buf[sizeof (uint64_t)], &pub, 132 memcpy (&buf[sizeof (uint64_t)], &pub,
133 sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)); 133 sizeof (struct GNUNET_CRYPTO_EddsaPublicKey));
134 i = 0; 134 i = 0;
diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c
index 545b78981..8e4930da4 100644
--- a/src/util/gnunet-uri.c
+++ b/src/util/gnunet-uri.c
@@ -77,7 +77,7 @@ run (void *cls, char *const *args, const char *cfgfile,
77 const char *slash; 77 const char *slash;
78 char *subsystem; 78 char *subsystem;
79 char *program; 79 char *program;
80 GNUNET_SCHEDULER_TaskIdentifier rt; 80 struct GNUNET_SCHEDULER_Task * rt;
81 81
82 if (NULL == (uri = args[0])) 82 if (NULL == (uri = args[0]))
83 { 83 {
diff --git a/src/util/helper.c b/src/util/helper.c
index 105ccf057..6dd417a91 100644
--- a/src/util/helper.c
+++ b/src/util/helper.c
@@ -142,17 +142,17 @@ struct GNUNET_HELPER_Handle
142 /** 142 /**
143 * Task to read from the helper. 143 * Task to read from the helper.
144 */ 144 */
145 GNUNET_SCHEDULER_TaskIdentifier read_task; 145 struct GNUNET_SCHEDULER_Task * read_task;
146 146
147 /** 147 /**
148 * Task to read from the helper. 148 * Task to read from the helper.
149 */ 149 */
150 GNUNET_SCHEDULER_TaskIdentifier write_task; 150 struct GNUNET_SCHEDULER_Task * write_task;
151 151
152 /** 152 /**
153 * Restart task. 153 * Restart task.
154 */ 154 */
155 GNUNET_SCHEDULER_TaskIdentifier restart_task; 155 struct GNUNET_SCHEDULER_Task * restart_task;
156 156
157 /** 157 /**
158 * Does the helper support the use of a control pipe for signalling? 158 * Does the helper support the use of a control pipe for signalling?
@@ -187,15 +187,15 @@ GNUNET_HELPER_kill (struct GNUNET_HELPER_Handle *h,
187 sh->cont (sh->cont_cls, GNUNET_NO); 187 sh->cont (sh->cont_cls, GNUNET_NO);
188 GNUNET_free (sh); 188 GNUNET_free (sh);
189 } 189 }
190 if (GNUNET_SCHEDULER_NO_TASK != h->restart_task) 190 if (NULL != h->restart_task)
191 { 191 {
192 GNUNET_SCHEDULER_cancel (h->restart_task); 192 GNUNET_SCHEDULER_cancel (h->restart_task);
193 h->restart_task = GNUNET_SCHEDULER_NO_TASK; 193 h->restart_task = NULL;
194 } 194 }
195 if (GNUNET_SCHEDULER_NO_TASK != h->read_task) 195 if (NULL != h->read_task)
196 { 196 {
197 GNUNET_SCHEDULER_cancel (h->read_task); 197 GNUNET_SCHEDULER_cancel (h->read_task);
198 h->read_task = GNUNET_SCHEDULER_NO_TASK; 198 h->read_task = NULL;
199 } 199 }
200 if (NULL == h->helper_proc) 200 if (NULL == h->helper_proc)
201 return GNUNET_SYSERR; 201 return GNUNET_SYSERR;
@@ -235,15 +235,15 @@ GNUNET_HELPER_wait (struct GNUNET_HELPER_Handle *h)
235 GNUNET_OS_process_destroy (h->helper_proc); 235 GNUNET_OS_process_destroy (h->helper_proc);
236 h->helper_proc = NULL; 236 h->helper_proc = NULL;
237 } 237 }
238 if (GNUNET_SCHEDULER_NO_TASK != h->read_task) 238 if (NULL != h->read_task)
239 { 239 {
240 GNUNET_SCHEDULER_cancel (h->read_task); 240 GNUNET_SCHEDULER_cancel (h->read_task);
241 h->read_task = GNUNET_SCHEDULER_NO_TASK; 241 h->read_task = NULL;
242 } 242 }
243 if (GNUNET_SCHEDULER_NO_TASK != h->write_task) 243 if (NULL != h->write_task)
244 { 244 {
245 GNUNET_SCHEDULER_cancel (h->write_task); 245 GNUNET_SCHEDULER_cancel (h->write_task);
246 h->write_task = GNUNET_SCHEDULER_NO_TASK; 246 h->write_task = NULL;
247 } 247 }
248 if (NULL != h->helper_in) 248 if (NULL != h->helper_in)
249 { 249 {
@@ -284,10 +284,10 @@ static void
284stop_helper (struct GNUNET_HELPER_Handle *h, 284stop_helper (struct GNUNET_HELPER_Handle *h,
285 int soft_kill) 285 int soft_kill)
286{ 286{
287 if (GNUNET_SCHEDULER_NO_TASK != h->restart_task) 287 if (NULL != h->restart_task)
288 { 288 {
289 GNUNET_SCHEDULER_cancel (h->restart_task); 289 GNUNET_SCHEDULER_cancel (h->restart_task);
290 h->restart_task = GNUNET_SCHEDULER_NO_TASK; 290 h->restart_task = NULL;
291 } 291 }
292 else 292 else
293 { 293 {
@@ -322,7 +322,7 @@ helper_read (void *cls,
322 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE] GNUNET_ALIGN; 322 char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE] GNUNET_ALIGN;
323 ssize_t t; 323 ssize_t t;
324 324
325 h->read_task = GNUNET_SCHEDULER_NO_TASK; 325 h->read_task = NULL;
326 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 326 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
327 { 327 {
328 /* try again */ 328 /* try again */
@@ -460,7 +460,7 @@ restart_task (void *cls,
460{ 460{
461 struct GNUNET_HELPER_Handle*h = cls; 461 struct GNUNET_HELPER_Handle*h = cls;
462 462
463 h->restart_task = GNUNET_SCHEDULER_NO_TASK; 463 h->restart_task = NULL;
464 start_helper (h); 464 start_helper (h);
465} 465}
466 466
@@ -524,13 +524,13 @@ GNUNET_HELPER_destroy (struct GNUNET_HELPER_Handle *h)
524 unsigned int c; 524 unsigned int c;
525 struct GNUNET_HELPER_SendHandle *sh; 525 struct GNUNET_HELPER_SendHandle *sh;
526 526
527 if (GNUNET_SCHEDULER_NO_TASK != h->write_task) 527 if (NULL != h->write_task)
528 { 528 {
529 GNUNET_SCHEDULER_cancel (h->write_task); 529 GNUNET_SCHEDULER_cancel (h->write_task);
530 h->write_task = GNUNET_SCHEDULER_NO_TASK; 530 h->write_task = NULL;
531 } 531 }
532 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->read_task); 532 GNUNET_assert (NULL == h->read_task);
533 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->restart_task); 533 GNUNET_assert (NULL == h->restart_task);
534 while (NULL != (sh = h->sh_head)) 534 while (NULL != (sh = h->sh_head))
535 { 535 {
536 GNUNET_CONTAINER_DLL_remove (h->sh_head, 536 GNUNET_CONTAINER_DLL_remove (h->sh_head,
@@ -582,7 +582,7 @@ helper_write (void *cls,
582 const char *buf; 582 const char *buf;
583 ssize_t t; 583 ssize_t t;
584 584
585 h->write_task = GNUNET_SCHEDULER_NO_TASK; 585 h->write_task = NULL;
586 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 586 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
587 { 587 {
588 /* try again */ 588 /* try again */
@@ -684,7 +684,7 @@ GNUNET_HELPER_send (struct GNUNET_HELPER_Handle *h,
684 GNUNET_CONTAINER_DLL_insert_tail (h->sh_head, 684 GNUNET_CONTAINER_DLL_insert_tail (h->sh_head,
685 h->sh_tail, 685 h->sh_tail,
686 sh); 686 sh);
687 if (GNUNET_SCHEDULER_NO_TASK == h->write_task) 687 if (NULL == h->write_task)
688 h->write_task = GNUNET_SCHEDULER_add_write_file (GNUNET_TIME_UNIT_FOREVER_REL, 688 h->write_task = GNUNET_SCHEDULER_add_write_file (GNUNET_TIME_UNIT_FOREVER_REL,
689 h->fh_to_helper, 689 h->fh_to_helper,
690 &helper_write, 690 &helper_write,
@@ -714,7 +714,7 @@ GNUNET_HELPER_send_cancel (struct GNUNET_HELPER_SendHandle *sh)
714 if (NULL == h->sh_head) 714 if (NULL == h->sh_head)
715 { 715 {
716 GNUNET_SCHEDULER_cancel (h->write_task); 716 GNUNET_SCHEDULER_cancel (h->write_task);
717 h->write_task = GNUNET_SCHEDULER_NO_TASK; 717 h->write_task = NULL;
718 } 718 }
719 } 719 }
720} 720}
diff --git a/src/util/mq.c b/src/util/mq.c
index d34850b8c..254e5d33e 100644
--- a/src/util/mq.c
+++ b/src/util/mq.c
@@ -133,7 +133,7 @@ struct GNUNET_MQ_Handle
133 /** 133 /**
134 * Task scheduled during #GNUNET_MQ_impl_send_continue. 134 * Task scheduled during #GNUNET_MQ_impl_send_continue.
135 */ 135 */
136 GNUNET_SCHEDULER_TaskIdentifier continue_task; 136 struct GNUNET_SCHEDULER_Task * continue_task;
137 137
138 /** 138 /**
139 * Next id that should be used for the @e assoc_map, 139 * Next id that should be used for the @e assoc_map,
@@ -310,7 +310,7 @@ impl_send_continue (void *cls,
310 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 310 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
311 return; 311 return;
312 312
313 mq->continue_task = GNUNET_SCHEDULER_NO_TASK; 313 mq->continue_task = NULL;
314 /* call is only valid if we're actually currently sending 314 /* call is only valid if we're actually currently sending
315 * a message */ 315 * a message */
316 current_envelope = mq->current_envelope; 316 current_envelope = mq->current_envelope;
@@ -345,7 +345,7 @@ impl_send_continue (void *cls,
345void 345void
346GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq) 346GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq)
347{ 347{
348 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == mq->continue_task); 348 GNUNET_assert (NULL == mq->continue_task);
349 mq->continue_task = GNUNET_SCHEDULER_add_now (&impl_send_continue, 349 mq->continue_task = GNUNET_SCHEDULER_add_now (&impl_send_continue,
350 mq); 350 mq);
351} 351}
@@ -776,10 +776,10 @@ GNUNET_MQ_destroy (struct GNUNET_MQ_Handle *mq)
776 { 776 {
777 mq->destroy_impl (mq, mq->impl_state); 777 mq->destroy_impl (mq, mq->impl_state);
778 } 778 }
779 if (GNUNET_SCHEDULER_NO_TASK != mq->continue_task) 779 if (NULL != mq->continue_task)
780 { 780 {
781 GNUNET_SCHEDULER_cancel (mq->continue_task); 781 GNUNET_SCHEDULER_cancel (mq->continue_task);
782 mq->continue_task = GNUNET_SCHEDULER_NO_TASK; 782 mq->continue_task = NULL;
783 } 783 }
784 while (NULL != mq->envelope_head) 784 while (NULL != mq->envelope_head)
785 { 785 {
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index d3310abb1..a76a5cc4a 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -1693,7 +1693,7 @@ struct GNUNET_OS_CommandHandle
1693 /** 1693 /**
1694 * Task reading from pipe. 1694 * Task reading from pipe.
1695 */ 1695 */
1696 GNUNET_SCHEDULER_TaskIdentifier rtask; 1696 struct GNUNET_SCHEDULER_Task * rtask;
1697 1697
1698 /** 1698 /**
1699 * When to time out. 1699 * When to time out.
@@ -1719,7 +1719,7 @@ GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd)
1719{ 1719{
1720 if (NULL != cmd->proc) 1720 if (NULL != cmd->proc)
1721 { 1721 {
1722 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != cmd->rtask); 1722 GNUNET_assert (NULL != cmd->rtask);
1723 GNUNET_SCHEDULER_cancel (cmd->rtask); 1723 GNUNET_SCHEDULER_cancel (cmd->rtask);
1724 } 1724 }
1725 (void) GNUNET_OS_process_kill (cmd->eip, SIGKILL); 1725 (void) GNUNET_OS_process_kill (cmd->eip, SIGKILL);
@@ -1744,7 +1744,7 @@ cmd_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1744 char *end; 1744 char *end;
1745 ssize_t ret; 1745 ssize_t ret;
1746 1746
1747 cmd->rtask = GNUNET_SCHEDULER_NO_TASK; 1747 cmd->rtask = NULL;
1748 if (GNUNET_YES != GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, cmd->r)) 1748 if (GNUNET_YES != GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, cmd->r))
1749 { 1749 {
1750 /* timeout, shutdown, etc. */ 1750 /* timeout, shutdown, etc. */
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c
index f3988c7c5..8ddaafa0a 100644
--- a/src/util/resolver_api.c
+++ b/src/util/resolver_api.c
@@ -78,13 +78,13 @@ static struct GNUNET_TIME_Relative backoff;
78/** 78/**
79 * Task for reconnecting. 79 * Task for reconnecting.
80 */ 80 */
81static GNUNET_SCHEDULER_TaskIdentifier r_task; 81static struct GNUNET_SCHEDULER_Task * r_task;
82 82
83/** 83/**
84 * Task ID of shutdown task; only present while we have a 84 * Task ID of shutdown task; only present while we have a
85 * connection to the resolver service. 85 * connection to the resolver service.
86 */ 86 */
87static GNUNET_SCHEDULER_TaskIdentifier s_task; 87static struct GNUNET_SCHEDULER_Task * s_task;
88 88
89 89
90/** 90/**
@@ -131,7 +131,7 @@ struct GNUNET_RESOLVER_RequestHandle
131 * Task handle for making reply callbacks in numeric lookups 131 * Task handle for making reply callbacks in numeric lookups
132 * asynchronous, and for timeout handling. 132 * asynchronous, and for timeout handling.
133 */ 133 */
134 GNUNET_SCHEDULER_TaskIdentifier task; 134 struct GNUNET_SCHEDULER_Task * task;
135 135
136 /** 136 /**
137 * Desired address family. 137 * Desired address family.
@@ -256,15 +256,15 @@ GNUNET_RESOLVER_disconnect ()
256 GNUNET_CLIENT_disconnect (client); 256 GNUNET_CLIENT_disconnect (client);
257 client = NULL; 257 client = NULL;
258 } 258 }
259 if (GNUNET_SCHEDULER_NO_TASK != r_task) 259 if (NULL != r_task)
260 { 260 {
261 GNUNET_SCHEDULER_cancel (r_task); 261 GNUNET_SCHEDULER_cancel (r_task);
262 r_task = GNUNET_SCHEDULER_NO_TASK; 262 r_task = NULL;
263 } 263 }
264 if (GNUNET_SCHEDULER_NO_TASK != s_task) 264 if (NULL != s_task)
265 { 265 {
266 GNUNET_SCHEDULER_cancel (s_task); 266 GNUNET_SCHEDULER_cancel (s_task);
267 s_task = GNUNET_SCHEDULER_NO_TASK; 267 s_task = NULL;
268 } 268 }
269} 269}
270 270
@@ -381,7 +381,7 @@ handle_response (void *cls,
381 rh->addr_callback (rh->cls, NULL, 0); 381 rh->addr_callback (rh->cls, NULL, 0);
382 } 382 }
383 GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh); 383 GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
384 if (GNUNET_SCHEDULER_NO_TASK != rh->task) 384 if (NULL != rh->task)
385 GNUNET_SCHEDULER_cancel (rh->task); 385 GNUNET_SCHEDULER_cancel (rh->task);
386 GNUNET_free (rh); 386 GNUNET_free (rh);
387 GNUNET_CLIENT_disconnect (client); 387 GNUNET_CLIENT_disconnect (client);
@@ -410,7 +410,7 @@ handle_response (void *cls,
410 rh->addr_callback (rh->cls, NULL, 0); 410 rh->addr_callback (rh->cls, NULL, 0);
411 } 411 }
412 GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh); 412 GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
413 if (GNUNET_SCHEDULER_NO_TASK != rh->task) 413 if (NULL != rh->task)
414 GNUNET_SCHEDULER_cancel (rh->task); 414 GNUNET_SCHEDULER_cancel (rh->task);
415 GNUNET_free (rh); 415 GNUNET_free (rh);
416 process_requests (); 416 process_requests ();
@@ -428,7 +428,7 @@ handle_response (void *cls,
428 if (GNUNET_SYSERR != rh->was_transmitted) 428 if (GNUNET_SYSERR != rh->was_transmitted)
429 rh->name_callback (rh->cls, NULL); 429 rh->name_callback (rh->cls, NULL);
430 GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh); 430 GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
431 if (GNUNET_SCHEDULER_NO_TASK != rh->task) 431 if (NULL != rh->task)
432 GNUNET_SCHEDULER_cancel (rh->task); 432 GNUNET_SCHEDULER_cancel (rh->task);
433 GNUNET_free (rh); 433 GNUNET_free (rh);
434 GNUNET_CLIENT_disconnect (client); 434 GNUNET_CLIENT_disconnect (client);
@@ -485,7 +485,7 @@ handle_response (void *cls,
485 if (GNUNET_SYSERR != rh->was_transmitted) 485 if (GNUNET_SYSERR != rh->was_transmitted)
486 rh->addr_callback (rh->cls, NULL, 0); 486 rh->addr_callback (rh->cls, NULL, 0);
487 GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh); 487 GNUNET_CONTAINER_DLL_remove (req_head, req_tail, rh);
488 if (GNUNET_SCHEDULER_NO_TASK != rh->task) 488 if (NULL != rh->task)
489 GNUNET_SCHEDULER_cancel (rh->task); 489 GNUNET_SCHEDULER_cancel (rh->task);
490 GNUNET_free (rh); 490 GNUNET_free (rh);
491 GNUNET_CLIENT_disconnect (client); 491 GNUNET_CLIENT_disconnect (client);
@@ -519,7 +519,7 @@ numeric_resolution (void *cls,
519 struct sockaddr_in6 v6; 519 struct sockaddr_in6 v6;
520 const char *hostname; 520 const char *hostname;
521 521
522 rh->task = GNUNET_SCHEDULER_NO_TASK; 522 rh->task = NULL;
523 memset (&v4, 0, sizeof (v4)); 523 memset (&v4, 0, sizeof (v4));
524 v4.sin_family = AF_INET; 524 v4.sin_family = AF_INET;
525#if HAVE_SOCKADDR_IN_SIN_LEN 525#if HAVE_SOCKADDR_IN_SIN_LEN
@@ -582,7 +582,7 @@ loopback_resolution (void *cls,
582 struct sockaddr_in v4; 582 struct sockaddr_in v4;
583 struct sockaddr_in6 v6; 583 struct sockaddr_in6 v6;
584 584
585 rh->task = GNUNET_SCHEDULER_NO_TASK; 585 rh->task = NULL;
586 memset (&v4, 0, sizeof (v4)); 586 memset (&v4, 0, sizeof (v4));
587 v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK); 587 v4.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
588 v4.sin_family = AF_INET; 588 v4.sin_family = AF_INET;
@@ -625,7 +625,7 @@ static void
625shutdown_task (void *cls, 625shutdown_task (void *cls,
626 const struct GNUNET_SCHEDULER_TaskContext *tc) 626 const struct GNUNET_SCHEDULER_TaskContext *tc)
627{ 627{
628 s_task = GNUNET_SCHEDULER_NO_TASK; 628 s_task = NULL;
629 GNUNET_RESOLVER_disconnect (); 629 GNUNET_RESOLVER_disconnect ();
630 backoff = GNUNET_TIME_UNIT_MILLISECONDS; 630 backoff = GNUNET_TIME_UNIT_MILLISECONDS;
631} 631}
@@ -694,7 +694,7 @@ static void
694reconnect_task (void *cls, 694reconnect_task (void *cls,
695 const struct GNUNET_SCHEDULER_TaskContext *tc) 695 const struct GNUNET_SCHEDULER_TaskContext *tc)
696{ 696{
697 r_task = GNUNET_SCHEDULER_NO_TASK; 697 r_task = NULL;
698 if (NULL == req_head) 698 if (NULL == req_head)
699 return; /* no work pending */ 699 return; /* no work pending */
700 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 700 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
@@ -721,7 +721,7 @@ reconnect ()
721{ 721{
722 struct GNUNET_RESOLVER_RequestHandle *rh; 722 struct GNUNET_RESOLVER_RequestHandle *rh;
723 723
724 if (GNUNET_SCHEDULER_NO_TASK != r_task) 724 if (NULL != r_task)
725 return; 725 return;
726 GNUNET_assert (NULL == client); 726 GNUNET_assert (NULL == client);
727 if (NULL != (rh = req_head)) 727 if (NULL != (rh = req_head))
@@ -766,7 +766,7 @@ handle_lookup_timeout (void *cls,
766{ 766{
767 struct GNUNET_RESOLVER_RequestHandle *rh = cls; 767 struct GNUNET_RESOLVER_RequestHandle *rh = cls;
768 768
769 rh->task = GNUNET_SCHEDULER_NO_TASK; 769 rh->task = NULL;
770 rh->addr_callback (rh->cls, 770 rh->addr_callback (rh->cls,
771 NULL, 771 NULL,
772 0); 772 0);
@@ -837,10 +837,10 @@ GNUNET_RESOLVER_ip_get (const char *hostname, int af,
837 rh); 837 rh);
838 GNUNET_CONTAINER_DLL_insert_tail (req_head, req_tail, rh); 838 GNUNET_CONTAINER_DLL_insert_tail (req_head, req_tail, rh);
839 rh->was_queued = GNUNET_YES; 839 rh->was_queued = GNUNET_YES;
840 if (s_task != GNUNET_SCHEDULER_NO_TASK) 840 if (s_task != NULL)
841 { 841 {
842 GNUNET_SCHEDULER_cancel (s_task); 842 GNUNET_SCHEDULER_cancel (s_task);
843 s_task = GNUNET_SCHEDULER_NO_TASK; 843 s_task = NULL;
844 } 844 }
845 process_requests (); 845 process_requests ();
846 return rh; 846 return rh;
@@ -863,7 +863,7 @@ numeric_reverse (void *cls,
863 struct GNUNET_RESOLVER_RequestHandle *rh = cls; 863 struct GNUNET_RESOLVER_RequestHandle *rh = cls;
864 char *result; 864 char *result;
865 865
866 rh->task = GNUNET_SCHEDULER_NO_TASK; 866 rh->task = NULL;
867 result = no_resolve (rh->af, 867 result = no_resolve (rh->af,
868 &rh[1], 868 &rh[1],
869 rh->data_len); 869 rh->data_len);
@@ -937,10 +937,10 @@ GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa,
937 req_tail, 937 req_tail,
938 rh); 938 rh);
939 rh->was_queued = GNUNET_YES; 939 rh->was_queued = GNUNET_YES;
940 if (s_task != GNUNET_SCHEDULER_NO_TASK) 940 if (s_task != NULL)
941 { 941 {
942 GNUNET_SCHEDULER_cancel (s_task); 942 GNUNET_SCHEDULER_cancel (s_task);
943 s_task = GNUNET_SCHEDULER_NO_TASK; 943 s_task = NULL;
944 } 944 }
945 process_requests (); 945 process_requests ();
946 return rh; 946 return rh;
@@ -1024,10 +1024,10 @@ GNUNET_RESOLVER_hostname_resolve (int af,
1024void 1024void
1025GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh) 1025GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh)
1026{ 1026{
1027 if (rh->task != GNUNET_SCHEDULER_NO_TASK) 1027 if (rh->task != NULL)
1028 { 1028 {
1029 GNUNET_SCHEDULER_cancel (rh->task); 1029 GNUNET_SCHEDULER_cancel (rh->task);
1030 rh->task = GNUNET_SCHEDULER_NO_TASK; 1030 rh->task = NULL;
1031 } 1031 }
1032 if (GNUNET_NO == rh->was_transmitted) 1032 if (GNUNET_NO == rh->was_transmitted)
1033 { 1033 {
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 87a107dba..ec45889ea 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -71,19 +71,24 @@
71 71
72 72
73/** 73/**
74 * Linked list of pending tasks. 74 * Entry in list of pending tasks.
75 */ 75 */
76struct Task 76struct GNUNET_SCHEDULER_Task
77{ 77{
78 /** 78 /**
79 * This is a linked list. 79 * This is a linked list.
80 */ 80 */
81 struct Task *next; 81 struct GNUNET_SCHEDULER_Task *next;
82
83 /**
84 * This is a linked list.
85 */
86 struct GNUNET_SCHEDULER_Task *prev;
82 87
83 /** 88 /**
84 * Function to run when ready. 89 * Function to run when ready.
85 */ 90 */
86 GNUNET_SCHEDULER_Task callback; 91 GNUNET_SCHEDULER_TaskCallback callback;
87 92
88 /** 93 /**
89 * Closure for the @e callback. 94 * Closure for the @e callback.
@@ -106,13 +111,8 @@ struct Task
106 struct GNUNET_NETWORK_FDSet *write_set; 111 struct GNUNET_NETWORK_FDSet *write_set;
107 112
108 /** 113 /**
109 * Unique task identifier.
110 */
111 GNUNET_SCHEDULER_TaskIdentifier id;
112
113 /**
114 * Absolute timeout value for the task, or 114 * Absolute timeout value for the task, or
115 * GNUNET_TIME_UNIT_FOREVER_ABS for "no timeout". 115 * #GNUNET_TIME_UNIT_FOREVER_ABS for "no timeout".
116 */ 116 */
117 struct GNUNET_TIME_Absolute timeout; 117 struct GNUNET_TIME_Absolute timeout;
118 118
@@ -169,9 +169,14 @@ struct Task
169 169
170 170
171/** 171/**
172 * List of tasks waiting for an event. 172 * Head of list of tasks waiting for an event.
173 */
174static struct GNUNET_SCHEDULER_Task *pending_head;
175
176/**
177 * Tail of list of tasks waiting for an event.
173 */ 178 */
174static struct Task *pending; 179static struct GNUNET_SCHEDULER_Task *pending_tail;
175 180
176/** 181/**
177 * List of tasks waiting ONLY for a timeout event. 182 * List of tasks waiting ONLY for a timeout event.
@@ -180,31 +185,37 @@ static struct Task *pending;
180 * building select sets (we just look at the head 185 * building select sets (we just look at the head
181 * to determine the respective timeout ONCE). 186 * to determine the respective timeout ONCE).
182 */ 187 */
183static struct Task *pending_timeout; 188static struct GNUNET_SCHEDULER_Task *pending_timeout_head;
189
190/**
191 * List of tasks waiting ONLY for a timeout event.
192 * Sorted by timeout (earliest first). Used so that
193 * we do not traverse the list of these tasks when
194 * building select sets (we just look at the head
195 * to determine the respective timeout ONCE).
196 */
197static struct GNUNET_SCHEDULER_Task *pending_timeout_tail;
184 198
185/** 199/**
186 * Last inserted task waiting ONLY for a timeout event. 200 * Last inserted task waiting ONLY for a timeout event.
187 * Used to (heuristically) speed up insertion. 201 * Used to (heuristically) speed up insertion.
188 */ 202 */
189static struct Task *pending_timeout_last; 203static struct GNUNET_SCHEDULER_Task *pending_timeout_last;
190 204
191/** 205/**
192 * ID of the task that is running right now. 206 * ID of the task that is running right now.
193 */ 207 */
194static struct Task *active_task; 208static struct GNUNET_SCHEDULER_Task *active_task;
195 209
196/** 210/**
197 * List of tasks ready to run right now, 211 * Head of list of tasks ready to run right now, grouped by importance.
198 * grouped by importance.
199 */ 212 */
200static struct Task *ready[GNUNET_SCHEDULER_PRIORITY_COUNT]; 213static struct GNUNET_SCHEDULER_Task *ready_head[GNUNET_SCHEDULER_PRIORITY_COUNT];
201 214
202/** 215/**
203 * Identity of the last task queued. Incremented for each task to 216 * Tail of list of tasks ready to run right now, grouped by importance.
204 * generate a unique task ID (it is virtually impossible to start
205 * more than 2^64 tasks during the lifetime of a process).
206 */ 217 */
207static GNUNET_SCHEDULER_TaskIdentifier last_id; 218static struct GNUNET_SCHEDULER_Task *ready_tail[GNUNET_SCHEDULER_PRIORITY_COUNT];
208 219
209/** 220/**
210 * Number of tasks on the ready list. 221 * Number of tasks on the ready list.
@@ -240,10 +251,11 @@ static int current_lifeness;
240static GNUNET_SCHEDULER_select scheduler_select; 251static GNUNET_SCHEDULER_select scheduler_select;
241 252
242/** 253/**
243 * Closure for 'scheduler_select'. 254 * Closure for #scheduler_select.
244 */ 255 */
245static void *scheduler_select_cls; 256static void *scheduler_select_cls;
246 257
258
247/** 259/**
248 * Sets the select function to use in the scheduler (scheduler_select). 260 * Sets the select function to use in the scheduler (scheduler_select).
249 * 261 *
@@ -284,25 +296,25 @@ check_priority (enum GNUNET_SCHEDULER_Priority p)
284 * @param timeout next timeout (updated) 296 * @param timeout next timeout (updated)
285 */ 297 */
286static void 298static void
287update_sets (struct GNUNET_NETWORK_FDSet *rs, struct GNUNET_NETWORK_FDSet *ws, 299update_sets (struct GNUNET_NETWORK_FDSet *rs,
300 struct GNUNET_NETWORK_FDSet *ws,
288 struct GNUNET_TIME_Relative *timeout) 301 struct GNUNET_TIME_Relative *timeout)
289{ 302{
290 struct Task *pos; 303 struct GNUNET_SCHEDULER_Task *pos;
291 struct GNUNET_TIME_Absolute now; 304 struct GNUNET_TIME_Absolute now;
292 struct GNUNET_TIME_Relative to; 305 struct GNUNET_TIME_Relative to;
293 306
294 now = GNUNET_TIME_absolute_get (); 307 now = GNUNET_TIME_absolute_get ();
295 pos = pending_timeout; 308 pos = pending_timeout_head;
296 if (NULL != pos) 309 if (NULL != pos)
297 { 310 {
298 to = GNUNET_TIME_absolute_get_difference (now, pos->timeout); 311 to = GNUNET_TIME_absolute_get_difference (now, pos->timeout);
299 if (timeout->rel_value_us > to.rel_value_us) 312 if (timeout->rel_value_us > to.rel_value_us)
300 *timeout = to; 313 *timeout = to;
301 if (pos->reason != 0) 314 if (0 != pos->reason)
302 *timeout = GNUNET_TIME_UNIT_ZERO; 315 *timeout = GNUNET_TIME_UNIT_ZERO;
303 } 316 }
304 pos = pending; 317 for (pos = pending_head; NULL != pos; pos = pos->next)
305 while (NULL != pos)
306 { 318 {
307 if (pos->timeout.abs_value_us != GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us) 319 if (pos->timeout.abs_value_us != GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us)
308 { 320 {
@@ -320,7 +332,6 @@ update_sets (struct GNUNET_NETWORK_FDSet *rs, struct GNUNET_NETWORK_FDSet *ws,
320 GNUNET_NETWORK_fdset_add (ws, pos->write_set); 332 GNUNET_NETWORK_fdset_add (ws, pos->write_set);
321 if (0 != pos->reason) 333 if (0 != pos->reason)
322 *timeout = GNUNET_TIME_UNIT_ZERO; 334 *timeout = GNUNET_TIME_UNIT_ZERO;
323 pos = pos->next;
324 } 335 }
325} 336}
326 337
@@ -328,11 +339,11 @@ update_sets (struct GNUNET_NETWORK_FDSet *rs, struct GNUNET_NETWORK_FDSet *ws,
328/** 339/**
329 * Check if the ready set overlaps with the set we want to have ready. 340 * Check if the ready set overlaps with the set we want to have ready.
330 * If so, update the want set (set all FDs that are ready). If not, 341 * If so, update the want set (set all FDs that are ready). If not,
331 * return GNUNET_NO. 342 * return #GNUNET_NO.
332 * 343 *
333 * @param ready set that is ready 344 * @param ready set that is ready
334 * @param want set that we want to be ready 345 * @param want set that we want to be ready
335 * @return GNUNET_YES if there was some overlap 346 * @return #GNUNET_YES if there was some overlap
336 */ 347 */
337static int 348static int
338set_overlaps (const struct GNUNET_NETWORK_FDSet *ready, 349set_overlaps (const struct GNUNET_NETWORK_FDSet *ready,
@@ -362,7 +373,8 @@ set_overlaps (const struct GNUNET_NETWORK_FDSet *ready,
362 * @return #GNUNET_YES if we can run it, #GNUNET_NO if not. 373 * @return #GNUNET_YES if we can run it, #GNUNET_NO if not.
363 */ 374 */
364static int 375static int
365is_ready (struct Task *task, struct GNUNET_TIME_Absolute now, 376is_ready (struct GNUNET_SCHEDULER_Task *task,
377 struct GNUNET_TIME_Absolute now,
366 const struct GNUNET_NETWORK_FDSet *rs, 378 const struct GNUNET_NETWORK_FDSet *rs,
367 const struct GNUNET_NETWORK_FDSet *ws) 379 const struct GNUNET_NETWORK_FDSet *ws)
368{ 380{
@@ -395,14 +407,15 @@ is_ready (struct Task *task, struct GNUNET_TIME_Absolute now,
395 * @param task task ready for execution 407 * @param task task ready for execution
396 */ 408 */
397static void 409static void
398queue_ready_task (struct Task *task) 410queue_ready_task (struct GNUNET_SCHEDULER_Task *task)
399{ 411{
400 enum GNUNET_SCHEDULER_Priority p = task->priority; 412 enum GNUNET_SCHEDULER_Priority p = check_priority (task->priority);
401 413
402 if (0 != (task->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 414 if (0 != (task->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
403 p = GNUNET_SCHEDULER_PRIORITY_SHUTDOWN; 415 p = GNUNET_SCHEDULER_PRIORITY_SHUTDOWN;
404 task->next = ready[check_priority (p)]; 416 GNUNET_CONTAINER_DLL_insert (ready_head[p],
405 ready[check_priority (p)] = task; 417 ready_tail[p],
418 task);
406 ready_count++; 419 ready_count++;
407} 420}
408 421
@@ -418,45 +431,35 @@ static void
418check_ready (const struct GNUNET_NETWORK_FDSet *rs, 431check_ready (const struct GNUNET_NETWORK_FDSet *rs,
419 const struct GNUNET_NETWORK_FDSet *ws) 432 const struct GNUNET_NETWORK_FDSet *ws)
420{ 433{
421 struct Task *pos; 434 struct GNUNET_SCHEDULER_Task *pos;
422 struct Task *prev; 435 struct GNUNET_SCHEDULER_Task *next;
423 struct Task *next;
424 struct GNUNET_TIME_Absolute now; 436 struct GNUNET_TIME_Absolute now;
425 437
426 now = GNUNET_TIME_absolute_get (); 438 now = GNUNET_TIME_absolute_get ();
427 prev = NULL; 439 while (NULL != (pos = pending_timeout_head))
428 pos = pending_timeout;
429 while (NULL != pos)
430 { 440 {
431 next = pos->next;
432 if (now.abs_value_us >= pos->timeout.abs_value_us) 441 if (now.abs_value_us >= pos->timeout.abs_value_us)
433 pos->reason |= GNUNET_SCHEDULER_REASON_TIMEOUT; 442 pos->reason |= GNUNET_SCHEDULER_REASON_TIMEOUT;
434 if (0 == pos->reason) 443 if (0 == pos->reason)
435 break; 444 break;
436 pending_timeout = next; 445 GNUNET_CONTAINER_DLL_remove (pending_timeout_head,
446 pending_timeout_tail,
447 pos);
437 if (pending_timeout_last == pos) 448 if (pending_timeout_last == pos)
438 pending_timeout_last = NULL; 449 pending_timeout_last = NULL;
439 queue_ready_task (pos); 450 queue_ready_task (pos);
440 pos = next;
441 } 451 }
442 pos = pending; 452 pos = pending_head;
443 while (NULL != pos) 453 while (NULL != pos)
444 { 454 {
445 LOG (GNUNET_ERROR_TYPE_DEBUG,
446 "Checking readiness of task: %llu / %p\n",
447 pos->id, pos->callback_cls);
448 next = pos->next; 455 next = pos->next;
449 if (GNUNET_YES == is_ready (pos, now, rs, ws)) 456 if (GNUNET_YES == is_ready (pos, now, rs, ws))
450 { 457 {
451 if (NULL == prev) 458 GNUNET_CONTAINER_DLL_remove (pending_head,
452 pending = next; 459 pending_tail,
453 else 460 pos);
454 prev->next = next;
455 queue_ready_task (pos); 461 queue_ready_task (pos);
456 pos = next;
457 continue;
458 } 462 }
459 prev = pos;
460 pos = next; 463 pos = next;
461 } 464 }
462} 465}
@@ -468,43 +471,24 @@ check_ready (const struct GNUNET_NETWORK_FDSet *rs,
468 * cause all tasks to run (as soon as possible, respecting 471 * cause all tasks to run (as soon as possible, respecting
469 * priorities and prerequisite tasks). Note that tasks 472 * priorities and prerequisite tasks). Note that tasks
470 * scheduled AFTER this call may still be delayed arbitrarily. 473 * scheduled AFTER this call may still be delayed arbitrarily.
474 *
475 * Note that we don't move the tasks into the ready queue yet;
476 * check_ready() will do that later, possibly adding additional
477 * readiness-factors
471 */ 478 */
472void 479void
473GNUNET_SCHEDULER_shutdown () 480GNUNET_SCHEDULER_shutdown ()
474{ 481{
475 struct Task *pos; 482 struct GNUNET_SCHEDULER_Task *pos;
476 int i; 483 int i;
477 484
478 pos = pending_timeout; 485 for (pos = pending_timeout_head; NULL != pos; pos = pos->next)
479 while (NULL != pos)
480 {
481 pos->reason |= GNUNET_SCHEDULER_REASON_SHUTDOWN; 486 pos->reason |= GNUNET_SCHEDULER_REASON_SHUTDOWN;
482 /* we don't move the task into the ready queue yet; check_ready 487 for (pos = pending_head; NULL != pos; pos = pos->next)
483 * will do that later, possibly adding additional
484 * readiness-factors */
485 pos = pos->next;
486 }
487 pos = pending;
488 while (NULL != pos)
489 {
490 pos->reason |= GNUNET_SCHEDULER_REASON_SHUTDOWN; 488 pos->reason |= GNUNET_SCHEDULER_REASON_SHUTDOWN;
491 /* we don't move the task into the ready queue yet; check_ready
492 * will do that later, possibly adding additional
493 * readiness-factors */
494 pos = pos->next;
495 }
496 for (i = 0; i < GNUNET_SCHEDULER_PRIORITY_COUNT; i++) 489 for (i = 0; i < GNUNET_SCHEDULER_PRIORITY_COUNT; i++)
497 { 490 for (pos = ready_head[i]; NULL != pos; pos = pos->next)
498 pos = ready[i];
499 while (NULL != pos)
500 {
501 pos->reason |= GNUNET_SCHEDULER_REASON_SHUTDOWN; 491 pos->reason |= GNUNET_SCHEDULER_REASON_SHUTDOWN;
502 /* we don't move the task into the ready queue yet; check_ready
503 * will do that later, possibly adding additional
504 * readiness-factors */
505 pos = pos->next;
506 }
507 }
508} 492}
509 493
510 494
@@ -514,7 +498,7 @@ GNUNET_SCHEDULER_shutdown ()
514 * @param t task to destroy 498 * @param t task to destroy
515 */ 499 */
516static void 500static void
517destroy_task (struct Task *t) 501destroy_task (struct GNUNET_SCHEDULER_Task *t)
518{ 502{
519 if (NULL != t->read_set) 503 if (NULL != t->read_set)
520 GNUNET_NETWORK_fdset_destroy (t->read_set); 504 GNUNET_NETWORK_fdset_destroy (t->read_set);
@@ -542,7 +526,7 @@ run_ready (struct GNUNET_NETWORK_FDSet *rs,
542 struct GNUNET_NETWORK_FDSet *ws) 526 struct GNUNET_NETWORK_FDSet *ws)
543{ 527{
544 enum GNUNET_SCHEDULER_Priority p; 528 enum GNUNET_SCHEDULER_Priority p;
545 struct Task *pos; 529 struct GNUNET_SCHEDULER_Task *pos;
546 struct GNUNET_SCHEDULER_TaskContext tc; 530 struct GNUNET_SCHEDULER_TaskContext tc;
547 531
548 max_priority_added = GNUNET_SCHEDULER_PRIORITY_KEEP; 532 max_priority_added = GNUNET_SCHEDULER_PRIORITY_KEEP;
@@ -550,17 +534,19 @@ run_ready (struct GNUNET_NETWORK_FDSet *rs,
550 { 534 {
551 if (0 == ready_count) 535 if (0 == ready_count)
552 return; 536 return;
553 GNUNET_assert (ready[GNUNET_SCHEDULER_PRIORITY_KEEP] == NULL); 537 GNUNET_assert (NULL == ready_head[GNUNET_SCHEDULER_PRIORITY_KEEP]);
554 /* yes, p>0 is correct, 0 is "KEEP" which should 538 /* yes, p>0 is correct, 0 is "KEEP" which should
555 * always be an empty queue (see assertion)! */ 539 * always be an empty queue (see assertion)! */
556 for (p = GNUNET_SCHEDULER_PRIORITY_COUNT - 1; p > 0; p--) 540 for (p = GNUNET_SCHEDULER_PRIORITY_COUNT - 1; p > 0; p--)
557 { 541 {
558 pos = ready[p]; 542 pos = ready_head[p];
559 if (NULL != pos) 543 if (NULL != pos)
560 break; 544 break;
561 } 545 }
562 GNUNET_assert (NULL != pos); /* ready_count wrong? */ 546 GNUNET_assert (NULL != pos); /* ready_count wrong? */
563 ready[p] = pos->next; 547 GNUNET_CONTAINER_DLL_remove (ready_head[p],
548 ready_tail[p],
549 pos);
564 ready_count--; 550 ready_count--;
565 current_priority = pos->priority; 551 current_priority = pos->priority;
566 current_lifeness = pos->lifeness; 552 current_lifeness = pos->lifeness;
@@ -570,35 +556,35 @@ run_ready (struct GNUNET_NETWORK_FDSet *rs,
570 DELAY_THRESHOLD.rel_value_us) 556 DELAY_THRESHOLD.rel_value_us)
571 { 557 {
572 LOG (GNUNET_ERROR_TYPE_DEBUG, 558 LOG (GNUNET_ERROR_TYPE_DEBUG,
573 "Task %llu took %s to be scheduled\n", 559 "Task %p took %s to be scheduled\n",
574 (unsigned long long) pos->id, 560 pos,
575 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (pos->start_time), 561 GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (pos->start_time),
576 GNUNET_YES)); 562 GNUNET_YES));
577 } 563 }
578#endif 564#endif
579 tc.reason = pos->reason; 565 tc.reason = pos->reason;
580 tc.read_ready = (pos->read_set == NULL) ? rs : pos->read_set; 566 tc.read_ready = (NULL == pos->read_set) ? rs : pos->read_set;
581 if ((pos->read_fd != -1) && 567 if ((-1 != pos->read_fd) &&
582 (0 != (pos->reason & GNUNET_SCHEDULER_REASON_READ_READY))) 568 (0 != (pos->reason & GNUNET_SCHEDULER_REASON_READ_READY)))
583 GNUNET_NETWORK_fdset_set_native (rs, pos->read_fd); 569 GNUNET_NETWORK_fdset_set_native (rs, pos->read_fd);
584 tc.write_ready = (pos->write_set == NULL) ? ws : pos->write_set; 570 tc.write_ready = (NULL == pos->write_set) ? ws : pos->write_set;
585 if ((pos->write_fd != -1) && 571 if ((-1 != pos->write_fd) &&
586 (0 != (pos->reason & GNUNET_SCHEDULER_REASON_WRITE_READY))) 572 (0 != (pos->reason & GNUNET_SCHEDULER_REASON_WRITE_READY)))
587 GNUNET_NETWORK_fdset_set_native (ws, pos->write_fd); 573 GNUNET_NETWORK_fdset_set_native (ws, pos->write_fd);
588 if (((tc.reason & GNUNET_SCHEDULER_REASON_WRITE_READY) != 0) && 574 if ((0 != (tc.reason & GNUNET_SCHEDULER_REASON_WRITE_READY)) &&
589 (pos->write_fd != -1) && 575 (-1 != pos->write_fd) &&
590 (!GNUNET_NETWORK_fdset_test_native (ws, pos->write_fd))) 576 (!GNUNET_NETWORK_fdset_test_native (ws, pos->write_fd)))
591 GNUNET_abort (); // added to ready in previous select loop! 577 GNUNET_abort (); // added to ready in previous select loop!
592 LOG (GNUNET_ERROR_TYPE_DEBUG, 578 LOG (GNUNET_ERROR_TYPE_DEBUG,
593 "Running task: %llu / %p\n", pos->id, 579 "Running task: %p\n",
594 pos->callback_cls); 580 pos);
595 pos->callback (pos->callback_cls, &tc); 581 pos->callback (pos->callback_cls, &tc);
596#if EXECINFO 582#if EXECINFO
597 int i; 583 unsigned int i;
598 584
599 for (i = 0; i < pos->num_backtrace_strings; i++) 585 for (i = 0; i < pos->num_backtrace_strings; i++)
600 LOG (GNUNET_ERROR_TYPE_ERROR, 586 LOG (GNUNET_ERROR_TYPE_ERROR,
601 "Task %llu trace %d: %s\n", 587 "Task %llu trace %u: %s\n",
602 pos->id, 588 pos->id,
603 i, 589 i,
604 pos->backtrace_strings[i]); 590 pos->backtrace_strings[i]);
@@ -607,9 +593,10 @@ run_ready (struct GNUNET_NETWORK_FDSet *rs,
607 destroy_task (pos); 593 destroy_task (pos);
608 tasks_run++; 594 tasks_run++;
609 } 595 }
610 while ((NULL == pending) || (p >= max_priority_added)); 596 while ((NULL == pending_head) || (p >= max_priority_added));
611} 597}
612 598
599
613/** 600/**
614 * Pipe used to communicate shutdown via signal. 601 * Pipe used to communicate shutdown via signal.
615 */ 602 */
@@ -680,17 +667,17 @@ sighandler_shutdown ()
680static int 667static int
681check_lifeness () 668check_lifeness ()
682{ 669{
683 struct Task *t; 670 struct GNUNET_SCHEDULER_Task *t;
684 671
685 if (ready_count > 0) 672 if (ready_count > 0)
686 return GNUNET_OK; 673 return GNUNET_OK;
687 for (t = pending; NULL != t; t = t->next) 674 for (t = pending_head; NULL != t; t = t->next)
688 if (t->lifeness == GNUNET_YES) 675 if (t->lifeness == GNUNET_YES)
689 return GNUNET_OK; 676 return GNUNET_OK;
690 for (t = pending_timeout; NULL != t; t = t->next) 677 for (t = pending_timeout_head; NULL != t; t = t->next)
691 if (t->lifeness == GNUNET_YES) 678 if (t->lifeness == GNUNET_YES)
692 return GNUNET_OK; 679 return GNUNET_OK;
693 if ((NULL != pending) || (NULL != pending_timeout)) 680 if ((NULL != pending_head) || (NULL != pending_timeout_head))
694 { 681 {
695 GNUNET_SCHEDULER_shutdown (); 682 GNUNET_SCHEDULER_shutdown ();
696 return GNUNET_OK; 683 return GNUNET_OK;
@@ -714,7 +701,8 @@ check_lifeness ()
714 * @param task_cls closure of @a task 701 * @param task_cls closure of @a task
715 */ 702 */
716void 703void
717GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls) 704GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_TaskCallback task,
705 void *task_cls)
718{ 706{
719 struct GNUNET_NETWORK_FDSet *rs; 707 struct GNUNET_NETWORK_FDSet *rs;
720 struct GNUNET_NETWORK_FDSet *ws; 708 struct GNUNET_NETWORK_FDSet *ws;
@@ -740,13 +728,17 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls)
740 rs = GNUNET_NETWORK_fdset_create (); 728 rs = GNUNET_NETWORK_fdset_create ();
741 ws = GNUNET_NETWORK_fdset_create (); 729 ws = GNUNET_NETWORK_fdset_create ();
742 GNUNET_assert (NULL == shutdown_pipe_handle); 730 GNUNET_assert (NULL == shutdown_pipe_handle);
743 shutdown_pipe_handle = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, GNUNET_NO, GNUNET_NO); 731 shutdown_pipe_handle = GNUNET_DISK_pipe (GNUNET_NO,
732 GNUNET_NO,
733 GNUNET_NO,
734 GNUNET_NO);
744 GNUNET_assert (NULL != shutdown_pipe_handle); 735 GNUNET_assert (NULL != shutdown_pipe_handle);
745 pr = GNUNET_DISK_pipe_handle (shutdown_pipe_handle, 736 pr = GNUNET_DISK_pipe_handle (shutdown_pipe_handle,
746 GNUNET_DISK_PIPE_END_READ); 737 GNUNET_DISK_PIPE_END_READ);
747 GNUNET_assert (pr != NULL); 738 GNUNET_assert (NULL != pr);
748 my_pid = getpid (); 739 my_pid = getpid ();
749 LOG (GNUNET_ERROR_TYPE_DEBUG, "Registering signal handlers\n"); 740 LOG (GNUNET_ERROR_TYPE_DEBUG,
741 "Registering signal handlers\n");
750 shc_int = GNUNET_SIGNAL_handler_install (SIGINT, &sighandler_shutdown); 742 shc_int = GNUNET_SIGNAL_handler_install (SIGINT, &sighandler_shutdown);
751 shc_term = GNUNET_SIGNAL_handler_install (SIGTERM, &sighandler_shutdown); 743 shc_term = GNUNET_SIGNAL_handler_install (SIGTERM, &sighandler_shutdown);
752#if (SIGTERM != GNUNET_TERM_SIG) 744#if (SIGTERM != GNUNET_TERM_SIG)
@@ -759,7 +751,8 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls)
759#endif 751#endif
760 current_priority = GNUNET_SCHEDULER_PRIORITY_DEFAULT; 752 current_priority = GNUNET_SCHEDULER_PRIORITY_DEFAULT;
761 current_lifeness = GNUNET_YES; 753 current_lifeness = GNUNET_YES;
762 GNUNET_SCHEDULER_add_continuation (task, task_cls, 754 GNUNET_SCHEDULER_add_continuation (task,
755 task_cls,
763 GNUNET_SCHEDULER_REASON_STARTUP); 756 GNUNET_SCHEDULER_REASON_STARTUP);
764 active_task = (void *) (long) -1; /* force passing of sanity check */ 757 active_task = (void *) (long) -1; /* force passing of sanity check */
765 GNUNET_SCHEDULER_add_now_with_lifeness (GNUNET_NO, 758 GNUNET_SCHEDULER_add_now_with_lifeness (GNUNET_NO,
@@ -860,7 +853,7 @@ GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls)
860enum GNUNET_SCHEDULER_Reason 853enum GNUNET_SCHEDULER_Reason
861GNUNET_SCHEDULER_get_reason () 854GNUNET_SCHEDULER_get_reason ()
862{ 855{
863 GNUNET_assert (active_task != NULL); 856 GNUNET_assert (NULL != active_task);
864 return active_task->reason; 857 return active_task->reason;
865} 858}
866 859
@@ -877,21 +870,17 @@ GNUNET_SCHEDULER_get_reason ()
877unsigned int 870unsigned int
878GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p) 871GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p)
879{ 872{
880 struct Task *pos; 873 struct GNUNET_SCHEDULER_Task *pos;
881 unsigned int ret; 874 unsigned int ret;
882 875
883 GNUNET_assert (active_task != NULL); 876 GNUNET_assert (NULL != active_task);
884 if (p == GNUNET_SCHEDULER_PRIORITY_COUNT) 877 if (p == GNUNET_SCHEDULER_PRIORITY_COUNT)
885 return ready_count; 878 return ready_count;
886 if (p == GNUNET_SCHEDULER_PRIORITY_KEEP) 879 if (p == GNUNET_SCHEDULER_PRIORITY_KEEP)
887 p = current_priority; 880 p = current_priority;
888 ret = 0; 881 ret = 0;
889 pos = ready[check_priority (p)]; 882 for (pos = ready_head[check_priority (p)]; NULL != pos; pos = pos->next)
890 while (NULL != pos)
891 {
892 pos = pos->next;
893 ret++; 883 ret++;
894 }
895 return ret; 884 return ret;
896} 885}
897 886
@@ -904,92 +893,45 @@ GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p)
904 * @return original closure of the task 893 * @return original closure of the task
905 */ 894 */
906void * 895void *
907GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task) 896GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task)
908{ 897{
909 struct Task *t;
910 struct Task *prev;
911 enum GNUNET_SCHEDULER_Priority p; 898 enum GNUNET_SCHEDULER_Priority p;
912 int to;
913 void *ret; 899 void *ret;
914 900
915 GNUNET_assert (NULL != active_task); 901 GNUNET_assert (NULL != active_task);
916 to = 0; 902 if (GNUNET_SCHEDULER_REASON_NONE == task->reason)
917 prev = NULL;
918 t = pending;
919 while (NULL != t)
920 {
921 if (t->id == task)
922 break;
923 prev = t;
924 t = t->next;
925 }
926 if (NULL == t)
927 {
928 prev = NULL;
929 to = 1;
930 t = pending_timeout;
931 while (t != NULL)
932 {
933 if (t->id == task)
934 break;
935 prev = t;
936 t = t->next;
937 }
938 if (pending_timeout_last == t)
939 pending_timeout_last = NULL;
940 }
941 p = 0;
942 while (NULL == t)
943 {
944 p++;
945 if (p >= GNUNET_SCHEDULER_PRIORITY_COUNT)
946 {
947 LOG (GNUNET_ERROR_TYPE_ERROR,
948 _("Attempt to cancel dead task %llu!\n"),
949 (unsigned long long) task);
950 GNUNET_assert (0);
951 }
952 prev = NULL;
953 t = ready[p];
954 while (NULL != t)
955 {
956 if (t->id == task)
957 {
958 ready_count--;
959 break;
960 }
961 prev = t;
962 t = t->next;
963 }
964 }
965 if (NULL == prev)
966 { 903 {
967 if (0 == p) 904 if ( (-1 == task->read_fd) &&
905 (-1 == task->write_fd) &&
906 (NULL == task->read_set) &&
907 (NULL == task->write_set) )
968 { 908 {
969 if (0 == to) 909 GNUNET_CONTAINER_DLL_remove (pending_timeout_head,
970 { 910 pending_timeout_tail,
971 pending = t->next; 911 task);
972 } 912 if (task == pending_timeout_last)
973 else 913 pending_timeout_last = NULL;
974 {
975 pending_timeout = t->next;
976 }
977 } 914 }
978 else 915 else
979 { 916 {
980 ready[p] = t->next; 917 GNUNET_CONTAINER_DLL_remove (pending_head,
918 pending_tail,
919 task);
981 } 920 }
982 } 921 }
983 else 922 else
984 { 923 {
985 prev->next = t->next; 924 p = check_priority (task->priority);
925 GNUNET_CONTAINER_DLL_remove (ready_head[p],
926 ready_tail[p],
927 task);
928 ready_count--;
986 } 929 }
987 ret = t->callback_cls; 930 ret = task->callback_cls;
988 LOG (GNUNET_ERROR_TYPE_DEBUG, 931 LOG (GNUNET_ERROR_TYPE_DEBUG,
989 "Canceling task: %llu / %p\n", 932 "Canceling task %p\n",
990 task, 933 task);
991 t->callback_cls); 934 destroy_task (task);
992 destroy_task (t);
993 return ret; 935 return ret;
994} 936}
995 937
@@ -1005,11 +947,12 @@ GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task)
1005 * @param priority priority to use for the task 947 * @param priority priority to use for the task
1006 */ 948 */
1007void 949void
1008GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_Task task, void *task_cls, 950GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_TaskCallback task,
951 void *task_cls,
1009 enum GNUNET_SCHEDULER_Reason reason, 952 enum GNUNET_SCHEDULER_Reason reason,
1010 enum GNUNET_SCHEDULER_Priority priority) 953 enum GNUNET_SCHEDULER_Priority priority)
1011{ 954{
1012 struct Task *t; 955 struct GNUNET_SCHEDULER_Task *t;
1013 956
1014#if EXECINFO 957#if EXECINFO
1015 void *backtrace_array[50]; 958 void *backtrace_array[50];
@@ -1018,7 +961,7 @@ GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_Task task, voi
1018 GNUNET_assert (NULL != task); 961 GNUNET_assert (NULL != task);
1019 GNUNET_assert ((NULL != active_task) || 962 GNUNET_assert ((NULL != active_task) ||
1020 (GNUNET_SCHEDULER_REASON_STARTUP == reason)); 963 (GNUNET_SCHEDULER_REASON_STARTUP == reason));
1021 t = GNUNET_new (struct Task); 964 t = GNUNET_new (struct GNUNET_SCHEDULER_Task);
1022#if EXECINFO 965#if EXECINFO
1023 t->num_backtrace_strings = backtrace (backtrace_array, 50); 966 t->num_backtrace_strings = backtrace (backtrace_array, 50);
1024 t->backtrace_strings = 967 t->backtrace_strings =
@@ -1028,7 +971,6 @@ GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_Task task, voi
1028 t->write_fd = -1; 971 t->write_fd = -1;
1029 t->callback = task; 972 t->callback = task;
1030 t->callback_cls = task_cls; 973 t->callback_cls = task_cls;
1031 t->id = ++last_id;
1032#if PROFILE_DELAYS 974#if PROFILE_DELAYS
1033 t->start_time = GNUNET_TIME_absolute_get (); 975 t->start_time = GNUNET_TIME_absolute_get ();
1034#endif 976#endif
@@ -1036,9 +978,8 @@ GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_Task task, voi
1036 t->priority = priority; 978 t->priority = priority;
1037 t->lifeness = current_lifeness; 979 t->lifeness = current_lifeness;
1038 LOG (GNUNET_ERROR_TYPE_DEBUG, 980 LOG (GNUNET_ERROR_TYPE_DEBUG,
1039 "Adding continuation task: %llu / %p\n", 981 "Adding continuation task %p\n",
1040 t->id, 982 t);
1041 t->callback_cls);
1042 queue_ready_task (t); 983 queue_ready_task (t);
1043} 984}
1044 985
@@ -1053,7 +994,7 @@ GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_Task task, voi
1053 * @param reason reason for task invocation 994 * @param reason reason for task invocation
1054 */ 995 */
1055void 996void
1056GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, void *task_cls, 997GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_TaskCallback task, void *task_cls,
1057 enum GNUNET_SCHEDULER_Reason reason) 998 enum GNUNET_SCHEDULER_Reason reason)
1058{ 999{
1059 GNUNET_SCHEDULER_add_continuation_with_priority (task, task_cls, 1000 GNUNET_SCHEDULER_add_continuation_with_priority (task, task_cls,
@@ -1063,26 +1004,6 @@ GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, void *task_cls,
1063 1004
1064 1005
1065/** 1006/**
1066 * Schedule a new task to be run with a specified priority.
1067 *
1068 * @param prio how important is the new task?
1069 * @param task main function of the task
1070 * @param task_cls closure of @a task
1071 * @return unique task identifier for the job
1072 * only valid until @a task is started!
1073 */
1074GNUNET_SCHEDULER_TaskIdentifier
1075GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio,
1076 GNUNET_SCHEDULER_Task task, void *task_cls)
1077{
1078 return GNUNET_SCHEDULER_add_select (prio,
1079 GNUNET_TIME_UNIT_ZERO, NULL, NULL, task,
1080 task_cls);
1081}
1082
1083
1084
1085/**
1086 * Schedule a new task to be run with a specified delay. The task 1007 * Schedule a new task to be run with a specified delay. The task
1087 * will be scheduled for execution once the delay has expired. 1008 * will be scheduled for execution once the delay has expired.
1088 * 1009 *
@@ -1094,14 +1015,15 @@ GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio,
1094 * @return unique task identifier for the job 1015 * @return unique task identifier for the job
1095 * only valid until @a task is started! 1016 * only valid until @a task is started!
1096 */ 1017 */
1097GNUNET_SCHEDULER_TaskIdentifier 1018struct GNUNET_SCHEDULER_Task *
1098GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay, 1019GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
1099 enum GNUNET_SCHEDULER_Priority priority, 1020 enum GNUNET_SCHEDULER_Priority priority,
1100 GNUNET_SCHEDULER_Task task, void *task_cls) 1021 GNUNET_SCHEDULER_TaskCallback task,
1022 void *task_cls)
1101{ 1023{
1102 struct Task *t; 1024 struct GNUNET_SCHEDULER_Task *t;
1103 struct Task *pos; 1025 struct GNUNET_SCHEDULER_Task *pos;
1104 struct Task *prev; 1026 struct GNUNET_SCHEDULER_Task *prev;
1105 1027
1106#if EXECINFO 1028#if EXECINFO
1107 void *backtrace_array[MAX_TRACE_DEPTH]; 1029 void *backtrace_array[MAX_TRACE_DEPTH];
@@ -1109,7 +1031,7 @@ GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
1109 1031
1110 GNUNET_assert (NULL != active_task); 1032 GNUNET_assert (NULL != active_task);
1111 GNUNET_assert (NULL != task); 1033 GNUNET_assert (NULL != task);
1112 t = GNUNET_new (struct Task); 1034 t = GNUNET_new (struct GNUNET_SCHEDULER_Task);
1113 t->callback = task; 1035 t->callback = task;
1114 t->callback_cls = task_cls; 1036 t->callback_cls = task_cls;
1115#if EXECINFO 1037#if EXECINFO
@@ -1119,7 +1041,6 @@ GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
1119#endif 1041#endif
1120 t->read_fd = -1; 1042 t->read_fd = -1;
1121 t->write_fd = -1; 1043 t->write_fd = -1;
1122 t->id = ++last_id;
1123#if PROFILE_DELAYS 1044#if PROFILE_DELAYS
1124 t->start_time = GNUNET_TIME_absolute_get (); 1045 t->start_time = GNUNET_TIME_absolute_get ();
1125#endif 1046#endif
@@ -1128,44 +1049,74 @@ GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
1128 t->lifeness = current_lifeness; 1049 t->lifeness = current_lifeness;
1129 /* try tail first (optimization in case we are 1050 /* try tail first (optimization in case we are
1130 * appending to a long list of tasks with timeouts) */ 1051 * appending to a long list of tasks with timeouts) */
1131 prev = pending_timeout_last; 1052 if (0 == delay.rel_value_us)
1132 if (prev != NULL)
1133 { 1053 {
1134 if (prev->timeout.abs_value_us > t->timeout.abs_value_us) 1054 GNUNET_CONTAINER_DLL_insert (pending_timeout_head,
1135 prev = NULL; 1055 pending_timeout_tail,
1136 else 1056 t);
1137 pos = prev->next; /* heuristic success! */
1138 }
1139 if (prev == NULL)
1140 {
1141 /* heuristic failed, do traversal of timeout list */
1142 pos = pending_timeout;
1143 } 1057 }
1144 while ((pos != NULL) && 1058 else
1145 ((pos->timeout.abs_value_us <= t->timeout.abs_value_us) ||
1146 (0 != pos->reason)))
1147 { 1059 {
1148 prev = pos; 1060 /* first move from heuristic start backwards to before start time */
1149 pos = pos->next; 1061 prev = pending_timeout_last;
1062 while ( (NULL != prev) &&
1063 (prev->timeout.abs_value_us > t->timeout.abs_value_us) )
1064 prev = prev->prev;
1065 /* now, move from heuristic start (or head of list) forward to insertion point */
1066 if (NULL == prev)
1067 pos = pending_timeout_head;
1068 else
1069 pos = prev->next;
1070 while ( (NULL != pos) &&
1071 ( (pos->timeout.abs_value_us <= t->timeout.abs_value_us) ||
1072 (0 != pos->reason) ) )
1073 {
1074 prev = pos;
1075 pos = pos->next;
1076 }
1077 GNUNET_CONTAINER_DLL_insert_after (pending_timeout_head,
1078 pending_timeout_tail,
1079 prev,
1080 t);
1081 /* finally, update heuristic insertion point to last insertion... */
1082 pending_timeout_last = t;
1150 } 1083 }
1151 if (prev == NULL)
1152 pending_timeout = t;
1153 else
1154 prev->next = t;
1155 t->next = pos;
1156 /* hyper-optimization... */
1157 pending_timeout_last = t;
1158 1084
1159 LOG (GNUNET_ERROR_TYPE_DEBUG, "Adding task: %llu / %p\n", t->id, 1085 LOG (GNUNET_ERROR_TYPE_DEBUG,
1160 t->callback_cls); 1086 "Adding task: %p\n",
1087 t);
1161#if EXECINFO 1088#if EXECINFO
1162 int i; 1089 unsigned int i;
1163 1090
1164 for (i = 0; i < t->num_backtrace_strings; i++) 1091 for (i = 0; i < t->num_backtrace_strings; i++)
1165 LOG (GNUNET_ERROR_TYPE_DEBUG, "Task %llu trace %d: %s\n", t->id, i, 1092 LOG (GNUNET_ERROR_TYPE_DEBUG,
1093 "Task %p trace %d: %s\n",
1094 t,
1095 i,
1166 t->backtrace_strings[i]); 1096 t->backtrace_strings[i]);
1167#endif 1097#endif
1168 return t->id; 1098 return t;
1099}
1100
1101
1102/**
1103 * Schedule a new task to be run with a specified priority.
1104 *
1105 * @param prio how important is the new task?
1106 * @param task main function of the task
1107 * @param task_cls closure of @a task
1108 * @return unique task identifier for the job
1109 * only valid until @a task is started!
1110 */
1111struct GNUNET_SCHEDULER_Task *
1112GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio,
1113 GNUNET_SCHEDULER_TaskCallback task,
1114 void *task_cls)
1115{
1116 return GNUNET_SCHEDULER_add_delayed_with_priority (GNUNET_TIME_UNIT_ZERO,
1117 prio,
1118 task,
1119 task_cls);
1169} 1120}
1170 1121
1171 1122
@@ -1181,9 +1132,9 @@ GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
1181 * @return unique task identifier for the job 1132 * @return unique task identifier for the job
1182 * only valid until "task" is started! 1133 * only valid until "task" is started!
1183 */ 1134 */
1184GNUNET_SCHEDULER_TaskIdentifier 1135struct GNUNET_SCHEDULER_Task *
1185GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, 1136GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay,
1186 GNUNET_SCHEDULER_Task task, void *task_cls) 1137 GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
1187{ 1138{
1188 return GNUNET_SCHEDULER_add_delayed_with_priority (delay, 1139 return GNUNET_SCHEDULER_add_delayed_with_priority (delay,
1189 GNUNET_SCHEDULER_PRIORITY_DEFAULT, 1140 GNUNET_SCHEDULER_PRIORITY_DEFAULT,
@@ -1206,8 +1157,8 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay,
1206 * @return unique task identifier for the job 1157 * @return unique task identifier for the job
1207 * only valid until "task" is started! 1158 * only valid until "task" is started!
1208 */ 1159 */
1209GNUNET_SCHEDULER_TaskIdentifier 1160struct GNUNET_SCHEDULER_Task *
1210GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls) 1161GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
1211{ 1162{
1212 return GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_ZERO, task, task_cls); 1163 return GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_ZERO, task, task_cls);
1213} 1164}
@@ -1227,19 +1178,15 @@ GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls)
1227 * @return unique task identifier for the job 1178 * @return unique task identifier for the job
1228 * only valid until @a task is started! 1179 * only valid until @a task is started!
1229 */ 1180 */
1230GNUNET_SCHEDULER_TaskIdentifier 1181struct GNUNET_SCHEDULER_Task *
1231GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, 1182GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness,
1232 GNUNET_SCHEDULER_Task task, 1183 GNUNET_SCHEDULER_TaskCallback task,
1233 void *task_cls) 1184 void *task_cls)
1234{ 1185{
1235 GNUNET_SCHEDULER_TaskIdentifier ret; 1186 struct GNUNET_SCHEDULER_Task *ret;
1236 1187
1237 ret = 1188 ret = GNUNET_SCHEDULER_add_now (task, task_cls);
1238 GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT, 1189 ret->lifeness = lifeness;
1239 GNUNET_TIME_UNIT_ZERO, NULL, NULL, task,
1240 task_cls);
1241 GNUNET_assert (pending->id == ret);
1242 pending->lifeness = lifeness;
1243 return ret; 1190 return ret;
1244} 1191}
1245 1192
@@ -1269,16 +1216,18 @@ GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness,
1269 * @param task main function of the task 1216 * @param task main function of the task
1270 * @param task_cls closure of @a task 1217 * @param task_cls closure of @a task
1271 * @return unique task identifier for the job 1218 * @return unique task identifier for the job
1272 * only valid until "task" is started! 1219 * only valid until @a task is started!
1273 */ 1220 */
1274#ifndef MINGW 1221#ifndef MINGW
1275static GNUNET_SCHEDULER_TaskIdentifier 1222static struct GNUNET_SCHEDULER_Task *
1276add_without_sets (struct GNUNET_TIME_Relative delay, 1223add_without_sets (struct GNUNET_TIME_Relative delay,
1277 enum GNUNET_SCHEDULER_Priority priority, 1224 enum GNUNET_SCHEDULER_Priority priority,
1278 int rfd, int wfd, 1225 int rfd,
1279 GNUNET_SCHEDULER_Task task, void *task_cls) 1226 int wfd,
1227 GNUNET_SCHEDULER_TaskCallback task,
1228 void *task_cls)
1280{ 1229{
1281 struct Task *t; 1230 struct GNUNET_SCHEDULER_Task *t;
1282 1231
1283#if EXECINFO 1232#if EXECINFO
1284 void *backtrace_array[MAX_TRACE_DEPTH]; 1233 void *backtrace_array[MAX_TRACE_DEPTH];
@@ -1286,7 +1235,7 @@ add_without_sets (struct GNUNET_TIME_Relative delay,
1286 1235
1287 GNUNET_assert (NULL != active_task); 1236 GNUNET_assert (NULL != active_task);
1288 GNUNET_assert (NULL != task); 1237 GNUNET_assert (NULL != task);
1289 t = GNUNET_new (struct Task); 1238 t = GNUNET_new (struct GNUNET_SCHEDULER_Task);
1290 t->callback = task; 1239 t->callback = task;
1291 t->callback_cls = task_cls; 1240 t->callback_cls = task_cls;
1292#if EXECINFO 1241#if EXECINFO
@@ -1339,36 +1288,35 @@ add_without_sets (struct GNUNET_TIME_Relative delay,
1339 t->read_fd = rfd; 1288 t->read_fd = rfd;
1340 GNUNET_assert (wfd >= -1); 1289 GNUNET_assert (wfd >= -1);
1341 t->write_fd = wfd; 1290 t->write_fd = wfd;
1342 t->id = ++last_id;
1343#if PROFILE_DELAYS 1291#if PROFILE_DELAYS
1344 t->start_time = GNUNET_TIME_absolute_get (); 1292 t->start_time = GNUNET_TIME_absolute_get ();
1345#endif 1293#endif
1346 t->timeout = GNUNET_TIME_relative_to_absolute (delay); 1294 t->timeout = GNUNET_TIME_relative_to_absolute (delay);
1347 t->priority = check_priority ((priority == GNUNET_SCHEDULER_PRIORITY_KEEP) ? current_priority : priority); 1295 t->priority = check_priority ((priority == GNUNET_SCHEDULER_PRIORITY_KEEP) ? current_priority : priority);
1348 t->lifeness = current_lifeness; 1296 t->lifeness = current_lifeness;
1349 t->next = pending; 1297 GNUNET_CONTAINER_DLL_insert (pending_head,
1350 pending = t; 1298 pending_tail,
1351 max_priority_added = GNUNET_MAX (max_priority_added, t->priority); 1299 t);
1300 max_priority_added = GNUNET_MAX (max_priority_added,
1301 t->priority);
1352 LOG (GNUNET_ERROR_TYPE_DEBUG, 1302 LOG (GNUNET_ERROR_TYPE_DEBUG,
1353 "Adding task: %llu / %p\n", 1303 "Adding task %p\n",
1354 t->id, 1304 t);
1355 t->callback_cls);
1356#if EXECINFO 1305#if EXECINFO
1357 int i; 1306 unsigned int i;
1358 1307
1359 for (i = 0; i < t->num_backtrace_strings; i++) 1308 for (i = 0; i < t->num_backtrace_strings; i++)
1360 LOG (GNUNET_ERROR_TYPE_DEBUG, 1309 LOG (GNUNET_ERROR_TYPE_DEBUG,
1361 "Task %llu trace %d: %s\n", 1310 "Task %p trace %d: %s\n",
1362 t->id, 1311 t,
1363 i, 1312 i,
1364 t->backtrace_strings[i]); 1313 t->backtrace_strings[i]);
1365#endif 1314#endif
1366 return t->id; 1315 return t;
1367} 1316}
1368#endif 1317#endif
1369 1318
1370 1319
1371
1372/** 1320/**
1373 * Schedule a new task to be run with a specified delay or when the 1321 * Schedule a new task to be run with a specified delay or when the
1374 * specified file descriptor is ready for reading. The delay can be 1322 * specified file descriptor is ready for reading. The delay can be
@@ -1384,10 +1332,11 @@ add_without_sets (struct GNUNET_TIME_Relative delay,
1384 * @return unique task identifier for the job 1332 * @return unique task identifier for the job
1385 * only valid until @a task is started! 1333 * only valid until @a task is started!
1386 */ 1334 */
1387GNUNET_SCHEDULER_TaskIdentifier 1335struct GNUNET_SCHEDULER_Task *
1388GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, 1336GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay,
1389 struct GNUNET_NETWORK_Handle *rfd, 1337 struct GNUNET_NETWORK_Handle *rfd,
1390 GNUNET_SCHEDULER_Task task, void *task_cls) 1338 GNUNET_SCHEDULER_TaskCallback task,
1339 void *task_cls)
1391{ 1340{
1392 return GNUNET_SCHEDULER_add_read_net_with_priority (delay, 1341 return GNUNET_SCHEDULER_add_read_net_with_priority (delay,
1393 GNUNET_SCHEDULER_PRIORITY_DEFAULT, 1342 GNUNET_SCHEDULER_PRIORITY_DEFAULT,
@@ -1412,16 +1361,18 @@ GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay,
1412 * @return unique task identifier for the job 1361 * @return unique task identifier for the job
1413 * only valid until @a task is started! 1362 * only valid until @a task is started!
1414 */ 1363 */
1415GNUNET_SCHEDULER_TaskIdentifier 1364struct GNUNET_SCHEDULER_Task *
1416GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay, 1365GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay,
1417 enum GNUNET_SCHEDULER_Priority priority, 1366 enum GNUNET_SCHEDULER_Priority priority,
1418 struct GNUNET_NETWORK_Handle *rfd, 1367 struct GNUNET_NETWORK_Handle *rfd,
1419 GNUNET_SCHEDULER_Task task, void *task_cls) 1368 GNUNET_SCHEDULER_TaskCallback task,
1369 void *task_cls)
1420{ 1370{
1421 return GNUNET_SCHEDULER_add_net_with_priority ( 1371 return GNUNET_SCHEDULER_add_net_with_priority (delay, priority,
1422 delay, priority, 1372 rfd,
1423 rfd, GNUNET_YES, GNUNET_NO, 1373 GNUNET_YES,
1424 task, task_cls); 1374 GNUNET_NO,
1375 task, task_cls);
1425} 1376}
1426 1377
1427 1378
@@ -1441,15 +1392,17 @@ GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay,
1441 * @return unique task identifier for the job 1392 * @return unique task identifier for the job
1442 * only valid until @a task is started! 1393 * only valid until @a task is started!
1443 */ 1394 */
1444GNUNET_SCHEDULER_TaskIdentifier 1395struct GNUNET_SCHEDULER_Task *
1445GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, 1396GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
1446 struct GNUNET_NETWORK_Handle *wfd, 1397 struct GNUNET_NETWORK_Handle *wfd,
1447 GNUNET_SCHEDULER_Task task, void *task_cls) 1398 GNUNET_SCHEDULER_TaskCallback task,
1399 void *task_cls)
1448{ 1400{
1449 return GNUNET_SCHEDULER_add_net_with_priority ( 1401 return GNUNET_SCHEDULER_add_net_with_priority (delay,
1450 delay, GNUNET_SCHEDULER_PRIORITY_DEFAULT, 1402 GNUNET_SCHEDULER_PRIORITY_DEFAULT,
1451 wfd, GNUNET_NO, GNUNET_YES, 1403 wfd,
1452 task, task_cls); 1404 GNUNET_NO, GNUNET_YES,
1405 task, task_cls);
1453} 1406}
1454 1407
1455/** 1408/**
@@ -1460,7 +1413,7 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
1460 * socket operation is ready. 1413 * socket operation is ready.
1461 * 1414 *
1462 * @param delay when should this operation time out? Use 1415 * @param delay when should this operation time out? Use
1463 * GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown" 1416 * #GNUNET_TIME_UNIT_FOREVER_REL for "on shutdown"
1464 * @param priority priority of the task 1417 * @param priority priority of the task
1465 * @param fd file-descriptor 1418 * @param fd file-descriptor
1466 * @param on_read whether to poll the file-descriptor for readability 1419 * @param on_read whether to poll the file-descriptor for readability
@@ -1470,18 +1423,20 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
1470 * @return unique task identifier for the job 1423 * @return unique task identifier for the job
1471 * only valid until "task" is started! 1424 * only valid until "task" is started!
1472 */ 1425 */
1473GNUNET_SCHEDULER_TaskIdentifier 1426struct GNUNET_SCHEDULER_Task *
1474GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay, 1427GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay,
1475 enum GNUNET_SCHEDULER_Priority priority, 1428 enum GNUNET_SCHEDULER_Priority priority,
1476 struct GNUNET_NETWORK_Handle *fd, 1429 struct GNUNET_NETWORK_Handle *fd,
1477 int on_read, int on_write, 1430 int on_read,
1478 GNUNET_SCHEDULER_Task task, void *task_cls) 1431 int on_write,
1432 GNUNET_SCHEDULER_TaskCallback task,
1433 void *task_cls)
1479{ 1434{
1480#if MINGW 1435#if MINGW
1481 struct GNUNET_NETWORK_FDSet *s; 1436 struct GNUNET_NETWORK_FDSet *s;
1482 GNUNET_SCHEDULER_TaskIdentifier ret; 1437 struct GNUNET_SCHEDULER_Task * ret;
1483 1438
1484 GNUNET_assert (fd != NULL); 1439 GNUNET_assert (NULL != fd);
1485 s = GNUNET_NETWORK_fdset_create (); 1440 s = GNUNET_NETWORK_fdset_create ();
1486 GNUNET_NETWORK_fdset_set (s, fd); 1441 GNUNET_NETWORK_fdset_set (s, fd);
1487 ret = GNUNET_SCHEDULER_add_select ( 1442 ret = GNUNET_SCHEDULER_add_select (
@@ -1493,11 +1448,10 @@ GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay,
1493 return ret; 1448 return ret;
1494#else 1449#else
1495 GNUNET_assert (GNUNET_NETWORK_get_fd (fd) >= 0); 1450 GNUNET_assert (GNUNET_NETWORK_get_fd (fd) >= 0);
1496 return add_without_sets ( 1451 return add_without_sets (delay, priority,
1497 delay, priority, 1452 on_read ? GNUNET_NETWORK_get_fd (fd) : -1,
1498 on_read ? GNUNET_NETWORK_get_fd (fd) : -1, 1453 on_write ? GNUNET_NETWORK_get_fd (fd) : -1,
1499 on_write ? GNUNET_NETWORK_get_fd (fd) : -1, 1454 task, task_cls);
1500 task, task_cls);
1501#endif 1455#endif
1502} 1456}
1503 1457
@@ -1517,10 +1471,10 @@ GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay,
1517 * @return unique task identifier for the job 1471 * @return unique task identifier for the job
1518 * only valid until @a task is started! 1472 * only valid until @a task is started!
1519 */ 1473 */
1520GNUNET_SCHEDULER_TaskIdentifier 1474struct GNUNET_SCHEDULER_Task *
1521GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, 1475GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay,
1522 const struct GNUNET_DISK_FileHandle *rfd, 1476 const struct GNUNET_DISK_FileHandle *rfd,
1523 GNUNET_SCHEDULER_Task task, void *task_cls) 1477 GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
1524{ 1478{
1525 return GNUNET_SCHEDULER_add_file_with_priority ( 1479 return GNUNET_SCHEDULER_add_file_with_priority (
1526 delay, GNUNET_SCHEDULER_PRIORITY_DEFAULT, 1480 delay, GNUNET_SCHEDULER_PRIORITY_DEFAULT,
@@ -1544,10 +1498,10 @@ GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay,
1544 * @return unique task identifier for the job 1498 * @return unique task identifier for the job
1545 * only valid until @a task is started! 1499 * only valid until @a task is started!
1546 */ 1500 */
1547GNUNET_SCHEDULER_TaskIdentifier 1501struct GNUNET_SCHEDULER_Task *
1548GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, 1502GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay,
1549 const struct GNUNET_DISK_FileHandle *wfd, 1503 const struct GNUNET_DISK_FileHandle *wfd,
1550 GNUNET_SCHEDULER_Task task, void *task_cls) 1504 GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
1551{ 1505{
1552 return GNUNET_SCHEDULER_add_file_with_priority ( 1506 return GNUNET_SCHEDULER_add_file_with_priority (
1553 delay, GNUNET_SCHEDULER_PRIORITY_DEFAULT, 1507 delay, GNUNET_SCHEDULER_PRIORITY_DEFAULT,
@@ -1574,18 +1528,18 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay,
1574 * @return unique task identifier for the job 1528 * @return unique task identifier for the job
1575 * only valid until @a task is started! 1529 * only valid until @a task is started!
1576 */ 1530 */
1577GNUNET_SCHEDULER_TaskIdentifier 1531struct GNUNET_SCHEDULER_Task *
1578GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay, 1532GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay,
1579 enum GNUNET_SCHEDULER_Priority priority, 1533 enum GNUNET_SCHEDULER_Priority priority,
1580 const struct GNUNET_DISK_FileHandle *fd, 1534 const struct GNUNET_DISK_FileHandle *fd,
1581 int on_read, int on_write, 1535 int on_read, int on_write,
1582 GNUNET_SCHEDULER_Task task, void *task_cls) 1536 GNUNET_SCHEDULER_TaskCallback task, void *task_cls)
1583{ 1537{
1584#if MINGW 1538#if MINGW
1585 struct GNUNET_NETWORK_FDSet *s; 1539 struct GNUNET_NETWORK_FDSet *s;
1586 GNUNET_SCHEDULER_TaskIdentifier ret; 1540 struct GNUNET_SCHEDULER_Task * ret;
1587 1541
1588 GNUNET_assert (fd != NULL); 1542 GNUNET_assert (NULL != fd);
1589 s = GNUNET_NETWORK_fdset_create (); 1543 s = GNUNET_NETWORK_fdset_create ();
1590 GNUNET_NETWORK_fdset_handle_set (s, fd); 1544 GNUNET_NETWORK_fdset_handle_set (s, fd);
1591 ret = GNUNET_SCHEDULER_add_select ( 1545 ret = GNUNET_SCHEDULER_add_select (
@@ -1636,21 +1590,28 @@ GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay,
1636 * @return unique task identifier for the job 1590 * @return unique task identifier for the job
1637 * only valid until @a task is started! 1591 * only valid until @a task is started!
1638 */ 1592 */
1639GNUNET_SCHEDULER_TaskIdentifier 1593struct GNUNET_SCHEDULER_Task *
1640GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, 1594GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
1641 struct GNUNET_TIME_Relative delay, 1595 struct GNUNET_TIME_Relative delay,
1642 const struct GNUNET_NETWORK_FDSet *rs, 1596 const struct GNUNET_NETWORK_FDSet *rs,
1643 const struct GNUNET_NETWORK_FDSet *ws, 1597 const struct GNUNET_NETWORK_FDSet *ws,
1644 GNUNET_SCHEDULER_Task task, void *task_cls) 1598 GNUNET_SCHEDULER_TaskCallback task,
1599 void *task_cls)
1645{ 1600{
1646 struct Task *t; 1601 struct GNUNET_SCHEDULER_Task *t;
1647#if EXECINFO 1602#if EXECINFO
1648 void *backtrace_array[MAX_TRACE_DEPTH]; 1603 void *backtrace_array[MAX_TRACE_DEPTH];
1649#endif 1604#endif
1650 1605
1606 if ( (NULL == rs) &&
1607 (NULL == ws) )
1608 return GNUNET_SCHEDULER_add_delayed_with_priority (delay,
1609 prio,
1610 task,
1611 task_cls);
1651 GNUNET_assert (NULL != active_task); 1612 GNUNET_assert (NULL != active_task);
1652 GNUNET_assert (NULL != task); 1613 GNUNET_assert (NULL != task);
1653 t = GNUNET_new (struct Task); 1614 t = GNUNET_new (struct GNUNET_SCHEDULER_Task);
1654 t->callback = task; 1615 t->callback = task;
1655 t->callback_cls = task_cls; 1616 t->callback_cls = task_cls;
1656#if EXECINFO 1617#if EXECINFO
@@ -1670,7 +1631,6 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
1670 t->write_set = GNUNET_NETWORK_fdset_create (); 1631 t->write_set = GNUNET_NETWORK_fdset_create ();
1671 GNUNET_NETWORK_fdset_copy (t->write_set, ws); 1632 GNUNET_NETWORK_fdset_copy (t->write_set, ws);
1672 } 1633 }
1673 t->id = ++last_id;
1674#if PROFILE_DELAYS 1634#if PROFILE_DELAYS
1675 t->start_time = GNUNET_TIME_absolute_get (); 1635 t->start_time = GNUNET_TIME_absolute_get ();
1676#endif 1636#endif
@@ -1680,23 +1640,24 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
1680 GNUNET_SCHEDULER_PRIORITY_KEEP) ? current_priority : 1640 GNUNET_SCHEDULER_PRIORITY_KEEP) ? current_priority :
1681 prio); 1641 prio);
1682 t->lifeness = current_lifeness; 1642 t->lifeness = current_lifeness;
1683 t->next = pending; 1643 GNUNET_CONTAINER_DLL_insert (pending_head,
1684 pending = t; 1644 pending_tail,
1645 t);
1685 max_priority_added = GNUNET_MAX (max_priority_added, t->priority); 1646 max_priority_added = GNUNET_MAX (max_priority_added, t->priority);
1686 LOG (GNUNET_ERROR_TYPE_DEBUG, 1647 LOG (GNUNET_ERROR_TYPE_DEBUG,
1687 "Adding task: %llu / %p\n", 1648 "Adding task %p\n",
1688 t->id, 1649 t);
1689 t->callback_cls);
1690#if EXECINFO 1650#if EXECINFO
1691 int i; 1651 int i;
1692 1652
1693 for (i = 0; i < t->num_backtrace_strings; i++) 1653 for (i = 0; i < t->num_backtrace_strings; i++)
1694 LOG (GNUNET_ERROR_TYPE_DEBUG, 1654 LOG (GNUNET_ERROR_TYPE_DEBUG,
1695 "Task %llu trace %d: %s\n", 1655 "Task p trace %d: %s\n",
1696 t->id, i, 1656 t,
1657 i,
1697 t->backtrace_strings[i]); 1658 t->backtrace_strings[i]);
1698#endif 1659#endif
1699 return t->id; 1660 return t;
1700} 1661}
1701 1662
1702/* end of scheduler.c */ 1663/* end of scheduler.c */
diff --git a/src/util/server.c b/src/util/server.c
index b2b590dbd..52f00a08c 100644
--- a/src/util/server.c
+++ b/src/util/server.c
@@ -144,7 +144,7 @@ struct GNUNET_SERVER_Handle
144 /** 144 /**
145 * Task scheduled to do the listening. 145 * Task scheduled to do the listening.
146 */ 146 */
147 GNUNET_SCHEDULER_TaskIdentifier listen_task; 147 struct GNUNET_SCHEDULER_Task * listen_task;
148 148
149 /** 149 /**
150 * Alternative function to create a MST instance. 150 * Alternative function to create a MST instance.
@@ -246,12 +246,12 @@ struct GNUNET_SERVER_Client
246 /** 246 /**
247 * ID of task used to restart processing. 247 * ID of task used to restart processing.
248 */ 248 */
249 GNUNET_SCHEDULER_TaskIdentifier restart_task; 249 struct GNUNET_SCHEDULER_Task * restart_task;
250 250
251 /** 251 /**
252 * Task that warns about missing calls to #GNUNET_SERVER_receive_done. 252 * Task that warns about missing calls to #GNUNET_SERVER_receive_done.
253 */ 253 */
254 GNUNET_SCHEDULER_TaskIdentifier warn_task; 254 struct GNUNET_SCHEDULER_Task * warn_task;
255 255
256 /** 256 /**
257 * Time when the warn task was started. 257 * Time when the warn task was started.
@@ -400,7 +400,7 @@ process_listen_socket (void *cls,
400 struct GNUNET_SERVER_Client *client; 400 struct GNUNET_SERVER_Client *client;
401 unsigned int i; 401 unsigned int i;
402 402
403 server->listen_task = GNUNET_SCHEDULER_NO_TASK; 403 server->listen_task = NULL;
404 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 404 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
405 { 405 {
406 /* ignore shutdown, someone else will take care of it! */ 406 /* ignore shutdown, someone else will take care of it! */
@@ -691,10 +691,10 @@ test_monitor_clients (struct GNUNET_SERVER_Handle *server)
691void 691void
692GNUNET_SERVER_suspend (struct GNUNET_SERVER_Handle *server) 692GNUNET_SERVER_suspend (struct GNUNET_SERVER_Handle *server)
693{ 693{
694 if (GNUNET_SCHEDULER_NO_TASK != server->listen_task) 694 if (NULL != server->listen_task)
695 { 695 {
696 GNUNET_SCHEDULER_cancel (server->listen_task); 696 GNUNET_SCHEDULER_cancel (server->listen_task);
697 server->listen_task = GNUNET_SCHEDULER_NO_TASK; 697 server->listen_task = NULL;
698 } 698 }
699} 699}
700 700
@@ -750,10 +750,10 @@ GNUNET_SERVER_stop_listening (struct GNUNET_SERVER_Handle *server)
750 750
751 LOG (GNUNET_ERROR_TYPE_DEBUG, 751 LOG (GNUNET_ERROR_TYPE_DEBUG,
752 "Server in soft shutdown\n"); 752 "Server in soft shutdown\n");
753 if (GNUNET_SCHEDULER_NO_TASK != server->listen_task) 753 if (NULL != server->listen_task)
754 { 754 {
755 GNUNET_SCHEDULER_cancel (server->listen_task); 755 GNUNET_SCHEDULER_cancel (server->listen_task);
756 server->listen_task = GNUNET_SCHEDULER_NO_TASK; 756 server->listen_task = NULL;
757 } 757 }
758 if (NULL != server->listen_sockets) 758 if (NULL != server->listen_sockets)
759 { 759 {
@@ -784,10 +784,10 @@ GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *server)
784 784
785 LOG (GNUNET_ERROR_TYPE_DEBUG, 785 LOG (GNUNET_ERROR_TYPE_DEBUG,
786 "Server shutting down.\n"); 786 "Server shutting down.\n");
787 if (GNUNET_SCHEDULER_NO_TASK != server->listen_task) 787 if (NULL != server->listen_task)
788 { 788 {
789 GNUNET_SCHEDULER_cancel (server->listen_task); 789 GNUNET_SCHEDULER_cancel (server->listen_task);
790 server->listen_task = GNUNET_SCHEDULER_NO_TASK; 790 server->listen_task = NULL;
791 } 791 }
792 if (NULL != server->listen_sockets) 792 if (NULL != server->listen_sockets)
793 { 793 {
@@ -909,10 +909,10 @@ warn_no_receive_done (void *cls,
909void 909void
910GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client *client) 910GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client *client)
911{ 911{
912 if (GNUNET_SCHEDULER_NO_TASK != client->warn_task) 912 if (NULL != client->warn_task)
913 { 913 {
914 GNUNET_SCHEDULER_cancel (client->warn_task); 914 GNUNET_SCHEDULER_cancel (client->warn_task);
915 client->warn_task = GNUNET_SCHEDULER_NO_TASK; 915 client->warn_task = NULL;
916 } 916 }
917} 917}
918 918
@@ -975,7 +975,7 @@ GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server,
975 if (NULL != sender) 975 if (NULL != sender)
976 { 976 {
977 if ( (0 == sender->suspended) && 977 if ( (0 == sender->suspended) &&
978 (GNUNET_SCHEDULER_NO_TASK == sender->warn_task) ) 978 (NULL == sender->warn_task) )
979 { 979 {
980 GNUNET_break (0 != type); /* type should never be 0 here, as we don't use 0 */ 980 GNUNET_break (0 != type); /* type should never be 0 here, as we don't use 0 */
981 sender->warn_start = GNUNET_TIME_absolute_get (); 981 sender->warn_start = GNUNET_TIME_absolute_get ();
@@ -1169,7 +1169,7 @@ restart_processing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1169 struct GNUNET_SERVER_Client *client = cls; 1169 struct GNUNET_SERVER_Client *client = cls;
1170 1170
1171 GNUNET_assert (GNUNET_YES != client->shutdown_now); 1171 GNUNET_assert (GNUNET_YES != client->shutdown_now);
1172 client->restart_task = GNUNET_SCHEDULER_NO_TASK; 1172 client->restart_task = NULL;
1173 if (GNUNET_NO == client->receive_pending) 1173 if (GNUNET_NO == client->receive_pending)
1174 { 1174 {
1175 LOG (GNUNET_ERROR_TYPE_DEBUG, "Server begins to read again from client.\n"); 1175 LOG (GNUNET_ERROR_TYPE_DEBUG, "Server begins to read again from client.\n");
@@ -1479,15 +1479,15 @@ GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client)
1479 1479
1480 LOG (GNUNET_ERROR_TYPE_DEBUG, 1480 LOG (GNUNET_ERROR_TYPE_DEBUG,
1481 "Client is being disconnected from the server.\n"); 1481 "Client is being disconnected from the server.\n");
1482 if (GNUNET_SCHEDULER_NO_TASK != client->restart_task) 1482 if (NULL != client->restart_task)
1483 { 1483 {
1484 GNUNET_SCHEDULER_cancel (client->restart_task); 1484 GNUNET_SCHEDULER_cancel (client->restart_task);
1485 client->restart_task = GNUNET_SCHEDULER_NO_TASK; 1485 client->restart_task = NULL;
1486 } 1486 }
1487 if (GNUNET_SCHEDULER_NO_TASK != client->warn_task) 1487 if (NULL != client->warn_task)
1488 { 1488 {
1489 GNUNET_SCHEDULER_cancel (client->warn_task); 1489 GNUNET_SCHEDULER_cancel (client->warn_task);
1490 client->warn_task = GNUNET_SCHEDULER_NO_TASK; 1490 client->warn_task = NULL;
1491 } 1491 }
1492 if (GNUNET_YES == client->receive_pending) 1492 if (GNUNET_YES == client->receive_pending)
1493 { 1493 {
@@ -1532,10 +1532,10 @@ GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client)
1532 client->connection); 1532 client->connection);
1533 /* need to cancel again, as it might have been re-added 1533 /* need to cancel again, as it might have been re-added
1534 in the meantime (i.e. during callbacks) */ 1534 in the meantime (i.e. during callbacks) */
1535 if (GNUNET_SCHEDULER_NO_TASK != client->warn_task) 1535 if (NULL != client->warn_task)
1536 { 1536 {
1537 GNUNET_SCHEDULER_cancel (client->warn_task); 1537 GNUNET_SCHEDULER_cancel (client->warn_task);
1538 client->warn_task = GNUNET_SCHEDULER_NO_TASK; 1538 client->warn_task = NULL;
1539 } 1539 }
1540 if (GNUNET_YES == client->receive_pending) 1540 if (GNUNET_YES == client->receive_pending)
1541 { 1541 {
@@ -1684,10 +1684,10 @@ GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client,
1684 "GNUNET_SERVER_receive_done called, but more clients pending\n"); 1684 "GNUNET_SERVER_receive_done called, but more clients pending\n");
1685 return; 1685 return;
1686 } 1686 }
1687 if (GNUNET_SCHEDULER_NO_TASK != client->warn_task) 1687 if (NULL != client->warn_task)
1688 { 1688 {
1689 GNUNET_SCHEDULER_cancel (client->warn_task); 1689 GNUNET_SCHEDULER_cancel (client->warn_task);
1690 client->warn_task = GNUNET_SCHEDULER_NO_TASK; 1690 client->warn_task = NULL;
1691 } 1691 }
1692 if (GNUNET_YES == client->in_process_client_buffer) 1692 if (GNUNET_YES == client->in_process_client_buffer)
1693 { 1693 {
@@ -1702,7 +1702,7 @@ GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client,
1702 } 1702 }
1703 LOG (GNUNET_ERROR_TYPE_DEBUG, 1703 LOG (GNUNET_ERROR_TYPE_DEBUG,
1704 "GNUNET_SERVER_receive_done causes restart in reading from the socket\n"); 1704 "GNUNET_SERVER_receive_done causes restart in reading from the socket\n");
1705 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == client->restart_task); 1705 GNUNET_assert (NULL == client->restart_task);
1706 client->restart_task = GNUNET_SCHEDULER_add_now (&restart_processing, client); 1706 client->restart_task = GNUNET_SCHEDULER_add_now (&restart_processing, client);
1707} 1707}
1708 1708
diff --git a/src/util/service.c b/src/util/service.c
index 5be6bc33f..d49ad4f2a 100644
--- a/src/util/service.c
+++ b/src/util/service.c
@@ -187,7 +187,7 @@ struct GNUNET_SERVICE_Context
187 /** 187 /**
188 * Task ID of the shutdown task. 188 * Task ID of the shutdown task.
189 */ 189 */
190 GNUNET_SCHEDULER_TaskIdentifier shutdown_task; 190 struct GNUNET_SCHEDULER_Task * shutdown_task;
191 191
192 /** 192 /**
193 * Idle timeout for server. 193 * Idle timeout for server.
@@ -1134,7 +1134,7 @@ shutdown_task (void *cls,
1134 struct GNUNET_SERVICE_Context *service = cls; 1134 struct GNUNET_SERVICE_Context *service = cls;
1135 struct GNUNET_SERVER_Handle *server = service->server; 1135 struct GNUNET_SERVER_Handle *server = service->server;
1136 1136
1137 service->shutdown_task = GNUNET_SCHEDULER_NO_TASK; 1137 service->shutdown_task = NULL;
1138 if (0 != (service->options & GNUNET_SERVICE_OPTION_SOFT_SHUTDOWN)) 1138 if (0 != (service->options & GNUNET_SERVICE_OPTION_SOFT_SHUTDOWN))
1139 GNUNET_SERVER_stop_listening (server); 1139 GNUNET_SERVER_stop_listening (server);
1140 else 1140 else
@@ -1675,10 +1675,10 @@ GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx)
1675 } 1675 }
1676 } 1676 }
1677#endif 1677#endif
1678 if (GNUNET_SCHEDULER_NO_TASK != sctx->shutdown_task) 1678 if (NULL != sctx->shutdown_task)
1679 { 1679 {
1680 GNUNET_SCHEDULER_cancel (sctx->shutdown_task); 1680 GNUNET_SCHEDULER_cancel (sctx->shutdown_task);
1681 sctx->shutdown_task = GNUNET_SCHEDULER_NO_TASK; 1681 sctx->shutdown_task = NULL;
1682 } 1682 }
1683 if (NULL != sctx->server) 1683 if (NULL != sctx->server)
1684 GNUNET_SERVER_destroy (sctx->server); 1684 GNUNET_SERVER_destroy (sctx->server);
diff --git a/src/util/speedup.c b/src/util/speedup.c
index d71e7c158..544958be9 100644
--- a/src/util/speedup.c
+++ b/src/util/speedup.c
@@ -34,7 +34,7 @@ static struct GNUNET_TIME_Relative interval;
34 34
35static struct GNUNET_TIME_Relative delta; 35static struct GNUNET_TIME_Relative delta;
36 36
37static GNUNET_SCHEDULER_TaskIdentifier speedup_task; 37static struct GNUNET_SCHEDULER_Task * speedup_task;
38 38
39 39
40static void 40static void
@@ -43,7 +43,7 @@ do_speedup (void *cls,
43{ 43{
44 static long long current_offset; 44 static long long current_offset;
45 45
46 speedup_task = GNUNET_SCHEDULER_NO_TASK; 46 speedup_task = NULL;
47 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 47 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
48 return; 48 return;
49 current_offset += delta.rel_value_us; 49 current_offset += delta.rel_value_us;
@@ -97,10 +97,10 @@ GNUNET_SPEEDUP_start_ (const struct GNUNET_CONFIGURATION_Handle *cfg)
97void 97void
98GNUNET_SPEEDUP_stop_ () 98GNUNET_SPEEDUP_stop_ ()
99{ 99{
100 if (GNUNET_SCHEDULER_NO_TASK != speedup_task) 100 if (NULL != speedup_task)
101 { 101 {
102 GNUNET_SCHEDULER_cancel (speedup_task); 102 GNUNET_SCHEDULER_cancel (speedup_task);
103 speedup_task = GNUNET_SCHEDULER_NO_TASK; 103 speedup_task = NULL;
104 } 104 }
105 if ( (0 != interval.rel_value_us) && 105 if ( (0 != interval.rel_value_us) &&
106 (0 != delta.rel_value_us) ) 106 (0 != delta.rel_value_us) )
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c
index 0fe8614d0..42371f33f 100644
--- a/src/util/test_common_logging_runtime_loglevels.c
+++ b/src/util/test_common_logging_runtime_loglevels.c
@@ -49,9 +49,9 @@ static struct GNUNET_OS_Process *proc;
49/* Pipe to read from started processes stdout (on read end) */ 49/* Pipe to read from started processes stdout (on read end) */
50static struct GNUNET_DISK_PipeHandle *pipe_stdout; 50static struct GNUNET_DISK_PipeHandle *pipe_stdout;
51 51
52static GNUNET_SCHEDULER_TaskIdentifier die_task; 52static struct GNUNET_SCHEDULER_Task * die_task;
53 53
54static GNUNET_SCHEDULER_TaskIdentifier read_task; 54static struct GNUNET_SCHEDULER_Task * read_task;
55 55
56static void 56static void
57runone (void); 57runone (void);
@@ -72,10 +72,10 @@ end_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
72 GNUNET_OS_process_destroy (proc); 72 GNUNET_OS_process_destroy (proc);
73 proc = NULL; 73 proc = NULL;
74 } 74 }
75 if (GNUNET_SCHEDULER_NO_TASK != read_task) 75 if (NULL != read_task)
76 { 76 {
77 GNUNET_SCHEDULER_cancel (read_task); 77 GNUNET_SCHEDULER_cancel (read_task);
78 read_task = GNUNET_SCHEDULER_NO_TASK; 78 read_task = NULL;
79 } 79 }
80 GNUNET_DISK_pipe_close (pipe_stdout); 80 GNUNET_DISK_pipe_close (pipe_stdout);
81 if (ok == 1) 81 if (ok == 1)
@@ -223,7 +223,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
223 long delays[8]; 223 long delays[8];
224 int rd; 224 int rd;
225 225
226 read_task = GNUNET_SCHEDULER_NO_TASK; 226 read_task = NULL;
227 rd = GNUNET_DISK_file_read (stdout_read_handle, buf_ptr, 227 rd = GNUNET_DISK_file_read (stdout_read_handle, buf_ptr,
228 sizeof (buf) - bytes); 228 sizeof (buf) - bytes);
229 if (rd > 0) 229 if (rd > 0)
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c
index e76ec5bcf..e350c7ea7 100644
--- a/src/util/test_os_start_process.c
+++ b/src/util/test_os_start_process.c
@@ -46,7 +46,7 @@ static struct GNUNET_DISK_PipeHandle *hello_pipe_stdin;
46 */ 46 */
47static struct GNUNET_DISK_PipeHandle *hello_pipe_stdout; 47static struct GNUNET_DISK_PipeHandle *hello_pipe_stdout;
48 48
49static GNUNET_SCHEDULER_TaskIdentifier die_task; 49static struct GNUNET_SCHEDULER_Task * die_task;
50 50
51struct read_context 51struct read_context
52{ 52{
diff --git a/src/vpn/vpn_api.c b/src/vpn/vpn_api.c
index 95ef8c46d..b0d2bccf0 100644
--- a/src/vpn/vpn_api.c
+++ b/src/vpn/vpn_api.c
@@ -61,7 +61,7 @@ struct GNUNET_VPN_Handle
61 /** 61 /**
62 * Identifier of a reconnect task. 62 * Identifier of a reconnect task.
63 */ 63 */
64 GNUNET_SCHEDULER_TaskIdentifier rt; 64 struct GNUNET_SCHEDULER_Task * rt;
65 65
66 /** 66 /**
67 * How long do we wait until we try to reconnect? 67 * How long do we wait until we try to reconnect?
@@ -367,7 +367,7 @@ connect_task (void *cls,
367{ 367{
368 struct GNUNET_VPN_Handle *vh = cls; 368 struct GNUNET_VPN_Handle *vh = cls;
369 369
370 vh->rt = GNUNET_SCHEDULER_NO_TASK; 370 vh->rt = NULL;
371 vh->client = GNUNET_CLIENT_connect ("vpn", vh->cfg); 371 vh->client = GNUNET_CLIENT_connect ("vpn", vh->cfg);
372 GNUNET_assert (NULL != vh->client); 372 GNUNET_assert (NULL != vh->client);
373 GNUNET_assert (NULL == vh->th); 373 GNUNET_assert (NULL == vh->th);
@@ -578,10 +578,10 @@ GNUNET_VPN_disconnect (struct GNUNET_VPN_Handle *vh)
578 GNUNET_CLIENT_disconnect (vh->client); 578 GNUNET_CLIENT_disconnect (vh->client);
579 vh->client = NULL; 579 vh->client = NULL;
580 } 580 }
581 if (GNUNET_SCHEDULER_NO_TASK != vh->rt) 581 if (NULL != vh->rt)
582 { 582 {
583 GNUNET_SCHEDULER_cancel (vh->rt); 583 GNUNET_SCHEDULER_cancel (vh->rt);
584 vh->rt = GNUNET_SCHEDULER_NO_TASK; 584 vh->rt = NULL;
585 } 585 }
586 GNUNET_free (vh); 586 GNUNET_free (vh);
587} 587}