summaryrefslogtreecommitdiff
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;
static struct GNUNET_DHT_Handle *dht_handle;
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_tid;
+static struct GNUNET_SCHEDULER_Task * shutdown_tid;
/**
@@ -39,7 +39,7 @@ static int result;
static void
shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- shutdown_tid = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_tid = NULL;
if (NULL != dht_op)
{
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
/**
* ID of the reconnect task (if any).
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Current delay we use for re-trying to connect to core.
@@ -166,7 +166,7 @@ struct ARMControlMessage
/**
* Task to run when request times out.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task_id;
+ struct GNUNET_SCHEDULER_Task * timeout_task_id;
/**
* 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)
{
struct GNUNET_ARM_Handle *h = cls;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to ARM service after delay\n");
reconnect_arm (h);
}
@@ -240,7 +240,7 @@ reconnect_arm_later (struct GNUNET_ARM_Handle *h)
h->client = NULL;
}
h->currently_down = GNUNET_YES;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task);
+ GNUNET_assert (NULL == h->reconnect_task);
h->reconnect_task =
GNUNET_SCHEDULER_add_delayed (h->retry_backoff, &reconnect_arm_task, h);
/* Don't clear pending messages on disconnection, deliver them later
@@ -408,7 +408,7 @@ client_notify_handler (void *cls,
fail = GNUNET_YES;
break;
}
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != cm->timeout_task_id);
+ GNUNET_assert (NULL != cm->timeout_task_id);
GNUNET_SCHEDULER_cancel (cm->timeout_task_id);
GNUNET_CONTAINER_DLL_remove (h->control_sent_head,
h->control_sent_tail, cm);
@@ -493,7 +493,7 @@ transmit_arm_message (void *cls, size_t size, void *buf)
LOG (GNUNET_ERROR_TYPE_DEBUG,
"transmit_arm_message is running with %p buffer of size %lu. ARM is known to be %s\n",
buf, size, h->currently_down ? "unconnected" : "connected");
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task);
+ GNUNET_assert (NULL == h->reconnect_task);
h->cth = NULL;
if ((GNUNET_YES == h->currently_down) && (NULL != buf))
{
@@ -643,7 +643,7 @@ GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
h = GNUNET_new (struct GNUNET_ARM_Handle);
h->cfg = GNUNET_CONFIGURATION_dup (cfg);
h->currently_down = GNUNET_YES;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
h->conn_status = conn_status;
h->conn_status_cls = cls;
if (GNUNET_OK != reconnect_arm (h))
@@ -680,7 +680,7 @@ GNUNET_ARM_disconnect_and_free (struct GNUNET_ARM_Handle *h)
else
GNUNET_CONTAINER_DLL_remove (h->control_sent_head,
h->control_sent_tail, cm);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != cm->timeout_task_id);
+ GNUNET_assert (NULL != cm->timeout_task_id);
GNUNET_SCHEDULER_cancel (cm->timeout_task_id);
if (NULL != cm->result_cont)
cm->result_cont (cm->cont_cls, GNUNET_ARM_REQUEST_DISCONNECTED,
@@ -694,10 +694,10 @@ GNUNET_ARM_disconnect_and_free (struct GNUNET_ARM_Handle *h)
GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task)
+ if (NULL != h->reconnect_task)
{
GNUNET_SCHEDULER_cancel (h->reconnect_task);
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
}
if (GNUNET_NO == h->service_test_is_active)
{
@@ -984,10 +984,10 @@ GNUNET_ARM_request_service_start (struct GNUNET_ARM_Handle *h,
GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task)
+ if (NULL != h->reconnect_task)
{
GNUNET_SCHEDULER_cancel (h->reconnect_task);
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
}
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
/**
* ID of the reconnect task (if any).
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Current delay we use for re-trying to connect to core.
@@ -82,7 +82,7 @@ struct GNUNET_ARM_MonitorHandle
/**
* ID of a task to run if we fail to get a reply to the init message in time.
*/
- GNUNET_SCHEDULER_TaskIdentifier init_timeout_task_id;
+ struct GNUNET_SCHEDULER_Task * init_timeout_task_id;
};
static void
@@ -102,7 +102,7 @@ reconnect_arm_monitor_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext
{
struct GNUNET_ARM_MonitorHandle *h = cls;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG, "Connecting to ARM service for monitoring after delay\n");
reconnect_arm_monitor (h);
}
@@ -129,13 +129,13 @@ reconnect_arm_monitor_later (struct GNUNET_ARM_MonitorHandle *h)
h->monitor = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->init_timeout_task_id)
+ if (NULL != h->init_timeout_task_id)
{
GNUNET_SCHEDULER_cancel (h->init_timeout_task_id);
- h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK;
+ h->init_timeout_task_id = NULL;
}
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task);
+ GNUNET_assert (NULL == h->reconnect_task);
h->reconnect_task =
GNUNET_SCHEDULER_add_delayed (h->retry_backoff, &reconnect_arm_monitor_task, h);
@@ -156,7 +156,7 @@ init_timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Init message timed out\n");
- h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK;
+ h->init_timeout_task_id = NULL;
reconnect_arm_monitor_later (h);
}
@@ -176,8 +176,8 @@ transmit_monitoring_init_message (void *cls, size_t size, void *buf)
struct GNUNET_MessageHeader *msg;
uint16_t msize;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->init_timeout_task_id);
+ GNUNET_assert (NULL == h->reconnect_task);
+ GNUNET_assert (NULL == h->init_timeout_task_id);
h->cth = NULL;
if (NULL == buf)
{
@@ -254,8 +254,8 @@ GNUNET_ARM_monitor (const struct GNUNET_CONFIGURATION_Handle *cfg,
h = GNUNET_new (struct GNUNET_ARM_MonitorHandle);
h->cfg = GNUNET_CONFIGURATION_dup (cfg);
h->currently_down = GNUNET_YES;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
- h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
+ h->init_timeout_task_id = NULL;
h->service_status = cont;
h->cls = cont_cls;
if (GNUNET_OK != reconnect_arm_monitor (h))
@@ -281,20 +281,20 @@ GNUNET_ARM_monitor_disconnect_and_free (struct GNUNET_ARM_MonitorHandle *h)
GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth);
h->cth = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->init_timeout_task_id)
+ if (NULL != h->init_timeout_task_id)
{
GNUNET_SCHEDULER_cancel (h->init_timeout_task_id);
- h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK;
+ h->init_timeout_task_id = NULL;
}
if (NULL != h->monitor)
{
GNUNET_CLIENT_disconnect (h->monitor);
h->monitor = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task)
+ if (NULL != h->reconnect_task)
{
GNUNET_SCHEDULER_cancel (h->reconnect_task);
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
}
GNUNET_CONFIGURATION_destroy (h->cfg);
GNUNET_free (h);
@@ -335,10 +335,10 @@ monitor_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
reconnect_arm_monitor_later (h);
return;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->init_timeout_task_id)
+ if (NULL != h->init_timeout_task_id)
{
GNUNET_SCHEDULER_cancel (h->init_timeout_task_id);
- h->init_timeout_task_id = GNUNET_SCHEDULER_NO_TASK;
+ h->init_timeout_task_id = NULL;
}
res = (const struct GNUNET_ARM_StatusMessage *) msg;
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
/**
* Task doing the accepting.
*/
- GNUNET_SCHEDULER_TaskIdentifier accept_task;
+ struct GNUNET_SCHEDULER_Task * accept_task;
};
@@ -200,13 +200,13 @@ static char *final_option;
/**
* ID of task called whenever we get a SIGCHILD.
*/
-static GNUNET_SCHEDULER_TaskIdentifier child_death_task;
+static struct GNUNET_SCHEDULER_Task * child_death_task;
/**
* ID of task called whenever the timeout for restarting a child
* expires.
*/
-static GNUNET_SCHEDULER_TaskIdentifier child_restart_task;
+static struct GNUNET_SCHEDULER_Task * child_restart_task;
/**
* Pipe used to communicate shutdown via signal.
@@ -421,10 +421,10 @@ start_process (struct ServiceList *sl,
{
GNUNET_array_append (lsocks, ls,
GNUNET_NETWORK_get_fd (sli->listen_socket));
- if (sli->accept_task != GNUNET_SCHEDULER_NO_TASK)
+ if (sli->accept_task != NULL)
{
GNUNET_SCHEDULER_cancel (sli->accept_task);
- sli->accept_task = GNUNET_SCHEDULER_NO_TASK;
+ sli->accept_task = NULL;
}
}
#if WINDOWS
@@ -586,7 +586,7 @@ accept_connection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct ServiceListeningInfo *sli = cls;
struct ServiceList *sl = sli->sl;
- sli->accept_task = GNUNET_SCHEDULER_NO_TASK;
+ sli->accept_task = NULL;
GNUNET_assert (GNUNET_NO == in_shutdown);
if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
return;
@@ -971,10 +971,10 @@ do_shutdown ()
GNUNET_SERVER_destroy (server);
server = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != child_death_task)
+ if (NULL != child_death_task)
{
GNUNET_SCHEDULER_cancel (child_death_task);
- child_death_task = GNUNET_SCHEDULER_NO_TASK;
+ child_death_task = NULL;
}
}
@@ -1015,10 +1015,10 @@ shutdown_task (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"First shutdown phase\n");
- if (GNUNET_SCHEDULER_NO_TASK != child_restart_task)
+ if (NULL != child_restart_task)
{
GNUNET_SCHEDULER_cancel (child_restart_task);
- child_restart_task = GNUNET_SCHEDULER_NO_TASK;
+ child_restart_task = NULL;
}
in_shutdown = GNUNET_YES;
/* first, stop listening */
@@ -1028,10 +1028,10 @@ shutdown_task (void *cls,
{
GNUNET_CONTAINER_DLL_remove (pos->listen_head,
pos->listen_tail, sli);
- if (sli->accept_task != GNUNET_SCHEDULER_NO_TASK)
+ if (sli->accept_task != NULL)
{
GNUNET_SCHEDULER_cancel (sli->accept_task);
- sli->accept_task = GNUNET_SCHEDULER_NO_TASK;
+ sli->accept_task = NULL;
}
GNUNET_break (GNUNET_OK ==
GNUNET_NETWORK_socket_close (sli->listen_socket));
@@ -1082,7 +1082,7 @@ delayed_restart_task (void *cls,
struct GNUNET_TIME_Relative lowestRestartDelay;
struct ServiceListeningInfo *sli;
- child_restart_task = GNUNET_SCHEDULER_NO_TASK;
+ child_restart_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
GNUNET_assert (GNUNET_NO == in_shutdown);
@@ -1110,7 +1110,7 @@ delayed_restart_task (void *cls,
{
/* process is run on-demand, ensure it is re-started if there is demand */
for (sli = sl->listen_head; NULL != sli; sli = sli->next)
- if (GNUNET_SCHEDULER_NO_TASK == sli->accept_task)
+ if (NULL == sli->accept_task)
{
/* accept was actually paused, so start it again */
sli->accept_task =
@@ -1164,7 +1164,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
const struct GNUNET_DISK_FileHandle *pr;
pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
- child_death_task = GNUNET_SCHEDULER_NO_TASK;
+ child_death_task = NULL;
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
{
/* shutdown scheduled us, ignore! */
@@ -1239,7 +1239,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
/* process can still be re-started on-demand, ensure it is re-started if there is demand */
for (sli = pos->listen_head; NULL != sli; sli = sli->next)
{
- GNUNET_break (GNUNET_SCHEDULER_NO_TASK == sli->accept_task);
+ GNUNET_break (NULL == sli->accept_task);
sli->accept_task =
GNUNET_SCHEDULER_add_read_net (GNUNET_TIME_UNIT_FOREVER_REL,
sli->listen_socket, &accept_connection, sli);
@@ -1255,7 +1255,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
/* schedule restart */
pos->restart_at = GNUNET_TIME_relative_to_absolute (pos->backoff);
pos->backoff = GNUNET_TIME_STD_BACKOFF (pos->backoff);
- if (GNUNET_SCHEDULER_NO_TASK != child_restart_task)
+ if (NULL != child_restart_task)
GNUNET_SCHEDULER_cancel (child_restart_task);
child_restart_task = GNUNET_SCHEDULER_add_with_priority (
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
/**
* Task set up to cancel the shutdown request on timeout.
*/
- GNUNET_SCHEDULER_TaskIdentifier cancel_task;
+ struct GNUNET_SCHEDULER_Task * cancel_task;
/**
* 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
timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
{
struct Experiment *e = cls;
- e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->experiment_timeout_task = NULL;
fprintf (stderr, "Experiment timeout!\n");
- if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task)
+ if (NULL != e->episode_timeout_task)
{
GNUNET_SCHEDULER_cancel (e->episode_timeout_task);
- e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->episode_timeout_task = NULL;
}
e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time),
@@ -578,7 +578,7 @@ static void
timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
{
struct Experiment *e = cls;
- e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->episode_timeout_task = NULL;
if (NULL != e->ep_done_cb)
e->ep_done_cb (e->cur);
@@ -588,10 +588,10 @@ timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
{
/* done */
fprintf (stderr, "Last episode done!\n");
- if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task)
+ if (NULL != e->experiment_timeout_task)
{
GNUNET_SCHEDULER_cancel (e->experiment_timeout_task);
- e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->experiment_timeout_task = NULL;
}
e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), GNUNET_OK);
return;
@@ -728,15 +728,15 @@ GNUNET_ATS_TEST_experimentation_load (char *filename)
void
GNUNET_ATS_TEST_experimentation_stop (struct Experiment *e)
{
- if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task)
+ if (NULL != e->experiment_timeout_task)
{
GNUNET_SCHEDULER_cancel (e->experiment_timeout_task);
- e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->experiment_timeout_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task)
+ if (NULL != e->episode_timeout_task)
{
GNUNET_SCHEDULER_cancel (e->episode_timeout_task);
- e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->episode_timeout_task = NULL;
}
free_experiment (e);
}
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
/**
* Logging task
*/
- GNUNET_SCHEDULER_TaskIdentifier log_task;
+ struct GNUNET_SCHEDULER_Task * log_task;
/**
* Reference to perf_ats' masters
@@ -815,7 +815,7 @@ static void
collect_log_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct LoggingHandle *l = cls;
- l->log_task = GNUNET_SCHEDULER_NO_TASK;
+ l->log_task = NULL;
GNUNET_ATS_TEST_logging_now (l);
@@ -837,9 +837,9 @@ GNUNET_ATS_TEST_logging_stop (struct LoggingHandle *l)
if (GNUNET_YES!= l->running)
return;
- if (GNUNET_SCHEDULER_NO_TASK != l->log_task)
+ if (NULL != l->log_task)
GNUNET_SCHEDULER_cancel (l->log_task);
- l->log_task = GNUNET_SCHEDULER_NO_TASK;
+ l->log_task = NULL;
l->running = GNUNET_NO;
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,
{
struct BenchmarkPartner *p = cls;
double pref_value;
- p->pg->set_task = GNUNET_SCHEDULER_NO_TASK;
+ p->pg->set_task = NULL;
pref_value = get_preference (p->pg);
@@ -214,10 +214,10 @@ GNUNET_ATS_TEST_generate_preferences_stop (struct PreferenceGenerator *pg)
GNUNET_CONTAINER_DLL_remove (pg_head, pg_tail, pg);
pg->dest->pg = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != pg->set_task)
+ if (NULL != pg->set_task)
{
GNUNET_SCHEDULER_cancel (pg->set_task);
- pg->set_task = GNUNET_SCHEDULER_NO_TASK;
+ pg->set_task = NULL;
}
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,
{
struct BenchmarkPartner *p = cls;
- p->tg->send_task = GNUNET_SCHEDULER_NO_TASK;
+ p->tg->send_task = NULL;
p->last_message_sent = GNUNET_TIME_absolute_get();
if (GNUNET_YES == top->test_core)
{
@@ -389,10 +389,10 @@ GNUNET_ATS_TEST_generate_traffic_stop (struct TrafficGenerator *tg)
GNUNET_CONTAINER_DLL_remove (tg_head, tg_tail, tg);
tg->dest->tg = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != tg->send_task)
+ if (NULL != tg->send_task)
{
GNUNET_SCHEDULER_cancel (tg->send_task);
- tg->send_task = GNUNET_SCHEDULER_NO_TASK;
+ tg->send_task = NULL;
}
if (top->test_core)
{
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)
int c_op;
struct BenchmarkPeer *p;
- top->shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ top->shutdown_task = NULL;
top->state.benchmarking = GNUNET_NO;
GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Benchmarking done\n"));
@@ -82,9 +82,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
p->peer_id_op = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != p->ats_task)
+ if (NULL != p->ats_task)
GNUNET_SCHEDULER_cancel (p->ats_task);
- p->ats_task = GNUNET_SCHEDULER_NO_TASK;
+ p->ats_task = NULL;
for (c_op = 0; c_op < p->num_partners; c_op++)
{
@@ -419,7 +419,7 @@ connect_completion_callback (void *cls, struct GNUNET_TESTBED_Operation *op,
_("Failed to connect master peer [%u] with slave [%u]\n"),
cop->master->no, cop->slave->no);
GNUNET_break(0);
- if (GNUNET_SCHEDULER_NO_TASK != top->shutdown_task)
+ if (NULL != top->shutdown_task)
GNUNET_SCHEDULER_cancel (top->shutdown_task);
top->shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL );
}
@@ -470,7 +470,7 @@ do_connect_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
_("Could not connect master [%u] and slave [%u]\n"), p->no,
top->sps[c_s].no);
GNUNET_break(0);
- if (GNUNET_SCHEDULER_NO_TASK != top->shutdown_task)
+ if (NULL != top->shutdown_task)
GNUNET_SCHEDULER_cancel (top->shutdown_task);
top->shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL );
return;
@@ -489,7 +489,7 @@ comm_connect_completion_cb (void *cls, struct GNUNET_TESTBED_Operation *op,
{
GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Initialization failed, shutdown\n"));
GNUNET_break(0);
- if (GNUNET_SCHEDULER_NO_TASK != top->shutdown_task)
+ if (NULL != top->shutdown_task)
GNUNET_SCHEDULER_cancel (top->shutdown_task);
top->shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL );
return;
@@ -676,7 +676,7 @@ ats_connect_completion_cb (void *cls, struct GNUNET_TESTBED_Operation *op,
{
GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Initialization failed, shutdown\n"));
GNUNET_break(0);
- if (GNUNET_SCHEDULER_NO_TASK != top->shutdown_task)
+ if (NULL != top->shutdown_task)
GNUNET_SCHEDULER_cancel (top->shutdown_task);
top->shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL );
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
* Masters only
* Progress task
*/
- GNUNET_SCHEDULER_TaskIdentifier ats_task;
+ struct GNUNET_SCHEDULER_Task * ats_task;
/**
* Masters only
@@ -232,7 +232,7 @@ struct TrafficGenerator
long int max_rate;
struct GNUNET_TIME_Relative duration_period;
- GNUNET_SCHEDULER_TaskIdentifier send_task;
+ struct GNUNET_SCHEDULER_Task * send_task;
struct GNUNET_TIME_Absolute next_ping_transmission;
struct GNUNET_TIME_Absolute time_start;
};
@@ -255,7 +255,7 @@ struct PreferenceGenerator
struct GNUNET_TIME_Relative duration_period;
struct GNUNET_TIME_Relative frequency;
- GNUNET_SCHEDULER_TaskIdentifier set_task;
+ struct GNUNET_SCHEDULER_Task * set_task;
struct GNUNET_TIME_Absolute next_ping_transmission;
struct GNUNET_TIME_Absolute time_start;
};
@@ -381,12 +381,12 @@ struct GNUNET_ATS_TEST_Topology
/**
* Shutdown task
*/
- GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+ struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* Progress task
*/
- GNUNET_SCHEDULER_TaskIdentifier progress_task;
+ struct GNUNET_SCHEDULER_Task * progress_task;
/**
* Test result
@@ -524,8 +524,8 @@ struct Experiment
unsigned int num_episodes;
struct Episode *start;
- GNUNET_SCHEDULER_TaskIdentifier experiment_timeout_task;
- GNUNET_SCHEDULER_TaskIdentifier episode_timeout_task;
+ struct GNUNET_SCHEDULER_Task * experiment_timeout_task;
+ struct GNUNET_SCHEDULER_Task * episode_timeout_task;
struct Episode *cur;
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;
*/
static int opt_verbose;
-GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+struct GNUNET_SCHEDULER_Task * timeout_task;
struct Experiment *e;
struct LoggingHandle *l;
@@ -183,10 +183,10 @@ experiment_done_cb (struct Experiment *e, struct GNUNET_TIME_Relative duration,i
GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES));
else
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Experiment failed \n");
- if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
+ if (NULL != timeout_task)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
/* Stop logging */
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
timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
{
struct Experiment *e = cls;
- e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->experiment_timeout_task = NULL;
fprintf (stderr, "Experiment timeout!\n");
- if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task)
+ if (NULL != e->episode_timeout_task)
{
GNUNET_SCHEDULER_cancel (e->episode_timeout_task);
- e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->episode_timeout_task = NULL;
}
e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time),
@@ -588,7 +588,7 @@ static void
timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
{
struct Experiment *e = cls;
- e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->episode_timeout_task = NULL;
if (NULL != e->ep_done_cb)
e->ep_done_cb (e->cur);
@@ -598,10 +598,10 @@ timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
{
/* done */
fprintf (stderr, "Last episode done!\n");
- if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task)
+ if (NULL != e->experiment_timeout_task)
{
GNUNET_SCHEDULER_cancel (e->experiment_timeout_task);
- e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->experiment_timeout_task = NULL;
}
e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), GNUNET_OK);
return;
@@ -738,15 +738,15 @@ GNUNET_ATS_solvers_experimentation_load (char *filename)
void
GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e)
{
- if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task)
+ if (NULL != e->experiment_timeout_task)
{
GNUNET_SCHEDULER_cancel (e->experiment_timeout_task);
- e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->experiment_timeout_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task)
+ if (NULL != e->episode_timeout_task)
{
GNUNET_SCHEDULER_cancel (e->episode_timeout_task);
- e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->episode_timeout_task = NULL;
}
free_experiment (e);
}
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 @@
/**
* Shutdown task
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* Progress task
*/
-static GNUNET_SCHEDULER_TaskIdentifier progress_task;
+static struct GNUNET_SCHEDULER_Task * progress_task;
/**
* Test result
@@ -194,13 +194,13 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (GNUNET_YES == logging)
GNUNET_ATS_TEST_logging_clean_up(l);
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != progress_task)
+ shutdown_task = NULL;
+ if (NULL != progress_task)
{
fprintf (stderr, "0\n");
GNUNET_SCHEDULER_cancel (progress_task);
}
- progress_task = GNUNET_SCHEDULER_NO_TASK;
+ progress_task = NULL;
evaluate ();
GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Benchmarking done\n"));
@@ -213,7 +213,7 @@ static void
print_progress ()
{
static int calls;
- progress_task = GNUNET_SCHEDULER_NO_TASK;
+ progress_task = NULL;
fprintf (stderr, "%llu..",
(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)
{
struct BenchmarkPeer *me = cls;
- me->ats_task = GNUNET_SCHEDULER_NO_TASK;
+ me->ats_task = NULL;
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, " Master [%u] set preference for slave [%u] to %f\n",
me->no, me->pref_partner->no, me->pref_value);
@@ -248,7 +248,7 @@ start_benchmark()
GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Benchmarking start\n"));
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ if (NULL != shutdown_task)
GNUNET_SCHEDULER_cancel(shutdown_task);
shutdown_task = GNUNET_SCHEDULER_add_delayed(perf_duration, &do_shutdown,
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
* Masters only
* Progress task
*/
- GNUNET_SCHEDULER_TaskIdentifier ats_task;
+ struct GNUNET_SCHEDULER_Task * ats_task;
/**
* 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 @@
/**
* Logging task
*/
-static GNUNET_SCHEDULER_TaskIdentifier log_task;
+static struct GNUNET_SCHEDULER_Task * log_task;
/**
* Reference to perf_ats' masters
@@ -639,7 +639,7 @@ collect_log_now (void)
static void
collect_log_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- log_task = GNUNET_SCHEDULER_NO_TASK;
+ log_task = NULL;
collect_log_now();
@@ -661,9 +661,9 @@ perf_logging_stop ()
if (GNUNET_YES!= running)
return;
- if (GNUNET_SCHEDULER_NO_TASK != log_task)
+ if (NULL != log_task)
GNUNET_SCHEDULER_cancel (log_task);
- log_task = GNUNET_SCHEDULER_NO_TASK;
+ log_task = NULL;
tc.reason = GNUNET_SCHEDULER_REASON_SHUTDOWN;
collect_log_task (NULL, &tc);
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;
/**
* Shutdown task
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* Hashmap to store addresses
@@ -345,7 +345,7 @@ transport_addr_to_str_cb (void *cls,
if ((GNUNET_YES == stat_receive_done) && (0 == stat_pending))
{
/* All messages received and no resolutions pending*/
- if (shutdown_task != GNUNET_SCHEDULER_NO_TASK)
+ if (shutdown_task != NULL)
GNUNET_SCHEDULER_cancel (shutdown_task);
shutdown_task = GNUNET_SCHEDULER_add_now (end, NULL);
}
@@ -637,7 +637,7 @@ ats_perf_cb (void *cls,
if (0 == stat_pending)
{
/* All messages received and no resolutions pending*/
- if (shutdown_task != GNUNET_SCHEDULER_NO_TASK)
+ if (shutdown_task != NULL)
GNUNET_SCHEDULER_cancel (shutdown_task);
shutdown_task = GNUNET_SCHEDULER_add_now (end, NULL);
}
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
/**
* Task to trigger reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* Monitor request multiplexing
@@ -255,7 +255,7 @@ reconnect_task (void *cls,
{
struct GNUNET_ATS_PerformanceHandle *ph = cls;
- ph->task = GNUNET_SCHEDULER_NO_TASK;
+ ph->task = NULL;
reconnect (ph);
}
@@ -740,10 +740,10 @@ GNUNET_ATS_performance_done (struct GNUNET_ATS_PerformanceHandle *ph)
GNUNET_free (rc);
}
- if (GNUNET_SCHEDULER_NO_TASK != ph->task)
+ if (NULL != ph->task)
{
GNUNET_SCHEDULER_cancel (ph->task);
- ph->task = GNUNET_SCHEDULER_NO_TASK;
+ ph->task = NULL;
}
if (NULL != ph->client)
{
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
/**
* Task to trigger reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* Task retrieving interfaces from the system
*/
- GNUNET_SCHEDULER_TaskIdentifier interface_task;
+ struct GNUNET_SCHEDULER_Task * interface_task;
/**
@@ -217,7 +217,7 @@ reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_ATS_SchedulingHandle *sh = cls;
- sh->task = GNUNET_SCHEDULER_NO_TASK;
+ sh->task = NULL;
reconnect (sh);
}
@@ -825,7 +825,7 @@ static void
get_addresses (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_ATS_SchedulingHandle * sh = cls;
- sh->interface_task = GNUNET_SCHEDULER_NO_TASK;
+ sh->interface_task = NULL;
delete_networks (sh);
GNUNET_OS_network_interfaces_list(interface_proc, sh);
sh->interface_task = GNUNET_SCHEDULER_add_delayed (INTERFACE_PROCESSING_INTERVALL,
@@ -1005,10 +1005,10 @@ GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh)
GNUNET_CLIENT_disconnect (sh->client);
sh->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != sh->task)
+ if (NULL != sh->task)
{
GNUNET_SCHEDULER_cancel (sh->task);
- sh->task = GNUNET_SCHEDULER_NO_TASK;
+ sh->task = NULL;
}
next = sh->sug_head;
@@ -1020,10 +1020,10 @@ GNUNET_ATS_scheduling_done (struct GNUNET_ATS_SchedulingHandle *sh)
}
delete_networks (sh);
- if (sh->interface_task != GNUNET_SCHEDULER_NO_TASK)
+ if (sh->interface_task != NULL)
{
GNUNET_SCHEDULER_cancel(sh->interface_task);
- sh->interface_task = GNUNET_SCHEDULER_NO_TASK;
+ sh->interface_task = NULL;
}
GNUNET_array_grow (sh->session_array, sh->session_array_size, 0);
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
logging_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct LoggingHandle *l = cls;
- l->logging_task = GNUNET_SCHEDULER_NO_TASK;
+ l->logging_task = NULL;
GNUNET_ATS_solver_logging_now (l);
@@ -268,12 +268,12 @@ GNUNET_ATS_solver_logging_start (struct GNUNET_TIME_Relative freq)
void
GNUNET_ATS_solver_logging_stop (struct LoggingHandle *l)
{
- if (GNUNET_SCHEDULER_NO_TASK != l->logging_task)
+ if (NULL != l->logging_task)
GNUNET_SCHEDULER_cancel (l->logging_task);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stop logging\n");
- l->logging_task = GNUNET_SCHEDULER_NO_TASK;
+ l->logging_task = NULL;
}
static struct LoggingFileHandle *
@@ -513,9 +513,9 @@ GNUNET_ATS_solver_logging_free (struct LoggingHandle *l)
struct LoggingAddress *log_a_cur;
struct LoggingAddress *log_a_next;
- if (GNUNET_SCHEDULER_NO_TASK != l->logging_task)
+ if (NULL != l->logging_task)
GNUNET_SCHEDULER_cancel (l->logging_task);
- l->logging_task = GNUNET_SCHEDULER_NO_TASK;
+ l->logging_task = NULL;
lts_next = l->head;
while (NULL != (lts_cur = lts_next))
@@ -621,7 +621,7 @@ set_prop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
double prop_value;
struct GNUNET_ATS_Information atsi;
- pg->set_task = GNUNET_SCHEDULER_NO_TASK;
+ pg->set_task = NULL;
if (GNUNET_NO == GNUNET_CONTAINER_multipeermap_contains_value (sh->addresses,
&pg->test_peer->peer_id, pg->test_address->ats_addr))
@@ -702,10 +702,10 @@ GNUNET_ATS_solver_generate_property_stop (struct PropertyGenerator *pg)
{
GNUNET_CONTAINER_DLL_remove (prop_gen_head, prop_gen_tail, pg);
- if (GNUNET_SCHEDULER_NO_TASK != pg->set_task)
+ if (NULL != pg->set_task)
{
GNUNET_SCHEDULER_cancel (pg->set_task);
- pg->set_task = GNUNET_SCHEDULER_NO_TASK;
+ pg->set_task = NULL;
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Removing old up preference generator peer [%u] address [%u] `%s'\n",
@@ -897,7 +897,7 @@ set_feedback_task (void *cls,
struct GNUNET_TIME_Relative dur;
double p_new;
- pg->feedback_task = GNUNET_SCHEDULER_NO_TASK;
+ pg->feedback_task = NULL;
if (NULL == (p = find_peer_by_id (pg->peer)))
{
@@ -966,7 +966,7 @@ set_pref_task (void *cls,
struct PreferenceGenerator *pg = cls;
struct TestPeer *p;
double pref_value;
- pg->set_task = GNUNET_SCHEDULER_NO_TASK;
+ pg->set_task = NULL;
if (NULL == (p = find_peer_by_id (pg->peer)))
{
@@ -1030,16 +1030,16 @@ GNUNET_ATS_solver_generate_preferences_stop (struct PreferenceGenerator *pg)
{
GNUNET_CONTAINER_DLL_remove (pref_gen_head, pref_gen_tail, pg);
- if (GNUNET_SCHEDULER_NO_TASK != pg->feedback_task)
+ if (NULL != pg->feedback_task)
{
GNUNET_SCHEDULER_cancel (pg->feedback_task);
- pg->feedback_task = GNUNET_SCHEDULER_NO_TASK;
+ pg->feedback_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pg->set_task)
+ if (NULL != pg->set_task)
{
GNUNET_SCHEDULER_cancel (pg->set_task);
- pg->set_task = GNUNET_SCHEDULER_NO_TASK;
+ pg->set_task = NULL;
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Removing old up preference generator peer [%u] `%s'\n",
@@ -2146,13 +2146,13 @@ static void
timeout_experiment (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
{
struct Experiment *e = cls;
- e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->experiment_timeout_task = NULL;
fprintf (stderr, "Experiment timeout!\n");
- if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task)
+ if (NULL != e->episode_timeout_task)
{
GNUNET_SCHEDULER_cancel (e->episode_timeout_task);
- e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->episode_timeout_task = NULL;
}
e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time),
@@ -2524,7 +2524,7 @@ static void
timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
{
struct Experiment *e = cls;
- e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->episode_timeout_task = NULL;
if (NULL != e->ep_done_cb)
e->ep_done_cb (e->cur);
@@ -2534,10 +2534,10 @@ timeout_episode (void *cls, const struct GNUNET_SCHEDULER_TaskContext* tc)
{
/* done */
fprintf (stderr, "Last episode done!\n");
- if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task)
+ if (NULL != e->experiment_timeout_task)
{
GNUNET_SCHEDULER_cancel (e->experiment_timeout_task);
- e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->experiment_timeout_task = NULL;
}
e->e_done_cb (e, GNUNET_TIME_absolute_get_duration(e->start_time), GNUNET_OK);
return;
@@ -2589,15 +2589,15 @@ GNUNET_ATS_solvers_experimentation_run (struct Experiment *e,
void
GNUNET_ATS_solvers_experimentation_stop (struct Experiment *e)
{
- if (GNUNET_SCHEDULER_NO_TASK != e->experiment_timeout_task)
+ if (NULL != e->experiment_timeout_task)
{
GNUNET_SCHEDULER_cancel (e->experiment_timeout_task);
- e->experiment_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->experiment_timeout_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != e->episode_timeout_task)
+ if (NULL != e->episode_timeout_task)
{
GNUNET_SCHEDULER_cancel (e->episode_timeout_task);
- e->episode_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ e->episode_timeout_task = NULL;
}
if (NULL != e->cfg)
{
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
struct LoggingHandle
{
- GNUNET_SCHEDULER_TaskIdentifier logging_task;
+ struct GNUNET_SCHEDULER_Task * logging_task;
struct GNUNET_TIME_Relative log_freq;
/* DLL list for logging time steps */
@@ -256,8 +256,8 @@ struct Experiment
struct GNUNET_CONFIGURATION_Handle *cfg;
- GNUNET_SCHEDULER_TaskIdentifier experiment_timeout_task;
- GNUNET_SCHEDULER_TaskIdentifier episode_timeout_task;
+ struct GNUNET_SCHEDULER_Task * experiment_timeout_task;
+ struct GNUNET_SCHEDULER_Task * episode_timeout_task;
struct Episode *cur;
GNUNET_ATS_TESTING_EpisodeDoneCallback ep_done_cb;
@@ -282,8 +282,8 @@ struct PreferenceGenerator
struct GNUNET_TIME_Relative frequency;
struct GNUNET_TIME_Relative feedback_frequency;
- GNUNET_SCHEDULER_TaskIdentifier set_task;
- GNUNET_SCHEDULER_TaskIdentifier feedback_task;
+ struct GNUNET_SCHEDULER_Task * set_task;
+ struct GNUNET_SCHEDULER_Task * feedback_task;
struct GNUNET_TIME_Absolute next_ping_transmission;
struct GNUNET_TIME_Absolute time_start;
@@ -326,7 +326,7 @@ struct PropertyGenerator
struct GNUNET_TIME_Relative duration_period;
struct GNUNET_TIME_Relative frequency;
- GNUNET_SCHEDULER_TaskIdentifier set_task;
+ struct GNUNET_SCHEDULER_Task * set_task;
struct GNUNET_TIME_Absolute next_ping_transmission;
struct GNUNET_TIME_Absolute time_start;
};
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;
*/
static struct PeerRelative defvalues;
-static GNUNET_SCHEDULER_TaskIdentifier aging_task;
+static struct GNUNET_SCHEDULER_Task * aging_task;
/**
* Application Preference Normalization
@@ -385,7 +385,7 @@ preference_aging (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
int values_to_update;
double backup;
- aging_task = GNUNET_SCHEDULER_NO_TASK;
+ aging_task = NULL;
values_to_update = 0;
cur_client = NULL;
@@ -542,7 +542,7 @@ GAS_normalization_normalize_preference (void *client,
run_preference_update (c_cur, p_cur, kind, score_abs);
/* Start aging task */
- if (GNUNET_SCHEDULER_NO_TASK == aging_task)
+ if (NULL == aging_task)
aging_task = GNUNET_SCHEDULER_add_delayed (PREF_AGING_INTERVAL,
&preference_aging, NULL );
@@ -959,7 +959,7 @@ GAS_normalization_start (GAS_Normalization_preference_changed_cb pref_ch_cb,
for (i = 0; i < GNUNET_ATS_PreferenceCount; i++)
defvalues.f_rel[i] = DEFAULT_REL_PREFERENCE;
- aging_task = GNUNET_SCHEDULER_NO_TASK;
+ aging_task = NULL;
return;
}
@@ -992,10 +992,10 @@ GAS_normalization_stop ()
struct PreferenceClient *pc;
struct PreferenceClient *next_pc;
- if (GNUNET_SCHEDULER_NO_TASK != aging_task)
+ if (NULL != aging_task)
{
GNUNET_SCHEDULER_cancel (aging_task);
- aging_task = GNUNET_SCHEDULER_NO_TASK;
+ aging_task = NULL;
}
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
/**
* Task identifier of the next time-step to be executed
*/
- GNUNET_SCHEDULER_TaskIdentifier step_next_task_id;
+ struct GNUNET_SCHEDULER_Task * step_next_task_id;
/**
* Variable discount factor, dependent on time between steps
@@ -1546,7 +1546,7 @@ ril_step_scheduler_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *t
{
struct GAS_RIL_Handle *solver = cls;
- solver->step_next_task_id = GNUNET_SCHEDULER_NO_TASK;
+ solver->step_next_task_id = NULL;
ril_step (solver);
}
@@ -1875,7 +1875,7 @@ ril_step_schedule_next (struct GAS_RIL_Handle *solver)
time_next = GNUNET_TIME_UNIT_ZERO;
}
- if ((GNUNET_SCHEDULER_NO_TASK == solver->step_next_task_id) && (GNUNET_NO == solver->done))
+ if ((NULL == solver->step_next_task_id) && (GNUNET_NO == solver->done))
{
solver->step_next_task_id = GNUNET_SCHEDULER_add_delayed (time_next, &ril_step_scheduler_task,
solver);
@@ -2939,7 +2939,7 @@ libgnunet_plugin_ats_ril_done (void *cls)
cur_agent = next_agent;
}
- if (GNUNET_SCHEDULER_NO_TASK != s->step_next_task_id)
+ if (NULL != s->step_next_task_id)
{
GNUNET_SCHEDULER_cancel (s->step_next_task_id);
}
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 @@
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier consume_task;
+static struct GNUNET_SCHEDULER_Task * consume_task;
static struct GNUNET_ATS_SchedulingHandle *ats;
@@ -77,11 +77,11 @@ struct PeerContext
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
- if (consume_task != GNUNET_SCHEDULER_NO_TASK)
+ die_task = NULL;
+ if (consume_task != NULL)
{
GNUNET_SCHEDULER_cancel (consume_task);
- consume_task = GNUNET_SCHEDULER_NO_TASK;
+ consume_task = NULL;
}
if (sh != NULL)
GNUNET_ATS_reserve_bandwidth_cancel (sh);
@@ -98,15 +98,15 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end ()
{
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
- if (consume_task != GNUNET_SCHEDULER_NO_TASK)
+ if (consume_task != NULL)
{
GNUNET_SCHEDULER_cancel (consume_task);
- consume_task = GNUNET_SCHEDULER_NO_TASK;
+ consume_task = NULL;
}
GNUNET_ATS_scheduling_done (ats);
GNUNET_ATS_performance_done (atp);
@@ -142,7 +142,7 @@ reservation_cb (void *cls, const struct GNUNET_PeerIdentity *peer,
static void
consume_bandwidth (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- consume_task = GNUNET_SCHEDULER_NO_TASK;
+ consume_task = NULL;
int32_t to_reserve = 500;
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 @@
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -165,7 +165,7 @@ address_suggest_cb (void *cls,
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
@@ -174,10 +174,10 @@ static void
end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK )
+ if (die_task != NULL )
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
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 @@
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -172,7 +172,7 @@ address_suggest_cb (void *cls,
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
@@ -181,10 +181,10 @@ static void
end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK )
+ if (die_task != NULL )
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
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 @@
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -176,10 +176,10 @@ end (void *cls,
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK )
+ if (die_task != NULL )
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
{
@@ -216,7 +216,7 @@ static void
end_badly (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end (NULL, NULL);
ret = GNUNET_SYSERR;
}
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 @@
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -167,7 +167,7 @@ address_suggest_cb (void *cls,
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
@@ -176,10 +176,10 @@ static void
end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK )
+ if (die_task != NULL )
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
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 @@
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10)
#define WAIT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -174,7 +174,7 @@ address_suggest_cb (void *cls,
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
@@ -183,10 +183,10 @@ static void
end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK )
+ if (die_task != NULL )
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -103,10 +103,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -130,7 +130,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier wait_task;
+static struct GNUNET_SCHEDULER_Task * wait_task;
/**
* Statistics handle
@@ -95,13 +95,13 @@ stat_cb(void *cls, const char *subsystem,
subsystem,name, value);
if (1 < value)
{
- if (GNUNET_SCHEDULER_NO_TASK != wait_task)
+ if (NULL != wait_task)
GNUNET_SCHEDULER_cancel (wait_task);
GNUNET_SCHEDULER_add_now (&end_badly, NULL);
}
if (1 == value)
{
- if (GNUNET_SCHEDULER_NO_TASK == wait_task)
+ if (NULL == wait_task)
wait_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &end, NULL);
}
return GNUNET_OK;
@@ -112,12 +112,12 @@ static void
end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- wait_task = GNUNET_SCHEDULER_NO_TASK;
+ wait_task = NULL;
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -141,7 +141,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -109,10 +109,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -136,7 +136,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -116,10 +116,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -143,7 +143,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -114,10 +114,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -141,7 +141,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -116,10 +116,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -143,7 +143,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -120,10 +120,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -147,7 +147,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Initial statistics get request handle
@@ -86,10 +86,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -110,7 +110,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
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 @@
#define DEBUG_ATS_INFO GNUNET_NO
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Scheduling handle
@@ -102,7 +102,7 @@ unsigned long long wan_quota_in;
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Error! Shutting down\n");
if (sched_ats != NULL)
{
@@ -123,10 +123,10 @@ static void
end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -89,10 +89,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -117,7 +117,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -94,10 +94,10 @@ static void
end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -122,7 +122,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -114,10 +114,10 @@ stat_cb(void *cls, const char *subsystem, const char *name, uint64_t value,
static void
end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -144,7 +144,7 @@ static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
@@ -152,10 +152,10 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly_now ()
{
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
GNUNET_SCHEDULER_add_now (&end_badly, NULL);
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier end_task;
+static struct GNUNET_SCHEDULER_Task * end_task;
/**
* Statistics handle
@@ -113,10 +113,10 @@ static void
end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n");
- if (end_task == GNUNET_SCHEDULER_NO_TASK)
+ if (end_task == NULL)
{
GNUNET_SCHEDULER_cancel (end_task);
- end_task = GNUNET_SCHEDULER_NO_TASK;
+ end_task = NULL;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -99,10 +99,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Done!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK )
+ if (die_task != NULL )
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -132,7 +132,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end (NULL, NULL );
ret = GNUNET_SYSERR;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -94,10 +94,10 @@ static void
end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -122,7 +122,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
ret = GNUNET_SYSERR;
}
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 @@
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Statistics handle
@@ -96,10 +96,10 @@ static void
end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
}
if (NULL != sched_ats)
@@ -124,7 +124,7 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
end ( NULL, NULL);
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
/**
* Task triggering a timeout, can be NO_TASK if the timeout is FOREVER.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Size of 'data' -- or the desired size of 'notify' if 'data' is NULL.
@@ -210,7 +210,7 @@ struct GNUNET_CADET_Handle
/**
* Task for trying to reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* 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)
GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th);
/* clean up request */
- if (GNUNET_SCHEDULER_NO_TASK != th->timeout_task)
+ if (NULL != th->timeout_task)
GNUNET_SCHEDULER_cancel (th->timeout_task);
GNUNET_free (th);
}
@@ -528,7 +528,7 @@ timeout_transmission (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_CADET_TransmitHandle *th = cls;
struct GNUNET_CADET_Handle *cadet = th->channel->cadet;
- th->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ th->timeout_task = NULL;
th->channel->packet_size = 0;
GNUNET_CONTAINER_DLL_remove (cadet->th_head, cadet->th_tail, th);
if (GNUNET_YES == th_is_payload (th))
@@ -711,7 +711,7 @@ reconnect_cbk (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_CADET_Handle *h = cls;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
do_reconnect (h);
@@ -740,7 +740,7 @@ reconnect (struct GNUNET_CADET_Handle *h)
next = ch->next;
destroy_channel (ch, GNUNET_YES);
}
- if (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task)
+ if (NULL == h->reconnect_task)
h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->reconnect_time,
&reconnect_cbk, h);
}
@@ -1382,7 +1382,7 @@ send_callback (void *cls, size_t size, void *buf)
psize = th->size;
}
GNUNET_assert (GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE >= psize);
- if (th->timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (th->timeout_task != NULL)
GNUNET_SCHEDULER_cancel (th->timeout_task);
GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th);
GNUNET_free (th);
@@ -1487,7 +1487,7 @@ GNUNET_CADET_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls,
h->ports = ports;
h->next_chid = GNUNET_CADET_LOCAL_CHANNEL_ID_CLI;
h->reconnect_time = GNUNET_TIME_UNIT_MILLISECONDS;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
if (NULL != ports && ports[0] != 0 && NULL == new_channel)
{
@@ -1576,10 +1576,10 @@ GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle)
GNUNET_CLIENT_disconnect (handle->client);
handle->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != handle->reconnect_task)
+ if (NULL != handle->reconnect_task)
{
GNUNET_SCHEDULER_cancel(handle->reconnect_task);
- handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ handle->reconnect_task = NULL;
}
GNUNET_free (handle);
}
@@ -1761,7 +1761,7 @@ GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle *t
th->channel->packet_size = 0;
cadet = th->channel->cadet;
- if (th->timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (th->timeout_task != NULL)
GNUNET_SCHEDULER_cancel (th->timeout_task);
GNUNET_CONTAINER_DLL_remove (cadet->th_head, cadet->th_tail, th);
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)
struct CadetPeer *peer;
LOG (GNUNET_ERROR_TYPE_INFO, "Destroy delayed %p (%u)\n", path, path->length);
- path->path_delete = GNUNET_SCHEDULER_NO_TASK;
+ path->path_delete = NULL;
peer = GCP_get_short (path->peers[path->length - 1]);
if (2 < path->length)
GCP_remove_path (peer, path);
@@ -150,7 +150,7 @@ path_get_length (struct CadetPeerPath *path)
void
path_invalidate (struct CadetPeerPath *p)
{
- if (GNUNET_SCHEDULER_NO_TASK != p->path_delete)
+ if (NULL != p->path_delete)
return;
LOG (GNUNET_ERROR_TYPE_INFO, "Invalidating path %p (%u)\n", p, p->length);
@@ -267,7 +267,7 @@ path_equivalent (const struct CadetPeerPath *p1,
int
path_is_valid (const struct CadetPeerPath *path)
{
- return (GNUNET_SCHEDULER_NO_TASK == path->path_delete);
+ return (NULL == path->path_delete);
}
@@ -287,7 +287,7 @@ path_destroy (struct CadetPeerPath *p)
LOG (GNUNET_ERROR_TYPE_INFO, "destroying path %p (%u)\n", p, p->length);
GNUNET_PEER_decrement_rcs (p->peers, p->length);
GNUNET_free_non_null (p->peers);
- if (GNUNET_SCHEDULER_NO_TASK != p->path_delete)
+ if (NULL != p->path_delete)
GNUNET_SCHEDULER_cancel (p->path_delete);
GNUNET_free (p);
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
* Task to delete the path.
* We tried it, it didn't work, don't try again in a while.
*/
- GNUNET_SCHEDULER_TaskIdentifier path_delete;
+ struct GNUNET_SCHEDULER_Task * path_delete;
};
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
/**
* Task to do the next ping.
*/
- GNUNET_SCHEDULER_TaskIdentifier ping_task;
+ struct GNUNET_SCHEDULER_Task * ping_task;
float mean[number_rounds];
float var[number_rounds];
@@ -209,17 +209,17 @@ static struct GNUNET_CADET_TEST_Context *test_ctx;
/**
* Task called to shutdown test.
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
+static struct GNUNET_SCHEDULER_Task * shutdown_handle;
/**
* Task called to disconnect peers, before shutdown.
*/
-static GNUNET_SCHEDULER_TaskIdentifier disconnect_task;
+static struct GNUNET_SCHEDULER_Task * disconnect_task;
/**
* Task to perform tests
*/
-static GNUNET_SCHEDULER_TaskIdentifier test_task;
+static struct GNUNET_SCHEDULER_Task * test_task;
/**
* Round number.
@@ -320,7 +320,7 @@ static void
shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Ending test.\n");
- shutdown_handle = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_handle = NULL;
}
@@ -338,7 +338,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"disconnecting cadet service, called from line %ld\n", line);
- disconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ disconnect_task = NULL;
for (i = 0; i < peers_total; i++)
{
if (NULL != peers[i].op)
@@ -366,7 +366,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
}
}
GNUNET_CADET_TEST_cleanup (test_ctx);
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle)
+ if (NULL != shutdown_handle)
{
GNUNET_SCHEDULER_cancel (shutdown_handle);
}
@@ -382,7 +382,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
static void
abort_test (long line)
{
- if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (disconnect_task != NULL)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
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)
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "... collecting statistics done.\n");
GNUNET_TESTBED_operation_done (stats_op);
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
(void *) __LINE__);
@@ -513,9 +513,9 @@ adjust_running_peers (unsigned int target)
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "St%s peer %u: %s\n",
run ? "arting" : "opping", r, GNUNET_i2s (&peers[r].id));
- if (GNUNET_SCHEDULER_NO_TASK != peers[r].ping_task)
+ if (NULL != peers[r].ping_task)
GNUNET_SCHEDULER_cancel (peers[r].ping_task);
- peers[r].ping_task = GNUNET_SCHEDULER_NO_TASK;
+ peers[r].ping_task = NULL;
peers[r].up = run;
@@ -615,7 +615,7 @@ ping (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct CadetPeer *peer = (struct CadetPeer *) cls;
- peer->ping_task = GNUNET_SCHEDULER_NO_TASK;
+ peer->ping_task = NULL;
if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0
|| GNUNET_YES == test_finished)
@@ -797,7 +797,7 @@ incoming_channel (void *cls, struct GNUNET_CADET_Channel *channel,
peers_warmup++;
if (peers_warmup < peers_total)
return NULL;
- if (GNUNET_SCHEDULER_NO_TASK != test_task)
+ if (NULL != test_task)
{
GNUNET_SCHEDULER_cancel (test_task);
test_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
@@ -873,7 +873,7 @@ start_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
enum GNUNET_CADET_ChannelOption flags;
unsigned long i;
- test_task = GNUNET_SCHEDULER_NO_TASK;
+ test_task = NULL;
if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
return;
@@ -898,7 +898,7 @@ start_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
&ping, &peers[i]);
}
peers_running = peers_total;
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task =
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;
/**
* Task for next echo request.
*/
-GNUNET_SCHEDULER_TaskIdentifier echo_task;
+struct GNUNET_SCHEDULER_Task * echo_task;
/**
* Peer to connect to.
@@ -118,7 +118,7 @@ static struct GNUNET_CADET_Channel *ch;
/**
* Shutdown task handle.
*/
-GNUNET_SCHEDULER_TaskIdentifier sd;
+struct GNUNET_SCHEDULER_Task * sd;
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
/**
* Task to resend/poll in case no ACK is received.
*/
- GNUNET_SCHEDULER_TaskIdentifier retry_task;
+ struct GNUNET_SCHEDULER_Task * retry_task;
/**
* Counter for exponential backoff.
@@ -729,7 +729,7 @@ channel_retransmit_message (void *cls,
struct GNUNET_CADET_Data *payload;
int fwd;
- rel->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ rel->retry_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -763,7 +763,7 @@ channel_recreate (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct CadetChannelReliability *rel = cls;
- rel->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ rel->retry_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -815,7 +815,7 @@ ch_message_sent (void *cls,
GNUNET_assert (chq == copy->chq);
copy->timestamp = GNUNET_TIME_absolute_get ();
rel = copy->rel;
- if (GNUNET_SCHEDULER_NO_TASK == rel->retry_task)
+ if (NULL == rel->retry_task)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "!! scheduling retry in 4 * %s\n",
GNUNET_STRINGS_relative_time_to_string (rel->expected_delay,
@@ -859,7 +859,7 @@ ch_message_sent (void *cls,
&& GNUNET_MESSAGE_TYPE_CADET_DATA_ACK != type
&& GNUNET_NO == rel->ch->destroy)
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rel->retry_task);
+ GNUNET_assert (NULL == rel->retry_task);
LOG (GNUNET_ERROR_TYPE_DEBUG, "!!! STD BACKOFF %s\n",
GNUNET_STRINGS_relative_time_to_string (rel->retry_timer,
GNUNET_NO));
@@ -1006,10 +1006,10 @@ channel_rel_free_all (struct CadetChannelReliability *rel)
GCT_cancel (rel->uniq->tq);
/* ch_message_sent is called freeing uniq */
}
- if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task)
+ if (NULL != rel->retry_task)
{
GNUNET_SCHEDULER_cancel (rel->retry_task);
- rel->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ rel->retry_task = NULL;
}
GNUNET_free (rel);
}
@@ -1174,10 +1174,10 @@ channel_confirm (struct CadetChannel *ch, int fwd)
if (GCT_get_connections_buffer (ch->t) > 0 || GCT_is_loopback (ch->t))
send_client_ack (ch, fwd);
- if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task)
+ if (NULL != rel->retry_task)
{
GNUNET_SCHEDULER_cancel (rel->retry_task);
- rel->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ rel->retry_task = NULL;
}
else if (NULL != rel->uniq)
{
@@ -2079,10 +2079,10 @@ GCCH_handle_data_ack (struct CadetChannel *ch,
/* If some message was free'd, update the retransmission delay */
if (GNUNET_YES == work)
{
- if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task)
+ if (NULL != rel->retry_task)
{
GNUNET_SCHEDULER_cancel (rel->retry_task);
- rel->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ rel->retry_task = NULL;
if (NULL != rel->head_sent && NULL == rel->head_sent->chq)
{
struct GNUNET_TIME_Absolute new_target;
@@ -2179,12 +2179,12 @@ GCCH_handle_create (struct CadetTunnel *t,
else
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " duplicate create channel\n");
- if (GNUNET_SCHEDULER_NO_TASK != ch->dest_rel->retry_task)
+ if (NULL != ch->dest_rel->retry_task)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " clearing retry task\n");
/* we were waiting to re-send our 'SYNACK', wait no more! */
GNUNET_SCHEDULER_cancel (ch->dest_rel->retry_task);
- ch->dest_rel->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ ch->dest_rel->retry_task = NULL;
}
else if (NULL != ch->dest_rel->uniq)
{
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
/**
* Task to poll the peer in case of a lost ACK causes stall.
*/
- GNUNET_SCHEDULER_TaskIdentifier poll_task;
+ struct GNUNET_SCHEDULER_Task * poll_task;
/**
* How frequently to poll for ACKs.
@@ -190,13 +190,13 @@ struct CadetConnection
* Task to keep the used paths alive at the owner,
* time tunnel out on all the other peers.
*/
- GNUNET_SCHEDULER_TaskIdentifier fwd_maintenance_task;
+ struct GNUNET_SCHEDULER_Task * fwd_maintenance_task;
/**
* Task to keep the used paths alive at the destination,
* time tunnel out on all the other peers.
*/
- GNUNET_SCHEDULER_TaskIdentifier bck_maintenance_task;
+ struct GNUNET_SCHEDULER_Task * bck_maintenance_task;
/**
* Queue handle for maintainance traffic. One handle for FWD and BCK since
@@ -400,7 +400,7 @@ fc_init (struct CadetFlowControl *fc)
fc->last_pid_recv = (uint32_t) -1;
fc->last_ack_sent = (uint32_t) 0;
fc->last_ack_recv = (uint32_t) 0;
- fc->poll_task = GNUNET_SCHEDULER_NO_TASK;
+ fc->poll_task = NULL;
fc->poll_time = GNUNET_TIME_UNIT_SECONDS;
fc->queue_n = 0;
fc->queue_max = (max_msgs_queue / max_connections) + 1;
@@ -1008,9 +1008,9 @@ connection_keepalive (struct CadetConnection *c, int fwd, int shutdown)
GC_f2s (fwd), GCC_2s (c));
if (fwd)
- c->fwd_maintenance_task = GNUNET_SCHEDULER_NO_TASK;
+ c->fwd_maintenance_task = NULL;
else
- c->bck_maintenance_task = GNUNET_SCHEDULER_NO_TASK;
+ c->bck_maintenance_task = NULL;
if (GNUNET_NO != shutdown)
return;
@@ -1066,8 +1066,8 @@ static void
schedule_next_keepalive (struct CadetConnection *c, int fwd)
{
struct GNUNET_TIME_Relative delay;
- GNUNET_SCHEDULER_TaskIdentifier *task_id;
- GNUNET_SCHEDULER_Task keepalive_task;
+ struct GNUNET_SCHEDULER_Task * *task_id;
+ GNUNET_SCHEDULER_TaskCallback keepalive_task;
if (GNUNET_NO == GCC_is_origin (c, fwd))
return;
@@ -1100,7 +1100,7 @@ schedule_next_keepalive (struct CadetConnection *c, int fwd)
}
/* Check that no one scheduled it before us */
- if (GNUNET_SCHEDULER_NO_TASK != *task_id)
+ if (NULL != *task_id)
{
/* No need for a _break. It can happen for instance when sending a SYNACK
* for a duplicate SYN: the first SYNACK scheduled the task. */
@@ -1168,10 +1168,10 @@ connection_cancel_queues (struct CadetConnection *c, int fwd)
}
fc = fwd ? &c->fwd_fc : &c->bck_fc;
- if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task)
+ if (NULL != fc->poll_task)
{
GNUNET_SCHEDULER_cancel (fc->poll_task);
- fc->poll_task = GNUNET_SCHEDULER_NO_TASK;
+ fc->poll_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG, " *** Cancel POLL in ccq for fc %p\n", fc);
}
peer = get_hop (c, fwd);
@@ -1236,7 +1236,7 @@ connection_poll (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_CADET_Poll msg;
struct CadetConnection *c;
- fc->poll_task = GNUNET_SCHEDULER_NO_TASK;
+ fc->poll_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
return;
@@ -1316,7 +1316,7 @@ connection_fwd_timeout (void *cls,
{
struct CadetConnection *c = cls;
- c->fwd_maintenance_task = GNUNET_SCHEDULER_NO_TASK;
+ c->fwd_maintenance_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -1358,7 +1358,7 @@ connection_bck_timeout (void *cls,
{
struct CadetConnection *c = cls;
- c->bck_maintenance_task = GNUNET_SCHEDULER_NO_TASK;
+ c->bck_maintenance_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -1410,12 +1410,12 @@ connection_reset_timeout (struct CadetConnection *c, int fwd)
else /* Relay, endpoint. */
{
struct GNUNET_TIME_Relative delay;
- GNUNET_SCHEDULER_TaskIdentifier *ti;
- GNUNET_SCHEDULER_Task f;
+ struct GNUNET_SCHEDULER_Task * *ti;
+ GNUNET_SCHEDULER_TaskCallback f;
ti = fwd ? &c->fwd_maintenance_task : &c->bck_maintenance_task;
- if (GNUNET_SCHEDULER_NO_TASK != *ti)
+ if (NULL != *ti)
GNUNET_SCHEDULER_cancel (*ti);
delay = GNUNET_TIME_relative_multiply (refresh_connection_time, 4);
LOG (GNUNET_ERROR_TYPE_DEBUG, " timing out in %s\n",
@@ -2376,12 +2376,12 @@ GCC_handle_ack (void *cls, const struct GNUNET_PeerIdentity *peer,
fc->last_ack_recv = ack;
/* Cancel polling if the ACK is big enough. */
- if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task &&
+ if (NULL != fc->poll_task &&
GC_is_pid_bigger (fc->last_ack_recv, fc->last_pid_sent))
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " Cancel poll\n");
GNUNET_SCHEDULER_cancel (fc->poll_task);
- fc->poll_task = GNUNET_SCHEDULER_NO_TASK;
+ fc->poll_task = NULL;
fc->poll_time = GNUNET_TIME_UNIT_SECONDS;
}
@@ -2690,16 +2690,16 @@ GCC_destroy (struct CadetConnection *c)
if (GNUNET_NO == GCC_is_origin (c, GNUNET_YES) && NULL != c->path)
path_destroy (c->path);
- if (GNUNET_SCHEDULER_NO_TASK != c->fwd_maintenance_task)
+ if (NULL != c->fwd_maintenance_task)
GNUNET_SCHEDULER_cancel (c->fwd_maintenance_task);
- if (GNUNET_SCHEDULER_NO_TASK != c->bck_maintenance_task)
+ if (NULL != c->bck_maintenance_task)
GNUNET_SCHEDULER_cancel (c->bck_maintenance_task);
- if (GNUNET_SCHEDULER_NO_TASK != c->fwd_fc.poll_task)
+ if (NULL != c->fwd_fc.poll_task)
{
GNUNET_SCHEDULER_cancel (c->fwd_fc.poll_task);
LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL FWD canceled\n");
}
- if (GNUNET_SCHEDULER_NO_TASK != c->bck_fc.poll_task)
+ if (NULL != c->bck_fc.poll_task)
{
GNUNET_SCHEDULER_cancel (c->bck_fc.poll_task);
LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL BCK canceled\n");
@@ -3268,7 +3268,7 @@ GCC_start_poll (struct CadetConnection *c, int fwd)
fc = fwd ? &c->fwd_fc : &c->bck_fc;
LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL %s requested\n",
GC_f2s (fwd));
- if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task || NULL != fc->poll_msg)
+ if (NULL != fc->poll_task || NULL != fc->poll_msg)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " *** not needed (%u, %p)\n",
fc->poll_task, fc->poll_msg);
@@ -3295,10 +3295,10 @@ GCC_stop_poll (struct CadetConnection *c, int fwd)
struct CadetFlowControl *fc;
fc = fwd ? &c->fwd_fc : &c->bck_fc;
- if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task)
+ if (NULL != fc->poll_task)
{
GNUNET_SCHEDULER_cancel (fc->poll_task);
- fc->poll_task = GNUNET_SCHEDULER_NO_TASK;
+ fc->poll_task = NULL;
}
}
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;
/**
* Task to periodically announce itself in the network.
*/
-static GNUNET_SCHEDULER_TaskIdentifier announce_id_task;
+static struct GNUNET_SCHEDULER_Task * announce_id_task;
/**
* GET requests to stop on shutdown.
@@ -214,7 +214,7 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
- announce_id_task = GNUNET_SCHEDULER_NO_TASK;
+ announce_id_task = NULL;
return;
}
LOG (GNUNET_ERROR_TYPE_DEBUG, "Announce ID\n");
@@ -332,10 +332,10 @@ GCD_shutdown (void)
GNUNET_DHT_disconnect (dht_handle);
dht_handle = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != announce_id_task)
+ if (NULL != announce_id_task)
{
GNUNET_SCHEDULER_cancel (announce_id_task);
- announce_id_task = GNUNET_SCHEDULER_NO_TASK;
+ announce_id_task = NULL;
}
}
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
* Task for delayed destruction of the Key eXchange context, to allow delayed
* messages with the old key to be decrypted successfully.
*/
- GNUNET_SCHEDULER_TaskIdentifier finish_task;
+ struct GNUNET_SCHEDULER_Task * finish_task;
};
/**
@@ -164,7 +164,7 @@ struct CadetTunnel
/**
* Task to start the rekey process.
*/
- GNUNET_SCHEDULER_TaskIdentifier rekey_task;
+ struct GNUNET_SCHEDULER_Task * rekey_task;
/**
* Paths that are actively used to reach the destination peer.
@@ -191,7 +191,7 @@ struct CadetTunnel
/**
* Destroy flag: if true, destroy on last message.
*/
- GNUNET_SCHEDULER_TaskIdentifier destroy_task;
+ struct GNUNET_SCHEDULER_Task * destroy_task;
/**
* Queued messages, to transmit once tunnel gets connected.
@@ -202,7 +202,7 @@ struct CadetTunnel
/**
* Task to trim connections if too many are present.
*/
- GNUNET_SCHEDULER_TaskIdentifier trim_connections_task;
+ struct GNUNET_SCHEDULER_Task * trim_connections_task;
/**
* Ephemeral message in the queue (to avoid queueing more than one).
@@ -326,7 +326,7 @@ static struct GNUNET_CADET_KX_Ephemeral kx_msg;
/**
* Task to generate a new ephemeral key.
*/
-static GNUNET_SCHEDULER_TaskIdentifier rekey_task;
+static struct GNUNET_SCHEDULER_Task * rekey_task;
/**
* Rekey period.
@@ -604,7 +604,7 @@ select_key (const struct CadetTunnel *t)
const struct GNUNET_CRYPTO_SymmetricSessionKey *key;
if (NULL != t->kx_ctx
- && GNUNET_SCHEDULER_NO_TASK == t->kx_ctx->finish_task)
+ && NULL == t->kx_ctx->finish_task)
{
struct GNUNET_TIME_Relative age;
@@ -912,11 +912,11 @@ create_kx_ctx (struct CadetTunnel *t)
if (NULL != t->kx_ctx)
{
- if (GNUNET_SCHEDULER_NO_TASK != t->kx_ctx->finish_task)
+ if (NULL != t->kx_ctx->finish_task)
{
LOG (GNUNET_ERROR_TYPE_INFO, " resetting exisiting finish task\n");
GNUNET_SCHEDULER_cancel (t->kx_ctx->finish_task);
- t->kx_ctx->finish_task = GNUNET_SCHEDULER_NO_TASK;
+ t->kx_ctx->finish_task = NULL;
}
}
else
@@ -975,7 +975,7 @@ destroy_kx_ctx (struct CadetTunnel *t)
{
struct GNUNET_TIME_Relative delay;
- if (NULL == t->kx_ctx || GNUNET_SCHEDULER_NO_TASK != t->kx_ctx->finish_task)
+ if (NULL == t->kx_ctx || NULL != t->kx_ctx->finish_task)
return;
if (is_key_null (&t->kx_ctx->e_key_old))
@@ -1182,7 +1182,7 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message,
if (NULL == c)
{
/* Why is tunnel 'ready'? Should have been queued! */
- if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task)
+ if (NULL != t->destroy_task)
{
GNUNET_break (0);
GCT_debug (t, GNUNET_ERROR_TYPE_WARNING);
@@ -1387,7 +1387,7 @@ send_kx (struct CadetTunnel *t,
c = tunnel_get_connection (t);
if (NULL == c)
{
- if (GNUNET_SCHEDULER_NO_TASK == t->destroy_task
+ if (NULL == t->destroy_task
&& CADET_TUNNEL_READY == t->cstate)
{
GNUNET_break (0);
@@ -1488,7 +1488,7 @@ rekey_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct CadetTunnel *t = cls;
- t->rekey_task = GNUNET_SCHEDULER_NO_TASK;
+ t->rekey_task = NULL;
LOG (GNUNET_ERROR_TYPE_INFO, "Re-key Tunnel %s\n", GCT_2s (t));
if (NULL != tc && 0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
@@ -1571,7 +1571,7 @@ rekey_iterator (void *cls,
long n = (long) cls;
uint32_t r;
- if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task)
+ if (NULL != t->rekey_task)
return GNUNET_YES;
if (GNUNET_YES == GCT_is_loopback (t))
@@ -1599,7 +1599,7 @@ rekey (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_TIME_Absolute time;
long n;
- rekey_task = GNUNET_SCHEDULER_NO_TASK;
+ rekey_task = NULL;
if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
return;
@@ -1949,7 +1949,7 @@ handle_ephemeral (struct CadetTunnel *t,
{
GCT_change_estate (t, CADET_TUNNEL_KEY_REKEY);
}
- if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task)
+ if (NULL != t->rekey_task)
GNUNET_SCHEDULER_cancel (t->rekey_task);
t->rekey_task = GNUNET_SCHEDULER_add_now (rekey_tunnel, t);
}
@@ -1987,7 +1987,7 @@ handle_pong (struct CadetTunnel *t,
uint32_t challenge;
LOG (GNUNET_ERROR_TYPE_INFO, "<=== PONG for %s\n", GCT_2s (t));
- if (GNUNET_SCHEDULER_NO_TASK == t->rekey_task)
+ if (NULL == t->rekey_task)
{
GNUNET_STATISTICS_update (stats, "# duplicate PONG messages", 1, GNUNET_NO);
return;
@@ -2008,7 +2008,7 @@ handle_pong (struct CadetTunnel *t,
return;
}
GNUNET_SCHEDULER_cancel (t->rekey_task);
- t->rekey_task = GNUNET_SCHEDULER_NO_TASK;
+ t->rekey_task = NULL;
/* Don't free the old keys right away, but after a delay.
* Rationale: the KX could have happened over a very fast connection,
@@ -2223,10 +2223,10 @@ GCT_init (const struct GNUNET_CONFIGURATION_Handle *c,
void
GCT_shutdown (void)
{
- if (GNUNET_SCHEDULER_NO_TASK != rekey_task)
+ if (NULL != rekey_task)
{
GNUNET_SCHEDULER_cancel (rekey_task);
- rekey_task = GNUNET_SCHEDULER_NO_TASK;
+ rekey_task = NULL;
}
GNUNET_CONTAINER_multipeermap_iterate (tunnels, &destroy_iterator, NULL);
GNUNET_CONTAINER_multipeermap_destroy (tunnels);
@@ -2285,7 +2285,7 @@ GCT_change_cstate (struct CadetTunnel* t, enum CadetTunnelCState cstate)
else if (CADET_TUNNEL_KEY_UNINITIALIZED == t->estate)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " cstate triggered rekey\n");
- if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task)
+ if (NULL != t->rekey_task)
GNUNET_SCHEDULER_cancel (t->rekey_task);
create_kx_ctx (t);
rekey_tunnel (t, NULL);
@@ -2347,7 +2347,7 @@ trim_connections (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct CadetTunnel *t = cls;
- t->trim_connections_task = GNUNET_SCHEDULER_NO_TASK;
+ t->trim_connections_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -2409,7 +2409,7 @@ GCT_add_connection (struct CadetTunnel *t, struct CadetConnection *c)
if (CADET_TUNNEL_SEARCHING == t->cstate)
GCT_change_estate (t, CADET_TUNNEL_WAITING);
- if (GNUNET_SCHEDULER_NO_TASK != t->trim_connections_task)
+ if (NULL != t->trim_connections_task)
t->trim_connections_task = GNUNET_SCHEDULER_add_now (&trim_connections, t);
}
@@ -2442,7 +2442,7 @@ GCT_remove_connection (struct CadetTunnel *t,
conns = GCT_count_connections (t);
if (0 == conns
- && GNUNET_SCHEDULER_NO_TASK == t->destroy_task
+ && NULL == t->destroy_task
&& CADET_TUNNEL_SHUTDOWN != t->cstate
&& GNUNET_NO == shutting_down)
{
@@ -2454,7 +2454,7 @@ GCT_remove_connection (struct CadetTunnel *t,
/* Start new connections if needed */
if (CONNECTIONS_PER_TUNNEL > conns
- && GNUNET_SCHEDULER_NO_TASK == t->destroy_task
+ && NULL == t->destroy_task
&& CADET_TUNNEL_SHUTDOWN != t->cstate
&& GNUNET_NO == shutting_down)
{
@@ -2501,10 +2501,10 @@ GCT_add_channel (struct CadetTunnel *t, struct CadetChannel *ch)
LOG (GNUNET_ERROR_TYPE_DEBUG, " adding %p to %p\n", aux, t->channel_head);
GNUNET_CONTAINER_DLL_insert_tail (t->channel_head, t->channel_tail, aux);
- if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task)
+ if (NULL != t->destroy_task)
{
GNUNET_SCHEDULER_cancel (t->destroy_task);
- t->destroy_task = GNUNET_SCHEDULER_NO_TASK;
+ t->destroy_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG, " undo destroy!\n");
}
}
@@ -2585,7 +2585,7 @@ delayed_destroy (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
"Tunnel at %p should have been freed by GCT_shutdown\n", t);
return;
}
- t->destroy_task = GNUNET_SCHEDULER_NO_TASK;
+ t->destroy_task = NULL;
t->cstate = CADET_TUNNEL_SHUTDOWN;
for (iter = t->connection_head; NULL != iter; iter = iter->next)
@@ -2609,7 +2609,7 @@ GCT_destroy_empty (struct CadetTunnel *t)
if (GNUNET_YES == shutting_down)
return; /* Will be destroyed immediately anyway */
- if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task)
+ if (NULL != t->destroy_task)
{
LOG (GNUNET_ERROR_TYPE_WARNING,
"Tunnel %s is already scheduled for destruction. Tunnel debug dump:\n",
@@ -2690,32 +2690,32 @@ GCT_destroy (struct CadetTunnel *t)
/* Should only happen on shutdown, but it's ok. */
}
- if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task)
+ if (NULL != t->destroy_task)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "cancelling dest: %llX\n", t->destroy_task);
GNUNET_SCHEDULER_cancel (t->destroy_task);
- t->destroy_task = GNUNET_SCHEDULER_NO_TASK;
+ t->destroy_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != t->trim_connections_task)
+ if (NULL != t->trim_connections_task)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "cancelling trim: %llX\n",
t->trim_connections_task);
GNUNET_SCHEDULER_cancel (t->trim_connections_task);
- t->trim_connections_task = GNUNET_SCHEDULER_NO_TASK;
+ t->trim_connections_task = NULL;
}
GNUNET_STATISTICS_update (stats, "# tunnels", -1, GNUNET_NO);
GCP_set_tunnel (t->peer, NULL);
- if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task)
+ if (NULL != t->rekey_task)
{
GNUNET_SCHEDULER_cancel (t->rekey_task);
- t->rekey_task = GNUNET_SCHEDULER_NO_TASK;
+ t->rekey_task = NULL;
}
if (NULL != t->kx_ctx)
{
- if (GNUNET_SCHEDULER_NO_TASK != t->kx_ctx->finish_task)
+ if (NULL != t->kx_ctx->finish_task)
GNUNET_SCHEDULER_cancel (t->kx_ctx->finish_task);
GNUNET_free (t->kx_ctx);
}
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;
/**
* Task called to disconnect peers.
*/
-static GNUNET_SCHEDULER_TaskIdentifier disconnect_task;
+static struct GNUNET_SCHEDULER_Task * disconnect_task;
/**
* Task To perform tests
*/
-static GNUNET_SCHEDULER_TaskIdentifier test_task;
+static struct GNUNET_SCHEDULER_Task * test_task;
/**
* Task called to shutdown test.
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
+static struct GNUNET_SCHEDULER_Task * shutdown_handle;
/**
* Cadet handle for the root peer
@@ -254,7 +254,7 @@ static void
shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending test.\n");
- shutdown_handle = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_handle = NULL;
}
@@ -278,7 +278,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"disconnecting cadet service of peers, called from line %ld\n",
line);
- disconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ disconnect_task = NULL;
for (i = 0; i < 2; i++)
{
GNUNET_TESTBED_operation_done (t_op[i]);
@@ -294,7 +294,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
incoming_ch = NULL;
}
GNUNET_CADET_TEST_cleanup (test_ctx);
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle)
+ if (NULL != shutdown_handle)
{
GNUNET_SCHEDULER_cancel (shutdown_handle);
}
@@ -310,7 +310,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
static void
abort_test (long line)
{
- if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (disconnect_task != NULL)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
@@ -474,7 +474,7 @@ data_callback (void *cls, struct GNUNET_CADET_Channel *channel,
if ((ok % 20) == 0)
{
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " reschedule timeout\n");
GNUNET_SCHEDULER_cancel (disconnect_task);
@@ -573,7 +573,7 @@ data_callback (void *cls, struct GNUNET_CADET_Channel *channel,
}
}
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_delayed (SHORT_TIME,
@@ -604,7 +604,7 @@ stats_cont (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg)
ok--;
GNUNET_TESTBED_operation_done (stats_op);
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
(void *) __LINE__);
@@ -657,7 +657,7 @@ check_keepalives (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
return;
- disconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ disconnect_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "check keepalives\n");
GNUNET_CADET_channel_destroy (ch);
stats_op = GNUNET_TESTBED_get_statistics (peers_running, testbed_peers,
@@ -705,7 +705,7 @@ incoming_channel (void *cls, struct GNUNET_CADET_Channel *channel,
"Incoming channel for unknown client %lu\n", (long) cls);
GNUNET_break(0);
}
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
if (KEEPALIVE == test)
@@ -761,7 +761,7 @@ channel_cleaner (void *cls, const struct GNUNET_CADET_Channel *channel,
"Unknown peer! %d\n", i);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
@@ -791,7 +791,7 @@ do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test_task\n");
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
}
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;
static int got_data = GNUNET_NO;
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
static struct GNUNET_CADET_TransmitHandle *mth;
@@ -66,7 +66,7 @@ static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n");
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
{
GNUNET_SCHEDULER_cancel (abort_task);
}
@@ -95,11 +95,11 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ABORT\n");
result = GNUNET_SYSERR;
- abort_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ abort_task = NULL;
+ if (NULL != shutdown_task)
{
GNUNET_SCHEDULER_cancel (shutdown_task);
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task = NULL;
}
do_shutdown (cls, tc);
}
@@ -123,7 +123,7 @@ data_callback (void *cls, struct GNUNET_CADET_Channel *channel,
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Data callback! Shutting down.\n");
got_data = GNUNET_YES;
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ if (NULL != shutdown_task)
GNUNET_SCHEDULER_cancel (shutdown_task);
shutdown_task =
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;
static int result;
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
static unsigned int repetition;
@@ -62,7 +62,7 @@ static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n");
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
{
GNUNET_SCHEDULER_cancel (abort_task);
}
@@ -92,11 +92,11 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ABORT\n");
result = GNUNET_SYSERR;
- abort_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ abort_task = NULL;
+ if (NULL != shutdown_task)
{
GNUNET_SCHEDULER_cancel (shutdown_task);
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task = NULL;
}
do_shutdown (cls, tc);
}
@@ -105,7 +105,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
finish (void)
{
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ if (NULL != shutdown_task)
GNUNET_SCHEDULER_cancel (shutdown_task);
shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
&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
/**
* Timeout task identifier for the current round or subround.
*/
- GNUNET_SCHEDULER_TaskIdentifier round_timeout_tid;
+ struct GNUNET_SCHEDULER_Task * round_timeout_tid;
/**
* Number of other peers in the consensus.
@@ -440,12 +440,12 @@ round_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "P%d: round over\n", session->local_peer_idx);
if (tc != NULL)
- session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK;
+ session->round_timeout_tid = NULL;
- if (session->round_timeout_tid != GNUNET_SCHEDULER_NO_TASK)
+ if (session->round_timeout_tid != NULL)
{
GNUNET_SCHEDULER_cancel (session->round_timeout_tid);
- session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK;
+ session->round_timeout_tid = NULL;
}
for (i = 0; i < session->num_peers; i++)
@@ -726,16 +726,16 @@ subround_over (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (tc != NULL)
{
- session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK;
+ session->round_timeout_tid = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "P%u: consensus subround timed out\n",
session->local_peer_idx);
}
/* cancel timeout */
- if (session->round_timeout_tid != GNUNET_SCHEDULER_NO_TASK)
+ if (session->round_timeout_tid != NULL)
{
GNUNET_SCHEDULER_cancel (session->round_timeout_tid);
- session->round_timeout_tid = GNUNET_SCHEDULER_NO_TASK;
+ session->round_timeout_tid = NULL;
}
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;
/**
* Task scheduled to switch from recording to playback.
*/
-static GNUNET_SCHEDULER_TaskIdentifier switch_task;
+static struct GNUNET_SCHEDULER_Task * switch_task;
/**
* The shutdown task.
*/
-static GNUNET_SCHEDULER_TaskIdentifier st;
+static struct GNUNET_SCHEDULER_Task * st;
/**
* Head of DLL with recorded frames.
@@ -104,7 +104,7 @@ do_shutdown (void *cls,
{
struct Recording *rec;
- if (GNUNET_SCHEDULER_NO_TASK != switch_task)
+ if (NULL != switch_task)
GNUNET_SCHEDULER_cancel (switch_task);
if (NULL != microphone)
GNUNET_MICROPHONE_destroy (microphone);
@@ -134,7 +134,7 @@ switch_to_speaker (void *cls,
{
struct Recording *rec;
- switch_task = GNUNET_SCHEDULER_NO_TASK;
+ switch_task = NULL;
microphone->disable_microphone (microphone->cls);
if (GNUNET_OK !=
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;
/**
* Task which handles the commands
*/
-static GNUNET_SCHEDULER_TaskIdentifier handle_cmd_task;
+static struct GNUNET_SCHEDULER_Task * handle_cmd_task;
/**
* Our speaker.
@@ -1036,10 +1036,10 @@ do_stop_task (void *cls,
GNUNET_CONVERSATION_phone_destroy (phone);
phone = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != handle_cmd_task)
+ if (NULL != handle_cmd_task)
{
GNUNET_SCHEDULER_cancel (handle_cmd_task);
- handle_cmd_task = GNUNET_SCHEDULER_NO_TASK;
+ handle_cmd_task = NULL;
}
if (NULL != id)
{
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;
static void *call_rdc_cls;
-static GNUNET_SCHEDULER_TaskIdentifier phone_task;
+static struct GNUNET_SCHEDULER_Task * phone_task;
-static GNUNET_SCHEDULER_TaskIdentifier call_task;
+static struct GNUNET_SCHEDULER_Task * call_task;
static void
@@ -229,14 +229,14 @@ disable_mic (void *cls)
phone_rdc = NULL;
phone_rdc_cls = NULL;
GNUNET_SCHEDULER_cancel (phone_task);
- phone_task = GNUNET_SCHEDULER_NO_TASK;
+ phone_task = NULL;
}
else
{
call_rdc = NULL;
call_rdc_cls = NULL;
GNUNET_SCHEDULER_cancel (call_task);
- call_task = GNUNET_SCHEDULER_NO_TASK;
+ call_task = NULL;
}
}
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;
static void *phone_rdc_cls;
-static GNUNET_SCHEDULER_TaskIdentifier phone_task;
+static struct GNUNET_SCHEDULER_Task * phone_task;
/**
* Variable for recognizing caller1
@@ -114,7 +114,7 @@ struct MicContext
void *rdc_cls;
- GNUNET_SCHEDULER_TaskIdentifier call_task;
+ struct GNUNET_SCHEDULER_Task * call_task;
};
@@ -268,14 +268,14 @@ enable_mic (void *cls,
{
phone_rdc = rdc;
phone_rdc_cls = rdc_cls;
- GNUNET_break (GNUNET_SCHEDULER_NO_TASK == phone_task);
+ GNUNET_break (NULL == phone_task);
phone_task = GNUNET_SCHEDULER_add_now (&phone_send, NULL);
return GNUNET_OK;
}
mc = (CALLER1 == cls) ? &call1_mic_ctx : &call2_mic_ctx;
mc->rdc = rdc;
mc->rdc_cls = rdc_cls;
- GNUNET_break (GNUNET_SCHEDULER_NO_TASK == mc->call_task);
+ GNUNET_break (NULL == mc->call_task);
mc->call_task = GNUNET_SCHEDULER_add_now (&call_send, mc);
return GNUNET_OK;
}
@@ -294,14 +294,14 @@ disable_mic (void *cls)
phone_rdc = NULL;
phone_rdc_cls = NULL;
GNUNET_SCHEDULER_cancel (phone_task);
- phone_task = GNUNET_SCHEDULER_NO_TASK;
+ phone_task = NULL;
return;
}
mc = (CALLER1 == cls) ? &call1_mic_ctx : &call2_mic_ctx;
mc->rdc = NULL;
mc->rdc_cls = NULL;
GNUNET_SCHEDULER_cancel (mc->call_task);
- mc->call_task = GNUNET_SCHEDULER_NO_TASK;
+ mc->call_task = NULL;
}
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
* ID of timeout task for the 'pending_head' handle
* which is the one with the smallest timeout.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* ID of task to run 'next_request_transmission'.
*/
- GNUNET_SCHEDULER_TaskIdentifier ntr_task;
+ struct GNUNET_SCHEDULER_Task * ntr_task;
/**
* SendMessageRequest ID generator for this peer.
@@ -289,7 +289,7 @@ struct GNUNET_CORE_Handle
/**
* ID of reconnect task (if any).
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Current delay we use for re-trying to connect to core.
@@ -344,7 +344,7 @@ reconnect_task (void *cls,
{
struct GNUNET_CORE_Handle *h = cls;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Connecting to CORE service after delay\n");
reconnect (h);
@@ -369,15 +369,15 @@ disconnect_and_free_peer_entry (void *cls,
struct GNUNET_CORE_TransmitHandle *th;
struct PeerRecord *pr = value;
- if (GNUNET_SCHEDULER_NO_TASK != pr->timeout_task)
+ if (NULL != pr->timeout_task)
{
GNUNET_SCHEDULER_cancel (pr->timeout_task);
- pr->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->timeout_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pr->ntr_task)
+ if (NULL != pr->ntr_task)
{
GNUNET_SCHEDULER_cancel (pr->ntr_task);
- pr->ntr_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->ntr_task = NULL;
}
if ( (NULL != pr->prev) ||
(NULL != pr->next) ||
@@ -401,8 +401,8 @@ disconnect_and_free_peer_entry (void *cls,
GNUNET_assert (GNUNET_YES ==
GNUNET_CONTAINER_multipeermap_remove (h->peers, key, pr));
GNUNET_assert (pr->ch == h);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pr->timeout_task);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pr->ntr_task);
+ GNUNET_assert (NULL == pr->timeout_task);
+ GNUNET_assert (NULL == pr->ntr_task);
GNUNET_free (pr);
return GNUNET_YES;
}
@@ -420,7 +420,7 @@ reconnect_later (struct GNUNET_CORE_Handle *h)
struct ControlMessage *cm;
struct PeerRecord *pr;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task);
+ GNUNET_assert (NULL == h->reconnect_task);
if (NULL != h->cth)
{
GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth);
@@ -432,7 +432,7 @@ reconnect_later (struct GNUNET_CORE_Handle *h)
h->client = NULL;
}
h->currently_down = GNUNET_YES;
- GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK);
+ GNUNET_assert (h->reconnect_task == NULL);
h->reconnect_task =
GNUNET_SCHEDULER_add_delayed (h->retry_backoff,
&reconnect_task, h);
@@ -496,10 +496,10 @@ request_next_transmission (struct PeerRecord *pr)
struct SendMessageRequest *smr;
struct GNUNET_CORE_TransmitHandle *th;
- if (pr->timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (pr->timeout_task != NULL)
{
GNUNET_SCHEDULER_cancel (pr->timeout_task);
- pr->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->timeout_task = NULL;
}
th = &pr->th;
if (NULL == th->peer)
@@ -552,11 +552,11 @@ transmission_timeout (void *cls,
struct GNUNET_CORE_Handle *h = pr->ch;
struct GNUNET_CORE_TransmitHandle *th;
- pr->timeout_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != pr->ntr_task)
+ pr->timeout_task = NULL;
+ if (NULL != pr->ntr_task)
{
GNUNET_SCHEDULER_cancel (pr->ntr_task);
- pr->ntr_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->ntr_task = NULL;
}
th = &pr->th;
th->peer = NULL;
@@ -609,7 +609,7 @@ transmit_message (void *cls,
uint16_t msize;
size_t ret;
- GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK);
+ GNUNET_assert (h->reconnect_task == NULL);
h->cth = NULL;
if (NULL == buf)
{
@@ -657,10 +657,10 @@ transmit_message (void *cls,
h->ready_peer_tail,
pr);
th->peer = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != pr->timeout_task)
+ if (NULL != pr->timeout_task)
{
GNUNET_SCHEDULER_cancel (pr->timeout_task);
- pr->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->timeout_task = NULL;
}
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Transmitting SEND request to `%s' with %u bytes.\n",
@@ -1083,7 +1083,7 @@ init_done_task (void *cls, int success)
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Failed to exchange INIT with core, retrying\n");
- if (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK)
+ if (h->reconnect_task == NULL)
reconnect_later (h);
return;
}
@@ -1259,10 +1259,10 @@ GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle)
GNUNET_CONTAINER_multipeermap_iterate (handle->peers,
&disconnect_and_free_peer_entry,
handle);
- if (handle->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (handle->reconnect_task != NULL)
{
GNUNET_SCHEDULER_cancel (handle->reconnect_task);
- handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ handle->reconnect_task = NULL;
}
GNUNET_CONTAINER_multipeermap_destroy (handle->peers);
handle->peers = NULL;
@@ -1283,7 +1283,7 @@ run_request_next_transmission (void *cls,
{
struct PeerRecord *pr = cls;
- pr->ntr_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->ntr_task = NULL;
request_next_transmission (pr);
}
@@ -1361,7 +1361,7 @@ GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle,
th->priority = priority;
th->msize = notify_size;
th->cork = cork;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pr->ntr_task);
+ GNUNET_assert (NULL == pr->ntr_task);
pr->ntr_task =
GNUNET_SCHEDULER_add_now (&run_request_next_transmission, pr);
LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1409,10 +1409,10 @@ GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle *th)
h->ready_peer_tail,
pr);
}
- if (GNUNET_SCHEDULER_NO_TASK != pr->ntr_task)
+ if (NULL != pr->ntr_task)
{
GNUNET_SCHEDULER_cancel (pr->ntr_task);
- pr->ntr_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->ntr_task = NULL;
}
}
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
/**
* ID of task used for re-trying SET_KEY and PING message.
*/
- GNUNET_SCHEDULER_TaskIdentifier retry_set_key_task;
+ struct GNUNET_SCHEDULER_Task * retry_set_key_task;
/**
* ID of task used for sending keep-alive pings.
*/
- GNUNET_SCHEDULER_TaskIdentifier keep_alive_task;
+ struct GNUNET_SCHEDULER_Task * keep_alive_task;
/**
* Bit map indicating which of the 32 sequence numbers before the last
@@ -373,7 +373,7 @@ static struct GSC_KeyExchangeInfo *kx_tail;
* Task scheduled for periodic re-generation (and thus rekeying) of our
* ephemeral key.
*/
-static GNUNET_SCHEDULER_TaskIdentifier rekey_task;
+static struct GNUNET_SCHEDULER_Task * rekey_task;
/**
* Notification context for all monitors.
@@ -651,7 +651,7 @@ set_key_retry_task (void *cls,
{
struct GSC_KeyExchangeInfo *kx = cls;
- kx->retry_set_key_task = GNUNET_SCHEDULER_NO_TASK;
+ kx->retry_set_key_task = NULL;
kx->set_key_retry_frequency = GNUNET_TIME_STD_BACKOFF (kx->set_key_retry_frequency);
GNUNET_assert (GNUNET_CORE_KX_STATE_DOWN != kx->status);
send_key (kx);
@@ -746,15 +746,15 @@ GSC_KX_stop (struct GSC_KeyExchangeInfo *kx)
GSC_SESSIONS_end (&kx->peer);
GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# key exchanges stopped"),
1, GNUNET_NO);
- if (kx->retry_set_key_task != GNUNET_SCHEDULER_NO_TASK)
+ if (kx->retry_set_key_task != NULL)
{
GNUNET_SCHEDULER_cancel (kx->retry_set_key_task);
- kx->retry_set_key_task = GNUNET_SCHEDULER_NO_TASK;
+ kx->retry_set_key_task = NULL;
}
- if (kx->keep_alive_task != GNUNET_SCHEDULER_NO_TASK)
+ if (kx->keep_alive_task != NULL)
{
GNUNET_SCHEDULER_cancel (kx->keep_alive_task);
- kx->keep_alive_task = GNUNET_SCHEDULER_NO_TASK;
+ kx->keep_alive_task = NULL;
}
kx->status = GNUNET_CORE_KX_PEER_DISCONNECT;
monitor_notify_all (kx);
@@ -929,7 +929,7 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx,
switch (kx->status)
{
case GNUNET_CORE_KX_STATE_DOWN:
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == kx->keep_alive_task);
+ GNUNET_assert (NULL == kx->keep_alive_task);
kx->status = GNUNET_CORE_KX_STATE_KEY_RECEIVED;
monitor_notify_all (kx);
if (GNUNET_CORE_KX_STATE_KEY_SENT == sender_status)
@@ -937,7 +937,7 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx,
send_ping (kx);
break;
case GNUNET_CORE_KX_STATE_KEY_SENT:
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == kx->keep_alive_task);
+ GNUNET_assert (NULL == kx->keep_alive_task);
kx->status = GNUNET_CORE_KX_STATE_KEY_RECEIVED;
monitor_notify_all (kx);
if (GNUNET_CORE_KX_STATE_KEY_SENT == sender_status)
@@ -945,7 +945,7 @@ GSC_KX_handle_ephemeral_key (struct GSC_KeyExchangeInfo *kx,
send_ping (kx);
break;
case GNUNET_CORE_KX_STATE_KEY_RECEIVED:
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == kx->keep_alive_task);
+ GNUNET_assert (NULL == kx->keep_alive_task);
if (GNUNET_CORE_KX_STATE_KEY_SENT == sender_status)
send_key (kx);
send_ping (kx);
@@ -1069,7 +1069,7 @@ send_keep_alive (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_TIME_Relative retry;
struct GNUNET_TIME_Relative left;
- kx->keep_alive_task = GNUNET_SCHEDULER_NO_TASK;
+ kx->keep_alive_task = NULL;
left = GNUNET_TIME_absolute_get_remaining (kx->timeout);
if (0 == left.rel_value_us)
{
@@ -1122,7 +1122,7 @@ update_timeout (struct GSC_KeyExchangeInfo *kx)
are bigger than the threshold (5s) */
monitor_notify_all (kx);
}
- if (kx->keep_alive_task != GNUNET_SCHEDULER_NO_TASK)
+ if (kx->keep_alive_task != NULL)
GNUNET_SCHEDULER_cancel (kx->keep_alive_task);
kx->keep_alive_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide
@@ -1213,10 +1213,10 @@ GSC_KX_handle_pong (struct GSC_KeyExchangeInfo *kx,
"Received PONG from `%s'\n",
GNUNET_i2s (&kx->peer));
/* no need to resend key any longer */
- if (GNUNET_SCHEDULER_NO_TASK != kx->retry_set_key_task)
+ if (NULL != kx->retry_set_key_task)
{
GNUNET_SCHEDULER_cancel (kx->retry_set_key_task);
- kx->retry_set_key_task = GNUNET_SCHEDULER_NO_TASK;
+ kx->retry_set_key_task = NULL;
}
switch (kx->status)
{
@@ -1234,7 +1234,7 @@ GSC_KX_handle_pong (struct GSC_KeyExchangeInfo *kx,
kx->status = GNUNET_CORE_KX_STATE_UP;
monitor_notify_all (kx);
GSC_SESSIONS_create (&kx->peer, kx);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == kx->keep_alive_task);
+ GNUNET_assert (NULL == kx->keep_alive_task);
update_timeout (kx);
break;
case GNUNET_CORE_KX_STATE_UP:
@@ -1269,10 +1269,10 @@ static void
send_key (struct GSC_KeyExchangeInfo *kx)
{
GNUNET_assert (GNUNET_CORE_KX_STATE_DOWN != kx->status);
- if (GNUNET_SCHEDULER_NO_TASK != kx->retry_set_key_task)
+ if (NULL != kx->retry_set_key_task)
{
GNUNET_SCHEDULER_cancel (kx->retry_set_key_task);
- kx->retry_set_key_task = GNUNET_SCHEDULER_NO_TASK;
+ kx->retry_set_key_task = NULL;
}
/* always update sender status in SET KEY message */
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1402,10 +1402,10 @@ GSC_KX_handle_encrypted_message (struct GSC_KeyExchangeInfo *kx,
gettext_noop ("# sessions terminated by key expiration"),
1, GNUNET_NO);
GSC_SESSIONS_end (&kx->peer);
- if (GNUNET_SCHEDULER_NO_TASK != kx->keep_alive_task)
+ if (NULL != kx->keep_alive_task)
{
GNUNET_SCHEDULER_cancel (kx->keep_alive_task);
- kx->keep_alive_task = GNUNET_SCHEDULER_NO_TASK;
+ kx->keep_alive_task = NULL;
}
kx->status = GNUNET_CORE_KX_STATE_KEY_SENT;
monitor_notify_all (kx);
@@ -1684,10 +1684,10 @@ GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk,
void
GSC_KX_done ()
{
- if (GNUNET_SCHEDULER_NO_TASK != rekey_task)
+ if (NULL != rekey_task)
{
GNUNET_SCHEDULER_cancel (rekey_task);
- rekey_task = GNUNET_SCHEDULER_NO_TASK;
+ rekey_task = NULL;
}
if (NULL != my_ephemeral_key)
{
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
/**
* ID of task used for re-trying plaintext scheduling.
*/
- GNUNET_SCHEDULER_TaskIdentifier retry_plaintext_task;
+ struct GNUNET_SCHEDULER_Task * retry_plaintext_task;
/**
* #GNUNET_YES if this peer currently has excess bandwidth.
@@ -172,10 +172,10 @@ free_neighbour (struct Neighbour *n)
GSC_KX_stop (n->kxinfo);
n->kxinfo = NULL;
}
- if (n->retry_plaintext_task != GNUNET_SCHEDULER_NO_TASK)
+ if (n->retry_plaintext_task != NULL)
{
GNUNET_SCHEDULER_cancel (n->retry_plaintext_task);
- n->retry_plaintext_task = GNUNET_SCHEDULER_NO_TASK;
+ n->retry_plaintext_task = NULL;
}
GNUNET_assert (GNUNET_OK ==
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
/**
* Task to transmit corked messages with a delay.
*/
- GNUNET_SCHEDULER_TaskIdentifier cork_task;
+ struct GNUNET_SCHEDULER_Task * cork_task;
/**
* Task to transmit our type map.
*/
- GNUNET_SCHEDULER_TaskIdentifier typemap_task;
+ struct GNUNET_SCHEDULER_Task * typemap_task;
/**
* Retransmission delay we currently use for the typemap
@@ -213,10 +213,10 @@ GSC_SESSIONS_end (const struct GNUNET_PeerIdentity *pid)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Destroying session for peer `%4s'\n",
GNUNET_i2s (&session->peer));
- if (GNUNET_SCHEDULER_NO_TASK != session->cork_task)
+ if (NULL != session->cork_task)
{
GNUNET_SCHEDULER_cancel (session->cork_task);
- session->cork_task = GNUNET_SCHEDULER_NO_TASK;
+ session->cork_task = NULL;
}
while (NULL != (car = session->active_client_request_head))
{
@@ -231,10 +231,10 @@ GSC_SESSIONS_end (const struct GNUNET_PeerIdentity *pid)
sme);
GNUNET_free (sme);
}
- if (GNUNET_SCHEDULER_NO_TASK != session->typemap_task)
+ if (NULL != session->typemap_task)
{
GNUNET_SCHEDULER_cancel (session->typemap_task);
- session->typemap_task = GNUNET_SCHEDULER_NO_TASK;
+ session->typemap_task = NULL;
}
GSC_CLIENTS_notify_clients_about_neighbour (&session->peer,
session->tmap, NULL);
@@ -291,7 +291,7 @@ transmit_typemap_task (void *cls,
static void
start_typemap_task (struct Session *session)
{
- if (GNUNET_SCHEDULER_NO_TASK != session->typemap_task)
+ if (NULL != session->typemap_task)
GNUNET_SCHEDULER_cancel (session->typemap_task);
session->typemap_delay = GNUNET_TIME_UNIT_SECONDS;
session->typemap_task =
@@ -395,10 +395,10 @@ GSC_SESSIONS_confirm_typemap (const struct GNUNET_PeerIdentity *peer,
1, GNUNET_NO);
return;
}
- if (GNUNET_SCHEDULER_NO_TASK != session->typemap_task)
+ if (NULL != session->typemap_task)
{
GNUNET_SCHEDULER_cancel (session->typemap_task);
- session->typemap_task = GNUNET_SCHEDULER_NO_TASK;
+ session->typemap_task = NULL;
}
GNUNET_STATISTICS_update (GSC_stats,
gettext_noop
@@ -606,7 +606,7 @@ pop_cork_task (void *cls,
{
struct Session *session = cls;
- session->cork_task = GNUNET_SCHEDULER_NO_TASK;
+ session->cork_task = NULL;
try_transmission (session);
}
@@ -720,7 +720,7 @@ try_transmission (struct Session *session)
"Corking until %s\n",
GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_remaining (min_deadline),
GNUNET_YES));
- if (GNUNET_SCHEDULER_NO_TASK != session->cork_task)
+ if (NULL != session->cork_task)
GNUNET_SCHEDULER_cancel (session->cork_task);
session->cork_task =
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;
static struct PeerContext p2;
-static GNUNET_SCHEDULER_TaskIdentifier err_task;
+static struct GNUNET_SCHEDULER_Task * err_task;
-static GNUNET_SCHEDULER_TaskIdentifier con_task;
+static struct GNUNET_SCHEDULER_Task * con_task;
static int ok;
@@ -88,10 +88,10 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
p1.th = NULL;
GNUNET_TRANSPORT_disconnect (p2.th);
p2.th = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != con_task)
+ if (NULL != con_task)
{
GNUNET_SCHEDULER_cancel (con_task);
- con_task = GNUNET_SCHEDULER_NO_TASK;
+ con_task = NULL;
}
ok = 0;
}
@@ -125,10 +125,10 @@ terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_TRANSPORT_disconnect (p2.th);
p2.th = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != con_task)
+ if (NULL != con_task)
{
GNUNET_SCHEDULER_cancel (con_task);
- con_task = GNUNET_SCHEDULER_NO_TASK;
+ con_task = NULL;
}
ok = 42;
}
@@ -162,10 +162,10 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Encrypted connection established to peer `%4s'\n",
GNUNET_i2s (peer));
- if (GNUNET_SCHEDULER_NO_TASK != con_task)
+ if (NULL != con_task)
{
GNUNET_SCHEDULER_cancel (con_task);
- con_task = GNUNET_SCHEDULER_NO_TASK;
+ con_task = NULL;
}
pc->connect_status = 1;
if (pc == &p1)
@@ -250,7 +250,7 @@ connect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
- con_task = GNUNET_SCHEDULER_NO_TASK;
+ con_task = NULL;
return;
}
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;
static struct GNUNET_TIME_Absolute start_time;
-static GNUNET_SCHEDULER_TaskIdentifier err_task;
+static struct GNUNET_SCHEDULER_Task * err_task;
-static GNUNET_SCHEDULER_TaskIdentifier connect_task;
+static struct GNUNET_SCHEDULER_Task * connect_task;
struct PeerContext
@@ -119,7 +119,7 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_CORE_disconnect (p2.ch);
p2.ch = NULL;
GNUNET_free_non_null (p2.hello);
- if (connect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (connect_task != NULL)
GNUNET_SCHEDULER_cancel (connect_task);
GNUNET_TRANSPORT_disconnect (p1.th);
p1.th = NULL;
@@ -148,7 +148,7 @@ terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_CORE_disconnect (p2.ch);
p2.ch = NULL;
}
- if (connect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (connect_task != NULL)
GNUNET_SCHEDULER_cancel (connect_task);
if (p1.th != NULL)
{
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;
/**
* Handle to the cleanup task.
*/
-GNUNET_SCHEDULER_TaskIdentifier die_task;
+struct GNUNET_SCHEDULER_Task * die_task;
/**
* Identity of this peer.
@@ -57,7 +57,7 @@ struct GNUNET_CORE_Handle *core;
static void
cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tskctx)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
if (core != NULL)
{
@@ -73,7 +73,7 @@ static int
receive (void *cls, const struct GNUNET_PeerIdentity *other,
const struct GNUNET_MessageHeader *message)
{
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received message from peer %s\n",
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;
static struct PeerContext p2;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task_id;
+static struct GNUNET_SCHEDULER_Task * timeout_task_id;
static int ok;
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;
static struct GNUNET_TIME_Absolute start_time;
-static GNUNET_SCHEDULER_TaskIdentifier err_task;
+static struct GNUNET_SCHEDULER_Task * err_task;
-static GNUNET_SCHEDULER_TaskIdentifier measure_task;
+static struct GNUNET_SCHEDULER_Task * measure_task;
-static GNUNET_SCHEDULER_TaskIdentifier connect_task;
+static struct GNUNET_SCHEDULER_Task * connect_task;
struct PeerContext
@@ -118,7 +118,7 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_CORE_Handle *ch;
- err_task = GNUNET_SCHEDULER_NO_TASK;
+ err_task = NULL;
GNUNET_STATISTICS_destroy (p1.stats, GNUNET_NO);
GNUNET_STATISTICS_destroy (p2.stats, GNUNET_NO);
GNUNET_TRANSPORT_get_hello_cancel (p2.ghh);
@@ -128,10 +128,10 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_CORE_notify_transmit_ready_cancel (p1.nth);
p1.nth = NULL;
}
- if (connect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (connect_task != NULL)
{
GNUNET_SCHEDULER_cancel (connect_task);
- connect_task = GNUNET_SCHEDULER_NO_TASK;
+ connect_task = NULL;
}
ch = p1.ch;
p1.ch = NULL;
@@ -151,7 +151,7 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- err_task = GNUNET_SCHEDULER_NO_TASK;
+ err_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Testcase failed!\n");
@@ -161,12 +161,12 @@ terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_CORE_notify_transmit_ready_cancel (p1.nth);
p1.nth = NULL;
}
- if (measure_task != GNUNET_SCHEDULER_NO_TASK)
+ if (measure_task != NULL)
GNUNET_SCHEDULER_cancel (measure_task);
- if (connect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (connect_task != NULL)
{
GNUNET_SCHEDULER_cancel (connect_task);
- connect_task = GNUNET_SCHEDULER_NO_TASK;
+ connect_task = NULL;
}
GNUNET_TRANSPORT_get_hello_cancel (p1.ghh);
@@ -231,7 +231,7 @@ measurement_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
unsigned long long quota_delta;
enum GNUNET_ErrorType kind = GNUNET_ERROR_TYPE_DEBUG;
- measure_task = GNUNET_SCHEDULER_NO_TASK;
+ measure_task = NULL;
FPRINTF (stdout, "%s", "\n");
running = GNUNET_NO;
@@ -381,7 +381,7 @@ connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Asking core (1) for transmission to peer `%4s'\n",
GNUNET_i2s (&p2.id));
- if (err_task != GNUNET_SCHEDULER_NO_TASK)
+ if (err_task != NULL)
GNUNET_SCHEDULER_cancel (err_task);
err_task =
GNUNET_SCHEDULER_add_delayed (TIMEOUT, &terminate_task_error, NULL);
@@ -410,12 +410,12 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
if (0 == memcmp (&pc->id, peer, sizeof (struct GNUNET_PeerIdentity)))
return; /* loopback */
pc->connect_status = 0;
- if (GNUNET_SCHEDULER_NO_TASK != measure_task)
+ if (NULL != measure_task)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Measurement aborted due to disconnect!\n");
GNUNET_SCHEDULER_cancel (measure_task);
- measure_task = GNUNET_SCHEDULER_NO_TASK;
+ measure_task = NULL;
}
if (pc->nth != NULL)
{
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
/**
* Task for timeout signalling.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* Timeout for the current operation.
@@ -216,7 +216,7 @@ struct GNUNET_DATASTORE_Handle
/**
* Task for trying to reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* 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)
GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
- if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (h->reconnect_task != NULL)
{
GNUNET_SCHEDULER_cancel (h->reconnect_task);
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
}
while (NULL != (qe = h->queue_head))
{
@@ -393,7 +393,7 @@ timeout_queue_entry (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_STATISTICS_update (h->stats,
gettext_noop ("# queue entry timeouts"), 1,
GNUNET_NO);
- qe->task = GNUNET_SCHEDULER_NO_TASK;
+ qe->task = NULL;
GNUNET_assert (GNUNET_NO == qe->was_transmitted);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Timeout of request in datastore queue\n");
@@ -521,7 +521,7 @@ try_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_DATASTORE_Handle *h = cls;
h->retry_time = GNUNET_TIME_STD_BACKOFF (h->retry_time);
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
h->client = GNUNET_CLIENT_connect ("datastore", h->cfg);
if (h->client == NULL)
{
@@ -628,7 +628,7 @@ transmit_request (void *cls, size_t size, void *buf)
memcpy (buf, &qe[1], msize);
qe->was_transmitted = GNUNET_YES;
GNUNET_SCHEDULER_cancel (qe->task);
- qe->task = GNUNET_SCHEDULER_NO_TASK;
+ qe->task = NULL;
GNUNET_assert (GNUNET_NO == h->in_receive);
h->in_receive = GNUNET_YES;
GNUNET_CLIENT_receive (h->client, &receive_cb, h,
@@ -720,10 +720,10 @@ free_queue_entry (struct GNUNET_DATASTORE_QueueEntry *qe)
struct GNUNET_DATASTORE_Handle *h = qe->h;
GNUNET_CONTAINER_DLL_remove (h->queue_head, h->queue_tail, qe);
- if (qe->task != GNUNET_SCHEDULER_NO_TASK)
+ if (qe->task != NULL)
{
GNUNET_SCHEDULER_cancel (qe->task);
- qe->task = GNUNET_SCHEDULER_NO_TASK;
+ qe->task = NULL;
}
h->queue_size--;
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;
* Identity of the task that is used to delete
* expired content.
*/
-static GNUNET_SCHEDULER_TaskIdentifier expired_kill_task;
+static struct GNUNET_SCHEDULER_Task * expired_kill_task;
/**
* Minimum time that content should have to not be discarded instantly
@@ -381,7 +381,7 @@ expired_processor (void *cls,
static void
delete_expired (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- expired_kill_task = GNUNET_SCHEDULER_NO_TASK;
+ expired_kill_task = NULL;
plugin->api->get_expiration (plugin->api->cls, &expired_processor, NULL);
}
@@ -1423,10 +1423,10 @@ cleaning_task (void *cls,
GNUNET_free (tcc->msg);
GNUNET_free (tcc);
}
- if (expired_kill_task != GNUNET_SCHEDULER_NO_TASK)
+ if (expired_kill_task != NULL)
{
GNUNET_SCHEDULER_cancel (expired_kill_task);
- expired_kill_task = GNUNET_SCHEDULER_NO_TASK;
+ expired_kill_task = NULL;
}
if (GNUNET_YES == do_drop)
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
* Continuation to call when the request has been
* transmitted (for the first time) to the service; can be NULL.
*/
- GNUNET_SCHEDULER_Task cont;
+ GNUNET_SCHEDULER_TaskCallback cont;
/**
* Closure for 'cont'.
@@ -155,7 +155,7 @@ struct GNUNET_DHT_PutHandle
/**
* Timeout task for this operation.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Unique ID for the PUT operation.
@@ -345,7 +345,7 @@ struct GNUNET_DHT_Handle
/**
* Task for trying to reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* How quickly should we retry? Used for exponential back-off on
@@ -506,7 +506,7 @@ try_reconnect (void *cls,
LOG (GNUNET_ERROR_TYPE_DEBUG, "Reconnecting with DHT %p\n", handle);
handle->retry_time = GNUNET_TIME_STD_BACKOFF (handle->retry_time);
- handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ handle->reconnect_task = NULL;
if (GNUNET_YES != try_connect (handle))
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "dht reconnect failed(!)\n");
@@ -531,7 +531,7 @@ do_disconnect (struct GNUNET_DHT_Handle *handle)
if (NULL == handle->client)
return;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == handle->reconnect_task);
+ GNUNET_assert (NULL == handle->reconnect_task);
if (NULL != handle->th)
GNUNET_CLIENT_notify_transmit_ready_cancel (handle->th);
handle->th = NULL;
@@ -1126,7 +1126,7 @@ GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle)
GNUNET_CLIENT_disconnect (handle->client);
handle->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != handle->reconnect_task)
+ if (NULL != handle->reconnect_task)
GNUNET_SCHEDULER_cancel (handle->reconnect_task);
GNUNET_CONTAINER_multihashmap_destroy (handle->active_requests);
GNUNET_free (handle);
@@ -1146,7 +1146,7 @@ timeout_put_request (void *cls,
struct GNUNET_DHT_PutHandle *ph = cls;
struct GNUNET_DHT_Handle *handle = ph->dht_handle;
- ph->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ph->timeout_task = NULL;
if (NULL != ph->pending)
{
GNUNET_CONTAINER_DLL_remove (handle->pending_head, handle->pending_tail,
@@ -1283,10 +1283,10 @@ GNUNET_DHT_put_cancel (struct GNUNET_DHT_PutHandle *ph)
GNUNET_free (ph->pending);
ph->pending = NULL;
}
- if (ph->timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (ph->timeout_task != NULL)
{
GNUNET_SCHEDULER_cancel (ph->timeout_task);
- ph->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ph->timeout_task = NULL;
}
GNUNET_CONTAINER_DLL_remove (handle->put_head,
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;
/**
* Task that re-transmits requests (using retry_heap).
*/
-static GNUNET_SCHEDULER_TaskIdentifier retry_task;
+static struct GNUNET_SCHEDULER_Task * retry_task;
/**
@@ -459,7 +459,7 @@ transmit_next_request_task (void *cls,
struct ClientQueryRecord *cqr;
struct GNUNET_TIME_Relative delay;
- retry_task = GNUNET_SCHEDULER_NO_TASK;
+ retry_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
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,
GDS_NEIGHBOURS_get_id(),
&get->key);
/* start remote requests */
- if (GNUNET_SCHEDULER_NO_TASK != retry_task)
+ if (NULL != retry_task)
GNUNET_SCHEDULER_cancel (retry_task);
retry_task = GNUNET_SCHEDULER_add_now (&transmit_next_request_task, NULL);
/* perform local lookup */
@@ -1496,10 +1496,10 @@ GDS_CLIENTS_done ()
{
GNUNET_assert (client_head == NULL);
GNUNET_assert (client_tail == NULL);
- if (GNUNET_SCHEDULER_NO_TASK != retry_task)
+ if (NULL != retry_task)
{
GNUNET_SCHEDULER_cancel (retry_task);
- retry_task = GNUNET_SCHEDULER_NO_TASK;
+ retry_task = NULL;
}
if (NULL != retry_heap)
{
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
/**
* Task for scheduling preference updates
*/
- GNUNET_SCHEDULER_TaskIdentifier preference_task;
+ struct GNUNET_SCHEDULER_Task * preference_task;
/**
* What is the identity of the peer?
@@ -422,7 +422,7 @@ static unsigned int bucket_size = DEFAULT_BUCKET_SIZE;
/**
* Task that sends FIND PEER requests.
*/
-static GNUNET_SCHEDULER_TaskIdentifier find_peer_task;
+static struct GNUNET_SCHEDULER_Task * find_peer_task;
/**
* Identity of this peer.
@@ -485,7 +485,7 @@ update_core_preference (void *cls,
int bucket;
struct GNUNET_HashCode phash;
- peer->preference_task = GNUNET_SCHEDULER_NO_TASK;
+ peer->preference_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
GNUNET_CRYPTO_hash (&peer->id,
@@ -586,7 +586,7 @@ send_find_peer_message (void *cls,
struct BloomConstructorContext bcc;
struct GNUNET_CONTAINER_BloomFilter *peer_bf;
- find_peer_task = GNUNET_SCHEDULER_NO_TASK;
+ find_peer_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
if (newly_found_peers > bucket_size)
@@ -729,10 +729,10 @@ handle_core_disconnect (void *cls,
GNUNET_CONTAINER_multipeermap_remove (all_known_peers,
peer,
to_remove));
- if (GNUNET_SCHEDULER_NO_TASK != to_remove->preference_task)
+ if (NULL != to_remove->preference_task)
{
GNUNET_SCHEDULER_cancel (to_remove->preference_task);
- to_remove->preference_task = GNUNET_SCHEDULER_NO_TASK;
+ to_remove->preference_task = NULL;
}
GNUNET_CRYPTO_hash (peer,
sizeof (struct GNUNET_PeerIdentity),
@@ -2240,10 +2240,10 @@ GDS_NEIGHBOURS_done ()
GNUNET_assert (0 == GNUNET_CONTAINER_multipeermap_size (all_known_peers));
GNUNET_CONTAINER_multipeermap_destroy (all_known_peers);
all_known_peers = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != find_peer_task)
+ if (NULL != find_peer_task)
{
GNUNET_SCHEDULER_cancel (find_peer_task);
- find_peer_task = GNUNET_SCHEDULER_NO_TASK;
+ find_peer_task = NULL;
}
}
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;
/**
* Task that re-transmits requests (using retry_heap).
*/
-static GNUNET_SCHEDULER_TaskIdentifier retry_task;
+static struct GNUNET_SCHEDULER_Task * retry_task;
/**
@@ -875,7 +875,7 @@ transmit_next_request_task (void *cls,
struct ClientQueryRecord *cqr;
struct GNUNET_TIME_Relative delay;
- retry_task = GNUNET_SCHEDULER_NO_TASK;
+ retry_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
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,
&my_identity,
&get->key);
/* start remote requests */
- if (GNUNET_SCHEDULER_NO_TASK != retry_task)
+ if (NULL != retry_task)
GNUNET_SCHEDULER_cancel (retry_task);
retry_task = GNUNET_SCHEDULER_add_now (&transmit_next_request_task, NULL);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
@@ -1422,10 +1422,10 @@ GDS_CLIENTS_done ()
{
GNUNET_assert (client_head == NULL);
GNUNET_assert (client_tail == NULL);
- if (GNUNET_SCHEDULER_NO_TASK != retry_task)
+ if (NULL != retry_task)
{
GNUNET_SCHEDULER_cancel (retry_task);
- retry_task = GNUNET_SCHEDULER_NO_TASK;
+ retry_task = NULL;
}
if (NULL != retry_heap)
{
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
* Task that sends FIND FINGER TRAIL requests. This task is started when we have
* get our first friend.
*/
-static GNUNET_SCHEDULER_TaskIdentifier find_finger_trail_task;
+static struct GNUNET_SCHEDULER_Task * find_finger_trail_task;
/**
* Task that sends verify successor message. This task is started when we get
* our successor for the first time.
*/
-static GNUNET_SCHEDULER_TaskIdentifier send_verify_successor_task;
+static struct GNUNET_SCHEDULER_Task * send_verify_successor_task;
/**
* Task that sends verify successor message. This task is started when we get
* our successor for the first time.
*/
-static GNUNET_SCHEDULER_TaskIdentifier send_verify_successor_retry_task;
+static struct GNUNET_SCHEDULER_Task * send_verify_successor_retry_task;
/**
* Task that sends verify successor message. This task is started when we get
* our successor for the first time.
*/
-static GNUNET_SCHEDULER_TaskIdentifier send_notify_new_successor_retry_task;
+static struct GNUNET_SCHEDULER_Task * send_notify_new_successor_retry_task;
/**
* Identity of this peer.
@@ -3238,7 +3238,7 @@ send_verify_successor_message (void *cls,
successor = &finger_table[0];
/* This task will be scheduled when the result for Verify Successor is received. */
- send_verify_successor_task = GNUNET_SCHEDULER_NO_TASK;
+ send_verify_successor_task = NULL;
/* When verify successor is being called for first time *for current context*
* 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,
* --> Waiting for notify confirmation. again don't wait for it. notify
* confirmation will not succeded.
*/
- if (send_verify_successor_retry_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_verify_successor_retry_task != NULL)
{
/* FIXME: Are we scheduling retry task as soon as we send verify message.
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)
current_search_finger_index = PREDECESSOR_FINGER_ID;
if (0 != GNUNET_CRYPTO_cmp_peer_identity (&my_identity, &successor->finger_identity))
{
- if (GNUNET_SCHEDULER_NO_TASK == send_verify_successor_task)
+ if (NULL == send_verify_successor_task)
{
send_verify_successor_task =
GNUNET_SCHEDULER_add_now (&send_verify_successor_message, NULL);
@@ -5133,7 +5133,7 @@ compare_and_update_successor (struct GNUNET_PeerIdentity curr_succ,
GNUNET_STATISTICS_set (GDS_stats, key, succ, 0);
GNUNET_free (key);
}
- if (send_verify_successor_task == GNUNET_SCHEDULER_NO_TASK)
+ if (send_verify_successor_task == NULL)
send_verify_successor_task =
GNUNET_SCHEDULER_add_delayed(verify_successor_next_send_time,
&send_verify_successor_message,
@@ -5173,7 +5173,7 @@ compare_and_update_successor (struct GNUNET_PeerIdentity curr_succ,
successor_times--;
- if (send_verify_successor_task == GNUNET_SCHEDULER_NO_TASK)
+ if (send_verify_successor_task == NULL)
send_verify_successor_task =
GNUNET_SCHEDULER_add_delayed(verify_successor_next_send_time,
&send_verify_successor_message,
@@ -5262,7 +5262,7 @@ send_notify_new_successor (void *cls,
ctx->target_friend);
if (0 == ctx->num_retries_scheduled &&
- send_notify_new_successor_retry_task != GNUNET_SCHEDULER_NO_TASK)
+ send_notify_new_successor_retry_task != NULL)
{
// Result from previous notify successos hasn't arrived, so the retry task
// hasn't been cancelled! Already a new notify successor must be called.
@@ -5271,7 +5271,7 @@ send_notify_new_successor (void *cls,
old_notify_ctx = GNUNET_SCHEDULER_cancel(send_notify_new_successor_retry_task);
GNUNET_free (old_notify_ctx->successor_trail);
GNUNET_free (old_notify_ctx);
- send_notify_new_successor_retry_task = GNUNET_SCHEDULER_NO_TASK;
+ send_notify_new_successor_retry_task = NULL;
}
ctx->num_retries_scheduled++;
@@ -5337,12 +5337,12 @@ handle_dht_p2p_verify_successor_result(void *cls,
if(0 == (GNUNET_CRYPTO_cmp_peer_identity (&querying_peer, &my_identity)))
{
/* Cancel Retry Task */
- if (GNUNET_SCHEDULER_NO_TASK != send_verify_successor_retry_task)
+ if (NULL != send_verify_successor_retry_task)
{
struct VerifySuccessorContext *ctx;
ctx = GNUNET_SCHEDULER_cancel(send_verify_successor_retry_task);
GNUNET_free(ctx);
- send_verify_successor_retry_task = GNUNET_SCHEDULER_NO_TASK;
+ send_verify_successor_retry_task = NULL;
}
compare_and_update_successor (current_successor,
probable_successor, trail, trail_length);
@@ -5533,15 +5533,15 @@ handle_dht_p2p_notify_succ_confirmation (void *cls,
*/
// TODO: cancel schedule of notify_successor_retry_task
- if (send_notify_new_successor_retry_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_notify_new_successor_retry_task != NULL)
{
struct SendNotifyContext *notify_ctx;
notify_ctx = GNUNET_SCHEDULER_cancel(send_notify_new_successor_retry_task);
GNUNET_free (notify_ctx->successor_trail);
GNUNET_free (notify_ctx);
- send_notify_new_successor_retry_task = GNUNET_SCHEDULER_NO_TASK;
+ send_notify_new_successor_retry_task = NULL;
}
- if (send_verify_successor_task == GNUNET_SCHEDULER_NO_TASK)
+ if (send_verify_successor_task == NULL)
{
verify_successor_next_send_time.rel_value_us =
DHT_SEND_VERIFY_SUCCESSOR_INTERVAL.rel_value_us +
@@ -6063,10 +6063,10 @@ handle_core_disconnect (void *cls,
if (0 != GNUNET_CONTAINER_multipeermap_size (friend_peermap))
return;
- if (GNUNET_SCHEDULER_NO_TASK != find_finger_trail_task)
+ if (NULL != find_finger_trail_task)
{
GNUNET_SCHEDULER_cancel (find_finger_trail_task);
- find_finger_trail_task = GNUNET_SCHEDULER_NO_TASK;
+ find_finger_trail_task = NULL;
}
else
GNUNET_break (0);
@@ -6109,7 +6109,7 @@ handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer_identity)
* selected after some time out. This is to ensure that both peers have added
* each other as their friend. */
/* Got a first connection, good time to start with FIND FINGER TRAIL requests...*/
- if (GNUNET_SCHEDULER_NO_TASK == find_finger_trail_task)
+ if (NULL == find_finger_trail_task)
{
find_finger_trail_task = GNUNET_SCHEDULER_add_now (&send_find_finger_trail_message, NULL);
}
@@ -6244,33 +6244,33 @@ GDS_NEIGHBOURS_done (void)
GNUNET_CONTAINER_multipeermap_destroy (friend_peermap);
friend_peermap = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != find_finger_trail_task)
+ if (NULL != find_finger_trail_task)
{
GNUNET_SCHEDULER_cancel (find_finger_trail_task);
- find_finger_trail_task = GNUNET_SCHEDULER_NO_TASK;
+ find_finger_trail_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != send_verify_successor_task)
+ if (NULL != send_verify_successor_task)
{
GNUNET_SCHEDULER_cancel (send_verify_successor_task);
- send_verify_successor_task = GNUNET_SCHEDULER_NO_TASK;
+ send_verify_successor_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != send_verify_successor_retry_task)
+ if (NULL != send_verify_successor_retry_task)
{
struct VerifySuccessorContext *ctx;
ctx = GNUNET_SCHEDULER_cancel (send_verify_successor_retry_task);
GNUNET_free(ctx);
- send_verify_successor_retry_task = GNUNET_SCHEDULER_NO_TASK;
+ send_verify_successor_retry_task = NULL;
}
- if (send_notify_new_successor_retry_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_notify_new_successor_retry_task != NULL)
{
struct SendNotifyContext *notify_ctx;
notify_ctx = GNUNET_SCHEDULER_cancel(send_notify_new_successor_retry_task);
GNUNET_free (notify_ctx->successor_trail);
GNUNET_free (notify_ctx);
- send_notify_new_successor_retry_task = GNUNET_SCHEDULER_NO_TASK;
+ send_notify_new_successor_retry_task = NULL;
}
}
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
/**
* Delay task
*/
- GNUNET_SCHEDULER_TaskIdentifier delay_task;
+ struct GNUNET_SCHEDULER_Task * delay_task;
/**
* The size of the @e put_data
@@ -357,7 +357,7 @@ static int flag = 0;
/**
* Task to collect peer and its current successor statistics.
*/
-static GNUNET_SCHEDULER_TaskIdentifier successor_stats_task;
+static struct GNUNET_SCHEDULER_Task * successor_stats_task;
/**
* Closure for successor_stats_task.
@@ -441,7 +441,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
ac = a_ctx[cnt].ac;
if (NULL != ac)
{
- if (GNUNET_SCHEDULER_NO_TASK != ac->delay_task)
+ if (NULL != ac->delay_task)
GNUNET_SCHEDULER_cancel (ac->delay_task);
if (NULL != ac->put_data)
GNUNET_free (ac->put_data);
@@ -554,7 +554,7 @@ cancel_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct ActiveContext *ac = cls;
struct Context *ctx = ac->ctx;
- ac->delay_task = GNUNET_SCHEDULER_NO_TASK;
+ ac->delay_task = NULL;
GNUNET_assert (NULL != ac->dht_get);
GNUNET_DHT_get_stop (ac->dht_get);
ac->dht_get = NULL;
@@ -613,9 +613,9 @@ get_iter (void *cls,
get_ac->nrefs--;
GNUNET_DHT_get_stop (ac->dht_get);
ac->dht_get = NULL;
- if (ac->delay_task != GNUNET_SCHEDULER_NO_TASK)
+ if (ac->delay_task != NULL)
GNUNET_SCHEDULER_cancel (ac->delay_task);
- ac->delay_task = GNUNET_SCHEDULER_NO_TASK;
+ ac->delay_task = NULL;
GNUNET_assert (NULL != ctx->op);
GNUNET_TESTBED_operation_done (ctx->op);
ctx->op = NULL;
@@ -646,7 +646,7 @@ delayed_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct ActiveContext *get_ac;
unsigned int r;
- ac->delay_task = GNUNET_SCHEDULER_NO_TASK;
+ ac->delay_task = NULL;
get_ac = NULL;
while (1)
{
@@ -735,7 +735,7 @@ delayed_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct ActiveContext *ac = cls;
- ac->delay_task = GNUNET_SCHEDULER_NO_TASK;
+ ac->delay_task = NULL;
/* Generate and DHT PUT some random data */
ac->put_data_size = 16; /* minimum */
ac->put_data_size += GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
@@ -1065,7 +1065,7 @@ successor_stats_cont (void *cls,
int count;
/* Don't schedule the task till we are looking for circle here. */
- successor_stats_task = GNUNET_SCHEDULER_NO_TASK;
+ successor_stats_task = NULL;
GNUNET_TESTBED_operation_done (successor_stats_op);
successor_stats_op = NULL;
if (0 == max_searches)
@@ -1109,7 +1109,7 @@ successor_stats_cont (void *cls,
if ((start_val == val) && (count == num_peers))
{
DEBUG("CIRCLE COMPLETED after %u tries", tries);
- if(GNUNET_SCHEDULER_NO_TASK == successor_stats_task)
+ if(NULL == successor_stats_task)
{
start_func();
}
@@ -1123,11 +1123,11 @@ successor_stats_cont (void *cls,
"Maximum tries %u exceeded while checking successor TOTAL TRIES %u"
" circle formation. Exiting\n",
max_searches,tries);
- if (GNUNET_SCHEDULER_NO_TASK != successor_stats_task)
+ if (NULL != successor_stats_task)
{
- successor_stats_task = GNUNET_SCHEDULER_NO_TASK;
+ successor_stats_task = NULL;
}
- if(GNUNET_SCHEDULER_NO_TASK == successor_stats_task)
+ if(NULL == successor_stats_task)
{
start_func();
}
@@ -1255,7 +1255,7 @@ service_started (void *cls,
ctx->op = NULL;
peers_started++;
DEBUG("Peers Started = %d; num_peers = %d \n", peers_started, num_peers);
- if (GNUNET_SCHEDULER_NO_TASK == successor_stats_task && peers_started == num_peers)
+ if (NULL == successor_stats_task && peers_started == num_peers)
{
DEBUG("successor_stats_task \n");
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
/**
* The task identifier of the retry task, so it can be cancelled.
*/
- GNUNET_SCHEDULER_TaskIdentifier retry_task;
+ struct GNUNET_SCHEDULER_Task * retry_task;
};
@@ -72,7 +72,7 @@ struct RetryContext retry_context;
static int ok = 1;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
#if VERBOSE
@@ -86,7 +86,7 @@ static void
end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_SCHEDULER_cancel (die_task);
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
GNUNET_DHT_disconnect (dht_handle);
dht_handle = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -105,7 +105,7 @@ end_badly ()
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping get request!\n");
GNUNET_DHT_get_stop (get_handle);
}
- if (retry_context.retry_task != GNUNET_SCHEDULER_NO_TASK)
+ if (retry_context.retry_task != NULL)
GNUNET_SCHEDULER_cancel (retry_context.retry_task);
GNUNET_DHT_disconnect (dht_handle);
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;
/**
* Task called to disconnect peers.
*/
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Task to do DHT_puts
*/
-static GNUNET_SCHEDULER_TaskIdentifier put_task;
+static struct GNUNET_SCHEDULER_Task * put_task;
static struct GNUNET_DHT_MonitorHandle **monitors;
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;
/**
* Task to do DHT_puts
*/
-static GNUNET_SCHEDULER_TaskIdentifier put_task;
+static struct GNUNET_SCHEDULER_Task * put_task;
/**
* Task to time out / regular shutdown.
*/
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* 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
/**
* Task to reconnect to the service.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Re-connect counter, to make sure we did not reconnect in the meantime.
@@ -169,7 +169,7 @@ reconnect (void *cls,
struct ReplyQueueEntry *qe;
struct GNUNET_DNS_Register *msg;
- dh->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ dh->reconnect_task = NULL;
dh->dns_connection = GNUNET_CLIENT_connect ("dns", dh->cfg);
if (NULL == dh->dns_connection)
return;
@@ -508,10 +508,10 @@ GNUNET_DNS_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
void
GNUNET_DNS_disconnect (struct GNUNET_DNS_Handle *dh)
{
- if (GNUNET_SCHEDULER_NO_TASK != dh->reconnect_task)
+ if (NULL != dh->reconnect_task)
{
GNUNET_SCHEDULER_cancel (dh->reconnect_task);
- dh->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ dh->reconnect_task = NULL;
}
disconnect (dh);
/* 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
/**
* Task for reading from dnsout4 and dnsout6.
*/
- GNUNET_SCHEDULER_TaskIdentifier read_task;
+ struct GNUNET_SCHEDULER_Task * read_task;
/**
* When should this request time out?
@@ -125,10 +125,10 @@ cleanup_rs (struct GNUNET_DNSSTUB_RequestSocket *rs)
GNUNET_NETWORK_socket_close (rs->dnsout6);
rs->dnsout6 = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != rs->read_task)
+ if (NULL != rs->read_task)
{
GNUNET_SCHEDULER_cancel (rs->read_task);
- rs->read_task = GNUNET_SCHEDULER_NO_TASK;
+ rs->read_task = NULL;
}
}
@@ -223,10 +223,10 @@ get_request_socket (struct GNUNET_DNSSTUB_Context *ctx,
default:
return NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != rs->read_task)
+ if (NULL != rs->read_task)
{
GNUNET_SCHEDULER_cancel (rs->read_task);
- rs->read_task = GNUNET_SCHEDULER_NO_TASK;
+ rs->read_task = NULL;
}
if ( (NULL == rs->dnsout4) &&
(NULL == rs->dnsout6) )
@@ -475,7 +475,7 @@ read_response (void *cls,
struct GNUNET_DNSSTUB_RequestSocket *rs = cls;
struct GNUNET_NETWORK_FDSet *rset;
- rs->read_task = GNUNET_SCHEDULER_NO_TASK;
+ rs->read_task = NULL;
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
{
/* 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
* ID of the task we use to (periodically) update our consensus
* with this peer. Used if we are the initiating peer.
*/
- GNUNET_SCHEDULER_TaskIdentifier initiate_task;
+ struct GNUNET_SCHEDULER_Task * initiate_task;
/**
* At what offset are we, with respect to inserting our own routes
@@ -386,7 +386,7 @@ static struct GNUNET_ATS_PerformanceHandle *ats;
/**
* Task scheduled to refresh routes based on direct neighbours.
*/
-static GNUNET_SCHEDULER_TaskIdentifier rr_task;
+static struct GNUNET_SCHEDULER_Task * rr_task;
/**
* #GNUNET_YES if we are shutting down.
@@ -1138,7 +1138,7 @@ static void
refresh_routes_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- rr_task = GNUNET_SCHEDULER_NO_TASK;
+ rr_task = NULL;
GNUNET_CONTAINER_multipeermap_iterate (direct_neighbors,
&refresh_routes,
NULL);
@@ -1152,7 +1152,7 @@ refresh_routes_task (void *cls,
static void
schedule_refresh_routes ()
{
- if (GNUNET_SCHEDULER_NO_TASK == rr_task)
+ if (NULL == rr_task)
rr_task = GNUNET_SCHEDULER_add_now (&refresh_routes_task,
NULL);
}
@@ -1288,10 +1288,10 @@ handle_direct_disconnect (struct DirectNeighbor *neighbor)
GNUNET_SET_listen_cancel (neighbor->listen_handle);
neighbor->listen_handle = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != neighbor->initiate_task)
+ if (NULL != neighbor->initiate_task)
{
GNUNET_SCHEDULER_cancel (neighbor->initiate_task);
- neighbor->initiate_task = GNUNET_SCHEDULER_NO_TASK;
+ neighbor->initiate_task = NULL;
}
}
@@ -1745,7 +1745,7 @@ initiate_set_union (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Initiating SET union with peer `%s'\n",
GNUNET_i2s (&neighbor->peer));
- neighbor->initiate_task = GNUNET_SCHEDULER_NO_TASK;
+ neighbor->initiate_task = NULL;
neighbor->my_set = GNUNET_SET_create (cfg,
GNUNET_SET_OPERATION_UNION);
neighbor->set_op = GNUNET_SET_prepare (&neighbor->peer,
@@ -2154,10 +2154,10 @@ shutdown_task (void *cls,
consensi[i].array_length,
0);
}
- if (GNUNET_SCHEDULER_NO_TASK != rr_task)
+ if (NULL != rr_task)
{
GNUNET_SCHEDULER_cancel (rr_task);
- rr_task = GNUNET_SCHEDULER_NO_TASK;
+ rr_task = NULL;
}
}
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;
struct GNUNET_TESTBED_Operation *topology_op;
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
static void
do_shutdown (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task = NULL;
if (NULL != topology_op)
{
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;
/**
* Task for doing DHT PUTs to advertise exit service.
*/
-static GNUNET_SCHEDULER_TaskIdentifier dht_task;
+static struct GNUNET_SCHEDULER_Task * dht_task;
/**
* Advertisement message we put into the DHT to advertise us
@@ -3198,10 +3198,10 @@ cleanup (void *cls,
GNUNET_free (peer_key);
peer_key = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != dht_task)
+ if (NULL != dht_task)
{
GNUNET_SCHEDULER_cancel (dht_task);
- dht_task = GNUNET_SCHEDULER_NO_TASK;
+ dht_task = NULL;
}
if (NULL != dht_put)
{
@@ -3445,7 +3445,7 @@ do_dht_put (void *cls,
{
struct GNUNET_TIME_Absolute expiration;
- dht_task = GNUNET_SCHEDULER_NO_TASK;
+ dht_task = NULL;
expiration = GNUNET_TIME_absolute_ntoh (dns_advertisement.expiration_time);
if (GNUNET_TIME_absolute_get_remaining (expiration).rel_value_us <
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
* Task scheduled for transmitting the next ACK to the
* other peer.
*/
- GNUNET_SCHEDULER_TaskIdentifier ack_task;
+ struct GNUNET_SCHEDULER_Task * ack_task;
/**
* When did we receive which fragment? Used to calculate
@@ -236,10 +236,10 @@ GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc)
{
GNUNET_CONTAINER_DLL_remove (dc->head, dc->tail, mc);
dc->list_size--;
- if (GNUNET_SCHEDULER_NO_TASK != mc->ack_task)
+ if (NULL != mc->ack_task)
{
GNUNET_SCHEDULER_cancel (mc->ack_task);
- mc->ack_task = GNUNET_SCHEDULER_NO_TASK;
+ mc->ack_task = NULL;
}
GNUNET_free (mc);
}
@@ -261,7 +261,7 @@ send_ack (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_DEFRAGMENT_Context *dc = mc->dc;
struct FragmentAcknowledgement fa;
- mc->ack_task = GNUNET_SCHEDULER_NO_TASK;
+ mc->ack_task = NULL;
fa.header.size = htons (sizeof (struct FragmentAcknowledgement));
fa.header.type = htons (GNUNET_MESSAGE_TYPE_FRAGMENT_ACK);
fa.fragment_id = htonl (mc->fragment_id);
@@ -388,10 +388,10 @@ discard_oldest_mc (struct GNUNET_DEFRAGMENT_Context *dc)
GNUNET_assert (NULL != old);
GNUNET_CONTAINER_DLL_remove (dc->head, dc->tail, old);
dc->list_size--;
- if (GNUNET_SCHEDULER_NO_TASK != old->ack_task)
+ if (NULL != old->ack_task)
{
GNUNET_SCHEDULER_cancel (old->ack_task);
- old->ack_task = GNUNET_SCHEDULER_NO_TASK;
+ old->ack_task = NULL;
}
GNUNET_free (old);
}
@@ -550,7 +550,7 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
linear sequence; ACK now! */
delay = GNUNET_TIME_UNIT_ZERO;
}
- if (GNUNET_SCHEDULER_NO_TASK != mc->ack_task)
+ if (NULL != mc->ack_task)
GNUNET_SCHEDULER_cancel (mc->ack_task);
mc->ack_task = GNUNET_SCHEDULER_add_delayed (delay, &send_ack, mc);
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
/**
* Task performing work for the fragmenter.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* Our fragmentation ID. (chosen at random)
@@ -157,7 +157,7 @@ transmit_next (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
size_t fsize;
int wrap;
- fc->task = GNUNET_SCHEDULER_NO_TASK;
+ fc->task = NULL;
GNUNET_assert (GNUNET_NO == fc->proc_busy);
if (0 == fc->acks)
return; /* all done */
@@ -323,7 +323,7 @@ GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context *fc)
{
GNUNET_assert (fc->proc_busy == GNUNET_YES);
fc->proc_busy = GNUNET_NO;
- GNUNET_assert (fc->task == GNUNET_SCHEDULER_NO_TASK);
+ GNUNET_assert (fc->task == NULL);
fc->task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
(fc->delay_until), &transmit_next, fc);
@@ -415,7 +415,7 @@ GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc,
if (0 != fc->acks)
{
/* more to transmit, do so right now (if tracker permits...) */
- if (fc->task != GNUNET_SCHEDULER_NO_TASK)
+ if (fc->task != NULL)
{
/* schedule next transmission now, no point in waiting... */
GNUNET_SCHEDULER_cancel (fc->task);
@@ -434,10 +434,10 @@ GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc,
GNUNET_STATISTICS_update (fc->stats,
_("# fragmentation transmissions completed"), 1,
GNUNET_NO);
- if (fc->task != GNUNET_SCHEDULER_NO_TASK)
+ if (fc->task != NULL)
{
GNUNET_SCHEDULER_cancel (fc->task);
- fc->task = GNUNET_SCHEDULER_NO_TASK;
+ fc->task = NULL;
}
return GNUNET_OK;
}
@@ -458,7 +458,7 @@ GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *fc,
struct GNUNET_TIME_Relative *msg_delay,
struct GNUNET_TIME_Relative *ack_delay)
{
- if (fc->task != GNUNET_SCHEDULER_NO_TASK)
+ if (fc->task != NULL)
GNUNET_SCHEDULER_cancel (fc->task);
if (NULL != ack_delay)
*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];
static struct GNUNET_FRAGMENT_Context *frags[NUM_MSGS];
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
@@ -68,7 +68,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
unsigned int i;
ret = 0;
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task = NULL;
GNUNET_DEFRAGMENT_context_destroy (defrag);
defrag = NULL;
for (i = 0; i < NUM_MSGS; i++)
@@ -102,7 +102,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr)
/* tolerate 10% loss, i.e. due to duplicate fragment IDs */
if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0))
{
- if (GNUNET_SCHEDULER_NO_TASK == shutdown_task)
+ if (NULL == shutdown_task)
shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
}
}
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,
int num_downloads_change;
int block_limit_hit;
- h->queue_job = GNUNET_SCHEDULER_NO_TASK;
+ h->queue_job = NULL;
/* restart_at will be set to the time when it makes sense to
re-evaluate the job queue (unless, of course, jobs complete
or are added, then we'll be triggered immediately */
@@ -336,7 +336,7 @@ GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h,
qe->priority = priority;
GNUNET_CONTAINER_DLL_insert_after (h->pending_head, h->pending_tail,
h->pending_tail, qe);
- if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
+ if (h->queue_job != NULL)
GNUNET_SCHEDULER_cancel (h->queue_job);
h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -364,7 +364,7 @@ GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qe)
stop_job (qe);
GNUNET_CONTAINER_DLL_remove (h->pending_head, h->pending_tail, qe);
GNUNET_free (qe);
- if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
+ if (h->queue_job != NULL)
GNUNET_SCHEDULER_cancel (h->queue_job);
h->queue_job = GNUNET_SCHEDULER_add_now (&process_job_queue, h);
}
@@ -1619,7 +1619,7 @@ deserialize_publish_file (void *cls,
/* re-start publishing (if needed)... */
if (GNUNET_YES != pc->all_done)
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority
(GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
@@ -2140,7 +2140,7 @@ GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc)
GNUNET_assert ((GNUNET_YES == GNUNET_FS_uri_test_ksk (sc->uri)) ||
(GNUNET_YES == GNUNET_FS_uri_test_sks (sc->uri)));
uris = GNUNET_FS_uri_to_string (sc->uri);
- in_pause = (sc->task != GNUNET_SCHEDULER_NO_TASK) ? 'r' : '\0';
+ in_pause = (sc->task != NULL) ? 'r' : '\0';
if ((GNUNET_OK != GNUNET_BIO_write_string (wh, uris)) ||
(GNUNET_OK != write_start_time (wh, sc->start_time)) ||
(GNUNET_OK != GNUNET_BIO_write_string (wh, sc->emsg)) ||
@@ -3130,7 +3130,7 @@ GNUNET_FS_stop (struct GNUNET_FS_Handle *h)
{
while (h->top_head != NULL)
h->top_head->ssf (h->top_head->ssf_cls);
- if (h->queue_job != GNUNET_SCHEDULER_NO_TASK)
+ if (h->queue_job != NULL)
GNUNET_SCHEDULER_cancel (h->queue_job);
GNUNET_free (h->client_name);
GNUNET_free (h);
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h
index 157662a65..5fbdef6c2 100644
--- a/src/fs/fs_api.h
+++ b/src/fs/fs_api.h
@@ -601,7 +601,7 @@ struct GNUNET_FS_SearchResult
* complete on time (and that will need to be cancelled if we clean
* up the search result before then).
*/
- GNUNET_SCHEDULER_TaskIdentifier probe_cancel_task;
+ struct GNUNET_SCHEDULER_Task * probe_cancel_task;
/**
* When did the current probe become active?
@@ -1170,13 +1170,13 @@ struct GNUNET_FS_Handle
* Task that processes the jobs in the running and pending queues
* (and moves jobs around as needed).
*/
- GNUNET_SCHEDULER_TaskIdentifier queue_job;
+ struct GNUNET_SCHEDULER_Task * queue_job;
/**
* Task we use to report periodically to the application that
* certain search probes (from @e probes_head) are still running.
*/
- GNUNET_SCHEDULER_TaskIdentifier probe_ping_task;
+ struct GNUNET_SCHEDULER_Task * probe_ping_task;
/**
* Average time we take for a single request to be satisfied.
@@ -1300,7 +1300,7 @@ struct GNUNET_FS_PublishContext
* ID of the task performing the upload. NO_TASK if the upload has
* completed.
*/
- GNUNET_SCHEDULER_TaskIdentifier upload_task;
+ struct GNUNET_SCHEDULER_Task * upload_task;
/**
* Storage space to reserve for the operation.
@@ -1629,10 +1629,10 @@ struct GNUNET_FS_SearchContext
/**
* ID of a task that is using this struct and that must be cancelled
* when the search is being stopped (if not
- * #GNUNET_SCHEDULER_NO_TASK). Used for the task that adds some
+ * #NULL). Used for the task that adds some
* artificial delay when trying to reconnect to the FS service.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* How many of the entries in the search request
@@ -1961,12 +1961,12 @@ struct GNUNET_FS_DownloadContext
/**
* ID of a task that is using this struct and that must be cancelled
* when the download is being stopped (if not
- * #GNUNET_SCHEDULER_NO_TASK). Used for the task that adds some
+ * #NULL). Used for the task that adds some
* artificial delay when trying to reconnect to the FS service or
* the task processing incrementally the data on disk, or the
* task requesting blocks, etc.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* What is the first offset that we're interested
diff --git a/src/fs/fs_dirmetascan.c b/src/fs/fs_dirmetascan.c
index 83e436b16..2477aab4b 100644
--- a/src/fs/fs_dirmetascan.c
+++ b/src/fs/fs_dirmetascan.c
@@ -80,7 +80,7 @@ struct GNUNET_FS_DirScanner
/**
* Task scheduled when we are done.
*/
- GNUNET_SCHEDULER_TaskIdentifier stop_task;
+ struct GNUNET_SCHEDULER_Task * stop_task;
/**
* Arguments for helper.
@@ -106,7 +106,7 @@ GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds)
/* free resources */
if (NULL != ds->toplevel)
GNUNET_FS_share_tree_free (ds->toplevel);
- if (GNUNET_SCHEDULER_NO_TASK != ds->stop_task)
+ if (NULL != ds->stop_task)
GNUNET_SCHEDULER_cancel (ds->stop_task);
GNUNET_free_non_null (ds->ex_arg);
GNUNET_free (ds->filename_expanded);
@@ -230,7 +230,7 @@ finish_scan (void *cls,
{
struct GNUNET_FS_DirScanner *ds = cls;
- ds->stop_task = GNUNET_SCHEDULER_NO_TASK;
+ ds->stop_task = NULL;
if (NULL != ds->helper)
{
GNUNET_HELPER_stop (ds->helper, GNUNET_NO);
@@ -427,7 +427,7 @@ helper_died_cb (void *cls)
struct GNUNET_FS_DirScanner *ds = cls;
ds->helper = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != ds->stop_task)
+ if (NULL != ds->stop_task)
return; /* normal death, was finished */
ds->progress_callback (ds->progress_callback_cls,
NULL, GNUNET_SYSERR,
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index 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)
GNUNET_FS_dequeue_ (dc->job_queue);
dc->job_queue = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != dc->task)
+ if (NULL != dc->task)
{
GNUNET_SCHEDULER_cancel (dc->task);
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
}
if (NULL != dc->rfh)
{
@@ -1380,7 +1380,7 @@ do_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_FS_DownloadContext *dc = cls;
struct GNUNET_CLIENT_Connection *client;
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
client = GNUNET_CLIENT_connect ("fs", dc->h->cfg);
if (NULL == client)
{
@@ -1633,10 +1633,10 @@ reconstruct_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_FS_DownloadContext *dc = cls;
/* clean up state from tree encoder */
- if (dc->task != GNUNET_SCHEDULER_NO_TASK)
+ if (dc->task != NULL)
{
GNUNET_SCHEDULER_cancel (dc->task);
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
}
if (NULL != dc->rfh)
{
@@ -1662,7 +1662,7 @@ get_next_block (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_FS_DownloadContext *dc = cls;
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
GNUNET_FS_tree_encoder_next (dc->te);
}
@@ -1866,7 +1866,7 @@ GNUNET_FS_download_start_task_ (void *cls,
struct GNUNET_DISK_FileHandle *fh;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Start task running...\n");
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
if (0 == dc->length)
{
/* no bytes required! */
@@ -2028,10 +2028,10 @@ GNUNET_FS_download_signal_suspend_ (void *cls)
if (NULL != dc->parent)
GNUNET_CONTAINER_DLL_remove (dc->parent->child_head, dc->parent->child_tail,
dc);
- if (GNUNET_SCHEDULER_NO_TASK != dc->task)
+ if (NULL != dc->task)
{
GNUNET_SCHEDULER_cancel (dc->task);
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
}
pi.status = GNUNET_FS_STATUS_DOWNLOAD_SUSPEND;
GNUNET_FS_download_make_status_ (&pi, dc);
@@ -2336,10 +2336,10 @@ GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete)
if (NULL != dc->top)
GNUNET_FS_end_top (dc->h, dc->top);
- if (GNUNET_SCHEDULER_NO_TASK != dc->task)
+ if (NULL != dc->task)
{
GNUNET_SCHEDULER_cancel (dc->task);
- dc->task = GNUNET_SCHEDULER_NO_TASK;
+ dc->task = NULL;
}
search_was_null = (NULL == dc->search);
if (NULL != dc->search)
diff --git a/src/fs/fs_list_indexed.c b/src/fs/fs_list_indexed.c
index 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
/**
* Continuation to trigger at the end.
*/
- GNUNET_SCHEDULER_Task cont;
+ GNUNET_SCHEDULER_TaskCallback cont;
/**
* Closure for cont.
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 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)
GNUNET_CLIENT_disconnect (pc->client);
pc->client = NULL;
}
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
GNUNET_free (pc);
}
@@ -138,7 +138,7 @@ ds_put_cont (void *cls, int success,
GNUNET_FS_unindex_start (pc->h, pc->fi_pos->filename, NULL);
}
}
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
&GNUNET_FS_publish_main_, pc);
@@ -316,7 +316,7 @@ publish_kblocks_cont (void *cls,
signal_publish_error (p, pc, emsg);
GNUNET_FS_file_information_sync_ (p);
GNUNET_FS_publish_sync_ (pc);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority
(GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
@@ -334,7 +334,7 @@ publish_kblocks_cont (void *cls,
else
pc->fi_pos = p->dir;
GNUNET_FS_publish_sync_ (pc);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
&GNUNET_FS_publish_main_, pc);
@@ -449,7 +449,7 @@ encode_cont (void *cls,
p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, flen);
}
/* continue with main */ /* continue with main */
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
&GNUNET_FS_publish_main_, pc);
@@ -487,7 +487,7 @@ block_proc (void *cls,
if (NULL == pc->dsh)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Waiting for datastore connection\n");
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority
(GNUNET_SCHEDULER_PRIORITY_BACKGROUND, &GNUNET_FS_publish_main_, pc);
@@ -947,7 +947,7 @@ GNUNET_FS_publish_main_ (void *cls,
struct GNUNET_FS_FileInformation *p;
char *fn;
- pc->upload_task = GNUNET_SCHEDULER_NO_TASK;
+ pc->upload_task = NULL;
p = pc->fi_pos;
if (NULL == p)
{
@@ -1234,10 +1234,10 @@ GNUNET_FS_publish_signal_suspend_ (void *cls)
{
struct GNUNET_FS_PublishContext *pc = cls;
- if (GNUNET_SCHEDULER_NO_TASK != pc->upload_task)
+ if (NULL != pc->upload_task)
{
GNUNET_SCHEDULER_cancel (pc->upload_task);
- pc->upload_task = GNUNET_SCHEDULER_NO_TASK;
+ pc->upload_task = NULL;
}
pc->skip_next_fi_callback = GNUNET_YES;
GNUNET_FS_file_information_inspect (pc->fi, &fip_signal_suspend, pc);
@@ -1275,7 +1275,7 @@ finish_reserve (void *cls, int success,
return;
}
pc->rid = success;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
+ GNUNET_assert (NULL == pc->upload_task);
pc->upload_task =
GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,
&GNUNET_FS_publish_main_, pc);
@@ -1373,7 +1373,7 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
}
else
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == ret->upload_task);
+ GNUNET_assert (NULL == ret->upload_task);
ret->upload_task =
GNUNET_SCHEDULER_add_with_priority
(GNUNET_SCHEDULER_PRIORITY_BACKGROUND, &GNUNET_FS_publish_main_, ret);
@@ -1462,10 +1462,10 @@ GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc)
GNUNET_FS_publish_sks_cancel (pc->sks_pc);
pc->sks_pc = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pc->upload_task)
+ if (NULL != pc->upload_task)
{
GNUNET_SCHEDULER_cancel (pc->upload_task);
- pc->upload_task = GNUNET_SCHEDULER_NO_TASK;
+ pc->upload_task = NULL;
}
pc->skip_next_fi_callback = GNUNET_YES;
GNUNET_FS_file_information_inspect (pc->fi, &fip_signal_stop, pc);
diff --git a/src/fs/fs_publish_ksk.c b/src/fs/fs_publish_ksk.c
index 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
/**
* Current task.
*/
- GNUNET_SCHEDULER_TaskIdentifier ksk_task;
+ struct GNUNET_SCHEDULER_Task * ksk_task;
/**
* Function to call once we're done.
@@ -156,7 +156,7 @@ publish_ksk_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_FS_PublishKskContext *pkc = cls;
const char *keyword;
- pkc->ksk_task = GNUNET_SCHEDULER_NO_TASK;
+ pkc->ksk_task = NULL;
if ( (pkc->i == pkc->ksk_uri->data.ksk.keywordCount) ||
(NULL == pkc->dsh) )
{
@@ -236,10 +236,10 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h,
void
GNUNET_FS_publish_ksk_cancel (struct GNUNET_FS_PublishKskContext *pkc)
{
- if (GNUNET_SCHEDULER_NO_TASK != pkc->ksk_task)
+ if (NULL != pkc->ksk_task)
{
GNUNET_SCHEDULER_cancel (pkc->ksk_task);
- pkc->ksk_task = GNUNET_SCHEDULER_NO_TASK;
+ pkc->ksk_task = NULL;
}
if (NULL != pkc->uc)
{
diff --git a/src/fs/fs_publish_ublock.c b/src/fs/fs_publish_ublock.c
index 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
/**
* Task to run continuation asynchronously.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
};
@@ -155,7 +155,7 @@ run_cont (void *cls,
{
struct GNUNET_FS_PublishUblockContext *uc = cls;
- uc->task = GNUNET_SCHEDULER_NO_TASK;
+ uc->task = NULL;
uc->cont (uc->cont_cls, NULL);
GNUNET_free (uc);
}
@@ -316,7 +316,7 @@ GNUNET_FS_publish_ublock_cancel_ (struct GNUNET_FS_PublishUblockContext *uc)
{
if (NULL != uc->qre)
GNUNET_DATASTORE_cancel (uc->qre);
- if (GNUNET_SCHEDULER_NO_TASK != uc->task)
+ if (NULL != uc->task)
GNUNET_SCHEDULER_cancel (uc->task);
GNUNET_free (uc);
}
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index c85d6d3df..8f640009a 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -223,7 +223,7 @@ probe_failure_handler (void *cls,
{
struct GNUNET_FS_SearchResult *sr = cls;
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
sr->availability_trials++;
GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES);
sr->probe_ctx = NULL;
@@ -249,7 +249,7 @@ probe_success_handler (void *cls,
{
struct GNUNET_FS_SearchResult *sr = cls;
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
sr->availability_trials++;
sr->availability_success++;
GNUNET_FS_download_stop (sr->probe_ctx, GNUNET_YES);
@@ -303,34 +303,34 @@ GNUNET_FS_search_probe_progress_ (void *cls,
/* ignore */
break;
case GNUNET_FS_STATUS_DOWNLOAD_ERROR:
- if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
+ if (NULL != sr->probe_cancel_task)
{
GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
}
sr->probe_cancel_task =
GNUNET_SCHEDULER_add_delayed (sr->remaining_probe_time,
&probe_failure_handler, sr);
break;
case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
- if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
+ if (NULL != sr->probe_cancel_task)
{
GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
}
sr->probe_cancel_task =
GNUNET_SCHEDULER_add_now (&probe_success_handler, sr);
break;
case GNUNET_FS_STATUS_DOWNLOAD_STOPPED:
- if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
+ if (NULL != sr->probe_cancel_task)
{
GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
}
sr = NULL;
break;
case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE:
- if (GNUNET_SCHEDULER_NO_TASK == sr->probe_cancel_task)
+ if (NULL == sr->probe_cancel_task)
{
sr->probe_active_time = GNUNET_TIME_absolute_get ();
sr->probe_cancel_task =
@@ -339,10 +339,10 @@ GNUNET_FS_search_probe_progress_ (void *cls,
}
break;
case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE:
- if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
+ if (NULL != sr->probe_cancel_task)
{
GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
}
dur = GNUNET_TIME_absolute_get_duration (sr->probe_active_time);
sr->remaining_probe_time =
@@ -396,7 +396,7 @@ start_probe_ping_task (struct GNUNET_FS_SearchResult *sr)
GNUNET_CONTAINER_DLL_insert (h->probes_head,
h->probes_tail,
sr);
- if (GNUNET_SCHEDULER_NO_TASK == h->probe_ping_task)
+ if (NULL == h->probe_ping_task)
h->probe_ping_task
= GNUNET_SCHEDULER_add_now (&probe_ping_task_cb,
h);
@@ -419,7 +419,7 @@ GNUNET_FS_stop_probe_ping_task_ (struct GNUNET_FS_SearchResult *sr)
if (NULL == h->probes_head)
{
GNUNET_SCHEDULER_cancel (h->probe_ping_task);
- h->probe_ping_task = GNUNET_SCHEDULER_NO_TASK;
+ h->probe_ping_task = NULL;
}
}
@@ -520,10 +520,10 @@ GNUNET_FS_search_stop_probe_ (struct GNUNET_FS_SearchResult *sr)
sr->probe_ctx = NULL;
GNUNET_FS_stop_probe_ping_task_ (sr);
}
- if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
+ if (NULL != sr->probe_cancel_task)
{
GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
}
}
@@ -1253,7 +1253,7 @@ do_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_FS_SearchContext *sc = cls;
struct GNUNET_CLIENT_Connection *client;
- sc->task = GNUNET_SCHEDULER_NO_TASK;
+ sc->task = NULL;
client = GNUNET_CLIENT_connect ("fs", sc->h->cfg);
if (NULL == client)
{
@@ -1446,10 +1446,10 @@ search_result_freeze_probes (void *cls,
sr->probe_ctx = NULL;
GNUNET_FS_stop_probe_ping_task_ (sr);
}
- if (GNUNET_SCHEDULER_NO_TASK != sr->probe_cancel_task)
+ if (NULL != sr->probe_cancel_task)
{
GNUNET_SCHEDULER_cancel (sr->probe_cancel_task);
- sr->probe_cancel_task = GNUNET_SCHEDULER_NO_TASK;
+ sr->probe_cancel_task = NULL;
}
if (NULL != sr->update_search)
GNUNET_FS_search_pause (sr->update_search);
@@ -1545,10 +1545,10 @@ GNUNET_FS_search_signal_suspend_ (void *cls)
pi.status = GNUNET_FS_STATUS_SEARCH_SUSPEND;
sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc);
GNUNET_break (NULL == sc->client_info);
- if (sc->task != GNUNET_SCHEDULER_NO_TASK)
+ if (sc->task != NULL)
{
GNUNET_SCHEDULER_cancel (sc->task);
- sc->task = GNUNET_SCHEDULER_NO_TASK;
+ sc->task = NULL;
}
if (NULL != sc->client)
{
@@ -1609,10 +1609,10 @@ GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc)
{
struct GNUNET_FS_ProgressInfo pi;
- if (GNUNET_SCHEDULER_NO_TASK != sc->task)
+ if (NULL != sc->task)
{
GNUNET_SCHEDULER_cancel (sc->task);
- sc->task = GNUNET_SCHEDULER_NO_TASK;
+ sc->task = NULL;
}
if (NULL != sc->client)
GNUNET_CLIENT_disconnect (sc->client);
@@ -1636,7 +1636,7 @@ GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc)
struct GNUNET_FS_ProgressInfo pi;
GNUNET_assert (NULL == sc->client);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == sc->task);
+ GNUNET_assert (NULL == sc->task);
do_reconnect (sc, NULL);
GNUNET_FS_search_sync_ (sc);
pi.status = GNUNET_FS_STATUS_SEARCH_CONTINUED;
@@ -1721,7 +1721,7 @@ search_result_free (void *cls,
GNUNET_assert (NULL == sr->update_search);
}
GNUNET_break (NULL == sr->probe_ctx);
- GNUNET_break (GNUNET_SCHEDULER_NO_TASK == sr->probe_cancel_task);
+ GNUNET_break (NULL == sr->probe_cancel_task);
GNUNET_break (NULL == sr->client_info);
GNUNET_free_non_null (sr->serialization);
GNUNET_FS_uri_destroy (sr->uri);
@@ -1766,7 +1766,7 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc)
pi.status = GNUNET_FS_STATUS_SEARCH_STOPPED;
sc->client_info = GNUNET_FS_search_make_status_ (&pi, sc->h, sc);
GNUNET_break (NULL == sc->client_info);
- if (GNUNET_SCHEDULER_NO_TASK != sc->task)
+ if (NULL != sc->task)
GNUNET_SCHEDULER_cancel (sc->task);
if (NULL != sc->client)
GNUNET_CLIENT_disconnect (sc->client);
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c
index 1e098bd60..589f979d6 100644
--- a/src/fs/fs_test_lib.c
+++ b/src/fs/fs_test_lib.c
@@ -63,7 +63,7 @@ struct TestPublishOperation
/**
* Task to abort publishing (timeout).
*/
- GNUNET_SCHEDULER_TaskIdentifier publish_timeout_task;
+ struct GNUNET_SCHEDULER_Task * publish_timeout_task;
/**
* Seed for file generation.
@@ -131,7 +131,7 @@ struct TestDownloadOperation
/**
* Function to call when download is done.
*/
- GNUNET_SCHEDULER_Task download_cont;
+ GNUNET_SCHEDULER_TaskCallback download_cont;
/**
* Closure for download_cont.
@@ -146,7 +146,7 @@ struct TestDownloadOperation
/**
* Task to abort downloading (timeout).
*/
- GNUNET_SCHEDULER_TaskIdentifier download_timeout_task;
+ struct GNUNET_SCHEDULER_Task * download_timeout_task;
/**
* Context for current download operation.
@@ -215,7 +215,7 @@ publish_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct TestPublishOperation *po = cls;
- po->publish_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ po->publish_timeout_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout while trying to publish data\n");
GNUNET_TESTBED_operation_done (po->fs_op);
@@ -242,7 +242,7 @@ publish_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
{
case GNUNET_FS_STATUS_PUBLISH_COMPLETED:
GNUNET_SCHEDULER_cancel (po->publish_timeout_task);
- po->publish_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ po->publish_timeout_task = NULL;
po->publish_uri =
GNUNET_FS_uri_dup (info->value.publish.specifics.completed.chk_uri);
GNUNET_SCHEDULER_add_continuation (&report_uri, po,
@@ -489,7 +489,7 @@ download_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout while trying to download file\n");
- dop->download_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ dop->download_timeout_task = NULL;
GNUNET_FS_download_stop (dop->download_context, GNUNET_YES);
GNUNET_SCHEDULER_add_continuation (dop->download_cont,
dop->download_cont_cls,
@@ -543,7 +543,7 @@ download_progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
break;
case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED:
GNUNET_SCHEDULER_cancel (dop->download_timeout_task);
- dop->download_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ dop->download_timeout_task = NULL;
GNUNET_SCHEDULER_add_continuation (&report_success, dop,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
break;
@@ -627,7 +627,7 @@ GNUNET_FS_TEST_download (struct GNUNET_TESTBED_Peer *peer,
struct GNUNET_TIME_Relative timeout,
uint32_t anonymity, uint32_t seed,
const struct GNUNET_FS_Uri *uri, unsigned int verbose,
- GNUNET_SCHEDULER_Task cont, void *cont_cls)
+ GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls)
{
struct TestDownloadOperation *dop;
diff --git a/src/fs/fs_test_lib.h b/src/fs/fs_test_lib.h
index 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,
struct GNUNET_TIME_Relative timeout,
uint32_t anonymity, uint32_t seed,
const struct GNUNET_FS_Uri *uri, unsigned int verbose,
- GNUNET_SCHEDULER_Task cont, void *cont_cls);
+ GNUNET_SCHEDULER_TaskCallback cont, void *cont_cls);
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c
index 5dc39e4e6..715ecddb1 100644
--- a/src/fs/fs_tree.c
+++ b/src/fs/fs_tree.c
@@ -63,7 +63,7 @@ struct GNUNET_FS_TreeEncoder
/**
* Function to call once we're done with processing.
*/
- GNUNET_SCHEDULER_Task cont;
+ GNUNET_SCHEDULER_TaskCallback cont;
/**
* Set to an error message (if we had an error).
@@ -272,7 +272,7 @@ GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size,
GNUNET_FS_DataReader reader,
GNUNET_FS_TreeBlockProcessor proc,
GNUNET_FS_TreeProgressCallback progress,
- GNUNET_SCHEDULER_Task cont)
+ GNUNET_SCHEDULER_TaskCallback cont)
{
struct GNUNET_FS_TreeEncoder *te;
diff --git a/src/fs/fs_tree.h b/src/fs/fs_tree.h
index 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,
void *cls, GNUNET_FS_DataReader reader,
GNUNET_FS_TreeBlockProcessor proc,
GNUNET_FS_TreeProgressCallback progress,
- GNUNET_SCHEDULER_Task cont);
+ GNUNET_SCHEDULER_TaskCallback cont);
/**
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c
index 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;
/**
* Handle for the 'shutdown' task.
*/
-static GNUNET_SCHEDULER_TaskIdentifier kill_task;
+static struct GNUNET_SCHEDULER_Task * kill_task;
/**
* Handle for the main task that does scanning and working.
*/
-static GNUNET_SCHEDULER_TaskIdentifier run_task;
+static struct GNUNET_SCHEDULER_Task * run_task;
/**
* Anonymity level option to use for publishing.
@@ -322,17 +322,17 @@ save_state ()
static void
do_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- kill_task = GNUNET_SCHEDULER_NO_TASK;
+ kill_task = NULL;
do_shutdown = GNUNET_YES;
if (NULL != publish_proc)
{
GNUNET_OS_process_kill (publish_proc, SIGKILL);
return;
}
- if (GNUNET_SCHEDULER_NO_TASK != run_task)
+ if (NULL != run_task)
{
GNUNET_SCHEDULER_cancel (run_task);
- run_task = GNUNET_SCHEDULER_NO_TASK;
+ run_task = NULL;
}
}
@@ -363,7 +363,7 @@ maint_child_death (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
const struct GNUNET_DISK_FileHandle *pr;
- run_task = GNUNET_SCHEDULER_NO_TASK;
+ run_task = NULL;
pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
{
@@ -457,7 +457,7 @@ work (void *cls,
const struct GNUNET_DISK_FileHandle *pr;
int argc;
- run_task = GNUNET_SCHEDULER_NO_TASK;
+ run_task = NULL;
wi = work_head;
GNUNET_CONTAINER_DLL_remove (work_head,
work_tail,
@@ -629,7 +629,7 @@ add_file (void *cls,
static void
scan (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- run_task = GNUNET_SCHEDULER_NO_TASK;
+ run_task = NULL;
start_time = GNUNET_TIME_absolute_get ();
(void) GNUNET_DISK_directory_scan (dir_name,
&add_file,
diff --git a/src/fs/gnunet-daemon-fsprofiler.c b/src/fs/gnunet-daemon-fsprofiler.c
index 1549972a1..9c4f28351 100644
--- a/src/fs/gnunet-daemon-fsprofiler.c
+++ b/src/fs/gnunet-daemon-fsprofiler.c
@@ -69,12 +69,12 @@ struct Pattern
/**
* Task to run the operation.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* Secondary task to run the operation.
*/
- GNUNET_SCHEDULER_TaskIdentifier stask;
+ struct GNUNET_SCHEDULER_Task * stask;
/**
* X-value.
@@ -276,7 +276,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
while (NULL != (p = publish_head))
{
- if (GNUNET_SCHEDULER_NO_TASK != p->task)
+ if (NULL != p->task)
GNUNET_SCHEDULER_cancel (p->task);
if (NULL != p->ctx)
GNUNET_FS_publish_stop (p->ctx);
@@ -285,9 +285,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
}
while (NULL != (p = download_head))
{
- if (GNUNET_SCHEDULER_NO_TASK != p->task)
+ if (NULL != p->task)
GNUNET_SCHEDULER_cancel (p->task);
- if (GNUNET_SCHEDULER_NO_TASK != p->stask)
+ if (NULL != p->stask)
GNUNET_SCHEDULER_cancel (p->stask);
if (NULL != p->ctx)
GNUNET_FS_download_stop (p->ctx, GNUNET_YES);
@@ -320,7 +320,7 @@ publish_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct Pattern *p = cls;
- p->task = GNUNET_SCHEDULER_NO_TASK;
+ p->task = NULL;
GNUNET_FS_publish_stop (p->ctx);
}
@@ -336,7 +336,7 @@ download_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct Pattern *p = cls;
- p->task = GNUNET_SCHEDULER_NO_TASK;
+ p->task = NULL;
GNUNET_FS_download_stop (p->ctx, GNUNET_YES);
}
@@ -352,7 +352,7 @@ search_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct Pattern *p = cls;
- p->stask = GNUNET_SCHEDULER_NO_TASK;
+ p->stask = NULL;
GNUNET_FS_search_stop (p->sctx);
}
@@ -507,7 +507,7 @@ start_publish (void *cls,
struct Pattern *p = cls;
struct GNUNET_FS_FileInformation *fi;
- p->task = GNUNET_SCHEDULER_NO_TASK;
+ p->task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
fi = make_file (p->x, p->y, p);
@@ -532,7 +532,7 @@ start_download (void *cls,
struct Pattern *p = cls;
struct GNUNET_FS_Uri *keywords;
- p->task = GNUNET_SCHEDULER_NO_TASK;
+ p->task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
keywords = make_keywords (p->x);
diff --git a/src/fs/gnunet-fs-profiler.c b/src/fs/gnunet-fs-profiler.c
index 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;
/**
* Handle to the task run during termination.
*/
-static GNUNET_SCHEDULER_TaskIdentifier terminate_taskid;
+static struct GNUNET_SCHEDULER_Task * terminate_taskid;
/**
@@ -115,7 +115,7 @@ static void
terminate_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- terminate_taskid = GNUNET_SCHEDULER_NO_TASK;
+ terminate_taskid = NULL;
GNUNET_TESTBED_get_statistics (0, NULL,
NULL, NULL,
&process_stats,
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c
index 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;
/**
* Task run on CTRL-C to kill everything nicely.
*/
-static GNUNET_SCHEDULER_TaskIdentifier kill_task;
+static struct GNUNET_SCHEDULER_Task * kill_task;
/**
* Handle to the directory scanner (for recursive insertions).
@@ -159,7 +159,7 @@ do_stop_task (void *cls,
{
struct GNUNET_FS_PublishContext *p;
- kill_task = GNUNET_SCHEDULER_NO_TASK;
+ kill_task = NULL;
if (NULL != identity)
{
GNUNET_IDENTITY_disconnect (identity);
@@ -188,7 +188,7 @@ do_stop_task (void *cls,
static void
stop_scanner_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- kill_task = GNUNET_SCHEDULER_NO_TASK;
+ kill_task = NULL;
if (NULL != ds)
{
GNUNET_FS_directory_scan_abort (ds);
@@ -256,10 +256,10 @@ progress_cb (void *cls,
case GNUNET_FS_STATUS_PUBLISH_ERROR:
FPRINTF (stderr, _("Error publishing: %s.\n"),
info->value.publish.specifics.error.message);
- if (kill_task != GNUNET_SCHEDULER_NO_TASK)
+ if (kill_task != NULL)
{
GNUNET_SCHEDULER_cancel (kill_task);
- kill_task = GNUNET_SCHEDULER_NO_TASK;
+ kill_task = NULL;
}
kill_task = GNUNET_SCHEDULER_add_now (&do_stop_task, NULL);
break;
@@ -284,7 +284,7 @@ progress_cb (void *cls,
}
if (NULL == info->value.publish.pctx)
{
- if (GNUNET_SCHEDULER_NO_TASK != kill_task)
+ if (NULL != kill_task)
GNUNET_SCHEDULER_cancel (kill_task);
kill_task = GNUNET_SCHEDULER_add_now (&do_stop_task, NULL);
}
@@ -669,10 +669,10 @@ directory_scan_cb (void *cls,
FPRINTF (stdout,
"%s",
_("Internal error scanning directory.\n"));
- if (kill_task != GNUNET_SCHEDULER_NO_TASK)
+ if (kill_task != NULL)
{
GNUNET_SCHEDULER_cancel (kill_task);
- kill_task = GNUNET_SCHEDULER_NO_TASK;
+ kill_task = NULL;
}
kill_task = GNUNET_SCHEDULER_add_now (&stop_scanner_task, NULL);
break;
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 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;
/**
* ID of our task that we use to age the cover counters.
*/
-static GNUNET_SCHEDULER_TaskIdentifier cover_age_task;
+static struct GNUNET_SCHEDULER_Task * cover_age_task;
/**
* Datastore 'GET' load tracking.
@@ -569,10 +569,10 @@ shutdown_task (void *cls,
block_cfg = NULL;
GNUNET_STATISTICS_destroy (GSF_stats, GNUNET_NO);
GSF_stats = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != cover_age_task)
+ if (NULL != cover_age_task)
{
GNUNET_SCHEDULER_cancel (cover_age_task);
- cover_age_task = GNUNET_SCHEDULER_NO_TASK;
+ cover_age_task = NULL;
}
GNUNET_FS_indexing_done ();
GNUNET_LOAD_value_free (datastore_get_load);
diff --git a/src/fs/gnunet-service-fs_cadet_client.c b/src/fs/gnunet-service-fs_cadet_client.c
index 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
* a few seconds to give the application a chance to give
* us another query).
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Task to reset cadets that had errors (asynchronously,
* as we may not be able to do it immediately during a
* callback from the cadet API).
*/
- GNUNET_SCHEDULER_TaskIdentifier reset_task;
+ struct GNUNET_SCHEDULER_Task * reset_task;
};
@@ -258,7 +258,7 @@ cadet_timeout (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Timeout on cadet channel to %s\n",
GNUNET_i2s (&mh->target));
- mh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ mh->timeout_task = NULL;
tun = mh->channel;
mh->channel = NULL;
if(NULL != tun)
@@ -278,7 +278,7 @@ reset_cadet_task (void *cls,
{
struct CadetHandle *mh = cls;
- mh->reset_task = GNUNET_SCHEDULER_NO_TASK;
+ mh->reset_task = NULL;
reset_cadet (mh);
}
@@ -292,7 +292,7 @@ reset_cadet_task (void *cls,
static void
reset_cadet_async (struct CadetHandle *mh)
{
- if (GNUNET_SCHEDULER_NO_TASK != mh->reset_task)
+ if (NULL != mh->reset_task)
GNUNET_SCHEDULER_cancel (mh->reset_task);
mh->reset_task = GNUNET_SCHEDULER_add_now (&reset_cadet_task,
mh);
@@ -527,10 +527,10 @@ get_cadet (const struct GNUNET_PeerIdentity *target)
target);
if (NULL != mh)
{
- if (GNUNET_SCHEDULER_NO_TASK != mh->timeout_task)
+ if (NULL != mh->timeout_task)
{
GNUNET_SCHEDULER_cancel (mh->timeout_task);
- mh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ mh->timeout_task = NULL;
}
return mh;
}
@@ -698,9 +698,9 @@ cleaner_cb (void *cls,
mh);
if (NULL != mh->wh)
GNUNET_CADET_notify_transmit_ready_cancel (mh->wh);
- if (GNUNET_SCHEDULER_NO_TASK != mh->timeout_task)
+ if (NULL != mh->timeout_task)
GNUNET_SCHEDULER_cancel (mh->timeout_task);
- if (GNUNET_SCHEDULER_NO_TASK != mh->reset_task)
+ if (NULL != mh->reset_task)
GNUNET_SCHEDULER_cancel (mh->reset_task);
GNUNET_assert (0 ==
GNUNET_CONTAINER_multihashmap_size (mh->waiting_map));
diff --git a/src/fs/gnunet-service-fs_cadet_server.c b/src/fs/gnunet-service-fs_cadet_server.c
index 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
/**
* Task that is scheduled to asynchronously terminate the connection.
*/
- GNUNET_SCHEDULER_TaskIdentifier terminate_task;
+ struct GNUNET_SCHEDULER_Task * terminate_task;
/**
* Task that is scheduled to terminate idle connections.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Size of the last write that was initiated.
@@ -163,7 +163,7 @@ timeout_cadet_task (void *cls,
struct CadetClient *sc = cls;
struct GNUNET_CADET_Channel *tun;
- sc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ sc->timeout_task = NULL;
tun = sc->channel;
sc->channel = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -181,7 +181,7 @@ timeout_cadet_task (void *cls,
static void
refresh_timeout_task (struct CadetClient *sc)
{
- if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task)
+ if (NULL != sc->timeout_task)
GNUNET_SCHEDULER_cancel (sc->timeout_task);
sc->timeout_task = GNUNET_SCHEDULER_add_delayed (IDLE_TIMEOUT,
&timeout_cadet_task,
@@ -530,9 +530,9 @@ cleaner_cb (void *cls,
GNUNET_STATISTICS_update (GSF_stats,
gettext_noop ("# cadet connections active"), -1,
GNUNET_NO);
- if (GNUNET_SCHEDULER_NO_TASK != sc->terminate_task)
+ if (NULL != sc->terminate_task)
GNUNET_SCHEDULER_cancel (sc->terminate_task);
- if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task)
+ if (NULL != sc->timeout_task)
GNUNET_SCHEDULER_cancel (sc->timeout_task);
if (NULL != sc->wh)
GNUNET_CADET_notify_transmit_ready_cancel (sc->wh);
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c
index 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
/**
* Task called on timeout, or 0 for none.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Function to call to get the actual message.
@@ -155,7 +155,7 @@ struct GSF_DelayedHandle
/**
* Task for the delay.
*/
- GNUNET_SCHEDULER_TaskIdentifier delay_task;
+ struct GNUNET_SCHEDULER_Task * delay_task;
/**
* Size of the message.
@@ -184,7 +184,7 @@ struct PeerRequest
/**
* Task for asynchronous stopping of this request.
*/
- GNUNET_SCHEDULER_TaskIdentifier kill_task;
+ struct GNUNET_SCHEDULER_Task * kill_task;
};
@@ -209,7 +209,7 @@ struct GSF_ConnectedPeer
/**
* Task scheduled to revive migration to this peer.
*/
- GNUNET_SCHEDULER_TaskIdentifier mig_revive_task;
+ struct GNUNET_SCHEDULER_Task * mig_revive_task;
/**
* Messages (replies, queries, content migration) we would like to
@@ -248,7 +248,7 @@ struct GSF_ConnectedPeer
/**
* Task scheduled if we need to retry bandwidth reservation later.
*/
- GNUNET_SCHEDULER_TaskIdentifier rc_delay_task;
+ struct GNUNET_SCHEDULER_Task * rc_delay_task;
/**
* Active requests from this neighbour, map of query to 'struct PeerRequest'.
@@ -472,10 +472,10 @@ peer_transmit_ready_cb (void *cls, size_t size, void *buf)
schedule_transmission (pth);
return 0;
}
- if (GNUNET_SCHEDULER_NO_TASK != pth->timeout_task)
+ if (NULL != pth->timeout_task)
{
GNUNET_SCHEDULER_cancel (pth->timeout_task);
- pth->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ pth->timeout_task = NULL;
}
GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
if (GNUNET_YES == pth->is_query)
@@ -516,7 +516,7 @@ retry_reservation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_PeerIdentity target;
GNUNET_PEER_resolve (cp->ppd.pid, &target);
- cp->rc_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ cp->rc_delay_task = NULL;
cp->rc =
GNUNET_ATS_reserve_bandwidth (GSF_ats, &target, DBLOCK_SIZE,
&ats_reserve_callback, cp);
@@ -652,7 +652,7 @@ revive_migration (void *cls,
struct GSF_ConnectedPeer *cp = cls;
struct GNUNET_TIME_Relative bt;
- cp->mig_revive_task = GNUNET_SCHEDULER_NO_TASK;
+ cp->mig_revive_task = NULL;
bt = GNUNET_TIME_absolute_get_remaining (cp->ppd.migration_blocked_until);
if (0 != bt.rel_value_us)
{
@@ -715,7 +715,7 @@ GSF_handle_p2p_migration_stop_ (void *cls,
GNUNET_i2s (other),
GNUNET_STRINGS_relative_time_to_string (bt, GNUNET_YES));
cp->ppd.migration_blocked_until = GNUNET_TIME_relative_to_absolute (bt);
- if (GNUNET_SCHEDULER_NO_TASK == cp->mig_revive_task)
+ if (NULL == cp->mig_revive_task)
{
GSF_push_stop_ (cp);
cp->mig_revive_task =
@@ -773,10 +773,10 @@ free_pending_request (struct PeerRequest *peerreq,
{
struct GSF_ConnectedPeer *cp = peerreq->cp;
- if (GNUNET_SCHEDULER_NO_TASK != peerreq->kill_task)
+ if (NULL != peerreq->kill_task)
{
GNUNET_SCHEDULER_cancel (peerreq->kill_task);
- peerreq->kill_task = GNUNET_SCHEDULER_NO_TASK;
+ peerreq->kill_task = NULL;
}
GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# P2P searches active"),
-1, GNUNET_NO);
@@ -825,7 +825,7 @@ peer_request_destroy (void *cls,
struct GSF_PendingRequest *pr = peerreq->pr;
struct GSF_PendingRequestData *prd;
- peerreq->kill_task = GNUNET_SCHEDULER_NO_TASK;
+ peerreq->kill_task = NULL;
prd = GSF_pending_request_get_data_ (pr);
cancel_pending_request (NULL, &prd->query, peerreq);
}
@@ -987,7 +987,7 @@ handle_p2p_reply (void *cls,
}
if (GNUNET_BLOCK_EVALUATION_OK_LAST != eval)
return;
- if (GNUNET_SCHEDULER_NO_TASK == peerreq->kill_task)
+ if (NULL == peerreq->kill_task)
{
GNUNET_STATISTICS_update (GSF_stats,
gettext_noop
@@ -1356,7 +1356,7 @@ peer_transmit_timeout (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Timeout trying to transmit to other peer\n");
- pth->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ pth->timeout_task = NULL;
cp = pth->cp;
GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
if (GNUNET_YES == pth->is_query)
@@ -1440,10 +1440,10 @@ GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth)
{
struct GSF_ConnectedPeer *cp;
- if (GNUNET_SCHEDULER_NO_TASK != pth->timeout_task)
+ if (NULL != pth->timeout_task)
{
GNUNET_SCHEDULER_cancel (pth->timeout_task);
- pth->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ pth->timeout_task = NULL;
}
cp = pth->cp;
GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
@@ -1586,10 +1586,10 @@ GSF_peer_disconnect_handler_ (void *cls,
GNUNET_ATS_reserve_bandwidth_cancel (cp->rc);
cp->rc = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != cp->rc_delay_task)
+ if (NULL != cp->rc_delay_task)
{
GNUNET_SCHEDULER_cancel (cp->rc_delay_task);
- cp->rc_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ cp->rc_delay_task = NULL;
}
GNUNET_CONTAINER_multihashmap_iterate (cp->request_map,
&cancel_pending_request, cp);
@@ -1608,10 +1608,10 @@ GSF_peer_disconnect_handler_ (void *cls,
GNUNET_assert (0 == cp->cth_in_progress);
while (NULL != (pth = cp->pth_head))
{
- if (pth->timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (pth->timeout_task != NULL)
{
GNUNET_SCHEDULER_cancel (pth->timeout_task);
- pth->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ pth->timeout_task = NULL;
}
GNUNET_CONTAINER_DLL_remove (cp->pth_head, cp->pth_tail, pth);
pth->gmc (pth->gmc_cls, 0, NULL);
@@ -1625,10 +1625,10 @@ GSF_peer_disconnect_handler_ (void *cls,
GNUNET_free (dh);
}
GNUNET_PEER_change_rc (cp->ppd.pid, -1);
- if (GNUNET_SCHEDULER_NO_TASK != cp->mig_revive_task)
+ if (NULL != cp->mig_revive_task)
{
GNUNET_SCHEDULER_cancel (cp->mig_revive_task);
- cp->mig_revive_task = GNUNET_SCHEDULER_NO_TASK;
+ cp->mig_revive_task = NULL;
}
GNUNET_free (cp);
}
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c
index 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
/**
* Task scheduled to destroy the request.
*/
- GNUNET_SCHEDULER_TaskIdentifier kill_task;
+ struct GNUNET_SCHEDULER_Task * kill_task;
};
@@ -193,7 +193,7 @@ client_request_destroy (void *cls,
struct ClientRequest *cr = cls;
struct GSF_LocalClient *lc;
- cr->kill_task = GNUNET_SCHEDULER_NO_TASK;
+ cr->kill_task = NULL;
lc = cr->lc;
GNUNET_CONTAINER_DLL_remove (lc->cr_head, lc->cr_tail, cr);
GSF_pending_request_cancel_ (cr->pr, GNUNET_YES);
@@ -242,7 +242,7 @@ client_response_handler (void *cls,
if (NULL == data)
{
/* local-only request, with no result, clean up. */
- if (GNUNET_SCHEDULER_NO_TASK == cr->kill_task)
+ if (NULL == cr->kill_task)
cr->kill_task = GNUNET_SCHEDULER_add_now (&client_request_destroy,
cr);
return;
@@ -285,7 +285,7 @@ client_response_handler (void *cls,
(int) eval);
return;
}
- if (GNUNET_SCHEDULER_NO_TASK == cr->kill_task)
+ if (NULL == cr->kill_task)
cr->kill_task = GNUNET_SCHEDULER_add_now (&client_request_destroy, cr);
}
@@ -497,7 +497,7 @@ GSF_client_disconnect_handler_ (void *cls,
return;
while (NULL != (cr = pos->cr_head))
{
- if (GNUNET_SCHEDULER_NO_TASK != cr->kill_task)
+ if (NULL != cr->kill_task)
GNUNET_SCHEDULER_cancel (cr->kill_task);
client_request_destroy (cr, NULL);
}
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c
index 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
/**
* Current task for executing the plan.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
};
@@ -337,7 +337,7 @@ plan (struct PeerPlan *pp, struct GSF_RequestPlan *rp)
GNUNET_CONTAINER_multihashmap_contains_value (pp->plan_map,
get_rp_key (rp),
rp));
- if (GNUNET_SCHEDULER_NO_TASK != pp->task)
+ if (NULL != pp->task)
GNUNET_SCHEDULER_cancel (pp->task);
pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
#undef N
@@ -391,7 +391,7 @@ transmit_message_callback (void *cls, size_t buf_size, void *buf)
if (NULL == buf)
{
/* failed, try again... */
- if (GNUNET_SCHEDULER_NO_TASK != pp->task)
+ if (NULL != pp->task)
GNUNET_SCHEDULER_cancel (pp->task);
pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
@@ -404,7 +404,7 @@ transmit_message_callback (void *cls, size_t buf_size, void *buf)
rp = GNUNET_CONTAINER_heap_peek (pp->priority_heap);
if (NULL == rp)
{
- if (GNUNET_SCHEDULER_NO_TASK != pp->task)
+ if (NULL != pp->task)
GNUNET_SCHEDULER_cancel (pp->task);
pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
return 0;
@@ -412,7 +412,7 @@ transmit_message_callback (void *cls, size_t buf_size, void *buf)
msize = GSF_pending_request_get_message_ (get_latest (rp), buf_size, buf);
if (msize > buf_size)
{
- if (GNUNET_SCHEDULER_NO_TASK != pp->task)
+ if (NULL != pp->task)
GNUNET_SCHEDULER_cancel (pp->task);
/* buffer to small (message changed), try again */
pp->task = GNUNET_SCHEDULER_add_now (&schedule_peer_transmission, pp);
@@ -451,7 +451,7 @@ schedule_peer_transmission (void *cls,
size_t msize;
struct GNUNET_TIME_Relative delay;
- pp->task = GNUNET_SCHEDULER_NO_TASK;
+ pp->task = NULL;
if (NULL != pp->pth)
{
GSF_peer_transmit_cancel_ (pp->pth);
@@ -661,10 +661,10 @@ GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp)
GSF_peer_transmit_cancel_ (pp->pth);
pp->pth = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pp->task)
+ if (NULL != pp->task)
{
GNUNET_SCHEDULER_cancel (pp->task);
- pp->task = GNUNET_SCHEDULER_NO_TASK;
+ pp->task = NULL;
}
while (NULL != (rp = GNUNET_CONTAINER_heap_remove_root (pp->priority_heap)))
{
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c
index 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
/**
* Task that warns us if the local datastore lookup takes too long.
*/
- GNUNET_SCHEDULER_TaskIdentifier warn_task;
+ struct GNUNET_SCHEDULER_Task * warn_task;
/**
* Current offset for querying our local datastore for results.
@@ -632,10 +632,10 @@ clean_request (void *cls, const struct GNUNET_HashCode *key, void *value)
GNUNET_DHT_get_stop (pr->gh);
pr->gh = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pr->warn_task)
+ if (NULL != pr->warn_task)
{
GNUNET_SCHEDULER_cancel (pr->warn_task);
- pr->warn_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->warn_task = NULL;
}
GNUNET_assert (GNUNET_OK ==
GNUNET_CONTAINER_multihashmap_remove (pr_map,
@@ -690,10 +690,10 @@ GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, int full_cleanup)
GNUNET_DHT_get_stop (pr->gh);
pr->gh = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pr->warn_task)
+ if (NULL != pr->warn_task)
{
GNUNET_SCHEDULER_cancel (pr->warn_task);
- pr->warn_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->warn_task = NULL;
}
return;
}
@@ -1307,7 +1307,7 @@ process_local_reply (void *cls, const struct GNUNET_HashCode * key, size_t size,
unsigned int old_rf;
GNUNET_SCHEDULER_cancel (pr->warn_task);
- pr->warn_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->warn_task = NULL;
if (NULL != pr->qe)
{
pr->qe = NULL;
@@ -1514,10 +1514,10 @@ process_local_reply (void *cls, const struct GNUNET_HashCode * key, size_t size,
check_error_and_continue:
if (NULL != pr->qe)
return;
- if (GNUNET_SCHEDULER_NO_TASK != pr->warn_task)
+ if (NULL != pr->warn_task)
{
GNUNET_SCHEDULER_cancel (pr->warn_task);
- pr->warn_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->warn_task = NULL;
}
if (NULL == (cont = pr->llc_cont))
return; /* no continuation */
@@ -1620,7 +1620,7 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr,
("# Datastore lookups concluded (error queueing)"),
1, GNUNET_NO);
GNUNET_SCHEDULER_cancel (pr->warn_task);
- pr->warn_task = GNUNET_SCHEDULER_NO_TASK;
+ pr->warn_task = NULL;
pr->llc_cont = NULL;
if (NULL != cont)
cont (cont_cls, pr, pr->local_result);
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c
index 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;
/**
* ID of task that collects blocks for migration.
*/
-static GNUNET_SCHEDULER_TaskIdentifier mig_task;
+static struct GNUNET_SCHEDULER_Task * mig_task;
/**
* What is the maximum frequency at which we are allowed to
@@ -452,7 +452,7 @@ consider_gathering ()
return;
if (NULL != mig_qe)
return;
- if (GNUNET_SCHEDULER_NO_TASK != mig_task)
+ if (NULL != mig_task)
return;
if (mig_size >= MAX_MIGRATION_QUEUE)
return;
@@ -575,7 +575,7 @@ static void
gather_migration_blocks (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- mig_task = GNUNET_SCHEDULER_NO_TASK;
+ mig_task = NULL;
if (mig_size >= MAX_MIGRATION_QUEUE)
return;
if (NULL == GSF_dsh)
@@ -682,10 +682,10 @@ GSF_push_init_ ()
void
GSF_push_done_ ()
{
- if (GNUNET_SCHEDULER_NO_TASK != mig_task)
+ if (NULL != mig_task)
{
GNUNET_SCHEDULER_cancel (mig_task);
- mig_task = GNUNET_SCHEDULER_NO_TASK;
+ mig_task = NULL;
}
if (NULL != mig_qe)
{
diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c
index 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
/**
* ID of task that collects blocks for DHT PUTs.
*/
- GNUNET_SCHEDULER_TaskIdentifier dht_task;
+ struct GNUNET_SCHEDULER_Task * dht_task;
/**
* How many entires with zero anonymity of our type do we currently
@@ -158,7 +158,7 @@ delay_dht_put_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct PutOperator *po = cls;
- po->dht_task = GNUNET_SCHEDULER_NO_TASK;
+ po->dht_task = NULL;
schedule_next_put (po);
}
@@ -219,7 +219,7 @@ gather_dht_put_blocks (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct PutOperator *po = cls;
- po->dht_task = GNUNET_SCHEDULER_NO_TASK;
+ po->dht_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
po->dht_qe =
@@ -263,10 +263,10 @@ GSF_put_done_ ()
i = 0;
while ((po = &operators[i])->dht_put_type != GNUNET_BLOCK_TYPE_ANY)
{
- if (GNUNET_SCHEDULER_NO_TASK != po->dht_task)
+ if (NULL != po->dht_task)
{
GNUNET_SCHEDULER_cancel (po->dht_task);
- po->dht_task = GNUNET_SCHEDULER_NO_TASK;
+ po->dht_task = NULL;
}
if (NULL != po->dht_put)
{
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c
index 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;
static struct GNUNET_FS_PublishContext *publish;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_kill;
+static struct GNUNET_SCHEDULER_Task * timeout_kill;
static char *fn;
@@ -80,7 +80,7 @@ timeout_kill_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
publish = NULL;
}
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Timeout downloading file\n");
- timeout_kill = GNUNET_SCHEDULER_NO_TASK;
+ timeout_kill = NULL;
err = 1;
}
@@ -120,7 +120,7 @@ abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_free (fn);
fn = NULL;
GNUNET_SCHEDULER_cancel (timeout_kill);
- timeout_kill = GNUNET_SCHEDULER_NO_TASK;
+ timeout_kill = NULL;
}
diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c
index 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;
static struct GNUNET_FS_PublishContext *publish;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_kill;
+static struct GNUNET_SCHEDULER_Task * timeout_kill;
static char *fn;
@@ -75,7 +75,7 @@ timeout_kill_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_FS_publish_stop (publish);
publish = NULL;
}
- timeout_kill = GNUNET_SCHEDULER_NO_TASK;
+ timeout_kill = NULL;
err = 1;
}
@@ -107,7 +107,7 @@ abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_free (fn);
fn = NULL;
GNUNET_SCHEDULER_cancel (timeout_kill);
- timeout_kill = GNUNET_SCHEDULER_NO_TASK;
+ timeout_kill = NULL;
}
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c
index 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;
static struct GNUNET_FS_SearchContext *ksk_search;
-static GNUNET_SCHEDULER_TaskIdentifier kill_task;
+static struct GNUNET_SCHEDULER_Task * kill_task;
static int update_started;
@@ -58,7 +58,7 @@ abort_ksk_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (sks_search == NULL)
{
GNUNET_FS_stop (fs);
- if (GNUNET_SCHEDULER_NO_TASK != kill_task)
+ if (NULL != kill_task)
GNUNET_SCHEDULER_cancel (kill_task);
}
}
@@ -75,7 +75,7 @@ abort_sks_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (ksk_search == NULL)
{
GNUNET_FS_stop (fs);
- if (GNUNET_SCHEDULER_NO_TASK != kill_task)
+ if (NULL != kill_task)
GNUNET_SCHEDULER_cancel (kill_task);
}
}
@@ -86,7 +86,7 @@ do_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
err = 1;
FPRINTF (stderr, "%s", "Operation timed out\n");
- kill_task = GNUNET_SCHEDULER_NO_TASK;
+ kill_task = NULL;
abort_sks_search_task (NULL, tc);
abort_ksk_search_task (NULL, tc);
}
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c
index 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;
static int err;
-static GNUNET_SCHEDULER_TaskIdentifier rtask;
+static struct GNUNET_SCHEDULER_Task * rtask;
static void
@@ -76,10 +76,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
fn2 = NULL;
GNUNET_FS_stop (fs);
fs = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != rtask)
+ if (NULL != rtask)
{
GNUNET_SCHEDULER_cancel (rtask);
- rtask = GNUNET_SCHEDULER_NO_TASK;
+ rtask = NULL;
}
}
@@ -91,7 +91,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event);
static void
restart_fs_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- rtask = GNUNET_SCHEDULER_NO_TASK;
+ rtask = NULL;
GNUNET_FS_stop (fs);
fs = GNUNET_FS_start (cfg, "test-fs-publish-persistence",
&progress_cb, NULL,
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c
index 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;
static struct GNUNET_FS_PublishContext *publish;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
static int err;
@@ -65,10 +65,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_FS_publish_stop (publish);
publish = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
+ if (NULL != timeout_task)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
}
@@ -78,7 +78,7 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
fprintf (stderr,
"Timeout\n");
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
if (NULL != search)
{
GNUNET_FS_search_stop (search);
diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c
index 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;
static const struct GNUNET_CONFIGURATION_Handle *cfg;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
static int err;
@@ -62,7 +62,7 @@ static int err;
static void
abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
fprintf (stderr,
"Timeout\n");
if (NULL != search)
@@ -86,10 +86,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_FS_publish_stop (publish);
publish = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
+ if (NULL != timeout_task)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
}
diff --git a/src/fs/test_fs_search_probes.c b/src/fs/test_fs_search_probes.c
index 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;
static struct GNUNET_FS_PublishContext *publish;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
static int err;
@@ -61,7 +61,7 @@ static int err;
static void
abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
fprintf (stderr,
"Timeout\n");
if (NULL != search)
@@ -86,10 +86,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_FS_publish_stop (publish);
publish = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
+ if (NULL != timeout_task)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
}
diff --git a/src/fs/test_fs_search_with_and.c b/src/fs/test_fs_search_with_and.c
index 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;
static struct GNUNET_FS_PublishContext *publish;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
static int err;
@@ -73,10 +73,10 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_FS_publish_stop (publish);
publish = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
+ if (NULL != timeout_task)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
}
@@ -86,7 +86,7 @@ abort_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
fprintf (stderr,
"Timeout\n");
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
if (NULL != search)
{
GNUNET_FS_search_stop (search);
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
/**
* Reconnect task
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* How long do we wait until we try to reconnect?
@@ -210,7 +210,7 @@ reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_GNS_Handle *handle = cls;
- handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ handle->reconnect_task = NULL;
reconnect (handle);
}
@@ -484,10 +484,10 @@ GNUNET_GNS_disconnect (struct GNUNET_GNS_Handle *handle)
GNUNET_CLIENT_disconnect (handle->client);
handle->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != handle->reconnect_task)
+ if (NULL != handle->reconnect_task)
{
GNUNET_SCHEDULER_cancel (handle->reconnect_task);
- handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ handle->reconnect_task = NULL;
}
GNUNET_assert (NULL == handle->lookup_head);
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;
/**
* Our primary task for the HTTPD.
*/
-static GNUNET_SCHEDULER_TaskIdentifier http_task;
+static struct GNUNET_SCHEDULER_Task * http_task;
/**
* Our main website.
@@ -278,7 +278,7 @@ access_handler_callback (void *cls, struct MHD_Connection *connection,
* Function that queries MHD's select sets and
* starts the task waiting for them.
*/
-static GNUNET_SCHEDULER_TaskIdentifier
+static struct GNUNET_SCHEDULER_Task *
prepare_daemon (struct MHD_Daemon *daemon_handle);
@@ -291,7 +291,7 @@ run_daemon (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct MHD_Daemon *daemon_handle = cls;
- http_task = GNUNET_SCHEDULER_NO_TASK;
+ http_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
GNUNET_assert (MHD_YES == MHD_run (daemon_handle));
@@ -303,10 +303,10 @@ run_daemon (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
* Function that queries MHD's select sets and
* starts the task waiting for them.
*/
-static GNUNET_SCHEDULER_TaskIdentifier
+static struct GNUNET_SCHEDULER_Task *
prepare_daemon (struct MHD_Daemon *daemon_handle)
{
- GNUNET_SCHEDULER_TaskIdentifier ret;
+ struct GNUNET_SCHEDULER_Task * ret;
fd_set rs;
fd_set ws;
fd_set es;
@@ -389,10 +389,10 @@ server_stop (void *cls,
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"HTTP server shutdown\n");
- if (GNUNET_SCHEDULER_NO_TASK != http_task)
+ if (NULL != http_task)
{
GNUNET_SCHEDULER_cancel (http_task);
- http_task = GNUNET_SCHEDULER_NO_TASK;
+ http_task = NULL;
}
if (NULL != daemon_handle)
{
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
* Task run on timeout or shutdown to clean up without
* response.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Number of bytes in 'addr'.
@@ -113,12 +113,12 @@ static struct GNUNET_NETWORK_Handle *listen_socket6;
/**
* Task for IPv4 socket.
*/
-static GNUNET_SCHEDULER_TaskIdentifier t4;
+static struct GNUNET_SCHEDULER_Task * t4;
/**
* Task for IPv6 socket.
*/
-static GNUNET_SCHEDULER_TaskIdentifier t6;
+static struct GNUNET_SCHEDULER_Task * t6;
/**
* DNS suffix, suffix of this gateway in DNS; defaults to '.zkey.eu'
@@ -176,9 +176,9 @@ static void
do_shutdown (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (GNUNET_SCHEDULER_NO_TASK != t4)
+ if (NULL != t4)
GNUNET_SCHEDULER_cancel (t4);
- if (GNUNET_SCHEDULER_NO_TASK != t6)
+ if (NULL != t6)
GNUNET_SCHEDULER_cancel (t6);
if (NULL != listen_socket4)
{
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
/**
* The task ID
*/
- GNUNET_SCHEDULER_TaskIdentifier httpd_task;
+ struct GNUNET_SCHEDULER_Task * httpd_task;
/**
* is this an ssl daemon?
@@ -456,17 +456,17 @@ struct Socks5Request
/**
* Client socket read task
*/
- GNUNET_SCHEDULER_TaskIdentifier rtask;
+ struct GNUNET_SCHEDULER_Task * rtask;
/**
* Client socket write task
*/
- GNUNET_SCHEDULER_TaskIdentifier wtask;
+ struct GNUNET_SCHEDULER_Task * wtask;
/**
* Timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Read buffer
@@ -593,17 +593,17 @@ static struct GNUNET_NETWORK_Handle *lsock6;
/**
* The listen task ID for IPv4
*/
-static GNUNET_SCHEDULER_TaskIdentifier ltask4;
+static struct GNUNET_SCHEDULER_Task * ltask4;
/**
* The listen task ID for IPv6
*/
-static GNUNET_SCHEDULER_TaskIdentifier ltask6;
+static struct GNUNET_SCHEDULER_Task * ltask6;
/**
* The cURL download task (curl multi API).
*/
-static GNUNET_SCHEDULER_TaskIdentifier curl_download_task;
+static struct GNUNET_SCHEDULER_Task * curl_download_task;
/**
* The cURL multi handle
@@ -716,11 +716,11 @@ cleanup_s5r (struct Socks5Request *s5r)
if ( (NULL != s5r->response) &&
(curl_failure_response != s5r->response) )
MHD_destroy_response (s5r->response);
- if (GNUNET_SCHEDULER_NO_TASK != s5r->rtask)
+ if (NULL != s5r->rtask)
GNUNET_SCHEDULER_cancel (s5r->rtask);
- if (GNUNET_SCHEDULER_NO_TASK != s5r->timeout_task)
+ if (NULL != s5r->timeout_task)
GNUNET_SCHEDULER_cancel (s5r->timeout_task);
- if (GNUNET_SCHEDULER_NO_TASK != s5r->wtask)
+ if (NULL != s5r->wtask)
GNUNET_SCHEDULER_cancel (s5r->wtask);
if (NULL != s5r->gns_lookup)
GNUNET_GNS_lookup_cancel (s5r->gns_lookup);
@@ -1266,10 +1266,10 @@ curl_download_prepare ()
long to;
struct GNUNET_TIME_Relative rtime;
- if (GNUNET_SCHEDULER_NO_TASK != curl_download_task)
+ if (NULL != curl_download_task)
{
GNUNET_SCHEDULER_cancel (curl_download_task);
- curl_download_task = GNUNET_SCHEDULER_NO_TASK;
+ curl_download_task = NULL;
}
max = -1;
FD_ZERO (&rs);
@@ -1327,7 +1327,7 @@ curl_task_download (void *cls,
CURLMcode mret;
struct Socks5Request *s5r;
- curl_download_task = GNUNET_SCHEDULER_NO_TASK;
+ curl_download_task = NULL;
do
{
running = 0;
@@ -1750,7 +1750,7 @@ mhd_log_callback (void *cls,
}
s5r->url = GNUNET_strdup (url);
GNUNET_SCHEDULER_cancel (s5r->timeout_task);
- s5r->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ s5r->timeout_task = NULL;
return s5r;
}
}
@@ -1772,10 +1772,10 @@ kill_httpd (struct MhdHttpList *hd)
hd);
GNUNET_free_non_null (hd->domain);
MHD_stop_daemon (hd->daemon);
- if (GNUNET_SCHEDULER_NO_TASK != hd->httpd_task)
+ if (NULL != hd->httpd_task)
{
GNUNET_SCHEDULER_cancel (hd->httpd_task);
- hd->httpd_task = GNUNET_SCHEDULER_NO_TASK;
+ hd->httpd_task = NULL;
}
GNUNET_free_non_null (hd->proxy_cert);
if (hd == httpd)
@@ -1796,7 +1796,7 @@ kill_httpd_task (void *cls,
{
struct MhdHttpList *hd = cls;
- hd->httpd_task = GNUNET_SCHEDULER_NO_TASK;
+ hd->httpd_task = NULL;
kill_httpd (hd);
}
@@ -1858,7 +1858,7 @@ schedule_httpd (struct MhdHttpList *hd)
wrs = NULL;
wws = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != hd->httpd_task)
+ if (NULL != hd->httpd_task)
GNUNET_SCHEDULER_cancel (hd->httpd_task);
if ( (MHD_YES != haveto) &&
(-1 == max) &&
@@ -1895,7 +1895,7 @@ do_httpd (void *cls,
{
struct MhdHttpList *hd = cls;
- hd->httpd_task = GNUNET_SCHEDULER_NO_TASK;
+ hd->httpd_task = NULL;
MHD_run (hd->daemon);
schedule_httpd (hd);
}
@@ -1909,7 +1909,7 @@ do_httpd (void *cls,
static void
run_mhd_now (struct MhdHttpList *hd)
{
- if (GNUNET_SCHEDULER_NO_TASK !=
+ if (NULL !=
hd->httpd_task)
GNUNET_SCHEDULER_cancel (hd->httpd_task);
hd->httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd,
@@ -2146,7 +2146,7 @@ timeout_s5r_handshake (void *cls,
{
struct Socks5Request *s5r = cls;
- s5r->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ s5r->timeout_task = NULL;
cleanup_s5r (s5r);
}
@@ -2221,7 +2221,7 @@ do_write (void *cls,
struct Socks5Request *s5r = cls;
ssize_t len;
- s5r->wtask = GNUNET_SCHEDULER_NO_TASK;
+ s5r->wtask = NULL;
len = GNUNET_NETWORK_socket_send (s5r->sock,
s5r->wbuf,
s5r->wbuf_len);
@@ -2253,7 +2253,7 @@ do_write (void *cls,
GNUNET_assert (0);
break;
case SOCKS5_REQUEST:
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != s5r->rtask);
+ GNUNET_assert (NULL != s5r->rtask);
break;
case SOCKS5_DATA_TRANSFER:
setup_data_transfer (s5r);
@@ -2285,7 +2285,7 @@ signal_socks_failure (struct Socks5Request *s5r,
s_resp->version = SOCKS_VERSION_5;
s_resp->reply = sc;
s5r->state = SOCKS5_WRITE_THEN_CLEANUP;
- if (GNUNET_SCHEDULER_NO_TASK != s5r->wtask)
+ if (NULL != s5r->wtask)
s5r->wtask =
GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
s5r->sock,
@@ -2314,7 +2314,7 @@ signal_socks_success (struct Socks5Request *s5r)
sizeof (struct in_addr) + sizeof (uint16_t));
s5r->wbuf_len += sizeof (struct Socks5ServerResponseMessage) +
sizeof (struct in_addr) + sizeof (uint16_t);
- if (GNUNET_SCHEDULER_NO_TASK == s5r->wtask)
+ if (NULL == s5r->wtask)
s5r->wtask =
GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
s5r->sock,
@@ -2482,7 +2482,7 @@ do_s5r_read (void *cls,
ssize_t rlen;
size_t alen;
- s5r->rtask = GNUNET_SCHEDULER_NO_TASK;
+ s5r->rtask = NULL;
if ( (NULL != tc->read_ready) &&
(GNUNET_NETWORK_fdset_isset (tc->read_ready, s5r->sock)) )
{
@@ -2527,7 +2527,7 @@ do_s5r_read (void *cls,
s5r->wbuf_len = sizeof (struct Socks5ServerHelloMessage);
s_hello->version = SOCKS_VERSION_5;
s_hello->auth_method = SOCKS_AUTH_NONE;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == s5r->wtask);
+ GNUNET_assert (NULL == s5r->wtask);
s5r->wtask = GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
s5r->sock,
&do_write, s5r);
@@ -2666,7 +2666,7 @@ do_s5r_read (void *cls,
}
/* We are done reading right now */
GNUNET_SCHEDULER_cancel (s5r->rtask);
- s5r->rtask = GNUNET_SCHEDULER_NO_TASK;
+ s5r->rtask = NULL;
return;
case SOCKS5_RESOLVING:
GNUNET_assert (0);
@@ -2696,9 +2696,9 @@ do_accept (void *cls,
struct Socks5Request *s5r;
if (lsock == lsock4)
- ltask4 = GNUNET_SCHEDULER_NO_TASK;
+ ltask4 = NULL;
else
- ltask6 = GNUNET_SCHEDULER_NO_TASK;
+ ltask6 = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
if (lsock == lsock4)
@@ -2778,20 +2778,20 @@ do_shutdown (void *cls,
GNUNET_GNS_disconnect (gns_handle);
gns_handle = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != curl_download_task)
+ if (NULL != curl_download_task)
{
GNUNET_SCHEDULER_cancel (curl_download_task);
- curl_download_task = GNUNET_SCHEDULER_NO_TASK;
+ curl_download_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != ltask4)
+ if (NULL != ltask4)
{
GNUNET_SCHEDULER_cancel (ltask4);
- ltask4 = GNUNET_SCHEDULER_NO_TASK;
+ ltask4 = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != ltask6)
+ if (NULL != ltask6)
{
GNUNET_SCHEDULER_cancel (ltask6);
- ltask6 = GNUNET_SCHEDULER_NO_TASK;
+ ltask6 = NULL;
}
gnutls_x509_crt_deinit (proxy_ca.cert);
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;
/**
* zone publish task
*/
-static GNUNET_SCHEDULER_TaskIdentifier zone_publish_task;
+static struct GNUNET_SCHEDULER_Task * zone_publish_task;
/**
* #GNUNET_YES if zone has never been published before
@@ -281,10 +281,10 @@ shutdown_task (void *cls,
GNUNET_STATISTICS_destroy (statistics, GNUNET_NO);
statistics = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != zone_publish_task)
+ if (NULL != zone_publish_task)
{
GNUNET_SCHEDULER_cancel (zone_publish_task);
- zone_publish_task = GNUNET_SCHEDULER_NO_TASK;
+ zone_publish_task = NULL;
}
if (NULL != namestore_iter)
{
@@ -329,7 +329,7 @@ static void
publish_zone_dht_next (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- zone_publish_task = GNUNET_SCHEDULER_NO_TASK;
+ zone_publish_task = NULL;
GNUNET_NAMESTORE_zone_iterator_next (namestore_iter);
}
@@ -609,7 +609,7 @@ static void
publish_zone_dht_start (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- zone_publish_task = GNUNET_SCHEDULER_NO_TASK;
+ zone_publish_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"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
/**
* ID of a task associated with the resolution process.
*/
- GNUNET_SCHEDULER_TaskIdentifier task_id;
+ struct GNUNET_SCHEDULER_Task * task_id;
/**
* The name to resolve
@@ -549,7 +549,7 @@ fail_resolution (void *cls,
{
struct GNS_ResolverHandle *rh = cls;
- rh->task_id = GNUNET_SCHEDULER_NO_TASK;
+ rh->task_id = NULL;
rh->proc (rh->proc_cls, 0, NULL);
GNS_resolver_lookup_cancel (rh);
}
@@ -845,7 +845,7 @@ dns_result_parser (void *cls,
rh->dns_request = NULL;
GNUNET_SCHEDULER_cancel (rh->task_id);
- rh->task_id = GNUNET_SCHEDULER_NO_TASK;
+ rh->task_id = NULL;
p = GNUNET_DNSPARSER_parse ((const char *) dns,
dns_len);
if (NULL == p)
@@ -2232,7 +2232,7 @@ recursive_resolution (void *cls,
{
struct GNS_ResolverHandle *rh = cls;
- rh->task_id = GNUNET_SCHEDULER_NO_TASK;
+ rh->task_id = NULL;
if (MAX_RECURSION < rh->loop_limiter++)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -2456,10 +2456,10 @@ GNS_resolver_lookup_cancel (struct GNS_ResolverHandle *rh)
GNUNET_free (rh->g2dc);
rh->g2dc = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != rh->task_id)
+ if (NULL != rh->task_id)
{
GNUNET_SCHEDULER_cancel (rh->task_id);
- rh->task_id = GNUNET_SCHEDULER_NO_TASK;
+ rh->task_id = NULL;
}
if (NULL != rh->get_handle)
{
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
/**
* Task to abort DHT lookup operation.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
};
@@ -160,10 +160,10 @@ free_get_pseu_authority_handle (struct GetPseuAuthorityHandle *gph)
GNUNET_NAMECACHE_cancel (gph->namecache_task);
gph->namecache_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != gph->timeout_task)
+ if (NULL != gph->timeout_task)
{
GNUNET_SCHEDULER_cancel (gph->timeout_task);
- gph->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ gph->timeout_task = NULL;
}
GNUNET_CONTAINER_DLL_remove (gph_head, gph_tail, gph);
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;
static struct MHD_Daemon *mhd;
-static GNUNET_SCHEDULER_TaskIdentifier mhd_task_id;
+static struct GNUNET_SCHEDULER_Task * mhd_task_id;
-static GNUNET_SCHEDULER_TaskIdentifier curl_task_id;
+static struct GNUNET_SCHEDULER_Task * curl_task_id;
static CURL *curl;
@@ -117,15 +117,15 @@ mhd_ahc (void *cls,
static void
do_shutdown ()
{
- if (mhd_task_id != GNUNET_SCHEDULER_NO_TASK)
+ if (mhd_task_id != NULL)
{
GNUNET_SCHEDULER_cancel (mhd_task_id);
- mhd_task_id = GNUNET_SCHEDULER_NO_TASK;
+ mhd_task_id = NULL;
}
- if (curl_task_id != GNUNET_SCHEDULER_NO_TASK)
+ if (curl_task_id != NULL)
{
GNUNET_SCHEDULER_cancel (curl_task_id);
- curl_task_id = GNUNET_SCHEDULER_NO_TASK;
+ curl_task_id = NULL;
}
if (NULL != mhd)
{
@@ -164,7 +164,7 @@ static void
curl_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- curl_task_id = GNUNET_SCHEDULER_NO_TASK;
+ curl_task_id = NULL;
curl_main ();
}
@@ -314,7 +314,7 @@ static void
mhd_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- mhd_task_id = GNUNET_SCHEDULER_NO_TASK;
+ mhd_task_id = NULL;
MHD_run (mhd);
mhd_main ();
}
@@ -332,7 +332,7 @@ mhd_main ()
unsigned MHD_LONG_LONG timeout;
struct GNUNET_TIME_Relative delay;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == mhd_task_id);
+ GNUNET_assert (NULL == mhd_task_id);
FD_ZERO (&rs);
FD_ZERO (&ws);
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,
return;
}
stats = GNUNET_STATISTICS_create ("hostlist", cfg);
+ if (NULL == stats)
+ {
+ GNUNET_break (0);
+ return;
+ }
if (bootstrapping)
- GNUNET_HOSTLIST_client_start (cfg, stats, &client_ch, &client_dh,
- &client_adv_handler, learning);
+ GNUNET_HOSTLIST_client_start (cfg, stats,
+ &client_ch,
+ &client_dh,
+ &client_adv_handler,
+ learning);
core =
GNUNET_CORE_connect (cfg, NULL,
&core_init,
&connect_handler,
- &disconnect_handler, NULL,
- GNUNET_NO, NULL,
- GNUNET_NO,
+ &disconnect_handler,
+ NULL, GNUNET_NO,
+ NULL, GNUNET_NO,
learning ? learn_handlers : no_learn_handlers);
@@ -346,7 +354,8 @@ main (int argc, char *const *argv)
GNUNET_log_setup ("hostlist", "WARNING", NULL);
ret =
(GNUNET_OK ==
- GNUNET_PROGRAM_run (argc, argv, "hostlist",
+ GNUNET_PROGRAM_run (argc, argv,
+ "hostlist",
_("GNUnet hostlist server and client"),
options,
&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;
/**
* ID of the task, checking if hostlist download should take plate
*/
-static GNUNET_SCHEDULER_TaskIdentifier ti_check_download;
+static struct GNUNET_SCHEDULER_Task * ti_check_download;
/**
* ID of the task downloading the hostlist
*/
-static GNUNET_SCHEDULER_TaskIdentifier ti_download;
+static struct GNUNET_SCHEDULER_Task * ti_download;
/**
* ID of the task saving the hostlsit in a regular intervall
*/
-static GNUNET_SCHEDULER_TaskIdentifier ti_saving_task;
+static struct GNUNET_SCHEDULER_Task * ti_saving_task;
/**
* ID of the task called to initiate a download
*/
-static GNUNET_SCHEDULER_TaskIdentifier ti_download_dispatcher_task;
+static struct GNUNET_SCHEDULER_Task * ti_download_dispatcher_task;
/**
* ID of the task controlling the locking between two hostlist tests
*/
-static GNUNET_SCHEDULER_TaskIdentifier ti_testing_intervall_task;
+static struct GNUNET_SCHEDULER_Task * ti_testing_intervall_task;
/**
* At what time MUST the current hostlist request be done?
@@ -846,7 +846,7 @@ task_download (void *cls,
struct CURLMsg *msg;
CURLMcode mret;
- ti_download = GNUNET_SCHEDULER_NO_TASK;
+ ti_download = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1044,7 +1044,7 @@ static void
task_download_dispatcher (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- ti_download_dispatcher_task = GNUNET_SCHEDULER_NO_TASK;
+ ti_download_dispatcher_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download is initiated...\n");
@@ -1075,7 +1075,7 @@ task_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static int once;
struct GNUNET_TIME_Relative delay;
- ti_check_download = GNUNET_SCHEDULER_NO_TASK;
+ ti_check_download = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
if (stats == NULL)
@@ -1084,7 +1084,7 @@ task_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
return; /* in shutdown */
}
if ( (stat_connection_count < MIN_CONNECTIONS) &&
- (GNUNET_SCHEDULER_NO_TASK == ti_download_dispatcher_task) )
+ (NULL == ti_download_dispatcher_task) )
ti_download_dispatcher_task =
GNUNET_SCHEDULER_add_now (&task_download_dispatcher, NULL);
@@ -1126,7 +1126,7 @@ static void
task_testing_intervall_reset (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- ti_testing_intervall_task = GNUNET_SCHEDULER_NO_TASK;
+ ti_testing_intervall_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
stat_testing_allowed = GNUNET_OK;
@@ -1144,7 +1144,7 @@ task_testing_intervall_reset (void *cls,
static void
task_hostlist_saving (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- ti_saving_task = GNUNET_SCHEDULER_NO_TASK;
+ ti_saving_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
save_hostlist_file (GNUNET_NO);
@@ -1284,7 +1284,7 @@ static void
primary_task (void *cls, int success)
{
sget = NULL;
- GNUNET_assert (stats != NULL);
+ GNUNET_assert (NULL != stats);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Statistics request done, scheduling hostlist download\n");
ti_check_download = GNUNET_SCHEDULER_add_now (&task_check, NULL);
@@ -1310,7 +1310,8 @@ process_stat (void *cls,
hostlist_delay.rel_value_us = value * 1000LL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Initial time between hostlist downloads is %s\n",
- GNUNET_STRINGS_relative_time_to_string (hostlist_delay, GNUNET_YES));
+ GNUNET_STRINGS_relative_time_to_string (hostlist_delay,
+ GNUNET_YES));
return GNUNET_OK;
}
@@ -1441,13 +1442,14 @@ save_hostlist_file (int shutdown)
if (NULL == wh)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- _
- ("Could not open file `%s' for writing to save hostlists: %s\n"),
- filename, STRERROR (errno));
+ _("Could not open file `%s' for writing to save hostlists: %s\n"),
+ filename,
+ STRERROR (errno));
GNUNET_free (filename);
return;
}
- GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Writing %u hostlist URIs to `%s'\n"),
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ _("Writing %u hostlist URIs to `%s'\n"),
linked_list_size, filename);
/* add code to write hostlists to file using bio */
ok = GNUNET_YES;
@@ -1525,6 +1527,7 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
transport = GNUNET_TRANSPORT_connect (c, NULL, NULL, NULL, NULL, NULL);
if (NULL == transport)
{
+ GNUNET_break (0);
curl_global_cleanup ();
return GNUNET_SYSERR;
}
@@ -1532,8 +1535,9 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
stats = st;
/* Read proxy configuration */
- if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg,
- "HOSTLIST", "PROXY", &proxy))
+ if (GNUNET_OK ==
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ "HOSTLIST", "PROXY", &proxy))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Found proxy host: `%s'\n",
@@ -1557,23 +1561,26 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
}
/* proxy type */
- if (GNUNET_OK == GNUNET_CONFIGURATION_get_value_string (cfg,
- "HOSTLIST", "PROXY_TYPE", &proxytype_str))
+ if (GNUNET_OK ==
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ "HOSTLIST",
+ "PROXY_TYPE",
+ &proxytype_str))
{
- GNUNET_STRINGS_utf8_toupper (proxytype_str, proxytype_str);
-
+ GNUNET_STRINGS_utf8_toupper (proxytype_str,
+ proxytype_str);
proxy_type = CURLPROXY_HTTP;
- if (0 == strcmp(proxytype_str, "HTTP"))
+ if (0 == strcmp (proxytype_str, "HTTP"))
proxy_type = CURLPROXY_HTTP;
- else if (0 == strcmp(proxytype_str, "HTTP_1_0"))
+ else if (0 == strcmp (proxytype_str, "HTTP_1_0"))
proxy_type = CURLPROXY_HTTP_1_0;
- else if (0 == strcmp(proxytype_str, "SOCKS4"))
+ else if (0 == strcmp (proxytype_str, "SOCKS4"))
proxy_type = CURLPROXY_SOCKS4;
- else if (0 == strcmp(proxytype_str, "SOCKS5"))
+ else if (0 == strcmp (proxytype_str, "SOCKS5"))
proxy_type = CURLPROXY_SOCKS5;
- else if (0 == strcmp(proxytype_str, "SOCKS4A"))
+ else if (0 == strcmp (proxytype_str, "SOCKS4A"))
proxy_type = CURLPROXY_SOCKS4A;
- else if (0 == strcmp(proxytype_str, "SOCKS5_HOSTNAME"))
+ else if (0 == strcmp (proxytype_str, "SOCKS5_HOSTNAME"))
proxy_type = CURLPROXY_SOCKS5_HOSTNAME;
else
{
@@ -1613,7 +1620,8 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
"Hostlists will be saved to file again in %s\n",
GNUNET_STRINGS_relative_time_to_string (SAVING_INTERVAL, GNUNET_YES));
ti_saving_task =
- GNUNET_SCHEDULER_add_delayed (SAVING_INTERVAL, &task_hostlist_saving,
+ GNUNET_SCHEDULER_add_delayed (SAVING_INTERVAL,
+ &task_hostlist_saving,
NULL);
}
else
@@ -1628,22 +1636,26 @@ GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
if (GNUNET_YES == GNUNET_DISK_file_test (filename))
{
result = remove (filename);
- if (result == 0)
+ if (0 == result)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _
- ("Since learning is not enabled on this peer, hostlist file `%s' was removed\n"),
+ _("Since learning is not enabled on this peer, hostlist file `%s' was removed\n"),
filename);
else
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Hostlist file `%s' could not be removed\n"), filename);
+ GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR,
+ "remove",
+ filename);
}
}
GNUNET_free (filename);
}
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Loading stats value on hostlist download frequency\n");
sget = GNUNET_STATISTICS_get (stats, "hostlist",
gettext_noop
("# milliseconds between hostlist downloads"),
- GNUNET_TIME_UNIT_MINUTES, &primary_task, &process_stat,
+ GNUNET_TIME_UNIT_MINUTES,
+ &primary_task,
+ &process_stat,
NULL);
return GNUNET_OK;
}
@@ -1664,31 +1676,31 @@ GNUNET_HOSTLIST_client_stop ()
stats = NULL;
if (GNUNET_YES == stat_learning)
save_hostlist_file (GNUNET_YES);
- if (ti_saving_task != GNUNET_SCHEDULER_NO_TASK)
+ if (ti_saving_task != NULL)
{
GNUNET_SCHEDULER_cancel (ti_saving_task);
- ti_saving_task = GNUNET_SCHEDULER_NO_TASK;
+ ti_saving_task = NULL;
}
- if (ti_download_dispatcher_task != GNUNET_SCHEDULER_NO_TASK)
+ if (ti_download_dispatcher_task != NULL)
{
GNUNET_SCHEDULER_cancel (ti_download_dispatcher_task);
- ti_download_dispatcher_task = GNUNET_SCHEDULER_NO_TASK;
+ ti_download_dispatcher_task = NULL;
}
- if (ti_testing_intervall_task != GNUNET_SCHEDULER_NO_TASK)
+ if (ti_testing_intervall_task != NULL)
{
GNUNET_SCHEDULER_cancel (ti_testing_intervall_task);
- ti_testing_intervall_task = GNUNET_SCHEDULER_NO_TASK;
+ ti_testing_intervall_task = NULL;
}
- if (ti_download != GNUNET_SCHEDULER_NO_TASK)
+ if (ti_download != NULL)
{
GNUNET_SCHEDULER_cancel (ti_download);
- ti_download = GNUNET_SCHEDULER_NO_TASK;
+ ti_download = NULL;
}
- if (ti_check_download != GNUNET_SCHEDULER_NO_TASK)
+ if (ti_check_download != NULL)
{
GNUNET_SCHEDULER_cancel (ti_check_download);
- ti_check_download = GNUNET_SCHEDULER_NO_TASK;
+ ti_check_download = NULL;
curl_global_cleanup ();
}
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;
/**
* Our primary task for IPv4.
*/
-static GNUNET_SCHEDULER_TaskIdentifier hostlist_task_v4;
+static struct GNUNET_SCHEDULER_Task * hostlist_task_v4;
/**
* Our primary task for IPv6.
*/
-static GNUNET_SCHEDULER_TaskIdentifier hostlist_task_v6;
+static struct GNUNET_SCHEDULER_Task * hostlist_task_v6;
/**
* Our canonical response.
@@ -618,7 +618,7 @@ process_notify (void *cls,
* Function that queries MHD's select sets and
* starts the task waiting for them.
*/
-static GNUNET_SCHEDULER_TaskIdentifier
+static struct GNUNET_SCHEDULER_Task *
prepare_daemon (struct MHD_Daemon *daemon_handle);
@@ -636,9 +636,9 @@ run_daemon (void *cls,
struct MHD_Daemon *daemon_handle = cls;
if (daemon_handle == daemon_handle_v4)
- hostlist_task_v4 = GNUNET_SCHEDULER_NO_TASK;
+ hostlist_task_v4 = NULL;
else
- hostlist_task_v6 = GNUNET_SCHEDULER_NO_TASK;
+ hostlist_task_v6 = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -656,10 +656,10 @@ run_daemon (void *cls,
*
* @param daemon_handle HTTP server to prepare to run
*/
-static GNUNET_SCHEDULER_TaskIdentifier
+static struct GNUNET_SCHEDULER_Task *
prepare_daemon (struct MHD_Daemon *daemon_handle)
{
- GNUNET_SCHEDULER_TaskIdentifier ret;
+ struct GNUNET_SCHEDULER_Task * ret;
fd_set rs;
fd_set ws;
fd_set es;
@@ -917,15 +917,15 @@ GNUNET_HOSTLIST_server_stop ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Hostlist server shutdown\n");
- if (GNUNET_SCHEDULER_NO_TASK != hostlist_task_v6)
+ if (NULL != hostlist_task_v6)
{
GNUNET_SCHEDULER_cancel (hostlist_task_v6);
- hostlist_task_v6 = GNUNET_SCHEDULER_NO_TASK;
+ hostlist_task_v6 = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != hostlist_task_v4)
+ if (NULL != hostlist_task_v4)
{
GNUNET_SCHEDULER_cancel (hostlist_task_v4);
- hostlist_task_v4 = GNUNET_SCHEDULER_NO_TASK;
+ hostlist_task_v4 = NULL;
}
if (NULL != daemon_handle_v4)
{
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 @@
static int ok;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
struct PeerContext
{
@@ -83,7 +83,7 @@ clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
timeout_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout trying to connect peers, test failed.\n");
clean_up (NULL, tc);
@@ -106,10 +106,10 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
return;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected, shutting down.\n");
ok = 0;
- if (timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (timeout_task != NULL)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
GNUNET_SCHEDULER_add_now (&clean_up, NULL);
}
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;
static const struct GNUNET_CONFIGURATION_Handle *cfg;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
-static GNUNET_SCHEDULER_TaskIdentifier check_task;
+static struct GNUNET_SCHEDULER_Task * check_task;
static struct PeerContext adv_peer;
@@ -83,10 +83,10 @@ static void
shutdown_testcase ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutdown testcase....\n");
- if (timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (timeout_task != NULL)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
if (NULL != download_stats)
{
@@ -113,10 +113,10 @@ shutdown_testcase ()
GNUNET_STATISTICS_destroy (learn_peer.stats, GNUNET_NO);
learn_peer.stats = NULL;
}
- if (check_task != GNUNET_SCHEDULER_NO_TASK)
+ if (check_task != NULL)
{
GNUNET_SCHEDULER_cancel (check_task);
- check_task = GNUNET_SCHEDULER_NO_TASK;
+ check_task = NULL;
}
if (NULL != current_adv_uri)
{
@@ -168,7 +168,7 @@ shutdown_testcase ()
static void
timeout_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout while executing testcase, test failed.\n");
timeout = GNUNET_YES;
@@ -269,7 +269,7 @@ check_statistics (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
char *stat;
- check_task = GNUNET_SCHEDULER_NO_TASK;
+ check_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
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 @@
static int ok;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
struct PeerContext
{
@@ -83,7 +83,7 @@ clean_up (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
timeout_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout trying to connect peers, test failed.\n");
clean_up (NULL, tc);
@@ -106,10 +106,10 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer)
return;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected, shutting down.\n");
ok = 0;
- if (timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (timeout_task != NULL)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
GNUNET_SCHEDULER_add_now (&clean_up, NULL);
}
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
/**
* Task doing exponential back-off trying to reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Time for next connect retry.
@@ -210,7 +210,7 @@ reconnect (void *cls,
static void
reschedule_connect (struct GNUNET_IDENTITY_Handle *h)
{
- GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK);
+ GNUNET_assert (h->reconnect_task == NULL);
if (NULL != h->th)
{
@@ -542,7 +542,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_IDENTITY_Operation *op;
struct GNUNET_MessageHeader msg;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Connecting to identity service.\n");
GNUNET_assert (NULL == h->client);
@@ -966,10 +966,10 @@ GNUNET_IDENTITY_disconnect (struct GNUNET_IDENTITY_Handle *h)
struct GNUNET_IDENTITY_Operation *op;
GNUNET_assert (NULL != h);
- if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (h->reconnect_task != NULL)
{
GNUNET_SCHEDULER_cancel (h->reconnect_task);
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
}
if (NULL != h->th)
{
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;
/**
* Handle for task for timeout termination.
*/
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
/**
@@ -107,10 +107,10 @@ end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end ()
{
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
&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;
/**
* Handle for task for timeout termination.
*/
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
/**
@@ -107,10 +107,10 @@ end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end ()
{
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
&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
* Task scheduled to call the @e excess_cb once we have
* reached the maximum bandwidth the tracker can hold.
*/
- GNUNET_SCHEDULER_TaskIdentifier excess_task;
+ struct GNUNET_SCHEDULER_Task * excess_task;
/**
* 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"
/**
* Opaque reference to a task.
*/
-typedef unsigned long long GNUNET_SCHEDULER_TaskIdentifier;
-
-
-/**
- * Constant used to indicate that the scheduled
- * task has no others as prerequisites.
- */
-#define GNUNET_SCHEDULER_NO_TASK ((GNUNET_SCHEDULER_TaskIdentifier) 0)
+struct GNUNET_SCHEDULER_Task;
/**
* Reasons why the schedule may have triggered
@@ -56,36 +49,41 @@ typedef unsigned long long GNUNET_SCHEDULER_TaskIdentifier;
enum GNUNET_SCHEDULER_Reason
{
/**
+ * This task is not ready.
+ */
+ GNUNET_SCHEDULER_REASON_NONE = 0,
+
+ /**
* This is the very first task run during startup.
*/
- GNUNET_SCHEDULER_REASON_STARTUP = 0,
+ GNUNET_SCHEDULER_REASON_STARTUP = 1,
/**
* We are shutting down and are running all shutdown-related tasks
* (regardless of timeout, etc.).
*/
- GNUNET_SCHEDULER_REASON_SHUTDOWN = 1,
+ GNUNET_SCHEDULER_REASON_SHUTDOWN = 2,
/**
* The specified timeout has expired.
* (also set if the delay given was 0).
*/
- GNUNET_SCHEDULER_REASON_TIMEOUT = 2,
+ GNUNET_SCHEDULER_REASON_TIMEOUT = 4,
/**
* The reading socket is ready.
*/
- GNUNET_SCHEDULER_REASON_READ_READY = 4,
+ GNUNET_SCHEDULER_REASON_READ_READY = 8,
/**
* The writing socket is ready.
*/
- GNUNET_SCHEDULER_REASON_WRITE_READY = 8,
+ GNUNET_SCHEDULER_REASON_WRITE_READY = 16,
/**
* The prerequisite task is done.
*/
- GNUNET_SCHEDULER_REASON_PREREQ_DONE = 16
+ GNUNET_SCHEDULER_REASON_PREREQ_DONE = 32
};
@@ -193,9 +191,9 @@ struct GNUNET_SCHEDULER_TaskContext
* @param cls closure
* @param tc context information (why was this task triggered now)
*/
-typedef void (*GNUNET_SCHEDULER_Task) (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext
- * tc);
+typedef void
+(*GNUNET_SCHEDULER_TaskCallback) (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc);
/**
@@ -209,11 +207,12 @@ typedef void (*GNUNET_SCHEDULER_Task) (void *cls,
* @param timeout relative value when to return
* @return number of selected sockets, #GNUNET_SYSERR on error
*/
-typedef int (*GNUNET_SCHEDULER_select) (void *cls,
- struct GNUNET_NETWORK_FDSet *rfds,
- struct GNUNET_NETWORK_FDSet *wfds,
- struct GNUNET_NETWORK_FDSet *efds,
- struct GNUNET_TIME_Relative timeout);
+typedef int
+(*GNUNET_SCHEDULER_select) (void *cls,
+ struct GNUNET_NETWORK_FDSet *rfds,
+ struct GNUNET_NETWORK_FDSet *wfds,
+ struct GNUNET_NETWORK_FDSet *efds,
+ struct GNUNET_TIME_Relative timeout);
/**
@@ -231,7 +230,8 @@ typedef int (*GNUNET_SCHEDULER_select) (void *cls,
* @param task_cls closure of task
*/
void
-GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls);
+GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
@@ -279,7 +279,7 @@ GNUNET_SCHEDULER_get_reason (void);
* @return the closure of the callback of the cancelled task
*/
void *
-GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task);
+GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task);
/**
@@ -292,7 +292,8 @@ GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task);
* @param reason reason for task invocation
*/
void
-GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, void *task_cls,
+GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls,
enum GNUNET_SCHEDULER_Reason reason);
@@ -307,7 +308,8 @@ GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, void *task_cls,
* @param priority priority to use for the task
*/
void
-GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_Task task, void *task_cls,
+GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls,
enum GNUNET_SCHEDULER_Reason reason,
enum GNUNET_SCHEDULER_Priority priority);
@@ -321,9 +323,10 @@ GNUNET_SCHEDULER_add_continuation_with_priority (GNUNET_SCHEDULER_Task task, voi
* @return unique task identifier for the job
* only valid until @a task is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
+struct GNUNET_SCHEDULER_Task *
GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio,
- GNUNET_SCHEDULER_Task task, void *task_cls);
+ GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
@@ -341,8 +344,9 @@ GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio,
* @return unique task identifier for the job
* only valid until @a task is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
-GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls);
+struct GNUNET_SCHEDULER_Task *
+GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
@@ -359,9 +363,9 @@ GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls);
* @return unique task identifier for the job
* only valid until @a task is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
+struct GNUNET_SCHEDULER_Task *
GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness,
- GNUNET_SCHEDULER_Task task,
+ GNUNET_SCHEDULER_TaskCallback task,
void *task_cls);
@@ -377,9 +381,10 @@ GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness,
* @return unique task identifier for the job
* only valid until @a task is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
+struct GNUNET_SCHEDULER_Task *
GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay,
- GNUNET_SCHEDULER_Task task, void *task_cls);
+ GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
@@ -394,10 +399,11 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay,
* @return unique task identifier for the job
* only valid until @a task is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
+struct GNUNET_SCHEDULER_Task *
GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
enum GNUNET_SCHEDULER_Priority priority,
- GNUNET_SCHEDULER_Task task, void *task_cls);
+ GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
@@ -415,10 +421,11 @@ GNUNET_SCHEDULER_add_delayed_with_priority (struct GNUNET_TIME_Relative delay,
* @return unique task identifier for the job
* only valid until @a task is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
+struct GNUNET_SCHEDULER_Task *
GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay,
struct GNUNET_NETWORK_Handle *rfd,
- GNUNET_SCHEDULER_Task task, void *task_cls);
+ GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
@@ -438,11 +445,12 @@ GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay,
* @return unique task identifier for the job
* only valid until @a task is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
+struct GNUNET_SCHEDULER_Task *
GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay,
enum GNUNET_SCHEDULER_Priority priority,
struct GNUNET_NETWORK_Handle *rfd,
- GNUNET_SCHEDULER_Task task, void *task_cls);
+ GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
@@ -460,10 +468,11 @@ GNUNET_SCHEDULER_add_read_net_with_priority (struct GNUNET_TIME_Relative delay,
* @return unique task identifier for the job
* only valid until @a task is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
+struct GNUNET_SCHEDULER_Task *
GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
struct GNUNET_NETWORK_Handle *wfd,
- GNUNET_SCHEDULER_Task task, void *task_cls);
+ GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
@@ -484,12 +493,14 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay,
* @return unique task identifier for the job
* only valid until "task" is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
+struct GNUNET_SCHEDULER_Task *
GNUNET_SCHEDULER_add_net_with_priority (struct GNUNET_TIME_Relative delay,
enum GNUNET_SCHEDULER_Priority priority,
struct GNUNET_NETWORK_Handle *fd,
- int on_read, int on_write,
- GNUNET_SCHEDULER_Task task, void *task_cls);
+ int on_read,
+ int on_write,
+ GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
* 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,
* @return unique task identifier for the job
* only valid until "task" is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
+struct GNUNET_SCHEDULER_Task *
GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay,
const struct GNUNET_DISK_FileHandle *rfd,
- GNUNET_SCHEDULER_Task task, void *task_cls);
+ GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
@@ -527,10 +539,11 @@ GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay,
* @return unique task identifier for the job
* only valid until @a task is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
+struct GNUNET_SCHEDULER_Task *
GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay,
const struct GNUNET_DISK_FileHandle *wfd,
- GNUNET_SCHEDULER_Task task, void *task_cls);
+ GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
@@ -551,12 +564,13 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay,
* @return unique task identifier for the job
* only valid until @a task is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
+struct GNUNET_SCHEDULER_Task *
GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay,
enum GNUNET_SCHEDULER_Priority priority,
const struct GNUNET_DISK_FileHandle *fd,
int on_read, int on_write,
- GNUNET_SCHEDULER_Task task, void *task_cls);
+ GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
@@ -586,12 +600,13 @@ GNUNET_SCHEDULER_add_file_with_priority (struct GNUNET_TIME_Relative delay,
* @return unique task identifier for the job
* only valid until "task" is started!
*/
-GNUNET_SCHEDULER_TaskIdentifier
+struct GNUNET_SCHEDULER_Task *
GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
struct GNUNET_TIME_Relative delay,
const struct GNUNET_NETWORK_FDSet *rs,
const struct GNUNET_NETWORK_FDSet *ws,
- GNUNET_SCHEDULER_Task task, void *task_cls);
+ GNUNET_SCHEDULER_TaskCallback task,
+ void *task_cls);
/**
* 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
char *gnunet_stat_name;
/**
- * Handle to statistics get request (OR GNUNET_SCHEDULER_NO_TASK)
+ * Handle to statistics get request (OR NULL)
*/
struct GNUNET_STATISTICS_GetHandle *gnunet_stat_get_handle;
@@ -178,9 +178,9 @@ struct GNUNET_SENSOR_SensorInfo
int report_anomalies;
/**
- * Execution task (OR GNUNET_SCHEDULER_NO_TASK)
+ * Execution task (OR NULL)
*/
- GNUNET_SCHEDULER_TaskIdentifier execution_task;
+ struct GNUNET_SCHEDULER_Task * execution_task;
/**
* 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;
struct GNUNET_TRANSPORT_OfferHelloHandle *
GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
const struct GNUNET_MessageHeader *hello,
- GNUNET_SCHEDULER_Task cont, void *cls);
+ GNUNET_SCHEDULER_TaskCallback cont, void *cls);
/**
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;
/**
* Handle for task for timeout termination.
*/
-static GNUNET_SCHEDULER_TaskIdentifier end_badly_task;
+static struct GNUNET_SCHEDULER_Task * end_badly_task;
/**
@@ -96,10 +96,10 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending tests.\n");
- if (end_badly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (end_badly_task != NULL)
{
GNUNET_SCHEDULER_cancel (end_badly_task);
- end_badly_task = GNUNET_SCHEDULER_NO_TASK;
+ end_badly_task = NULL;
}
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
&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
/**
* Reconnect task
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Delay introduced before we reconnect.
@@ -503,7 +503,7 @@ reconnect_task (void *cls,
{
struct GNUNET_NAMECACHE_Handle *h = cls;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
reconnect (h);
}
@@ -601,10 +601,10 @@ GNUNET_NAMECACHE_disconnect (struct GNUNET_NAMECACHE_Handle *h)
GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task)
+ if (NULL != h->reconnect_task)
{
GNUNET_SCHEDULER_cancel (h->reconnect_task);
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
}
GNUNET_free (h);
}
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 @@
static struct GNUNET_NAMECACHE_Handle *nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
@@ -122,17 +122,17 @@ name_lookup_proc (void *cls,
GNUNET_assert (NULL != cls);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
if (NULL == block)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Namecache returned no block\n"));
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
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;
/**
* Main HTTP task.
*/
-static GNUNET_SCHEDULER_TaskIdentifier httpd_task;
+static struct GNUNET_SCHEDULER_Task * httpd_task;
/**
* Handle to the namestore.
@@ -239,10 +239,10 @@ do_httpd (void *cls,
static void
run_httpd_now ()
{
- if (GNUNET_SCHEDULER_NO_TASK != httpd_task)
+ if (NULL != httpd_task)
{
GNUNET_SCHEDULER_cancel (httpd_task);
- httpd_task = GNUNET_SCHEDULER_NO_TASK;
+ httpd_task = NULL;
}
httpd_task = GNUNET_SCHEDULER_add_now (&do_httpd, NULL);
}
@@ -846,7 +846,7 @@ static void
do_httpd (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- httpd_task = GNUNET_SCHEDULER_NO_TASK;
+ httpd_task = NULL;
MHD_run (httpd);
run_httpd ();
}
@@ -862,10 +862,10 @@ static void
do_shutdown (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (GNUNET_SCHEDULER_NO_TASK != httpd_task)
+ if (NULL != httpd_task)
{
GNUNET_SCHEDULER_cancel (httpd_task);
- httpd_task = GNUNET_SCHEDULER_NO_TASK;
+ httpd_task = NULL;
}
if (NULL != ns)
{
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
/**
* Task active during initial iteration.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* Offset of the zone iteration used to address next result of the zone
@@ -355,10 +355,10 @@ client_disconnect_notification (void *cls,
GNUNET_CONTAINER_DLL_remove (monitor_head,
monitor_tail,
zm);
- if (GNUNET_SCHEDULER_NO_TASK != zm->task)
+ if (NULL != zm->task)
{
GNUNET_SCHEDULER_cancel (zm->task);
- zm->task = GNUNET_SCHEDULER_NO_TASK;
+ zm->task = NULL;
}
GNUNET_free (zm);
break;
@@ -1614,7 +1614,7 @@ monitor_next (void *cls,
struct ZoneMonitor *zm = cls;
int ret;
- zm->task = GNUNET_SCHEDULER_NO_TASK;
+ zm->task = NULL;
ret = GSN_database->iterate_records (GSN_database->cls,
(0 == memcmp (&zm->zone, &zero, sizeof (zero)))
? 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
/**
* Reconnect task
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Delay introduced before we reconnect.
@@ -874,7 +874,7 @@ reconnect_task (void *cls,
{
struct GNUNET_NAMESTORE_Handle *h = cls;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
reconnect (h);
}
@@ -979,10 +979,10 @@ GNUNET_NAMESTORE_disconnect (struct GNUNET_NAMESTORE_Handle *h)
GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->reconnect_task)
+ if (NULL != h->reconnect_task)
{
GNUNET_SCHEDULER_cancel (h->reconnect_task);
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
}
GNUNET_free (h);
}
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 @@
static struct GNUNET_NAMESTORE_Handle *nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
@@ -206,14 +206,14 @@ void lookup_it (void *cls,
if ((GNUNET_YES == found_nick) && (GNUNET_YES == found_record))
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
GNUNET_SCHEDULER_add_now (&end, NULL );
}
else
{
GNUNET_break (0);
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
GNUNET_SCHEDULER_add_now (&endbadly, NULL );
}
}
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 @@
static struct GNUNET_NAMESTORE_Handle *nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
@@ -136,7 +136,7 @@ void lookup_it (void *cls,
/* Done */
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
GNUNET_SCHEDULER_add_now (&end, NULL );
}
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;
static struct GNUNET_NAMECACHE_Handle *nch;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
@@ -139,17 +139,17 @@ name_lookup_proc (void *cls,
ncqe = NULL;
GNUNET_assert (NULL != cls);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
if (NULL == block)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Namestore returned no block\n"));
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
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;
static struct GNUNET_NAMECACHE_Handle *nch;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
@@ -171,17 +171,17 @@ name_lookup_proc (void *cls,
ncqe = NULL;
GNUNET_assert (NULL != cls);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
if (NULL == block)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Namestore returned no block\n"));
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
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;
static struct GNUNET_NAMECACHE_Handle *nch;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
-static GNUNET_SCHEDULER_TaskIdentifier delayed_lookup_task;
+static struct GNUNET_SCHEDULER_Task * delayed_lookup_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
@@ -99,10 +99,10 @@ cleanup ()
static void
endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (GNUNET_SCHEDULER_NO_TASK != delayed_lookup_task)
+ if (NULL != delayed_lookup_task)
{
GNUNET_SCHEDULER_cancel (delayed_lookup_task);
- delayed_lookup_task = GNUNET_SCHEDULER_NO_TASK;
+ delayed_lookup_task = NULL;
}
if (NULL != nsqe)
{
@@ -222,17 +222,17 @@ name_lookup_active_proc (void *cls,
ncqe = NULL;
ncqe_shadow = NULL;
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
if (NULL == block)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Namestore returned no block\n"));
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -249,7 +249,7 @@ name_lookup_shadow (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Performing lookup for shadow record \n");
- delayed_lookup_task = GNUNET_SCHEDULER_NO_TASK;
+ delayed_lookup_task = NULL;
ncqe_shadow = GNUNET_NAMECACHE_lookup_block (nch, &derived_hash,
&name_lookup_active_proc, &records[1]);
}
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 @@
static struct GNUNET_NAMESTORE_Handle * nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
@@ -196,10 +196,10 @@ zone_proc (void *cls,
if (2 == ++returned_records)
{
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
if (GNUNET_YES == fail)
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;
static struct GNUNET_NAMESTORE_Handle * nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
@@ -194,10 +194,10 @@ zone_proc (void *cls,
if (2 == ++returned_records)
{
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
if (GNUNET_YES == fail)
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 @@
static struct GNUNET_NAMESTORE_Handle *nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
@@ -103,7 +103,7 @@ remove_cont (void *cls,
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Records could not be removed: `%s'\n"), emsg);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -111,7 +111,7 @@ remove_cont (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Records were removed, perform lookup\n");
removed = GNUNET_YES;
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
GNUNET_SCHEDULER_add_now (&end, NULL);
}
@@ -130,7 +130,7 @@ put_cont (void *cls, int32_t success,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Namestore could not store record: `%s'\n",
emsg);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
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 @@
static struct GNUNET_NAMESTORE_Handle *nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
@@ -98,10 +98,10 @@ put_cont (void *cls, int32_t success, const char *emsg)
{
GNUNET_assert (NULL != cls);
nsqe = NULL;
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
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 @@
static struct GNUNET_NAMESTORE_Handle *nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
@@ -104,7 +104,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
name,
(success == GNUNET_OK) ? "SUCCESS" : "FAIL");
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
GNUNET_SCHEDULER_add_now (&end, NULL);
}
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;
static struct GNUNET_NAMECACHE_Handle *nch;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey *privkey;
@@ -168,7 +168,7 @@ rd_decrypt_cb (void *cls,
GNUNET_assert (0 == memcmp (&rd_cmp_data, rd[0].data, TEST_RECORD_DATALEN2));
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
GNUNET_SCHEDULER_add_now (&end, NULL);
}
}
@@ -187,7 +187,7 @@ name_lookup_proc (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Namecache returned no block for `%s'\n"),
name);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
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 @@
static struct GNUNET_NAMESTORE_Handle * nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
@@ -117,10 +117,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_NAMESTORE_zone_iteration_stop (zi);
zi = NULL;
}
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
if (privkey != NULL)
@@ -292,7 +292,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to created records: `%s'\n",
emsg);
GNUNET_break (0);
- if (GNUNET_SCHEDULER_NO_TASK != endbadly_task)
+ if (NULL != endbadly_task)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -311,7 +311,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to create zone iterator\n");
GNUNET_break (0);
- if (GNUNET_SCHEDULER_NO_TASK != endbadly_task)
+ if (NULL != endbadly_task)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -360,7 +360,7 @@ empty_zone_proc (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Expected empty zone but received zone private key\n"));
GNUNET_break (0);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -370,7 +370,7 @@ empty_zone_proc (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Expected no zone content but received data\n"));
GNUNET_break (0);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
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 @@
static struct GNUNET_NAMESTORE_Handle * nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
@@ -120,10 +120,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_NAMESTORE_zone_iteration_stop (zi);
zi = NULL;
}
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
if (privkey != NULL)
@@ -268,7 +268,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to created records: `%s'\n",
emsg);
GNUNET_break (0);
- if (GNUNET_SCHEDULER_NO_TASK != endbadly_task)
+ if (NULL != endbadly_task)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -287,7 +287,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to create zone iterator\n");
GNUNET_break (0);
- if (GNUNET_SCHEDULER_NO_TASK != endbadly_task)
+ if (NULL != endbadly_task)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -385,7 +385,7 @@ empty_zone_proc (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Expected empty zone but received zone private key\n"));
GNUNET_break (0);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -395,7 +395,7 @@ empty_zone_proc (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Expected no zone content but received data\n"));
GNUNET_break (0);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
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 @@
static struct GNUNET_NAMESTORE_Handle * nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
@@ -118,10 +118,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
zi = NULL;
}
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
if (privkey != NULL)
@@ -275,7 +275,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
"Failed to created records: `%s'\n",
emsg);
GNUNET_break (0);
- if (GNUNET_SCHEDULER_NO_TASK != endbadly_task)
+ if (NULL != endbadly_task)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -296,7 +296,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Failed to create zone iterator\n");
GNUNET_break (0);
- if (GNUNET_SCHEDULER_NO_TASK != endbadly_task)
+ if (NULL != endbadly_task)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -345,7 +345,7 @@ empty_zone_proc (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Expected empty zone but received zone private key\n"));
GNUNET_break (0);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -355,7 +355,7 @@ empty_zone_proc (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Expected no zone content but received data\n"));
GNUNET_break (0);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
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 @@
static struct GNUNET_NAMESTORE_Handle * nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
@@ -118,10 +118,10 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
zi = NULL;
}
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
if (privkey != NULL)
@@ -266,10 +266,10 @@ zone_proc (void *cls,
"Telling namestore to stop zone iteration\n");
GNUNET_NAMESTORE_zone_iteration_stop (zi);
zi = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != endbadly_task)
+ if (NULL != endbadly_task)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
res = 0;
GNUNET_SCHEDULER_add_delayed (WAIT, &end, NULL);
@@ -303,7 +303,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to created records: `%s'\n",
emsg);
GNUNET_break (0);
- if (GNUNET_SCHEDULER_NO_TASK != endbadly_task)
+ if (NULL != endbadly_task)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -322,7 +322,7 @@ put_cont (void *cls, int32_t success, const char *emsg)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Failed to create zone iterator\n");
GNUNET_break (0);
- if (GNUNET_SCHEDULER_NO_TASK != endbadly_task)
+ if (NULL != endbadly_task)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -371,7 +371,7 @@ empty_zone_proc (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Expected empty zone but received zone private key\n"));
GNUNET_break (0);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
return;
@@ -381,7 +381,7 @@ empty_zone_proc (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Expected no zone content but received data\n"));
GNUNET_break (0);
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
GNUNET_SCHEDULER_cancel (endbadly_task);
endbadly_task = GNUNET_SCHEDULER_add_now (&endbadly, NULL);
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 @@
static struct GNUNET_NAMESTORE_Handle * nsh;
-static GNUNET_SCHEDULER_TaskIdentifier endbadly_task;
+static struct GNUNET_SCHEDULER_Task * endbadly_task;
static struct GNUNET_CRYPTO_EcdsaPrivateKey * privkey;
@@ -81,10 +81,10 @@ endbadly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (endbadly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (endbadly_task != NULL)
{
GNUNET_SCHEDULER_cancel (endbadly_task);
- endbadly_task = GNUNET_SCHEDULER_NO_TASK;
+ endbadly_task = NULL;
}
if (privkey != NULL)
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
/**
* ID of select gnunet-helper-nat-server stdout read task
*/
- GNUNET_SCHEDULER_TaskIdentifier server_read_task;
+ struct GNUNET_SCHEDULER_Task * server_read_task;
/**
* ID of interface IP-scan task
*/
- GNUNET_SCHEDULER_TaskIdentifier ifc_task;
+ struct GNUNET_SCHEDULER_Task * ifc_task;
/**
* ID of hostname DNS lookup task
*/
- GNUNET_SCHEDULER_TaskIdentifier hostname_task;
+ struct GNUNET_SCHEDULER_Task * hostname_task;
/**
* ID of DynDNS lookup task
*/
- GNUNET_SCHEDULER_TaskIdentifier dns_task;
+ struct GNUNET_SCHEDULER_Task * dns_task;
/**
* ID of task to add addresses from bind.
*/
- GNUNET_SCHEDULER_TaskIdentifier bind_task;
+ struct GNUNET_SCHEDULER_Task * bind_task;
/**
* 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,
return GNUNET_OK;
}
if ((h->internal_address == NULL) && (h->server_proc == NULL) &&
- (h->server_read_task == GNUNET_SCHEDULER_NO_TASK) &&
+ (h->server_read_task == NULL) &&
(GNUNET_YES == isDefault) && ((addr->sa_family == AF_INET) ||
(addr->sa_family == AF_INET6)))
{
@@ -784,7 +784,7 @@ restart_nat_server (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_NAT_Handle *h = cls;
- h->server_read_task = GNUNET_SCHEDULER_NO_TASK;
+ h->server_read_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
start_gnunet_nat_server (h);
@@ -811,7 +811,7 @@ nat_server_read (void *cls,
const char *port_start;
struct sockaddr_in sin_addr;
- h->server_read_task = GNUNET_SCHEDULER_NO_TASK;
+ h->server_read_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
memset (mybuf, 0, sizeof (mybuf));
@@ -946,7 +946,7 @@ list_interfaces (void *cls,
{
struct GNUNET_NAT_Handle *h = cls;
- h->ifc_task = GNUNET_SCHEDULER_NO_TASK;
+ h->ifc_task = NULL;
remove_from_address_list_by_source (h, LAL_INTERFACE_ADDRESS);
GNUNET_OS_network_interfaces_list (&process_interfaces, h);
h->ifc_task =
@@ -967,7 +967,7 @@ resolve_hostname (void *cls,
{
struct GNUNET_NAT_Handle *h = cls;
- h->hostname_task = GNUNET_SCHEDULER_NO_TASK;
+ h->hostname_task = NULL;
remove_from_address_list_by_source (h, LAL_HOSTNAME_DNS);
h->hostname_dns =
GNUNET_RESOLVER_hostname_resolve (AF_UNSPEC, HOSTNAME_RESOLVE_TIMEOUT,
@@ -989,7 +989,7 @@ resolve_dns (void *cls,
struct GNUNET_NAT_Handle *h = cls;
struct LocalAddressList *pos;
- h->dns_task = GNUNET_SCHEDULER_NO_TASK;
+ h->dns_task = NULL;
for (pos = h->lal_head; NULL != pos; pos = pos->next)
if (pos->source == LAL_EXTERNAL_IP)
pos->source = LAL_EXTERNAL_IP_OLD;
@@ -1124,7 +1124,7 @@ add_from_bind (void *cls,
struct sockaddr *sa;
const struct sockaddr_in *v4;
- h->bind_task = GNUNET_SCHEDULER_NO_TASK;
+ h->bind_task = NULL;
for (i = 0; i < h->num_local_addrs; i++)
{
sa = h->local_addrs[i];
@@ -1384,30 +1384,30 @@ GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h)
GNUNET_RESOLVER_request_cancel (h->hostname_dns);
h->hostname_dns = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->server_read_task)
+ if (NULL != h->server_read_task)
{
GNUNET_SCHEDULER_cancel (h->server_read_task);
- h->server_read_task = GNUNET_SCHEDULER_NO_TASK;
+ h->server_read_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->bind_task)
+ if (NULL != h->bind_task)
{
GNUNET_SCHEDULER_cancel (h->bind_task);
- h->bind_task = GNUNET_SCHEDULER_NO_TASK;
+ h->bind_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->ifc_task)
+ if (NULL != h->ifc_task)
{
GNUNET_SCHEDULER_cancel (h->ifc_task);
- h->ifc_task = GNUNET_SCHEDULER_NO_TASK;
+ h->ifc_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->hostname_task)
+ if (NULL != h->hostname_task)
{
GNUNET_SCHEDULER_cancel (h->hostname_task);
- h->hostname_task = GNUNET_SCHEDULER_NO_TASK;
+ h->hostname_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->dns_task)
+ if (NULL != h->dns_task)
{
GNUNET_SCHEDULER_cancel (h->dns_task);
- h->dns_task = GNUNET_SCHEDULER_NO_TASK;
+ h->dns_task = NULL;
}
if (NULL != h->server_proc)
{
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
/**
* Task identifier for the timeout.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* Where are we in the test?
@@ -196,7 +196,7 @@ reversal_test (void *cls,
{
struct GNUNET_NAT_AutoHandle *ah = cls;
- ah->task = GNUNET_SCHEDULER_NO_TASK;
+ ah->task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Testing connection reversal with ICMP server.\n"));
GNUNET_RESOLVER_connect (ah->cfg);
@@ -603,10 +603,10 @@ GNUNET_NAT_autoconfig_cancel (struct GNUNET_NAT_AutoHandle *ah)
GNUNET_NAT_mini_get_external_ipv4_cancel (ah->eh);
ah->eh = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != ah->task)
+ if (NULL != ah->task)
{
GNUNET_SCHEDULER_cancel (ah->task);
- ah->task = GNUNET_SCHEDULER_NO_TASK;
+ ah->task = NULL;
}
GNUNET_CONFIGURATION_destroy (ah->cfg);
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
/**
* Read task.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* Handle to 'external-ip' process.
@@ -120,7 +120,7 @@ read_external_ipv4 (void *cls,
ssize_t ret;
struct in_addr addr;
- eh->task = GNUNET_SCHEDULER_NO_TASK;
+ eh->task = NULL;
if (GNUNET_YES == GNUNET_NETWORK_fdset_handle_isset (tc->read_ready, eh->r))
ret =
GNUNET_DISK_file_read (eh->r, &eh->buf[eh->off],
@@ -170,7 +170,7 @@ signal_external_ip_error (void *cls,
{
struct GNUNET_NAT_ExternalHandle *eh = cls;
- eh->task = GNUNET_SCHEDULER_NO_TASK;
+ eh->task = NULL;
eh->cb (eh->cb_cls,
NULL,
eh->ret);
@@ -254,7 +254,7 @@ GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle *eh)
}
if (NULL != eh->opipe)
GNUNET_DISK_pipe_close (eh->opipe);
- if (GNUNET_SCHEDULER_NO_TASK != eh->task)
+ if (NULL != eh->task)
GNUNET_SCHEDULER_cancel (eh->task);
GNUNET_free (eh);
}
@@ -300,7 +300,7 @@ struct GNUNET_NAT_MiniHandle
* We check the mapping periodically to see if it
* still works. This task triggers the check.
*/
- GNUNET_SCHEDULER_TaskIdentifier refresh_task;
+ struct GNUNET_SCHEDULER_Task * refresh_task;
/**
* Are we mapping TCP or UDP?
@@ -543,7 +543,7 @@ process_map_output (void *cls,
GNUNET_SYSERR,
NULL, 0,
GNUNET_NAT_ERROR_UPNPC_PORTMAP_FAILED);
- if (GNUNET_SCHEDULER_NO_TASK == mini->refresh_task)
+ if (NULL == mini->refresh_task)
mini->refresh_task =
GNUNET_SCHEDULER_add_delayed (MAP_REFRESH_FREQ, &do_refresh, mini);
return;
@@ -664,10 +664,10 @@ GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini)
{
char pstr[6];
- if (GNUNET_SCHEDULER_NO_TASK != mini->refresh_task)
+ if (NULL != mini->refresh_task)
{
GNUNET_SCHEDULER_cancel (mini->refresh_task);
- mini->refresh_task = GNUNET_SCHEDULER_NO_TASK;
+ mini->refresh_task = NULL;
}
if (NULL != mini->refresh_cmd)
{
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
/**
* Task reading from the incoming connection.
*/
- GNUNET_SCHEDULER_TaskIdentifier rtask;
+ struct GNUNET_SCHEDULER_Task * rtask;
};
@@ -141,12 +141,12 @@ struct GNUNET_NAT_Test
/**
* Identity of task for the listen socket (if any)
*/
- GNUNET_SCHEDULER_TaskIdentifier ltask;
+ struct GNUNET_SCHEDULER_Task * ltask;
/**
* Task identifier for the timeout (if any)
*/
- GNUNET_SCHEDULER_TaskIdentifier ttask;
+ struct GNUNET_SCHEDULER_Task * ttask;
/**
* GNUNET_YES if we're testing TCP
@@ -250,7 +250,7 @@ do_read (void *cls,
struct GNUNET_NAT_Test *tst;
uint16_t data;
- na->rtask = GNUNET_SCHEDULER_NO_TASK;
+ na->rtask = NULL;
tst = na->h;
GNUNET_CONTAINER_DLL_remove (tst->na_head, tst->na_tail, na);
if ((NULL != tc->write_ready) &&
@@ -287,7 +287,7 @@ do_accept (void *cls,
struct GNUNET_NETWORK_Handle *s;
struct NatActivity *wl;
- tst->ltask = GNUNET_SCHEDULER_NO_TASK;
+ tst->ltask = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
tst->ltask =
@@ -386,7 +386,7 @@ do_timeout (void *cls,
{
struct GNUNET_NAT_Test *nh = cls;
- nh->ttask = GNUNET_SCHEDULER_NO_TASK;
+ nh->ttask = NULL;
nh->report (nh->report_cls,
(GNUNET_NAT_ERROR_SUCCESS == nh->status)
? GNUNET_NAT_ERROR_TIMEOUT
@@ -495,10 +495,10 @@ GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
{
LOG (GNUNET_ERROR_TYPE_ERROR,
_("NAT test failed to start NAT library\n"));
- if (GNUNET_SCHEDULER_NO_TASK != nh->ltask)
+ if (NULL != nh->ltask)
{
GNUNET_SCHEDULER_cancel (nh->ltask);
- nh->ltask = GNUNET_SCHEDULER_NO_TASK;
+ nh->ltask = NULL;
}
if (NULL != nh->lsock)
{
@@ -541,9 +541,9 @@ GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst)
GNUNET_NETWORK_socket_close (pos->sock);
GNUNET_free (pos);
}
- if (GNUNET_SCHEDULER_NO_TASK != tst->ttask)
+ if (NULL != tst->ttask)
GNUNET_SCHEDULER_cancel (tst->ttask);
- if (GNUNET_SCHEDULER_NO_TASK != tst->ltask)
+ if (NULL != tst->ltask)
GNUNET_SCHEDULER_cancel (tst->ltask);
if (NULL != tst->lsock)
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;
static struct GNUNET_NAT_Test *tst;
-static GNUNET_SCHEDULER_TaskIdentifier tsk;
+static struct GNUNET_SCHEDULER_Task * tsk;
static void
@@ -54,7 +54,7 @@ report_result (void *cls,
GNUNET_NAT_test_stop (tst);
tst = NULL;
GNUNET_SCHEDULER_cancel (tsk);
- tsk = GNUNET_SCHEDULER_NO_TASK;
+ tsk = NULL;
}
@@ -62,7 +62,7 @@ static void
failed_timeout (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- tsk = GNUNET_SCHEDULER_NO_TASK;
+ tsk = NULL;
fprintf (stderr,
"NAT test failed to terminate on timeout\n");
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;
/**
* The shutdown task
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id;
+static struct GNUNET_SCHEDULER_Task * shutdown_task_id;
/**
* Maximum number of connections to NSE services.
@@ -270,7 +270,7 @@ close_monitor_connections ()
static void
shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- shutdown_task_id = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task_id = NULL;
if (GNUNET_YES == shutting_down)
return;
shutting_down = GNUNET_YES;
@@ -298,7 +298,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
shutdown_now ()
{
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task_id)
+ if (NULL != shutdown_task_id)
GNUNET_SCHEDULER_cancel (shutdown_task_id);
shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
}
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;
/**
* Shutdown task
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* The program status; 0 for success.
@@ -62,7 +62,7 @@ static int status;
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task = NULL;
if (NULL != test)
GNUNET_CLIENT_service_test_cancel (test);
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
/**
* Task scheduled to send message to this peer.
*/
- GNUNET_SCHEDULER_TaskIdentifier transmit_task;
+ struct GNUNET_SCHEDULER_Task * transmit_task;
/**
* Did we receive or send a message about the previous round
@@ -275,12 +275,12 @@ static unsigned int estimate_count;
/**
* Task scheduled to update our flood message for the next round.
*/
-static GNUNET_SCHEDULER_TaskIdentifier flood_task;
+static struct GNUNET_SCHEDULER_Task * flood_task;
/**
* Task scheduled to compute our proof.
*/
-static GNUNET_SCHEDULER_TaskIdentifier proof_task;
+static struct GNUNET_SCHEDULER_Task * proof_task;
/**
* Notification context, simplifies client broadcasts.
@@ -635,7 +635,7 @@ transmit_ready (void *cls,
peer_entry);
}
if ((0 == ntohl (size_estimate_messages[idx].hop_count)) &&
- (GNUNET_SCHEDULER_NO_TASK != proof_task))
+ (NULL != proof_task))
{
GNUNET_STATISTICS_update (stats,
"# flood messages not generated (no proof yet)",
@@ -681,7 +681,7 @@ transmit_task_cb (void *cls,
{
struct NSEPeerEntry *peer_entry = cls;
- peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK;
+ peer_entry->transmit_task = NULL;
GNUNET_assert (NULL == peer_entry->th);
peer_entry->th =
@@ -772,7 +772,7 @@ schedule_current_round (void *cls,
peer_entry->previous_round = GNUNET_NO;
return GNUNET_OK;
}
- if (GNUNET_SCHEDULER_NO_TASK != peer_entry->transmit_task)
+ if (NULL != peer_entry->transmit_task)
{
GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
peer_entry->previous_round = GNUNET_NO;
@@ -806,7 +806,7 @@ update_flood_message (void *cls,
struct GNUNET_TIME_Relative offset;
unsigned int i;
- flood_task = GNUNET_SCHEDULER_NO_TASK;
+ flood_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
offset = GNUNET_TIME_absolute_get_remaining (next_timestamp);
@@ -931,7 +931,7 @@ find_proof (void *cls,
struct GNUNET_HashCode result;
unsigned int i;
- proof_task = GNUNET_SCHEDULER_NO_TASK;
+ proof_task = NULL;
memcpy (&buf[sizeof (uint64_t)], &my_identity,
sizeof (struct GNUNET_PeerIdentity));
i = 0;
@@ -1034,17 +1034,17 @@ update_flood_times (void *cls,
{
/* still stuck in previous round, no point to update, check that
* we are active here though... */
- if ( (GNUNET_SCHEDULER_NO_TASK == peer_entry->transmit_task) &&
+ if ( (NULL == peer_entry->transmit_task) &&
(NULL == peer_entry->th) )
{
GNUNET_break (0);
}
return GNUNET_OK;
}
- if (GNUNET_SCHEDULER_NO_TASK != peer_entry->transmit_task)
+ if (NULL != peer_entry->transmit_task)
{
GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
- peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK;
+ peer_entry->transmit_task = NULL;
}
delay = get_transmit_delay (0);
peer_entry->transmit_task =
@@ -1169,10 +1169,10 @@ handle_p2p_size_estimate (void *cls,
}
/* got up-to-date information for current round, cancel transmission to
* this peer altogether */
- if (GNUNET_SCHEDULER_NO_TASK != peer_entry->transmit_task)
+ if (NULL != peer_entry->transmit_task)
{
GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
- peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK;
+ peer_entry->transmit_task = NULL;
}
if (NULL != peer_entry->th)
{
@@ -1189,7 +1189,7 @@ handle_p2p_size_estimate (void *cls,
/* push back our result now, that peer is spreading bad information... */
if (NULL == peer_entry->th)
{
- if (peer_entry->transmit_task != GNUNET_SCHEDULER_NO_TASK)
+ if (peer_entry->transmit_task != NULL)
GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
peer_entry->transmit_task =
GNUNET_SCHEDULER_add_now (&transmit_task_cb, peer_entry);
@@ -1214,10 +1214,10 @@ handle_p2p_size_estimate (void *cls,
if (idx == estimate_index)
{
/* cancel any activity for current round */
- if (peer_entry->transmit_task != GNUNET_SCHEDULER_NO_TASK)
+ if (peer_entry->transmit_task != NULL)
{
GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
- peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK;
+ peer_entry->transmit_task = NULL;
}
if (peer_entry->th != NULL)
{
@@ -1303,9 +1303,9 @@ handle_core_disconnect (void *cls,
GNUNET_assert (GNUNET_YES ==
GNUNET_CONTAINER_multipeermap_remove (peers, peer,
pos));
- if (pos->transmit_task != GNUNET_SCHEDULER_NO_TASK) {
+ if (pos->transmit_task != NULL) {
GNUNET_SCHEDULER_cancel (pos->transmit_task);
- pos->transmit_task = GNUNET_SCHEDULER_NO_TASK;
+ pos->transmit_task = NULL;
}
if (NULL != pos->th)
{
@@ -1345,15 +1345,15 @@ static void
shutdown_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (GNUNET_SCHEDULER_NO_TASK != flood_task)
+ if (NULL != flood_task)
{
GNUNET_SCHEDULER_cancel (flood_task);
- flood_task = GNUNET_SCHEDULER_NO_TASK;
+ flood_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != proof_task)
+ if (NULL != proof_task)
{
GNUNET_SCHEDULER_cancel (proof_task);
- proof_task = GNUNET_SCHEDULER_NO_TASK;
+ proof_task = NULL;
write_proof (); /* remember progress */
}
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
/**
* Task doing exponential back-off trying to reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Time for next connect retry.
@@ -133,7 +133,7 @@ message_handler (void *cls, const struct GNUNET_MessageHeader *msg)
static void
reschedule_connect (struct GNUNET_NSE_Handle *h)
{
- GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK);
+ GNUNET_assert (h->reconnect_task == NULL);
if (NULL != h->th)
{
@@ -206,7 +206,7 @@ reconnect (void *cls,
{
struct GNUNET_NSE_Handle *h = cls;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Connecting to network size estimation service.\n");
GNUNET_assert (NULL == h->client);
@@ -256,10 +256,10 @@ void
GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h)
{
GNUNET_assert (NULL != h);
- if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (h->reconnect_task != NULL)
{
GNUNET_SCHEDULER_cancel (h->reconnect_task);
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
}
if (NULL != h->th)
{
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 @@
static struct GNUNET_NSE_Handle *h;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
@@ -69,7 +69,7 @@ check_nse_message (void *cls, struct GNUNET_TIME_Absolute timestamp,
estimate, std_dev);
/* Fantastic check below. Expect NaN, the only thing not equal to itself. */
(*ok) = 0;
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_test, NULL);
}
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;
/**
* Main state machine task (if active).
*/
-static GNUNET_SCHEDULER_TaskIdentifier tt;
+static struct GNUNET_SCHEDULER_Task * tt;
/**
* Pending #GNUNET_TRANSPORT_get_hello() operation.
@@ -626,10 +626,10 @@ shutdown_task (void *cls,
GNUNET_PEERINFO_add_peer_cancel (ac);
ac = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != tt)
+ if (NULL != tt)
{
GNUNET_SCHEDULER_cancel (tt);
- tt = GNUNET_SCHEDULER_NO_TASK;
+ tt = NULL;
}
if (NULL != pic)
{
@@ -806,7 +806,7 @@ static void
state_machine (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- tt = GNUNET_SCHEDULER_NO_TASK;
+ tt = NULL;
if (NULL != put_uri)
{
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
/**
* Task responsible for timeout.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Timeout for the operation.
@@ -179,7 +179,7 @@ struct GNUNET_PEERINFO_Handle
/**
* ID for a reconnect task.
*/
- GNUNET_SCHEDULER_TaskIdentifier r_task;
+ struct GNUNET_SCHEDULER_Task * r_task;
/**
* Are we now receiving?
@@ -247,10 +247,10 @@ GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h)
GNUNET_CLIENT_disconnect (h->client);
h->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->r_task)
+ if (NULL != h->r_task)
{
GNUNET_SCHEDULER_cancel (h->r_task);
- h->r_task = GNUNET_SCHEDULER_NO_TASK;
+ h->r_task = NULL;
}
GNUNET_free (h);
}
@@ -287,7 +287,7 @@ reconnect_task (void *cls,
{
struct GNUNET_PEERINFO_Handle *h = cls;
- h->r_task = GNUNET_SCHEDULER_NO_TASK;
+ h->r_task = NULL;
reconnect (h);
}
@@ -300,10 +300,10 @@ reconnect_task (void *cls,
static void
reconnect (struct GNUNET_PEERINFO_Handle *h)
{
- if (GNUNET_SCHEDULER_NO_TASK != h->r_task)
+ if (NULL != h->r_task)
{
GNUNET_SCHEDULER_cancel (h->r_task);
- h->r_task = GNUNET_SCHEDULER_NO_TASK;
+ h->r_task = NULL;
}
if (NULL != h->th)
{
@@ -709,7 +709,7 @@ signal_timeout (void *cls,
GNUNET_PEERINFO_Processor cb;
void *cb_cls;
- ic->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ic->timeout_task = NULL;
cb = ic->callback;
cb_cls = ic->callback_cls;
GNUNET_PEERINFO_iterate_cancel (ic);
@@ -811,10 +811,10 @@ GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic)
struct GNUNET_PEERINFO_Handle *h;
h = ic->h;
- if (GNUNET_SCHEDULER_NO_TASK != ic->timeout_task)
+ if (NULL != ic->timeout_task)
{
GNUNET_SCHEDULER_cancel (ic->timeout_task);
- ic->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ic->timeout_task = NULL;
}
ic->callback = NULL;
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
/**
* Tasked used for delayed re-connection attempt.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* Include friend only HELLOs in callbacks
@@ -107,7 +107,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_PEERINFO_NotifyContext *nc = cls;
- nc->task = GNUNET_SCHEDULER_NO_TASK;
+ nc->task = NULL;
nc->client = GNUNET_CLIENT_connect ("peerinfo", nc->cfg);
if (NULL == nc->client)
{
@@ -295,7 +295,7 @@ GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc)
}
if (NULL != nc->client)
GNUNET_CLIENT_disconnect (nc->client);
- if (GNUNET_SCHEDULER_NO_TASK != nc->task)
+ if (NULL != nc->task)
GNUNET_SCHEDULER_cancel (nc->task);
GNUNET_free (nc);
}
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;
struct GNUNET_PeerIdentity pid;
-GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+struct GNUNET_SCHEDULER_Task * timeout_task;
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
GNUNET_break(0);
if (NULL != pnc_wo_fo)
{
@@ -95,10 +95,10 @@ done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_PEERINFO_disconnect (h);
h = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != timeout_task)
+ if (NULL != timeout_task)
{
GNUNET_SCHEDULER_cancel (timeout_task);
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
}
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
* Task identifier for the function called
* on iterate request timeout
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
};
@@ -367,7 +367,7 @@ iterate_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_PEERSTORE_Processor callback;
void *callback_cls;
- ic->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ic->timeout_task = NULL;
callback = ic->callback;
callback_cls = ic->callback_cls;
GNUNET_PEERSTORE_iterate_cancel (ic);
@@ -729,10 +729,10 @@ handle_iterate_result (void *cls, const struct GNUNET_MessageHeader *msg)
void
GNUNET_PEERSTORE_iterate_cancel (struct GNUNET_PEERSTORE_IterateContext *ic)
{
- if (GNUNET_SCHEDULER_NO_TASK != ic->timeout_task)
+ if (NULL != ic->timeout_task)
{
GNUNET_SCHEDULER_cancel (ic->timeout_task);
- ic->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ic->timeout_task = NULL;
}
if (GNUNET_NO == ic->iterating)
{
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;
/**
* Handle for task for timeout termination.
*/
-GNUNET_SCHEDULER_TaskIdentifier end_badly_task;
+struct GNUNET_SCHEDULER_Task * end_badly_task;
struct GNUNET_PSYC_Master *mst;
struct GNUNET_PSYC_Slave *slv;
@@ -187,10 +187,10 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending tests.\n");
- if (end_badly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (end_badly_task != NULL)
{
GNUNET_SCHEDULER_cancel (end_badly_task);
- end_badly_task = GNUNET_SCHEDULER_NO_TASK;
+ end_badly_task = NULL;
}
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
&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
/**
* Task doing exponential back-off trying to reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Time for next connect retry.
@@ -200,7 +200,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
static void
reschedule_connect (struct GNUNET_PSYCSTORE_Handle *h)
{
- GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK);
+ GNUNET_assert (h->reconnect_task == NULL);
if (NULL != h->th)
{
@@ -545,7 +545,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_PSYCSTORE_Handle *h = cls;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Connecting to PSYCstore service.\n");
GNUNET_assert (NULL == h->client);
@@ -582,10 +582,10 @@ void
GNUNET_PSYCSTORE_disconnect (struct GNUNET_PSYCSTORE_Handle *h)
{
GNUNET_assert (NULL != h);
- if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (h->reconnect_task != NULL)
{
GNUNET_SCHEDULER_cancel (h->reconnect_task);
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
}
if (NULL != h->th)
{
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;
/**
* Handle for task for timeout termination.
*/
-static GNUNET_SCHEDULER_TaskIdentifier end_badly_task;
+static struct GNUNET_SCHEDULER_Task * end_badly_task;
static struct GNUNET_CRYPTO_EddsaPrivateKey *channel_key;
static struct GNUNET_CRYPTO_EcdsaPrivateKey *slave_key;
@@ -143,10 +143,10 @@ end_normally (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end ()
{
- if (end_badly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (end_badly_task != NULL)
{
GNUNET_SCHEDULER_cancel (end_badly_task);
- end_badly_task = GNUNET_SCHEDULER_NO_TASK;
+ end_badly_task = NULL;
}
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
&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
/**
* Task used to abort this operation with timeout.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* 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;
static struct MHD_Daemon *mhd;
-static GNUNET_SCHEDULER_TaskIdentifier mhd_task_id;
+static struct GNUNET_SCHEDULER_Task * mhd_task_id;
-static GNUNET_SCHEDULER_TaskIdentifier curl_task_id;
+static struct GNUNET_SCHEDULER_Task * curl_task_id;
static CURL *curl;
@@ -131,15 +131,15 @@ mhd_ahc (void *cls,
static void
do_shutdown ()
{
- if (mhd_task_id != GNUNET_SCHEDULER_NO_TASK)
+ if (mhd_task_id != NULL)
{
GNUNET_SCHEDULER_cancel (mhd_task_id);
- mhd_task_id = GNUNET_SCHEDULER_NO_TASK;
+ mhd_task_id = NULL;
}
- if (curl_task_id != GNUNET_SCHEDULER_NO_TASK)
+ if (curl_task_id != NULL)
{
GNUNET_SCHEDULER_cancel (curl_task_id);
- curl_task_id = GNUNET_SCHEDULER_NO_TASK;
+ curl_task_id = NULL;
}
if (NULL != mhd)
{
@@ -162,7 +162,7 @@ static void
curl_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- curl_task_id = GNUNET_SCHEDULER_NO_TASK;
+ curl_task_id = NULL;
curl_main ();
}
@@ -311,7 +311,7 @@ static void
mhd_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- mhd_task_id = GNUNET_SCHEDULER_NO_TASK;
+ mhd_task_id = NULL;
MHD_run (mhd);
mhd_main ();
}
@@ -329,7 +329,7 @@ mhd_main ()
unsigned MHD_LONG_LONG timeout;
struct GNUNET_TIME_Relative delay;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == mhd_task_id);
+ GNUNET_assert (NULL == mhd_task_id);
FD_ZERO (&rs);
FD_ZERO (&ws);
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;
static struct MHD_Daemon *mhd;
-static GNUNET_SCHEDULER_TaskIdentifier mhd_task_id;
+static struct GNUNET_SCHEDULER_Task * mhd_task_id;
-static GNUNET_SCHEDULER_TaskIdentifier curl_task_id;
+static struct GNUNET_SCHEDULER_Task * curl_task_id;
-static GNUNET_SCHEDULER_TaskIdentifier ctrl_c_task_id;
+static struct GNUNET_SCHEDULER_Task * ctrl_c_task_id;
static struct GNUNET_VPN_RedirectionRequest *rr;
@@ -128,20 +128,20 @@ mhd_ahc (void *cls, struct MHD_Connection *connection, const char *url,
static void
do_shutdown ()
{
- if (mhd_task_id != GNUNET_SCHEDULER_NO_TASK)
+ if (mhd_task_id != NULL)
{
GNUNET_SCHEDULER_cancel (mhd_task_id);
- mhd_task_id = GNUNET_SCHEDULER_NO_TASK;
+ mhd_task_id = NULL;
}
- if (curl_task_id != GNUNET_SCHEDULER_NO_TASK)
+ if (curl_task_id != NULL)
{
GNUNET_SCHEDULER_cancel (curl_task_id);
- curl_task_id = GNUNET_SCHEDULER_NO_TASK;
+ curl_task_id = NULL;
}
- if (ctrl_c_task_id != GNUNET_SCHEDULER_NO_TASK)
+ if (ctrl_c_task_id != NULL)
{
GNUNET_SCHEDULER_cancel (ctrl_c_task_id);
- ctrl_c_task_id = GNUNET_SCHEDULER_NO_TASK;
+ ctrl_c_task_id = NULL;
}
if (NULL != mhd)
{
@@ -173,7 +173,7 @@ curl_main (void);
static void
curl_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- curl_task_id = GNUNET_SCHEDULER_NO_TASK;
+ curl_task_id = NULL;
curl_main ();
}
@@ -301,7 +301,7 @@ mhd_main (void);
static void
mhd_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- mhd_task_id = GNUNET_SCHEDULER_NO_TASK;
+ mhd_task_id = NULL;
MHD_run (mhd);
mhd_main ();
}
@@ -310,7 +310,7 @@ mhd_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
ctrl_c_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- ctrl_c_task_id = GNUNET_SCHEDULER_NO_TASK;
+ ctrl_c_task_id = NULL;
do_shutdown ();
GNUNET_break (0);
global_ret = 1;
@@ -329,7 +329,7 @@ mhd_main ()
unsigned MHD_LONG_LONG timeout;
struct GNUNET_TIME_Relative delay;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == mhd_task_id);
+ GNUNET_assert (NULL == mhd_task_id);
FD_ZERO (&rs);
FD_ZERO (&ws);
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;
/**
* Periodically reannounce regex.
*/
-static GNUNET_SCHEDULER_TaskIdentifier reannounce_task;
+static struct GNUNET_SCHEDULER_Task * reannounce_task;
/**
* What's the maximum reannounce period.
@@ -145,7 +145,7 @@ reannounce_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_TIME_Relative random_delay;
char *regex = cls;
- reannounce_task = GNUNET_SCHEDULER_NO_TASK;
+ reannounce_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
GNUNET_free (regex);
@@ -208,7 +208,7 @@ announce_regex (const char * regex)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Daemon for %s starting\n",
policy_filename);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == reannounce_task);
+ GNUNET_assert (NULL == reannounce_task);
copy = GNUNET_strdup (regex);
reannounce_task = GNUNET_SCHEDULER_add_now (reannounce_regex, (void *) copy);
}
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
/**
* Operation timeout
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout;
+ struct GNUNET_SCHEDULER_Task * timeout;
/**
* Deamon start
@@ -211,17 +211,17 @@ static struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Abort task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* Shutdown task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* Host registration task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier register_hosts_task;
+static struct GNUNET_SCHEDULER_Task * register_hosts_task;
/**
* Global event mask for all testbed events
@@ -296,7 +296,7 @@ static unsigned int next_search;
/**
* Search timeout task identifier.
*/
-static GNUNET_SCHEDULER_TaskIdentifier search_timeout_task;
+static struct GNUNET_SCHEDULER_Task * search_timeout_task;
/**
* Search timeout in seconds.
@@ -410,10 +410,10 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
char output_buffer[512];
size_t size;
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ shutdown_task = NULL;
+ if (NULL != abort_task)
GNUNET_SCHEDULER_cancel (abort_task);
- if (GNUNET_SCHEDULER_NO_TASK != register_hosts_task)
+ if (NULL != register_hosts_task)
GNUNET_SCHEDULER_cancel (register_hosts_task);
for (peer_cnt = 0; peer_cnt < num_peers; peer_cnt++)
@@ -479,9 +479,9 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
unsigned long i = (unsigned long) cls;
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Aborting from line %lu...\n", i);
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
result = GNUNET_SYSERR;
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ if (NULL != shutdown_task)
GNUNET_SCHEDULER_cancel (shutdown_task);
shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
}
@@ -734,10 +734,10 @@ regex_found_handler (void *cls,
strings_found++;
parallel_searches--;
- if (GNUNET_SCHEDULER_NO_TASK != peer->timeout)
+ if (NULL != peer->timeout)
{
GNUNET_SCHEDULER_cancel (peer->timeout);
- peer->timeout = GNUNET_SCHEDULER_NO_TASK;
+ peer->timeout = NULL;
if (GNUNET_NO == in_shutdown)
GNUNET_SCHEDULER_add_now (&announce_next_regex, NULL);
}
@@ -791,10 +791,10 @@ regex_found_handler (void *cls,
"All strings successfully matched in %s\n",
GNUNET_STRINGS_relative_time_to_string (prof_time, GNUNET_NO));
- if (GNUNET_SCHEDULER_NO_TASK != search_timeout_task)
+ if (NULL != search_timeout_task)
{
GNUNET_SCHEDULER_cancel (search_timeout_task);
- search_timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ search_timeout_task = NULL;
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Collecting stats.\n");
@@ -853,7 +853,7 @@ find_timed_out (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct RegexPeer *p = cls;
- p->timeout = GNUNET_SCHEDULER_NO_TASK;
+ p->timeout = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -996,7 +996,7 @@ announce_next_regex (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (strings_found != num_peers)
{
struct GNUNET_TIME_Relative new_delay;
- if (GNUNET_SCHEDULER_NO_TASK != search_timeout_task)
+ if (NULL != search_timeout_task)
GNUNET_SCHEDULER_cancel (search_timeout_task);
new_delay = GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MINUTES, 15);
search_timeout_task = GNUNET_SCHEDULER_add_delayed (new_delay,
@@ -1130,10 +1130,10 @@ test_master (void *cls,
"Testbed started in %s\n",
GNUNET_STRINGS_relative_time_to_string (prof_time, GNUNET_NO));
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
{
GNUNET_SCHEDULER_cancel (abort_task);
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
}
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;
/**
* Abort task identifier.
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* Shutdown task identifier.
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* Scan task identifier;
*/
-static GNUNET_SCHEDULER_TaskIdentifier scan_task;
+static struct GNUNET_SCHEDULER_Task * scan_task;
/**
* Global testing status.
@@ -276,8 +276,8 @@ free_meter (struct ProgressMeter *meter)
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ shutdown_task = NULL;
+ if (NULL != abort_task)
GNUNET_SCHEDULER_cancel (abort_task);
if (NULL != mysql_ctx)
GNUNET_MYSQL_context_destroy (mysql_ctx);
@@ -298,9 +298,9 @@ static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
GNUNET_SCHEDULER_cancel (scan_task);
- scan_task = GNUNET_SCHEDULER_NO_TASK;
+ scan_task = NULL;
result = GNUNET_SYSERR;
GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
}
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
/**
* Task for re-announcing.
*/
- GNUNET_SCHEDULER_TaskIdentifier refresh_task;
+ struct GNUNET_SCHEDULER_Task * refresh_task;
};
@@ -143,10 +143,10 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client)
nx = ce->next;
if (ce->client == client)
{
- if (GNUNET_SCHEDULER_NO_TASK != ce->refresh_task)
+ if (NULL != ce->refresh_task)
{
GNUNET_SCHEDULER_cancel (ce->refresh_task);
- ce->refresh_task = GNUNET_SCHEDULER_NO_TASK;
+ ce->refresh_task = NULL;
}
if (NULL != ce->ah)
{
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;
static int ok = 1;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
static void
end (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
GNUNET_REGEX_announce_cancel (a);
a = NULL;
GNUNET_REGEX_search_cancel (s);
@@ -64,7 +64,7 @@ end (void *cls,
static void
end_badly ()
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
FPRINTF (stderr, "%s", "Testcase failed (timeout).\n");
GNUNET_REGEX_announce_cancel (a);
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
/**
* Tasked used to trigger the set union operation.
*/
- GNUNET_SCHEDULER_TaskIdentifier transmit_task;
+ struct GNUNET_SCHEDULER_Task * transmit_task;
/**
* Handle to active set union operation (over revocation sets).
@@ -468,7 +468,7 @@ transmit_task_cb (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting set exchange with peer `%s'\n",
GNUNET_i2s (&peer_entry->id));
- peer_entry->transmit_task = GNUNET_SCHEDULER_NO_TASK;
+ peer_entry->transmit_task = NULL;
peer_entry->so = GNUNET_SET_prepare (&peer_entry->id,
&revocation_set_union_app_id,
NULL,
@@ -570,10 +570,10 @@ handle_core_disconnect (void *cls,
GNUNET_CONTAINER_multipeermap_remove (peers, peer,
pos));
GNUNET_MQ_destroy (pos->mq);
- if (pos->transmit_task != GNUNET_SCHEDULER_NO_TASK)
+ if (pos->transmit_task != NULL)
{
GNUNET_SCHEDULER_cancel (pos->transmit_task);
- pos->transmit_task = GNUNET_SCHEDULER_NO_TASK;
+ pos->transmit_task = NULL;
}
if (NULL != pos->so)
{
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;
/**
* Identifier for the main task that runs periodically.
*/
-GNUNET_SCHEDULER_TaskIdentifier do_round_task;
+struct GNUNET_SCHEDULER_Task * do_round_task;
/**
* Time inverval the do_round task runs in.
@@ -1318,10 +1318,10 @@ shutdown_task (void *cls,
{
LOG(GNUNET_ERROR_TYPE_DEBUG, "RPS is going down\n");
- if ( GNUNET_SCHEDULER_NO_TASK != do_round_task )
+ if ( NULL != do_round_task )
{
GNUNET_SCHEDULER_cancel (do_round_task);
- do_round_task = GNUNET_SCHEDULER_NO_TASK;
+ do_round_task = NULL;
}
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";
/**
* Scheduled task to shutdown
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+static struct GNUNET_SCHEDULER_Task * shutdown_task = NULL;
/**
* GNUnet configuration
@@ -157,7 +157,7 @@ static unsigned int sensor_names_size = 0;
/**
* Task run after any waiting period
*/
-static GNUNET_SCHEDULER_TaskIdentifier delayed_task = GNUNET_SCHEDULER_NO_TASK;
+static struct GNUNET_SCHEDULER_Task * delayed_task = NULL;
/**
@@ -180,10 +180,10 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
int i;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Shutting down.\n");
- if (GNUNET_SCHEDULER_NO_TASK != delayed_task)
+ if (NULL != delayed_task)
{
GNUNET_SCHEDULER_cancel (delayed_task);
- delayed_task = GNUNET_SCHEDULER_NO_TASK;
+ delayed_task = NULL;
}
for (i = 0; i < num_peers; i++)
{
@@ -536,7 +536,7 @@ simulate_anomalies (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
uint32_t an_peer;
struct GNUNET_TIME_Relative shutdown_delay;
- delayed_task = GNUNET_SCHEDULER_NO_TASK;
+ delayed_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Training period over, simulating anomalies now.\n");
GNUNET_assert (anomalous_peers <= num_peers);
@@ -572,7 +572,7 @@ peers_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
unsigned long long int training_points;
struct GNUNET_TIME_Relative training_period;
- delayed_task = GNUNET_SCHEDULER_NO_TASK;
+ delayed_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All peers are ready.\n");
GNUNET_assert (GNUNET_OK ==
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)
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Scheduling sensor `%s' to run after %" PRIu64 " microseconds\n",
sensorinfo->name, sensorinfo->interval.rel_value_us);
- if (GNUNET_SCHEDULER_NO_TASK != sensorinfo->execution_task)
+ if (NULL != sensorinfo->execution_task)
{
LOG (GNUNET_ERROR_TYPE_ERROR,
_("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
struct GNUNET_PEERSTORE_WatchContext *wc;
/**
- * Collection point reporting task (or #GNUNET_SCHEDULER_NO_TASK)
+ * Collection point reporting task (or #NULL)
*/
- GNUNET_SCHEDULER_TaskIdentifier reporting_task;
+ struct GNUNET_SCHEDULER_Task * reporting_task;
};
@@ -237,7 +237,7 @@ struct CadetPeer
/**
* Task used to try reconnection to collection point after failure
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Are we currently destroying the channel and its context?
@@ -400,10 +400,10 @@ destroy_value_info (struct ValueInfo *vi)
GNUNET_PEERSTORE_watch_cancel (vi->wc);
vi->wc = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != vi->reporting_task)
+ if (NULL != vi->reporting_task)
{
GNUNET_SCHEDULER_cancel (vi->reporting_task);
- vi->reporting_task = GNUNET_SCHEDULER_NO_TASK;
+ vi->reporting_task = NULL;
}
if (NULL != vi->last_value)
{
@@ -463,10 +463,10 @@ static void
destroy_cadet_peer (struct CadetPeer *cadetp)
{
cadetp->destroying = GNUNET_YES;
- if (GNUNET_SCHEDULER_NO_TASK != cadetp->reconnect_task)
+ if (NULL != cadetp->reconnect_task)
{
GNUNET_SCHEDULER_cancel (cadetp->reconnect_task);
- cadetp->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ cadetp->reconnect_task = NULL;
}
if (NULL != cadetp->mq)
{
@@ -625,7 +625,7 @@ cp_reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
LOG (GNUNET_ERROR_TYPE_INFO,
"Retrying connection to collection point `%s'.\n",
GNUNET_i2s (&cadetp->peer_id));
- cadetp->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ cadetp->reconnect_task = NULL;
GNUNET_assert (NULL == cadetp->channel);
cadetp->channel =
GNUNET_CADET_channel_create (cadet, cadetp, &cadetp->peer_id,
@@ -740,7 +740,7 @@ get_cadet_peer (struct GNUNET_PeerIdentity pid)
GNUNET_APPLICATION_TYPE_SENSORDASHBOARD,
GNUNET_CADET_OPTION_RELIABLE);
cadetp->mq = cp_mq_create (cadetp);
- cadetp->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ cadetp->reconnect_task = NULL;
GNUNET_CONTAINER_DLL_insert (cadetp_head, cadetp_tail, cadetp);
return cadetp;
}
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;
/**
* GNUnet scheduler task that starts the update check process.
*/
-static GNUNET_SCHEDULER_TaskIdentifier update_task;
+static struct GNUNET_SCHEDULER_Task * update_task;
/**
* Pointer to service reset function called when we have new sensor updates.
@@ -237,10 +237,10 @@ SENSOR_update_stop ()
up_default = NULL;
up = up_head;
- if (GNUNET_SCHEDULER_NO_TASK != update_task)
+ if (NULL != update_task)
{
GNUNET_SCHEDULER_cancel (update_task);
- update_task = GNUNET_SCHEDULER_NO_TASK;
+ update_task = NULL;
}
while (NULL != up)
{
@@ -390,7 +390,7 @@ check_for_updates (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_MessageHeader *msg;
size_t msg_size;
- update_task = GNUNET_SCHEDULER_NO_TASK;
+ update_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
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;
/**
* Task used to shutdown / expire the test
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* 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
/**
* Task responsible for timeout.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
};
@@ -365,7 +365,7 @@ signal_sensor_iteration_timeout (void *cls,
GNUNET_SENSOR_SensorIterateCB cb;
void *cb_cls;
- ic->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ic->timeout_task = NULL;
cb = ic->callback;
cb_cls = ic->callback_cls;
GNUNET_SENSOR_iterate_cancel (ic);
@@ -417,10 +417,10 @@ GNUNET_SENSOR_iterate_cancel (struct GNUNET_SENSOR_IterateContext *ic)
ic->callback_cls = NULL;
return;
}
- if (GNUNET_SCHEDULER_NO_TASK != ic->timeout_task)
+ if (NULL != ic->timeout_task)
{
GNUNET_SCHEDULER_cancel (ic->timeout_task);
- ic->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ic->timeout_task = NULL;
}
GNUNET_CONTAINER_DLL_remove (h->ic_head, h->ic_tail, ic);
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,
GNUNET_free (dummy);
}
//execution task
- sensor->execution_task = GNUNET_SCHEDULER_NO_TASK;
+ sensor->execution_task = NULL;
//running
sensor->running = GNUNET_NO;
return sensor;
@@ -479,10 +479,10 @@ destroy_sensor (void *cls, const struct GNUNET_HashCode *key, void *value)
{
struct GNUNET_SENSOR_SensorInfo *sensor = value;
- if (GNUNET_SCHEDULER_NO_TASK != sensor->execution_task)
+ if (NULL != sensor->execution_task)
{
GNUNET_SCHEDULER_cancel (sensor->execution_task);
- sensor->execution_task = GNUNET_SCHEDULER_NO_TASK;
+ sensor->execution_task = NULL;
}
if (NULL != sensor->gnunet_stat_get_handle)
{
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
/**
* Task that calculates the proof-of-work
*/
- GNUNET_SCHEDULER_TaskIdentifier calculate_pow_task;
+ struct GNUNET_SCHEDULER_Task * calculate_pow_task;
/**
* Size of msg (allocated after this struct)
@@ -157,7 +157,7 @@ calculate_pow (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
cx->matching_bits))
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "Found pow %" PRIu64 ".\n", cx->pow);
- cx->calculate_pow_task = GNUNET_SCHEDULER_NO_TASK;
+ cx->calculate_pow_task = NULL;
result_block =
GNUNET_malloc (sizeof (struct GNUNET_SENSOR_crypto_pow_block) +
cx->msg_size);
@@ -197,10 +197,10 @@ void
GNUNET_SENSOR_crypto_pow_sign_cancel (struct GNUNET_SENSOR_crypto_pow_context
*cx)
{
- if (GNUNET_SCHEDULER_NO_TASK != cx->calculate_pow_task)
+ if (NULL != cx->calculate_pow_task)
{
GNUNET_SCHEDULER_cancel (cx->calculate_pow_task);
- cx->calculate_pow_task = GNUNET_SCHEDULER_NO_TASK;
+ cx->calculate_pow_task = NULL;
}
GNUNET_free (cx);
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
/**
* GNUNET scheduler task that forces the anomaly after a stabilization delay
*/
- GNUNET_SCHEDULER_TaskIdentifier delay_task;
+ struct GNUNET_SCHEDULER_Task * delay_task;
};
@@ -152,7 +152,7 @@ static struct GNUNET_PEERSTORE_Handle *peerstore;
/**
* Task used to shutdown / expire the test
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* Status of the test to be returned by main()
@@ -163,10 +163,10 @@ static int ok = 1;
static void
destroy_peer (struct TestPeer *peer)
{
- if (GNUNET_SCHEDULER_NO_TASK != peer->delay_task)
+ if (NULL != peer->delay_task)
{
GNUNET_SCHEDULER_cancel (peer->delay_task);
- peer->delay_task = GNUNET_SCHEDULER_NO_TASK;
+ peer->delay_task = NULL;
}
if (NULL != peer->sensor_op)
{
@@ -280,7 +280,7 @@ force_anomaly_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct TestPeer *peer = cls;
- peer->delay_task = GNUNET_SCHEDULER_NO_TASK;
+ peer->delay_task = NULL;
GNUNET_SENSOR_force_anomaly (peer->sensor, (char *) sensor_name, GNUNET_YES,
NULL, NULL);
}
@@ -481,7 +481,7 @@ peer_info_cb (void *cb_cls, struct GNUNET_TESTBED_Operation *op,
peer = GNUNET_new (struct TestPeer);
peer->testbed_peer = testbed_peer;
- peer->delay_task = GNUNET_SCHEDULER_NO_TASK;
+ peer->delay_task = NULL;
GNUNET_CRYPTO_get_peer_identity (pinfo->result.cfg, &peer->peer_id);
if (NULL == peer_head) /* First peer (collection point) */
{
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;
/**
* Task used to shutdown / expire the test
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* 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)
GNUNET_CONTAINER_DLL_remove (incoming_head,
incoming_tail,
incoming);
- if (GNUNET_SCHEDULER_NO_TASK != incoming->timeout_task)
+ if (NULL != incoming->timeout_task)
{
GNUNET_SCHEDULER_cancel (incoming->timeout_task);
- incoming->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ incoming->timeout_task = NULL;
}
/* make sure that the tunnel end handler will not destroy us again */
incoming->vt = NULL;
@@ -543,9 +543,9 @@ incoming_suggest (struct Operation *incoming,
incoming->suggest_id = suggest_id++;
if (0 == suggest_id)
suggest_id++;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != incoming->timeout_task);
+ GNUNET_assert (NULL != incoming->timeout_task);
GNUNET_SCHEDULER_cancel (incoming->timeout_task);
- incoming->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ incoming->timeout_task = NULL;
mqm = GNUNET_MQ_msg_nested_mh (cmsg,
GNUNET_MESSAGE_TYPE_SET_REQUEST,
incoming->spec->context_msg);
@@ -624,7 +624,7 @@ handle_incoming_msg (struct Operation *op,
&msg->app_id);
if (NULL == listener)
{
- GNUNET_break (GNUNET_SCHEDULER_NO_TASK != op->timeout_task);
+ GNUNET_break (NULL != op->timeout_task);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"No matching listener for incoming request (op %u, app %s), waiting with timeout\n",
ntohl (msg->operation),
@@ -1279,7 +1279,7 @@ incoming_timeout_cb (void *cls,
{
struct Operation *incoming = cls;
- incoming->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ incoming->timeout_task = NULL;
GNUNET_assert (GNUNET_YES == incoming->is_incoming);
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
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
* Timeout task, if the incoming peer has not been accepted
* after the timeout, it will be disconnected.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* 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
/**
* Task for reconnecting when the listener fails.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Operation we listen for.
@@ -786,7 +786,7 @@ listen_connect (void *cls,
"Listener not reconnecting due to shutdown\n");
return;
}
- lh->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ lh->reconnect_task = NULL;
GNUNET_assert (NULL == lh->client);
lh->client = GNUNET_CLIENT_connect ("set", lh->cfg);
if (NULL == lh->client)
@@ -860,10 +860,10 @@ GNUNET_SET_listen_cancel (struct GNUNET_SET_ListenHandle *lh)
GNUNET_CLIENT_disconnect (lh->client);
lh->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != lh->reconnect_task)
+ if (NULL != lh->reconnect_task)
{
GNUNET_SCHEDULER_cancel (lh->reconnect_task);
- lh->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ lh->reconnect_task = NULL;
}
GNUNET_free (lh);
}
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;
/**
* Handle for task for timeout termination.
*/
-GNUNET_SCHEDULER_TaskIdentifier end_badly_task;
+struct GNUNET_SCHEDULER_Task * end_badly_task;
const struct GNUNET_CONFIGURATION_Handle *cfg;
@@ -196,10 +196,10 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending tests.\n");
- if (end_badly_task != GNUNET_SCHEDULER_NO_TASK)
+ if (end_badly_task != NULL)
{
GNUNET_SCHEDULER_cancel (end_badly_task);
- end_badly_task = GNUNET_SCHEDULER_NO_TASK;
+ end_badly_task = NULL;
}
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MILLISECONDS,
&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
/**
* Task run on timeout.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Associated value.
@@ -230,7 +230,7 @@ struct GNUNET_STATISTICS_Handle
/**
* Task doing exponential back-off trying to reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier backoff_task;
+ struct GNUNET_SCHEDULER_Task * backoff_task;
/**
* Time for next connect retry.
@@ -367,10 +367,10 @@ schedule_watch_request (struct GNUNET_STATISTICS_Handle *h,
static void
free_action_item (struct GNUNET_STATISTICS_GetHandle *gh)
{
- if (GNUNET_SCHEDULER_NO_TASK != gh->timeout_task)
+ if (NULL != gh->timeout_task)
{
GNUNET_SCHEDULER_cancel (gh->timeout_task);
- gh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ gh->timeout_task = NULL;
}
GNUNET_free_non_null (gh->subsystem);
GNUNET_free_non_null (gh->name);
@@ -426,7 +426,7 @@ try_connect (struct GNUNET_STATISTICS_Handle *h)
struct GNUNET_STATISTICS_GetHandle *gn;
unsigned int i;
- if (GNUNET_SCHEDULER_NO_TASK != h->backoff_task)
+ if (NULL != h->backoff_task)
return GNUNET_NO;
if (NULL != h->client)
return GNUNET_YES;
@@ -470,7 +470,7 @@ reconnect_task (void *cls,
{
struct GNUNET_STATISTICS_Handle *h = cls;
- h->backoff_task = GNUNET_SCHEDULER_NO_TASK;
+ h->backoff_task = NULL;
schedule_action (h);
}
@@ -502,7 +502,7 @@ reconnect_later (struct GNUNET_STATISTICS_Handle *h)
int loss;
struct GNUNET_STATISTICS_GetHandle *gh;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->backoff_task);
+ GNUNET_assert (NULL == h->backoff_task);
if (GNUNET_YES == h->do_destroy)
{
/* So we are shutting down and the service is not reachable.
@@ -992,10 +992,10 @@ GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h,
if (NULL == h)
return;
GNUNET_assert (GNUNET_NO == h->do_destroy); // Don't call twice.
- if (GNUNET_SCHEDULER_NO_TASK != h->backoff_task)
+ if (NULL != h->backoff_task)
{
GNUNET_SCHEDULER_cancel (h->backoff_task);
- h->backoff_task = GNUNET_SCHEDULER_NO_TASK;
+ h->backoff_task = NULL;
}
if (sync_first)
{
@@ -1117,7 +1117,7 @@ schedule_action (struct GNUNET_STATISTICS_Handle *h)
struct GNUNET_TIME_Relative timeout;
if ( (NULL != h->th) ||
- (GNUNET_SCHEDULER_NO_TASK != h->backoff_task) )
+ (NULL != h->backoff_task) )
return; /* action already pending */
if (GNUNET_YES != try_connect (h))
{
@@ -1172,7 +1172,7 @@ run_get_timeout (void *cls,
GNUNET_STATISTICS_Callback cont = gh->cont;
void *cont_cls = gh->cls;
- gh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ gh->timeout_task = NULL;
GNUNET_STATISTICS_get_cancel (gh);
cont (cont_cls, GNUNET_SYSERR);
}
@@ -1246,10 +1246,10 @@ GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh)
{
if (NULL == gh)
return;
- if (GNUNET_SCHEDULER_NO_TASK != gh->timeout_task)
+ if (NULL != gh->timeout_task)
{
GNUNET_SCHEDULER_cancel (gh->timeout_task);
- gh->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ gh->timeout_task = NULL;
}
gh->cont = NULL;
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;
static struct GNUNET_STATISTICS_Handle *h2;
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
static 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;
static struct GNUNET_STATISTICS_Handle *h2;
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
static 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;
/**
* Shutdown task identifier
*/
-GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
@@ -136,7 +136,7 @@ free_iterator (void *cls,
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task = NULL;
GNUNET_ATS_performance_done (ats);
ats = NULL;
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;
/**
* Task for shutdown
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* 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;
/**
* Task for shutdown
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
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;
/**
* Task identifier for the read task
*/
-static GNUNET_SCHEDULER_TaskIdentifier read_task_id;
+static struct GNUNET_SCHEDULER_Task * read_task_id;
/**
* Task identifier for the write task
*/
-static GNUNET_SCHEDULER_TaskIdentifier write_task_id;
+static struct GNUNET_SCHEDULER_Task * write_task_id;
/**
* Task to kill the child
*/
-static GNUNET_SCHEDULER_TaskIdentifier child_death_task_id;
+static struct GNUNET_SCHEDULER_Task * child_death_task_id;
/**
* shutdown task id
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id;
+static struct GNUNET_SCHEDULER_Task * shutdown_task_id;
/**
* Are we done reading messages from stdin?
@@ -162,26 +162,26 @@ static void
shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
LOG_DEBUG ("Shutting down\n");
- shutdown_task_id = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task_id = NULL;
if (NULL != testbed)
{
LOG_DEBUG ("Killing testbed\n");
GNUNET_break (0 == GNUNET_OS_process_kill (testbed, GNUNET_TERM_SIG));
}
- if (GNUNET_SCHEDULER_NO_TASK != read_task_id)
+ if (NULL != read_task_id)
{
GNUNET_SCHEDULER_cancel (read_task_id);
- read_task_id = GNUNET_SCHEDULER_NO_TASK;
+ read_task_id = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != write_task_id)
+ if (NULL != write_task_id)
{
GNUNET_SCHEDULER_cancel (write_task_id);
- write_task_id = GNUNET_SCHEDULER_NO_TASK;
+ write_task_id = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != child_death_task_id)
+ if (NULL != child_death_task_id)
{
GNUNET_SCHEDULER_cancel (child_death_task_id);
- child_death_task_id = GNUNET_SCHEDULER_NO_TASK;
+ child_death_task_id = NULL;
}
if (NULL != stdin_fd)
(void) GNUNET_DISK_file_close (stdin_fd);
@@ -209,7 +209,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
shutdown_now (void)
{
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task_id)
+ if (NULL != shutdown_task_id)
GNUNET_SCHEDULER_cancel (shutdown_task_id);
shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
}
@@ -228,7 +228,7 @@ write_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
ssize_t bytes_wrote;
GNUNET_assert (NULL != wc);
- write_task_id = GNUNET_SCHEDULER_NO_TASK;
+ write_task_id = NULL;
if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
{
GNUNET_free (wc->data);
@@ -275,7 +275,7 @@ child_death_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
int ret;
pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
- child_death_task_id = GNUNET_SCHEDULER_NO_TASK;
+ child_death_task_id = NULL;
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
{
child_death_task_id =
@@ -518,7 +518,7 @@ read_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
char buf[GNUNET_SERVER_MAX_MESSAGE_SIZE];
ssize_t sread;
- read_task_id = GNUNET_SCHEDULER_NO_TASK;
+ read_task_id = NULL;
if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
return;
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;
/**
* The shutdown task handle
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id;
+static struct GNUNET_SCHEDULER_Task * shutdown_task_id;
/**
* The number of connections we have
@@ -126,7 +126,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct MessageQueue *mq_entry;
- shutdown_task_id = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task_id = NULL;
in_shutdown = GNUNET_YES;
if (0 != nconn)
{
@@ -166,7 +166,7 @@ client_disconnected (void *cls, struct GNUNET_SERVER_Client *client)
nconn--;
if (GNUNET_YES != in_shutdown)
return;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != shutdown_task_id);
+ GNUNET_assert (NULL != shutdown_task_id);
GNUNET_SCHEDULER_cancel (shutdown_task_id);
shutdown_task_id = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
}
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;
/**
* The shutdown task handle
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id;
+static struct GNUNET_SCHEDULER_Task * shutdown_task_id;
/**
@@ -736,7 +736,7 @@ GST_clear_fopcq ()
{
GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fopc);
GNUNET_TESTBED_forward_operation_msg_cancel_ (fopc->opc);
- if (GNUNET_SCHEDULER_NO_TASK != fopc->timeout_task)
+ if (NULL != fopc->timeout_task)
GNUNET_SCHEDULER_cancel (fopc->timeout_task);
GNUNET_SERVER_client_drop (fopc->client);
switch (fopc->type)
@@ -784,7 +784,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct MessageQueue *mq_entry;
uint32_t id;
- shutdown_task_id = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task_id = NULL;
LOG_DEBUG ("Shutting down testbed service\n");
/* cleanup any remaining forwarded operations */
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
/**
* Task ID for the timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* 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
/**
* Identifier for the timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier tout_task;
+ struct GNUNET_SCHEDULER_Task * tout_task;
/**
* 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
/**
* The task to expire this connection from the connection pool
*/
- GNUNET_SCHEDULER_TaskIdentifier expire_task;
+ struct GNUNET_SCHEDULER_Task * expire_task;
/**
* The task to notify a waiting #GST_ConnectionPool_GetHandle object
*/
- GNUNET_SCHEDULER_TaskIdentifier notify_task;
+ struct GNUNET_SCHEDULER_Task * notify_task;
/**
* Number of active requests using this pooled connection
@@ -286,10 +286,10 @@ destroy_pooled_connection (struct PooledConnection *entry)
GNUNET_CONTAINER_multihashmap32_remove (map,
entry->index,
entry));
- if (GNUNET_SCHEDULER_NO_TASK != entry->notify_task)
+ if (NULL != entry->notify_task)
{
GNUNET_SCHEDULER_cancel (entry->notify_task);
- entry->notify_task = GNUNET_SCHEDULER_NO_TASK;
+ entry->notify_task = NULL;
}
LOG_DEBUG ("Cleaning up handles of a pooled connection\n");
if (NULL != entry->handle_transport)
@@ -322,7 +322,7 @@ expire (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct PooledConnection *entry = cls;
- entry->expire_task = GNUNET_SCHEDULER_NO_TASK;
+ entry->expire_task = NULL;
destroy_pooled_connection (entry);
}
@@ -335,10 +335,10 @@ expire (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
expire_task_cancel (struct PooledConnection *entry)
{
- if (GNUNET_SCHEDULER_NO_TASK != entry->expire_task)
+ if (NULL != entry->expire_task)
{
GNUNET_SCHEDULER_cancel (entry->expire_task);
- entry->expire_task = GNUNET_SCHEDULER_NO_TASK;
+ entry->expire_task = NULL;
}
}
@@ -355,7 +355,7 @@ add_to_lru (struct PooledConnection *entry)
GNUNET_assert (!entry->in_lru);
GNUNET_CONTAINER_DLL_insert_tail (head_lru, tail_lru, entry);
entry->in_lru = GNUNET_YES;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == entry->expire_task);
+ GNUNET_assert (NULL == entry->expire_task);
entry->expire_task = GNUNET_SCHEDULER_add_delayed (CACHE_EXPIRY,
&expire, entry);
}
@@ -415,8 +415,8 @@ connection_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GST_ConnectionPool_GetHandle *gh;
struct GST_ConnectionPool_GetHandle *gh_next;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != entry->notify_task);
- entry->notify_task = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_assert (NULL != entry->notify_task);
+ entry->notify_task = NULL;
gh = search_waiting (entry, entry->head_waiting);
GNUNET_assert (NULL != gh);
gh_next = NULL;
@@ -524,7 +524,7 @@ opstart_get_handle_transport (void *cls)
}
if (0 == entry->demand)
return;
- if (GNUNET_SCHEDULER_NO_TASK != entry->notify_task)
+ if (NULL != entry->notify_task)
return;
if (NULL != search_waiting (entry, entry->head_waiting))
{
@@ -597,7 +597,7 @@ core_startup_cb (void *cls,
sizeof (struct GNUNET_PeerIdentity));
if (0 == entry->demand)
return;
- if (GNUNET_SCHEDULER_NO_TASK != entry->notify_task)
+ if (NULL != entry->notify_task)
return;
if (NULL != search_waiting (entry, entry->head_waiting))
{
@@ -832,7 +832,7 @@ GST_connection_pool_get_handle (unsigned int peer_id,
GNUNET_CONTAINER_DLL_insert (entry->head_waiting, entry->tail_waiting, gh);
if (NULL != handle)
{
- if (GNUNET_SCHEDULER_NO_TASK == entry->notify_task)
+ if (NULL == entry->notify_task)
{
if (NULL != search_waiting (entry, entry->head_waiting))
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)
{
GNUNET_CONTAINER_DLL_remove (entry->head_waiting, entry->tail_waiting, gh);
if ( (NULL == search_waiting (entry, entry->head_waiting))
- && (GNUNET_SCHEDULER_NO_TASK != entry->notify_task) )
+ && (NULL != entry->notify_task) )
{
GNUNET_SCHEDULER_cancel (entry->notify_task);
- entry->notify_task = GNUNET_SCHEDULER_NO_TASK;
+ entry->notify_task = NULL;
}
}
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;
*/
struct GNUNET_BIO_WriteHandle *bw;
-GNUNET_SCHEDULER_TaskIdentifier sample_load_task_id;
+struct GNUNET_SCHEDULER_Task * sample_load_task_id;
#ifdef OSX
@@ -656,7 +656,7 @@ sample_load_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
unsigned int mem_usage;
unsigned int nproc;
- sample_load_task_id = GNUNET_SCHEDULER_NO_TASK;
+ sample_load_task_id = NULL;
if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
return;
ld_cpu = cpu_get_load ();
@@ -767,10 +767,10 @@ GST_stats_destroy ()
#elif OSX
GNUNET_free_non_null (prev_cpu_load);
#endif
- if (GNUNET_SCHEDULER_NO_TASK != sample_load_task_id)
+ if (NULL != sample_load_task_id)
{
GNUNET_SCHEDULER_cancel (sample_load_task_id);
- sample_load_task_id = GNUNET_SCHEDULER_NO_TASK;
+ sample_load_task_id = NULL;
}
GNUNET_break (GNUNET_OK == GNUNET_BIO_write_close (bw));
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
/**
* The timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* The id of the operation which created this context
@@ -206,7 +206,7 @@ struct Neighbour
/**
* Task id for the task to call notifications from the notification list
*/
- GNUNET_SCHEDULER_TaskIdentifier notify_task;
+ struct GNUNET_SCHEDULER_Task * notify_task;
/**
* How many references are present currently to this neighbour's connection
@@ -265,7 +265,7 @@ struct NeighbourConnectCtxt
/**
* Task to be run upon timeout
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* The notification handle associated with the neighbour's connection request
@@ -317,7 +317,7 @@ static struct LCFContextQueue *lcfq_tail;
/**
* The lcf_task handle
*/
-static GNUNET_SCHEDULER_TaskIdentifier lcf_proc_task_id;
+static struct GNUNET_SCHEDULER_Task * lcf_proc_task_id;
/**
* The size of the route list
@@ -602,7 +602,7 @@ lcf_proc_cc (void *cls, const char *emsg)
{
struct LCFContext *lcf = cls;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id);
+ GNUNET_assert (NULL == lcf_proc_task_id);
switch (lcf->state)
{
case INIT:
@@ -652,14 +652,14 @@ lcf_forwarded_operation_timeout (void *cls,
{
struct LCFContext *lcf = cls;
- lcf->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ lcf->timeout_task = NULL;
// GST_forwarded_operation_timeout (lcf->fopc, tc);
LOG (GNUNET_ERROR_TYPE_WARNING,
"A forwarded controller link operation has timed out\n");
send_controller_link_response (lcf->client, lcf->operation_id, NULL,
"A forwarded controller link operation has "
"timed out\n");
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id);
+ GNUNET_assert (NULL == lcf_proc_task_id);
lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
}
@@ -676,7 +676,7 @@ lcf_proc_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct LCFContext *lcf = cls;
struct LCFContextQueue *lcfq;
- lcf_proc_task_id = GNUNET_SCHEDULER_NO_TASK;
+ lcf_proc_task_id = NULL;
switch (lcf->state)
{
case INIT:
@@ -753,7 +753,7 @@ slave_event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
GNUNET_TESTBED_operation_done (lcf->op);
lcf->op = NULL;
GNUNET_assert (FINISHED == lcf->state);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != lcf->timeout_task);
+ GNUNET_assert (NULL != lcf->timeout_task);
GNUNET_SCHEDULER_cancel (lcf->timeout_task);
if (NULL == event->details.operation_finished.emsg)
send_controller_link_response (lcf->client, lcf->operation_id,
@@ -764,7 +764,7 @@ slave_event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
send_controller_link_response (lcf->client, lcf->operation_id,
NULL,
event->details.operation_finished.emsg);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id);
+ GNUNET_assert (NULL == lcf_proc_task_id);
lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcf);
return;
}
@@ -862,8 +862,8 @@ neighbour_connect_notify_task (void *cls,
struct NeighbourConnectNotification *h;
GNUNET_assert (NULL != (h = n->nl_head));
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != n->notify_task);
- n->notify_task = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_assert (NULL != n->notify_task);
+ n->notify_task = NULL;
GNUNET_assert (NULL != n->controller);
GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h);
trigger_notifications (n);
@@ -888,7 +888,7 @@ trigger_notifications (struct Neighbour *n)
return;
if (NULL == n->controller)
return;
- if (GNUNET_SCHEDULER_NO_TASK != n->notify_task)
+ if (NULL != n->notify_task)
return;
if (1 == n->inactive)
{
@@ -936,7 +936,7 @@ oprelease_neighbour_conn (void *cls)
struct Neighbour *n = cls;
GNUNET_assert (0 == n->reference_cnt);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == n->notify_task);
+ GNUNET_assert (NULL == n->notify_task);
GNUNET_assert (NULL == n->nl_head);
if (NULL != n->controller)
{
@@ -1006,12 +1006,12 @@ GST_neighbour_get_connection_cancel (struct NeighbourConnectNotification *h)
GNUNET_free (h);
if (GNUNET_NO == cleanup_task)
return;
- if (GNUNET_SCHEDULER_NO_TASK == n->notify_task)
+ if (NULL == n->notify_task)
return;
GNUNET_assert (0 < n->reference_cnt);
n->reference_cnt--;
GNUNET_SCHEDULER_cancel (n->notify_task);
- n->notify_task = GNUNET_SCHEDULER_NO_TASK;
+ n->notify_task = NULL;
if (NULL == n->nl_head)
{
if ( (0 == n->reference_cnt) && (0 == n->inactive) )
@@ -1056,7 +1056,7 @@ cleanup_ncc (struct NeighbourConnectCtxt *ncc)
{
if (NULL != ncc->nh)
GST_neighbour_get_connection_cancel (ncc->nh);
- if (GNUNET_SCHEDULER_NO_TASK != ncc->timeout_task)
+ if (NULL != ncc->timeout_task)
GNUNET_SCHEDULER_cancel (ncc->timeout_task);
GNUNET_SERVER_client_drop (ncc->client);
GNUNET_CONTAINER_DLL_remove (ncc_head, ncc_tail, ncc);
@@ -1126,7 +1126,7 @@ timeout_neighbour_connect (void *cls,
{
struct NeighbourConnectCtxt *ncc = cls;
- ncc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ncc->timeout_task = NULL;
send_controller_link_response (ncc->client, ncc->op_id, NULL,
"Could not connect to delegated controller");
cleanup_ncc (ncc);
@@ -1145,7 +1145,7 @@ neighbour_connect_cb (void *cls, struct GNUNET_TESTBED_Controller *c)
struct NeighbourConnectCtxt *ncc = cls;
GNUNET_SCHEDULER_cancel (ncc->timeout_task);
- ncc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ncc->timeout_task = NULL;
ncc->nh = NULL;
GST_neighbour_release_connection (ncc->n);
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,
lcfq->lcf->client = client;
if (NULL == lcfq_head)
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id);
+ GNUNET_assert (NULL == lcf_proc_task_id);
GNUNET_CONTAINER_DLL_insert_tail (lcfq_head, lcfq_tail, lcfq);
lcf_proc_task_id = GNUNET_SCHEDULER_add_now (&lcf_proc_task, lcfq->lcf);
}
@@ -1354,20 +1354,20 @@ GST_free_lcfq ()
if (NULL != lcfq_head)
{
- if (GNUNET_SCHEDULER_NO_TASK != lcf_proc_task_id)
+ if (NULL != lcf_proc_task_id)
{
GNUNET_SCHEDULER_cancel (lcf_proc_task_id);
- lcf_proc_task_id = GNUNET_SCHEDULER_NO_TASK;
+ lcf_proc_task_id = NULL;
}
}
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == lcf_proc_task_id);
+ GNUNET_assert (NULL == lcf_proc_task_id);
for (lcfq = lcfq_head; NULL != lcfq; lcfq = lcfq_head)
{
lcf = lcfq->lcf;
GNUNET_SERVER_client_drop (lcf->client);
if (NULL != lcf->op)
GNUNET_TESTBED_operation_done (lcf->op);
- if (GNUNET_SCHEDULER_NO_TASK != lcf->timeout_task)
+ if (NULL != lcf->timeout_task)
GNUNET_SCHEDULER_cancel (lcf->timeout_task);
GNUNET_free (lcf);
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
/**
* The task handle
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* The id of the operation which is resposible for this context
@@ -250,17 +250,17 @@ struct OverlayConnectContext
* The id of the task for sending HELLO of peer 2 to peer 1 and ask peer 1 to
* connect to peer 2
*/
- GNUNET_SCHEDULER_TaskIdentifier send_hello_task;
+ struct GNUNET_SCHEDULER_Task * send_hello_task;
/**
* The id of the overlay connect timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* The id of the cleanup task
*/
- GNUNET_SCHEDULER_TaskIdentifier cleanup_task;
+ struct GNUNET_SCHEDULER_Task * cleanup_task;
/**
* The type of this context information
@@ -321,12 +321,12 @@ struct RemoteOverlayConnectCtx
/**
* Task for offering HELLO of A to B and doing try_connect
*/
- GNUNET_SCHEDULER_TaskIdentifier attempt_connect_task_id;
+ struct GNUNET_SCHEDULER_Task * attempt_connect_task_id;
/**
* Task to timeout RequestOverlayConnect
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_rocc_task_id;
+ struct GNUNET_SCHEDULER_Task * timeout_rocc_task_id;
/**
* The id of the operation responsible for creating this context
@@ -478,7 +478,7 @@ cleanup_occ_lp2c (struct LocalPeer2Context *lp2c)
GST_connection_pool_get_handle_done (lp2c->tcc.cgh_th);
if (NULL != lp2c->tcc.tch)
GNUNET_TRANSPORT_try_connect_cancel (lp2c->tcc.tch);
- if (GNUNET_SCHEDULER_NO_TASK != lp2c->tcc.task)
+ if (NULL != lp2c->tcc.task)
GNUNET_SCHEDULER_cancel (lp2c->tcc.task);
}
@@ -523,11 +523,11 @@ cleanup_occ (struct OverlayConnectContext *occ)
GNUNET_free_non_null (occ->emsg);
GNUNET_free_non_null (occ->hello);
GNUNET_SERVER_client_drop (occ->client);
- if (GNUNET_SCHEDULER_NO_TASK != occ->send_hello_task)
+ if (NULL != occ->send_hello_task)
GNUNET_SCHEDULER_cancel (occ->send_hello_task);
- if (GNUNET_SCHEDULER_NO_TASK != occ->cleanup_task)
+ if (NULL != occ->cleanup_task)
GNUNET_SCHEDULER_cancel (occ->cleanup_task);
- if (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task)
+ if (NULL != occ->timeout_task)
GNUNET_SCHEDULER_cancel (occ->timeout_task);
if (NULL != occ->cgh_ch)
GST_connection_pool_get_handle_done (occ->cgh_ch);
@@ -571,7 +571,7 @@ do_cleanup_occ (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct OverlayConnectContext *occ = cls;
- occ->cleanup_task = GNUNET_SCHEDULER_NO_TASK;
+ occ->cleanup_task = NULL;
cleanup_occ (occ);
}
@@ -588,8 +588,8 @@ timeout_overlay_connect (void *cls,
{
struct OverlayConnectContext *occ = cls;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task);
- occ->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_assert (NULL != occ->timeout_task);
+ occ->timeout_task = NULL;
/* LOG (GNUNET_ERROR_TYPE_WARNING, */
/* "0x%llx: Timeout while connecting peers %u and %u: %s\n", occ->op_id, */
/* occ->peer->id, occ->other_peer_id, occ->emsg); */
@@ -653,21 +653,21 @@ overlay_connect_notify (void *cls, const struct GNUNET_PeerIdentity *new_peer)
LOG_DEBUG ("0x%llx: Peer %4s connected to peer %4s\n", occ->op_id,
other_peer_str, GNUNET_i2s (&occ->peer_identity));
GNUNET_free (other_peer_str);
- if (GNUNET_SCHEDULER_NO_TASK != occ->send_hello_task)
+ if (NULL != occ->send_hello_task)
{
GNUNET_SCHEDULER_cancel (occ->send_hello_task);
- occ->send_hello_task = GNUNET_SCHEDULER_NO_TASK;
+ occ->send_hello_task = NULL;
}
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task);
+ GNUNET_assert (NULL != occ->timeout_task);
GNUNET_SCHEDULER_cancel (occ->timeout_task);
- occ->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ occ->timeout_task = NULL;
if (OCC_TYPE_LOCAL == occ->type)
{
lp2c = &occ->p2ctx.local;
- if (GNUNET_SCHEDULER_NO_TASK != lp2c->tcc.task)
+ if (NULL != lp2c->tcc.task)
{
GNUNET_SCHEDULER_cancel (lp2c->tcc.task);
- lp2c->tcc.task = GNUNET_SCHEDULER_NO_TASK;
+ lp2c->tcc.task = NULL;
}
}
GNUNET_free_non_null (occ->emsg);
@@ -700,7 +700,7 @@ try_connect_cb (void *cls, const int result)
struct TryConnectContext *tcc = cls;
tcc->tch = NULL;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == tcc->task);
+ GNUNET_assert (NULL == tcc->task);
tcc->task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
(GNUNET_TIME_UNIT_MILLISECONDS,
@@ -720,7 +720,7 @@ try_connect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct TryConnectContext *tcc = cls;
- tcc->task = GNUNET_SCHEDULER_NO_TASK;
+ tcc->task = NULL;
if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
return;
GNUNET_assert (NULL == tcc->tch);
@@ -762,7 +762,7 @@ occ_hello_sent_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_assert (OCC_TYPE_LOCAL == occ->type);
lp2c = &occ->p2ctx.local;
lp2c->ohh = NULL;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == occ->send_hello_task);
+ GNUNET_assert (NULL == occ->send_hello_task);
if (GNUNET_SCHEDULER_REASON_TIMEOUT == tc->reason)
{
GNUNET_free_non_null (occ->emsg);
@@ -839,7 +839,7 @@ send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct LocalPeer2Context *lp2c;
char *other_peer_str;
- occ->send_hello_task = GNUNET_SCHEDULER_NO_TASK;
+ occ->send_hello_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
GNUNET_assert (NULL != occ->hello);
@@ -1048,7 +1048,7 @@ occ_cache_get_handle_core_cb (void *cls, struct GNUNET_CORE_Handle *ch,
struct OverlayConnectContext *occ = cls;
const struct GNUNET_MessageHeader *hello;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task);
+ GNUNET_assert (NULL != occ->timeout_task);
GNUNET_free_non_null (occ->emsg);
if ((NULL == ch) || (NULL == my_identity))
{
@@ -1066,7 +1066,7 @@ occ_cache_get_handle_core_cb (void *cls, struct GNUNET_CORE_Handle *ch,
{
LOG_DEBUG ("0x%llx: Target peer already connected\n", occ->op_id);
GNUNET_SCHEDULER_cancel (occ->timeout_task);
- occ->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ occ->timeout_task = NULL;
send_overlay_connect_success_msg (occ);
occ->cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup_occ, occ);
return;
@@ -1114,7 +1114,7 @@ overlay_connect_get_config (void *cls, const struct GNUNET_MessageHeader *msg)
GNUNET_assert (OCC_TYPE_LOCAL != occ->type);
rp2c = &occ->p2ctx.remote;
rp2c->opc = NULL;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != occ->timeout_task);
+ GNUNET_assert (NULL != occ->timeout_task);
if (GNUNET_MESSAGE_TYPE_TESTBED_PEER_INFORMATION != ntohs (msg->type))
{
GNUNET_SCHEDULER_cancel (occ->timeout_task);
@@ -1462,7 +1462,7 @@ GST_handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client,
GST_peer_list[p1]->reference_cnt++;
occ->peer = GST_peer_list[p1];
occ->op_id = operation_id;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == occ->timeout_task);
+ GNUNET_assert (NULL == occ->timeout_task);
occ->timeout_task =
GNUNET_SCHEDULER_add_delayed (GST_timeout, &timeout_overlay_connect, occ);
switch (occ->type)
@@ -1508,15 +1508,15 @@ static void
cleanup_rocc (struct RemoteOverlayConnectCtx *rocc)
{
LOG_DEBUG ("0x%llx: Cleaning up rocc\n", rocc->op_id);
- if (GNUNET_SCHEDULER_NO_TASK != rocc->attempt_connect_task_id)
+ if (NULL != rocc->attempt_connect_task_id)
GNUNET_SCHEDULER_cancel (rocc->attempt_connect_task_id);
- if (GNUNET_SCHEDULER_NO_TASK != rocc->timeout_rocc_task_id)
+ if (NULL != rocc->timeout_rocc_task_id)
GNUNET_SCHEDULER_cancel (rocc->timeout_rocc_task_id);
if (NULL != rocc->ohh)
GNUNET_TRANSPORT_offer_hello_cancel (rocc->ohh);
if (NULL != rocc->tcc.tch)
GNUNET_TRANSPORT_try_connect_cancel (rocc->tcc.tch);
- if (GNUNET_SCHEDULER_NO_TASK != rocc->tcc.task)
+ if (NULL != rocc->tcc.task)
GNUNET_SCHEDULER_cancel (rocc->tcc.task);
GST_connection_pool_get_handle_done (rocc->tcc.cgh_th);
GNUNET_assert (rocc->peer->reference_cnt > 0);
@@ -1541,8 +1541,8 @@ timeout_rocc_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct RemoteOverlayConnectCtx *rocc = cls;
- GNUNET_assert (rocc->timeout_rocc_task_id != GNUNET_SCHEDULER_NO_TASK);
- rocc->timeout_rocc_task_id = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_assert (rocc->timeout_rocc_task_id != NULL);
+ rocc->timeout_rocc_task_id = NULL;
LOG_DEBUG ("0x%llx: rocc timed out\n", rocc->op_id);
cleanup_rocc (rocc);
}
@@ -1596,7 +1596,7 @@ rocc_hello_sent_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct RemoteOverlayConnectCtx *rocc = cls;
rocc->ohh = NULL;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rocc->attempt_connect_task_id);
+ GNUNET_assert (NULL == rocc->attempt_connect_task_id);
LOG_DEBUG ("0x%llx: HELLO of peer %4s sent to local peer with id: %u\n",
rocc->op_id, GNUNET_i2s (&rocc->a_id), rocc->peer->id);
if (GNUNET_SCHEDULER_REASON_TIMEOUT == tc->reason)
@@ -1627,8 +1627,8 @@ attempt_connect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct RemoteOverlayConnectCtx *rocc = cls;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != rocc->attempt_connect_task_id);
- rocc->attempt_connect_task_id = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_assert (NULL != rocc->attempt_connect_task_id);
+ rocc->attempt_connect_task_id = NULL;
LOG_DEBUG ("0x%llx: Offering HELLO of peer %4s to local peer with id: %u\n",
rocc->op_id, GNUNET_i2s (&rocc->a_id), rocc->peer->id);
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;
/**
* Abort task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* Shutdown task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* Global event mask for all testbed events
@@ -112,11 +112,11 @@ static int noninteractive;
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ shutdown_task = NULL;
+ if (NULL != abort_task)
{
GNUNET_SCHEDULER_cancel (abort_task);
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
}
if (NULL != cfg)
{
@@ -137,9 +137,9 @@ static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
result = GNUNET_SYSERR;
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ if (NULL != shutdown_task)
GNUNET_SCHEDULER_cancel (shutdown_task);
shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
}
@@ -185,7 +185,7 @@ controller_event_cb (void *cls,
{
printf ("\nAborting due to very high failure rate\n");
print_overlay_links_summary ();
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
GNUNET_SCHEDULER_cancel (abort_task);
abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
return;
@@ -233,7 +233,7 @@ test_run (void *cls,
if (noninteractive)
{
GNUNET_SCHEDULER_cancel (abort_task);
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
&do_shutdown, NULL);
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;
/**
* The shutdown task
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task_id;
+static struct GNUNET_SCHEDULER_Task * shutdown_task_id;
/**
* Task to kill the child
*/
-static GNUNET_SCHEDULER_TaskIdentifier terminate_task_id;
+static struct GNUNET_SCHEDULER_Task * terminate_task_id;
/**
* Task to kill the child
*/
-static GNUNET_SCHEDULER_TaskIdentifier child_death_task_id;
+static struct GNUNET_SCHEDULER_Task * child_death_task_id;
/**
* The shutdown task
@@ -76,7 +76,7 @@ static GNUNET_SCHEDULER_TaskIdentifier child_death_task_id;
static void
shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- shutdown_task_id = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task_id = NULL;
if (0 != child_exit_code)
{
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)
char c[16];
pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
- child_death_task_id = GNUNET_SCHEDULER_NO_TASK;
+ child_death_task_id = NULL;
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
{
child_death_task_id =
@@ -152,7 +152,7 @@ child_death_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_break (0 < GNUNET_DISK_file_read (pr, &c, sizeof (c)));
LOG_DEBUG ("Child died\n");
GNUNET_SCHEDULER_cancel (terminate_task_id);
- terminate_task_id = GNUNET_SCHEDULER_NO_TASK;
+ terminate_task_id = NULL;
GNUNET_assert (GNUNET_OK == GNUNET_OS_process_status (child, &child_status,
&child_exit_code));
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;
/**
* Abort task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* Shutdown task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* Configuratin handler
@@ -85,7 +85,7 @@ static int result;
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
GNUNET_SCHEDULER_cancel (abort_task);
if (NULL != helper)
GNUNET_HELPER_stop (helper, GNUNET_NO);
@@ -104,12 +104,12 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
result = GNUNET_SYSERR;
if (NULL != shandle)
GNUNET_HELPER_send_cancel (shandle);
- if (GNUNET_SCHEDULER_NO_TASK == shutdown_task)
+ if (NULL == shutdown_task)
shutdown_task = GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
}
@@ -167,7 +167,7 @@ mst_cb (void *cls, void *client, const struct GNUNET_MessageHeader *message)
uncompress ((Bytef *) config, &config_size,
(const Bytef *) &msg[1], xconfig_size));
GNUNET_free (config);
- if (GNUNET_SCHEDULER_NO_TASK == shutdown_task)
+ if (NULL == shutdown_task)
shutdown_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
(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;
/**
* Abort task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* The testing result
@@ -139,7 +139,7 @@ static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "Shutting down...\n");
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
GNUNET_SCHEDULER_cancel (abort_task);
if (NULL != reg_handle)
GNUNET_TESTBED_cancel_registration (reg_handle);
@@ -162,9 +162,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
#define FAIL_TEST(cond, ret) do { \
if (!(cond)) { \
GNUNET_break(0); \
- if (GNUNET_SCHEDULER_NO_TASK != abort_task) \
+ if (NULL != abort_task) \
GNUNET_SCHEDULER_cancel (abort_task); \
- abort_task = GNUNET_SCHEDULER_NO_TASK; \
+ abort_task = NULL; \
GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \
ret; \
} \
@@ -181,7 +181,7 @@ static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
do_shutdown (cls, tc);
}
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;
/**
* Abort task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* Delayed connect job identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier delayed_connect_task;
+static struct GNUNET_SCHEDULER_Task * delayed_connect_task;
/**
* Different stages in testing
@@ -173,9 +173,9 @@ static enum Stage result;
#define FAIL_TEST(cond) do { \
if (!(cond)) { \
GNUNET_break(0); \
- if (GNUNET_SCHEDULER_NO_TASK != abort_task) \
+ if (NULL != abort_task) \
GNUNET_SCHEDULER_cancel (abort_task); \
- abort_task = GNUNET_SCHEDULER_NO_TASK; \
+ abort_task = NULL; \
GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \
return; \
} \
@@ -191,9 +191,9 @@ static enum Stage result;
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
GNUNET_SCHEDULER_cancel (abort_task);
- if (GNUNET_SCHEDULER_NO_TASK != delayed_connect_task)
+ if (NULL != delayed_connect_task)
GNUNET_SCHEDULER_cancel (delayed_connect_task);
if (NULL != reg_handle)
GNUNET_TESTBED_cancel_registration (reg_handle);
@@ -216,7 +216,7 @@ static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
do_shutdown (cls, tc);
}
@@ -242,7 +242,7 @@ op_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg);
static void
do_delayed_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- delayed_connect_task = GNUNET_SCHEDULER_NO_TASK;
+ delayed_connect_task = NULL;
FAIL_TEST (NULL == common_operation);
common_operation =
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;
/**
* Abort task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* Delayed connect job identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier delayed_connect_task;
+static struct GNUNET_SCHEDULER_Task * delayed_connect_task;
/**
* Different stages in testing
@@ -259,11 +259,11 @@ static enum Stage result;
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
GNUNET_SCHEDULER_cancel (abort_task);
if (NULL != hc_handle)
GNUNET_TESTBED_is_host_habitable_cancel (hc_handle);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == delayed_connect_task);
+ GNUNET_assert (NULL == delayed_connect_task);
if (NULL != common_operation)
GNUNET_TESTBED_operation_done (common_operation);
if (NULL != reg_handle)
@@ -294,11 +294,11 @@ static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
- abort_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != delayed_connect_task)
+ abort_task = NULL;
+ if (NULL != delayed_connect_task)
{
GNUNET_SCHEDULER_cancel (delayed_connect_task);
- delayed_connect_task = GNUNET_SCHEDULER_NO_TASK;
+ delayed_connect_task = NULL;
}
do_shutdown (cls, tc);
}
@@ -306,7 +306,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
abort_test ()
{
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
GNUNET_SCHEDULER_cancel (abort_task);
abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
}
@@ -333,7 +333,7 @@ op_comp_cb (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg);
static void
do_delayed_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- delayed_connect_task = GNUNET_SCHEDULER_NO_TASK;
+ delayed_connect_task = NULL;
if (NULL != common_operation)
{
GNUNET_break (0);
@@ -859,7 +859,7 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *_host,
"to use password less SSH logins to localhost.\n"
"Skipping test\n");
GNUNET_SCHEDULER_cancel (abort_task);
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
(void) GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
result = SKIP;
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;
/**
* Identifier for the shutdown task
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* Result of this test case
@@ -67,7 +67,7 @@ static int result;
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task = NULL;
if (NULL != barrier)
{
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;
/**
* Abort task
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* Operation handle for linking controllers
@@ -279,7 +279,7 @@ struct GNUNET_TESTBED_HostHabitableCheckHandle *hc_handle;
/**
* The task handle for the delay task
*/
-GNUNET_SCHEDULER_TaskIdentifier delay_task_id;
+struct GNUNET_SCHEDULER_Task * delay_task_id;
/**
* Event mask
@@ -297,9 +297,9 @@ static enum Stage result;
#define FAIL_TEST(cond) do { \
if (!(cond)) { \
GNUNET_break(0); \
- if (GNUNET_SCHEDULER_NO_TASK != abort_task) \
+ if (NULL != abort_task) \
GNUNET_SCHEDULER_cancel (abort_task); \
- abort_task = GNUNET_SCHEDULER_NO_TASK; \
+ abort_task = NULL; \
GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \
return; \
} \
@@ -315,12 +315,12 @@ static enum Stage result;
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
GNUNET_SCHEDULER_cancel (abort_task);
- if (GNUNET_SCHEDULER_NO_TASK != delay_task_id)
+ if (NULL != delay_task_id)
{
GNUNET_SCHEDULER_cancel (delay_task_id);
- delay_task_id = GNUNET_SCHEDULER_NO_TASK;
+ delay_task_id = NULL;
}
if (NULL != hc_handle)
GNUNET_TESTBED_is_host_habitable_cancel (hc_handle);
@@ -355,7 +355,7 @@ static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
do_shutdown (cls, tc);
}
@@ -369,7 +369,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
do_abort_now (void *cls)
{
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
GNUNET_SCHEDULER_cancel (abort_task);
abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
}
@@ -394,7 +394,7 @@ registration_cont (void *cls, const char *emsg);
static void
delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- delay_task_id = GNUNET_SCHEDULER_NO_TASK;
+ delay_task_id = NULL;
switch (result)
{
case SLAVE2_PEER_CREATE_SUCCESS:
@@ -756,7 +756,7 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *_host,
"to use password less SSH logins to localhost.\n"
"Skipping test\n");
GNUNET_SCHEDULER_cancel (abort_task);
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
(void) GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
result = SKIP;
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;
/**
* Shutdown task identifier
*/
-GNUNET_SCHEDULER_TaskIdentifier shutdown_id;
+struct GNUNET_SCHEDULER_Task * shutdown_id;
/**
* 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;
/**
* The delay task identifier
*/
-GNUNET_SCHEDULER_TaskIdentifier step_task;
+struct GNUNET_SCHEDULER_Task * step_task;
/**
@@ -267,8 +267,8 @@ release_cb (void *cls);
static void
step (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != step_task);
- step_task = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_assert (NULL != step_task);
+ step_task = NULL;
switch (result)
{
case TEST_OP1_STARTED:
@@ -344,28 +344,28 @@ start_cb (void *cls)
case TEST_INIT:
GNUNET_assert (&op1 == cls);
result = TEST_OP1_STARTED;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task);
+ GNUNET_assert (NULL == step_task);
step_task =
GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL);
break;
case TEST_PAUSE:
GNUNET_assert (&op2 == cls);
result = TEST_OP2_STARTED;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task);
+ GNUNET_assert (NULL == step_task);
step_task =
GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL);
break;
case TEST_OP2_RELEASED:
GNUNET_assert (&op3 == cls);
result = TEST_OP3_STARTED;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task);
+ GNUNET_assert (NULL == step_task);
step_task =
GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL);
break;
case TEST_OP3_RELEASED:
GNUNET_assert (&op4 == cls);
result = TEST_OP4_STARTED;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task);
+ GNUNET_assert (NULL == step_task);
step_task =
GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL);
break;
@@ -422,17 +422,17 @@ release_cb (void *cls)
case TEST_OP2_STARTED:
GNUNET_assert (&op2 == cls);
result = TEST_OP2_RELEASED;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task);
+ GNUNET_assert (NULL == step_task);
break;
case TEST_OP3_STARTED:
GNUNET_assert (&op3 == cls);
result = TEST_OP3_RELEASED;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task);
+ GNUNET_assert (NULL == step_task);
break;
case TEST_OP4_STARTED:
GNUNET_assert (&op4 == cls);
result = TEST_OP4_RELEASED;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == step_task);
+ GNUNET_assert (NULL == step_task);
op5 = GNUNET_TESTBED_operation_create_ (&op5, &start_cb, &release_cb);
GNUNET_TESTBED_operation_queue_insert2_ (q1, op5, 1);
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;
/**
* Abort task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* States in this test
@@ -77,7 +77,7 @@ enum {
#define FAIL_TEST(cond, ret) do { \
if (!(cond)) { \
GNUNET_break(0); \
- if (GNUNET_SCHEDULER_NO_TASK != abort_task) \
+ if (NULL != abort_task) \
GNUNET_SCHEDULER_cancel (abort_task); \
abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \
ret; \
@@ -95,7 +95,7 @@ static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n");
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
if (NULL != op)
{
GNUNET_TESTBED_operation_done (op);
@@ -134,7 +134,7 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event)
GNUNET_TESTBED_operation_done (op);
state = STATE_PEER_RECONFIGURED;
GNUNET_SCHEDULER_cancel (abort_task);
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
GNUNET_SCHEDULER_shutdown ();
}
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;
/**
* Abort task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* States in this test
@@ -91,7 +91,7 @@ enum {
#define FAIL_TEST(cond, ret) do { \
if (!(cond)) { \
GNUNET_break(0); \
- if (GNUNET_SCHEDULER_NO_TASK != abort_task) \
+ if (NULL != abort_task) \
GNUNET_SCHEDULER_cancel (abort_task); \
abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \
ret; \
@@ -109,7 +109,7 @@ static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n");
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
if (NULL != op)
{
GNUNET_TESTBED_operation_done (op);
@@ -151,7 +151,7 @@ op_comp_cb (void *cls,
case STATE_SERVICE_DOWN:
state = STATE_SERVICE_UP;
GNUNET_SCHEDULER_cancel (abort_task);
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
state = STATE_OK;
GNUNET_SCHEDULER_shutdown ();
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;
/**
* Abort task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* Global testing result
@@ -75,7 +75,7 @@ static unsigned int num_seen_peers;
#define FAIL_TEST(cond, ret) do { \
if (!(cond)) { \
GNUNET_break(0); \
- if (GNUNET_SCHEDULER_NO_TASK != abort_task) \
+ if (NULL != abort_task) \
GNUNET_SCHEDULER_cancel (abort_task); \
abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL); \
ret; \
@@ -93,7 +93,7 @@ static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test timed out -- Aborting\n");
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
if (NULL != op)
{
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;
/**
* Abort task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* shutdown task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* Testing result
@@ -75,8 +75,8 @@ static int result;
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ shutdown_task = NULL;
+ if (NULL != abort_task)
GNUNET_SCHEDULER_cancel (abort_task);
if (NULL != op)
GNUNET_TESTBED_operation_done (op);
@@ -89,10 +89,10 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
#define FAIL_TEST(cond) do { \
if (!(cond)) { \
GNUNET_break(0); \
- if (GNUNET_SCHEDULER_NO_TASK != abort_task) \
+ if (NULL != abort_task) \
GNUNET_SCHEDULER_cancel (abort_task); \
- abort_task = GNUNET_SCHEDULER_NO_TASK; \
- if (GNUNET_SCHEDULER_NO_TASK == shutdown_task) \
+ abort_task = NULL; \
+ if (NULL == shutdown_task) \
shutdown_task = GNUNET_SCHEDULER_add_now (do_shutdown, NULL); \
return; \
} \
@@ -109,8 +109,8 @@ static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
LOG (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
- abort_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ abort_task = NULL;
+ if (NULL != shutdown_task)
GNUNET_SCHEDULER_cancel (shutdown_task);
do_shutdown (cls, tc);
}
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;
/**
* Abort task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
/**
* Current peer id
@@ -73,7 +73,7 @@ static int wait_forever;
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
GNUNET_SCHEDULER_cancel (abort_task);
GNUNET_SCHEDULER_shutdown (); /* Stop scheduler to shutdown testbed run */
}
@@ -89,7 +89,7 @@ static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Test timedout -- Aborting\n");
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
(void) GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
}
@@ -117,10 +117,10 @@ test_master (void *cls,
result = GNUNET_OK;
if (GNUNET_YES == wait_forever)
{
- if (GNUNET_SCHEDULER_NO_TASK == abort_task)
+ if (NULL == abort_task)
return; /* abort already scheduled */
GNUNET_SCHEDULER_cancel (abort_task);
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
(void) GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
&do_shutdown, NULL);
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;
/**
* Shutdown task
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* Testing result
@@ -68,7 +68,7 @@ static unsigned int overlay_connects;
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task = NULL;
if (NULL != op)
{
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;
/**
* Shutdown task
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
/**
* Testing result
@@ -68,7 +68,7 @@ static unsigned int overlay_connects;
static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task = NULL;
if (NULL != op)
{
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;
/**
* Abort task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
-static GNUNET_SCHEDULER_TaskIdentifier write_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
+static struct GNUNET_SCHEDULER_Task * write_task;
static int result;
#define CANCEL_TASK(task) do { \
- if (GNUNET_SCHEDULER_NO_TASK != task) \
+ if (NULL != task) \
{ \
GNUNET_SCHEDULER_cancel (task); \
- task = GNUNET_SCHEDULER_NO_TASK; \
+ task = NULL; \
} \
} while (0)
@@ -100,7 +100,7 @@ static void
do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
LOG (GNUNET_ERROR_TYPE_WARNING, "Aborting\n");
- abort_task = GNUNET_SCHEDULER_NO_TASK;
+ abort_task = NULL;
shutdown_now ();
}
@@ -178,7 +178,7 @@ do_write (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static int i;
char buf[BSIZE];
- write_task = GNUNET_SCHEDULER_NO_TASK;
+ write_task = NULL;
if (0 == i)
write_task = GNUNET_SCHEDULER_add_delayed (TIME_REL_SECS(1), &do_write, NULL);
(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
/**
* Task id for the habitability check task
*/
- GNUNET_SCHEDULER_TaskIdentifier habitability_check_task;
+ struct GNUNET_SCHEDULER_Task * habitability_check_task;
/**
* 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)
enum GNUNET_OS_ProcessStatusType type;
int ret;
- h->habitability_check_task = GNUNET_SCHEDULER_NO_TASK;
+ h->habitability_check_task = NULL;
ret = GNUNET_OS_process_status (h->auxp, &type, &code);
if (GNUNET_SYSERR == ret)
{
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;
/**
* The id of the task to process the ready queue
*/
-GNUNET_SCHEDULER_TaskIdentifier process_rq_task_id;
+struct GNUNET_SCHEDULER_Task * process_rq_task_id;
/**
@@ -534,10 +534,10 @@ rq_remove (struct GNUNET_TESTBED_Operation *op)
GNUNET_CONTAINER_DLL_remove (rq_head, rq_tail, op->rq_entry);
GNUNET_free (op->rq_entry);
op->rq_entry = NULL;
- if ( (NULL == rq_head) && (GNUNET_SCHEDULER_NO_TASK != process_rq_task_id) )
+ if ( (NULL == rq_head) && (NULL != process_rq_task_id) )
{
GNUNET_SCHEDULER_cancel (process_rq_task_id);
- process_rq_task_id = GNUNET_SCHEDULER_NO_TASK;
+ process_rq_task_id = NULL;
}
}
@@ -558,7 +558,7 @@ process_rq_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct OperationQueue *queue;
unsigned int cnt;
- process_rq_task_id = GNUNET_SCHEDULER_NO_TASK;
+ process_rq_task_id = NULL;
GNUNET_assert (NULL != rq_head);
GNUNET_assert (NULL != (op = rq_head->op));
rq_remove (op);
@@ -592,7 +592,7 @@ rq_add (struct GNUNET_TESTBED_Operation *op)
rq_entry->op = op;
GNUNET_CONTAINER_DLL_insert_tail (rq_head, rq_tail, rq_entry);
op->rq_entry = rq_entry;
- if (GNUNET_SCHEDULER_NO_TASK == process_rq_task_id)
+ if (NULL == process_rq_task_id)
process_rq_task_id = GNUNET_SCHEDULER_add_now (&process_rq_task, NULL);
}
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
/**
* The task for calling the continuation callback
*/
- GNUNET_SCHEDULER_TaskIdentifier call_completion_task_id;
+ struct GNUNET_SCHEDULER_Task * call_completion_task_id;
/**
* The number of peers present in the peers array. This number also
@@ -128,7 +128,7 @@ struct PeerGetStatsContext
/**
* Task to mark the statistics service connect operation as done
*/
- GNUNET_SCHEDULER_TaskIdentifier op_done_task_id;
+ struct GNUNET_SCHEDULER_Task * op_done_task_id;
/**
* 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)
{
struct GetStatsContext *sc = cls;
- GNUNET_assert (sc->call_completion_task_id != GNUNET_SCHEDULER_NO_TASK);
- sc->call_completion_task_id = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_assert (sc->call_completion_task_id != NULL);
+ sc->call_completion_task_id = NULL;
LOG_DEBUG ("Calling get_statistics() continuation callback\n");
sc->cont (sc->cb_cls, sc->main_op, NULL);
}
@@ -179,7 +179,7 @@ op_done_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_TESTBED_Operation **op;
sc = peer_sc->sc;
- peer_sc->op_done_task_id = GNUNET_SCHEDULER_NO_TASK;
+ peer_sc->op_done_task_id = NULL;
op = &sc->ops[peer_sc->peer_index];
GNUNET_assert (NULL != *op);
GNUNET_TESTBED_operation_done (*op);
@@ -312,7 +312,7 @@ statistics_da (void *cls, void *op_result)
peer_sc->get_handle = NULL;
}
GNUNET_STATISTICS_destroy (sh, GNUNET_NO);
- if (GNUNET_SCHEDULER_NO_TASK != peer_sc->op_done_task_id)
+ if (NULL != peer_sc->op_done_task_id)
GNUNET_SCHEDULER_cancel (peer_sc->op_done_task_id);
GNUNET_free (peer_sc);
}
@@ -366,7 +366,7 @@ oprelease_get_stats (void *cls)
unsigned int peer;
LOG_DEBUG ("Cleaning up get_statistics operation\n");
- if (GNUNET_SCHEDULER_NO_TASK != sc->call_completion_task_id)
+ if (NULL != sc->call_completion_task_id)
GNUNET_SCHEDULER_cancel (sc->call_completion_task_id);
if (NULL != sc->ops)
{
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
/**
* Host registration task
*/
- GNUNET_SCHEDULER_TaskIdentifier register_hosts_task;
+ struct GNUNET_SCHEDULER_Task * register_hosts_task;
/**
* Task to be run of a timeout
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Task run upon shutdown interrupts
*/
- GNUNET_SCHEDULER_TaskIdentifier interrupt_task;
+ struct GNUNET_SCHEDULER_Task * interrupt_task;
/**
* The event mask for the controller
@@ -455,7 +455,7 @@ cleanup (struct GNUNET_TESTBED_RunHandle *rc)
{
unsigned int hid;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rc->register_hosts_task);
+ GNUNET_assert (NULL == rc->register_hosts_task);
GNUNET_assert (NULL == rc->reg_handle);
GNUNET_assert (NULL == rc->peers);
GNUNET_assert (NULL == rc->hclist);
@@ -524,15 +524,15 @@ rc_cleanup_operations (struct GNUNET_TESTBED_RunHandle *rc)
rc->hclist = NULL;
}
/* Stop register hosts task if it is running */
- if (GNUNET_SCHEDULER_NO_TASK != rc->register_hosts_task)
+ if (NULL != rc->register_hosts_task)
{
GNUNET_SCHEDULER_cancel (rc->register_hosts_task);
- rc->register_hosts_task = GNUNET_SCHEDULER_NO_TASK;
+ rc->register_hosts_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != rc->timeout_task)
+ if (NULL != rc->timeout_task)
{
GNUNET_SCHEDULER_cancel (rc->timeout_task);
- rc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ rc->timeout_task = NULL;
}
if (NULL != rc->reg_handle)
{
@@ -561,7 +561,7 @@ static void
cancel_interrupt_task (struct GNUNET_TESTBED_RunHandle *rc)
{
GNUNET_SCHEDULER_cancel (rc->interrupt_task);
- rc->interrupt_task = GNUNET_SCHEDULER_NO_TASK;
+ rc->interrupt_task = NULL;
}
@@ -730,7 +730,7 @@ static void
call_master (struct GNUNET_TESTBED_RunHandle *rc)
{
GNUNET_SCHEDULER_cancel (rc->timeout_task);
- rc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ rc->timeout_task = NULL;
if (NULL != rc->test_master)
rc->test_master (rc->test_master_cls, rc, rc->num_peers, rc->peers,
rc->links_succeeded, rc->links_failed);
@@ -1006,7 +1006,7 @@ register_hosts (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct RunContextOperation *rcop;
unsigned int slave;
- rc->register_hosts_task = GNUNET_SCHEDULER_NO_TASK;
+ rc->register_hosts_task = NULL;
if (rc->reg_hosts == rc->num_hosts)
{
DEBUG ("All hosts successfully registered\n");
@@ -1199,7 +1199,7 @@ timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_TESTBED_RunHandle *rc = cls;
- rc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ rc->timeout_task = NULL;
LOG (GNUNET_ERROR_TYPE_ERROR, _("Shutting down testbed due to timeout while setup.\n"));
GNUNET_SCHEDULER_shutdown ();
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
/**
* Task to call the flush completion callback
*/
- GNUNET_SCHEDULER_TaskIdentifier flush_completion_task;
+ struct GNUNET_SCHEDULER_Task * flush_completion_task;
/**
* Task to be executed when flushing takes too long
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_flush_task;
+ struct GNUNET_SCHEDULER_Task * timeout_flush_task;
};
@@ -162,7 +162,7 @@ static void
cancel_timeout_flush (struct GNUNET_TESTBED_LOGGER_Handle *h)
{
GNUNET_SCHEDULER_cancel (h->timeout_flush_task);
- h->timeout_flush_task = GNUNET_SCHEDULER_NO_TASK;
+ h->timeout_flush_task = NULL;
}
@@ -180,14 +180,14 @@ call_flush_completion (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
void *cb_cls;
size_t bw;
- h->flush_completion_task = GNUNET_SCHEDULER_NO_TASK;
+ h->flush_completion_task = NULL;
bw = h->bwrote;
h->bwrote = 0;
cb = h->cb;
h->cb = NULL;
cb_cls = h->cb_cls;
h->cb_cls = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != h->timeout_flush_task)
+ if (NULL != h->timeout_flush_task)
cancel_timeout_flush (h);
if (NULL != cb)
cb (cb_cls, bw);
@@ -202,7 +202,7 @@ call_flush_completion (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
trigger_flush_notification (struct GNUNET_TESTBED_LOGGER_Handle *h)
{
- if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task)
+ if (NULL != h->flush_completion_task)
GNUNET_SCHEDULER_cancel (h->flush_completion_task);
h->flush_completion_task = GNUNET_SCHEDULER_add_now (&call_flush_completion, h);
}
@@ -354,7 +354,7 @@ GNUNET_TESTBED_LOGGER_disconnect (struct GNUNET_TESTBED_LOGGER_Handle *h)
struct MessageQueue *mq;
unsigned int lost;
- if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task)
+ if (NULL != h->flush_completion_task)
GNUNET_SCHEDULER_cancel (h->flush_completion_task);
lost = 0;
while (NULL != (mq = h->mq_head))
@@ -425,15 +425,15 @@ timeout_flush (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_TESTBED_LOGGER_FlushCompletion cb;
void *cb_cls;
- h->timeout_flush_task = GNUNET_SCHEDULER_NO_TASK;
+ h->timeout_flush_task = NULL;
cb = h->cb;
h->cb = NULL;
cb_cls = h->cb_cls;
h->cb_cls = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task)
+ if (NULL != h->flush_completion_task)
{
GNUNET_SCHEDULER_cancel (h->flush_completion_task);
- h->flush_completion_task = GNUNET_SCHEDULER_NO_TASK;
+ h->flush_completion_task = NULL;
}
if (NULL != cb)
cb (cb_cls, 0);
@@ -456,7 +456,7 @@ GNUNET_TESTBED_LOGGER_flush (struct GNUNET_TESTBED_LOGGER_Handle *h,
{
h->cb = cb;
h->cb_cls = cb_cls;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->timeout_flush_task);
+ GNUNET_assert (NULL == h->timeout_flush_task);
h->timeout_flush_task =
GNUNET_SCHEDULER_add_delayed (timeout, &timeout_flush, h);
if (NULL == h->buf)
@@ -478,12 +478,12 @@ GNUNET_TESTBED_LOGGER_flush (struct GNUNET_TESTBED_LOGGER_Handle *h,
void
GNUNET_TESTBED_LOGGER_flush_cancel (struct GNUNET_TESTBED_LOGGER_Handle *h)
{
- if (GNUNET_SCHEDULER_NO_TASK != h->flush_completion_task)
+ if (NULL != h->flush_completion_task)
{
GNUNET_SCHEDULER_cancel (h->flush_completion_task);
- h->flush_completion_task = GNUNET_SCHEDULER_NO_TASK;
+ h->flush_completion_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != h->timeout_flush_task)
+ if (NULL != h->timeout_flush_task)
cancel_timeout_flush (h);
h->cb = NULL;
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;
/**
* Task identifier of the task that waits for stdin.
*/
-static GNUNET_SCHEDULER_TaskIdentifier tid;
+static struct GNUNET_SCHEDULER_Task * tid;
/**
* Peer started for '-r'.
@@ -207,10 +207,10 @@ cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (0 != UNLINK (tmpfilename))
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, "unlink", tmpfilename);
}
- if (GNUNET_SCHEDULER_NO_TASK != tid)
+ if (NULL != tid)
{
GNUNET_SCHEDULER_cancel (tid);
- tid = GNUNET_SCHEDULER_NO_TASK;
+ tid = NULL;
}
if (NULL != fh)
{
@@ -231,7 +231,7 @@ stdin_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
int c;
- tid = GNUNET_SCHEDULER_NO_TASK;
+ tid = NULL;
if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
return;
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
* ID of task we use to wait for the time to send the next HELLO
* to this peer.
*/
- GNUNET_SCHEDULER_TaskIdentifier hello_delay_task;
+ struct GNUNET_SCHEDULER_Task * hello_delay_task;
/**
* Task for issuing GNUNET_TRANSPORT_try_connect for this peer.
*/
- GNUNET_SCHEDULER_TaskIdentifier attempt_connect_task;
+ struct GNUNET_SCHEDULER_Task * attempt_connect_task;
/**
* ID of task we use to clear peers from the greylist.
*/
- GNUNET_SCHEDULER_TaskIdentifier greylist_clean_task;
+ struct GNUNET_SCHEDULER_Task * greylist_clean_task;
/**
* How often have we tried so far?
@@ -216,7 +216,7 @@ static struct GNUNET_TIME_Absolute next_connect_attempt;
/**
* Task scheduled to try to add peers.
*/
-static GNUNET_SCHEDULER_TaskIdentifier add_task;
+static struct GNUNET_SCHEDULER_Task * add_task;
/**
* Flag to disallow non-friend connections (pure F2F mode).
@@ -331,11 +331,11 @@ free_peer (void *cls, const struct GNUNET_PeerIdentity * pid, void *value)
GNUNET_CONTAINER_multipeermap_remove (peers, pid, pos));
if (pos->hello_req != NULL)
GNUNET_CORE_notify_transmit_ready_cancel (pos->hello_req);
- if (pos->hello_delay_task != GNUNET_SCHEDULER_NO_TASK)
+ if (pos->hello_delay_task != NULL)
GNUNET_SCHEDULER_cancel (pos->hello_delay_task);
- if (pos->attempt_connect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (pos->attempt_connect_task != NULL)
GNUNET_SCHEDULER_cancel (pos->attempt_connect_task);
- if (pos->greylist_clean_task != GNUNET_SCHEDULER_NO_TASK)
+ if (pos->greylist_clean_task != NULL)
GNUNET_SCHEDULER_cancel (pos->greylist_clean_task);
GNUNET_free_non_null (pos->hello);
if (pos->filter != NULL)
@@ -395,7 +395,7 @@ attempt_connect (struct Peer *pos)
pos->next_connect_attempt = GNUNET_TIME_absolute_min (pos->next_connect_attempt,
GNUNET_TIME_absolute_add (GNUNET_TIME_absolute_get(), MIN_CONNECT_FREQUENCY_DELAY));
- if (pos->greylist_clean_task != GNUNET_SCHEDULER_NO_TASK)
+ if (pos->greylist_clean_task != NULL)
GNUNET_SCHEDULER_cancel (pos->greylist_clean_task);
pos->greylist_clean_task =
GNUNET_SCHEDULER_add_delayed (rem, &remove_from_greylist, pos);
@@ -422,7 +422,7 @@ do_attempt_connect (void *cls,
struct Peer *pos = cls;
struct GNUNET_TIME_Relative delay;
- pos->attempt_connect_task = GNUNET_SCHEDULER_NO_TASK;
+ pos->attempt_connect_task = NULL;
if (GNUNET_YES == pos->is_connected)
return;
@@ -454,7 +454,7 @@ do_attempt_connect (void *cls,
static void
schedule_attempt_connect (struct Peer *pos)
{
- if (GNUNET_SCHEDULER_NO_TASK != pos->attempt_connect_task)
+ if (NULL != pos->attempt_connect_task)
return;
pos->attempt_connect_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining (next_connect_attempt),
&do_attempt_connect,
@@ -475,7 +475,7 @@ remove_from_greylist (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct Peer *pos = cls;
struct GNUNET_TIME_Relative rem;
- pos->greylist_clean_task = GNUNET_SCHEDULER_NO_TASK;
+ pos->greylist_clean_task = NULL;
rem = GNUNET_TIME_absolute_get_remaining (pos->greylisted_until);
if (0 == rem.rel_value_us)
{
@@ -646,7 +646,7 @@ schedule_next_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
size_t next_want;
struct GNUNET_TIME_Relative delay;
- pl->hello_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ pl->hello_delay_task = NULL;
GNUNET_assert (GNUNET_YES == pl->is_connected);
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return; /* we're out of here */
@@ -702,10 +702,10 @@ reschedule_hellos (void *cls, const struct GNUNET_PeerIdentity * pid, void *valu
GNUNET_CORE_notify_transmit_ready_cancel (peer->hello_req);
peer->hello_req = NULL;
}
- if (peer->hello_delay_task != GNUNET_SCHEDULER_NO_TASK)
+ if (peer->hello_delay_task != NULL)
{
GNUNET_SCHEDULER_cancel (peer->hello_delay_task);
- peer->hello_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ peer->hello_delay_task = NULL;
}
peer->hello_delay_task =
GNUNET_SCHEDULER_add_now (&schedule_next_hello, peer);
@@ -787,7 +787,7 @@ try_add_peers (void *cls, const struct GNUNET_PeerIdentity * pid, void *value)
static void
add_peer_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- add_task = GNUNET_SCHEDULER_NO_TASK;
+ add_task = NULL;
GNUNET_CONTAINER_multipeermap_iterate (peers, &try_add_peers, NULL);
}
@@ -827,10 +827,10 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
GNUNET_CORE_notify_transmit_ready_cancel (pos->hello_req);
pos->hello_req = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pos->hello_delay_task)
+ if (NULL != pos->hello_delay_task)
{
GNUNET_SCHEDULER_cancel (pos->hello_delay_task);
- pos->hello_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ pos->hello_delay_task = NULL;
}
GNUNET_STATISTICS_set (stats, gettext_noop ("# peers connected"),
connection_count, GNUNET_NO);
@@ -842,7 +842,7 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
}
if (((connection_count < target_connection_count) ||
(friend_count < minimum_friend_count)) &&
- (GNUNET_SCHEDULER_NO_TASK == add_task))
+ (NULL == add_task))
add_task = GNUNET_SCHEDULER_add_now (&add_peer_task, NULL);
if ((friend_count < minimum_friend_count) && (blacklist == NULL))
blacklist = GNUNET_TRANSPORT_blacklist (cfg, &blacklist_check, NULL);
@@ -1179,7 +1179,7 @@ hello_advertising_ready (void *cls, size_t size, void *buf)
GNUNET_NO);
}
- if (pl->hello_delay_task != GNUNET_SCHEDULER_NO_TASK)
+ if (pl->hello_delay_task != NULL)
GNUNET_SCHEDULER_cancel (pl->hello_delay_task);
pl->next_hello_allowed =
GNUNET_TIME_relative_to_absolute (HELLO_ADVERTISEMENT_MIN_FREQUENCY);
@@ -1211,10 +1211,10 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
handle = NULL;
}
whitelist_peers ();
- if (GNUNET_SCHEDULER_NO_TASK != add_task)
+ if (NULL != add_task)
{
GNUNET_SCHEDULER_cancel (add_task);
- add_task = GNUNET_SCHEDULER_NO_TASK;
+ add_task = NULL;
}
GNUNET_CONTAINER_multipeermap_iterate (peers, &free_peer, NULL);
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
/**
* The kill task.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
};
struct BlacklistCheckContext
@@ -246,7 +246,7 @@ kill_session_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct SessionKiller *sk = cls;
- sk->task = GNUNET_SCHEDULER_NO_TASK;
+ sk->task = NULL;
GNUNET_CONTAINER_DLL_remove(sk_head, sk_tail, sk);
sk->plugin->disconnect_session (sk->plugin->cls, sk->session);
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
/**
* Current task performing the check.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
};
@@ -230,7 +230,7 @@ client_disconnect_notification (void *cls, struct GNUNET_SERVER_Client *client)
GNUNET_SERVER_notify_transmit_ready_cancel (bc->th);
bc->th = NULL;
}
- if (bc->task == GNUNET_SCHEDULER_NO_TASK)
+ if (bc->task == NULL)
bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, bc);
}
GNUNET_CONTAINER_DLL_remove (bl_head, bl_tail, bl);
@@ -392,7 +392,7 @@ transmit_blacklist_message (void *cls, size_t size, void *buf)
bc->th = NULL;
if (size == 0)
{
- GNUNET_assert (bc->task == GNUNET_SCHEDULER_NO_TASK);
+ GNUNET_assert (bc->task == NULL);
bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, bc);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Failed to send blacklist test for peer `%s' to client\n",
@@ -432,7 +432,7 @@ do_blacklist_check (void *cls,
struct GST_BlacklistCheck *bc = cls;
struct Blacklisters *bl;
- bc->task = GNUNET_SCHEDULER_NO_TASK;
+ bc->task = NULL;
bl = bc->bl_pos;
if (bl == NULL)
{
@@ -642,7 +642,7 @@ GST_blacklist_handle_reply (void *cls, struct GNUNET_SERVER_Client *client,
}
/* check if any other blacklist checks are waiting for this blacklister */
for (bc = bc_head; bc != NULL; bc = bc->next)
- if ((bc->bl_pos == bl) && (GNUNET_SCHEDULER_NO_TASK == bc->task))
+ if ((bc->bl_pos == bl) && (NULL == bc->task))
{
bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, bc);
break;
@@ -817,10 +817,10 @@ GST_blacklist_test_cancel (struct GST_BlacklistCheck *bc)
bc->bl_pos->bc = NULL;
}
}
- if (GNUNET_SCHEDULER_NO_TASK != bc->task)
+ if (NULL != bc->task)
{
GNUNET_SCHEDULER_cancel (bc->task);
- bc->task = GNUNET_SCHEDULER_NO_TASK;
+ bc->task = NULL;
}
if (NULL != bc->th)
{
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;
/**
* Identifier of 'refresh_hello' task.
*/
-static GNUNET_SCHEDULER_TaskIdentifier hello_task;
+static struct GNUNET_SCHEDULER_Task * hello_task;
/**
@@ -164,7 +164,7 @@ refresh_hello_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GeneratorContext gc;
int friend_only;
- hello_task = GNUNET_SCHEDULER_NO_TASK;
+ hello_task = NULL;
gc.addr_pos = oal_head;
gc.expiration = GNUNET_TIME_relative_to_absolute (hello_expiration);
@@ -198,7 +198,7 @@ refresh_hello_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
refresh_hello ()
{
- if (hello_task != GNUNET_SCHEDULER_NO_TASK)
+ if (hello_task != NULL)
GNUNET_SCHEDULER_cancel (hello_task);
hello_task = GNUNET_SCHEDULER_add_now (&refresh_hello_task, NULL);
}
@@ -231,10 +231,10 @@ GST_hello_stop ()
{
hello_cb = NULL;
hello_cb_cls = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != hello_task)
+ if (NULL != hello_task)
{
GNUNET_SCHEDULER_cancel (hello_task);
- hello_task = GNUNET_SCHEDULER_NO_TASK;
+ hello_task = NULL;
}
if (NULL != our_hello)
{
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
/**
* Task to schedule delayed sendding
*/
- GNUNET_SCHEDULER_TaskIdentifier send_delay_task;
+ struct GNUNET_SCHEDULER_Task * send_delay_task;
/**
* Send queue DLL head
@@ -191,7 +191,7 @@ struct DelayQueueEntry *generic_dqe_tail;
/**
* Task to schedule delayed sending based on general delay
*/
-GNUNET_SCHEDULER_TaskIdentifier generic_send_delay_task;
+struct GNUNET_SCHEDULER_Task * generic_send_delay_task;
static void
set_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)
if (NULL != tmp)
{
GNUNET_break(GNUNET_YES == GST_neighbours_test_connected (&dqe->id));
- tmp->send_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ tmp->send_delay_task = NULL;
GNUNET_CONTAINER_DLL_remove(tmp->send_head, tmp->send_tail, dqe);
GST_neighbours_send(&dqe->id, dqe->msg, dqe->msg_size, dqe->timeout,
dqe->cont, dqe->cont_cls);
@@ -376,7 +376,7 @@ send_delayed(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
/* Remove from generic queue */
GNUNET_break(GNUNET_YES == GST_neighbours_test_connected (&dqe->id));
- generic_send_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ generic_send_delay_task = NULL;
GNUNET_CONTAINER_DLL_remove(generic_dqe_head, generic_dqe_tail, dqe);
GST_neighbours_send(&dqe->id, dqe->msg, dqe->msg_size, dqe->timeout,
dqe->cont, dqe->cont_cls);
@@ -434,7 +434,7 @@ GST_manipulation_send(const struct GNUNET_PeerIdentity *target, const void *msg,
dqe->timeout = timeout;
memcpy(dqe->msg, msg, msg_size);
GNUNET_CONTAINER_DLL_insert_tail(tmp->send_head, tmp->send_tail, dqe);
- if (GNUNET_SCHEDULER_NO_TASK == tmp->send_delay_task)
+ if (NULL == tmp->send_delay_task)
tmp->send_delay_task = GNUNET_SCHEDULER_add_delayed(delay,
&send_delayed, dqe);
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
@@ -462,7 +462,7 @@ GST_manipulation_send(const struct GNUNET_PeerIdentity *target, const void *msg,
dqe->timeout = timeout;
memcpy(dqe->msg, msg, msg_size);
GNUNET_CONTAINER_DLL_insert_tail(generic_dqe_head, generic_dqe_tail, dqe);
- if (GNUNET_SCHEDULER_NO_TASK == generic_send_delay_task)
+ if (NULL == generic_send_delay_task)
{
generic_send_delay_task = GNUNET_SCHEDULER_add_delayed(delay,
&send_delayed, dqe);
@@ -642,10 +642,10 @@ free_tmps(void *cls, const struct GNUNET_PeerIdentity *key, void *value)
dqe->cont(dqe->cont_cls, GNUNET_SYSERR, dqe->msg_size, 0);
GNUNET_free(dqe);
}
- if (GNUNET_SCHEDULER_NO_TASK != tmp->send_delay_task)
+ if (NULL != tmp->send_delay_task)
{
GNUNET_SCHEDULER_cancel(tmp->send_delay_task);
- tmp->send_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ tmp->send_delay_task = NULL;
}
GNUNET_free(tmp);
}
@@ -693,10 +693,10 @@ GST_manipulation_peer_disconnect(const struct GNUNET_PeerIdentity *peer)
GNUNET_free(dqe);
}
}
- if (GNUNET_SCHEDULER_NO_TASK != generic_send_delay_task)
+ if (NULL != generic_send_delay_task)
{
GNUNET_SCHEDULER_cancel(generic_send_delay_task);
- generic_send_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ generic_send_delay_task = NULL;
if (NULL != generic_dqe_head)
generic_send_delay_task = GNUNET_SCHEDULER_add_delayed(
GNUNET_TIME_absolute_get_remaining(generic_dqe_head->sent_at),
@@ -725,10 +725,10 @@ GST_manipulation_stop()
cur->cont(cur->cont_cls, GNUNET_SYSERR, cur->msg_size, 0);
GNUNET_free(cur);
}
- if (GNUNET_SCHEDULER_NO_TASK != generic_send_delay_task)
+ if (NULL != generic_send_delay_task)
{
GNUNET_SCHEDULER_cancel(generic_send_delay_task);
- generic_send_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ generic_send_delay_task = NULL;
}
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
* Main task that drives this peer (timeouts, keepalives, etc.).
* Always runs the 'master_task'.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
/**
* Task to disconnect neighbour after we received a DISCONNECT message
*/
- GNUNET_SCHEDULER_TaskIdentifier delayed_disconnect_task;
+ struct GNUNET_SCHEDULER_Task * delayed_disconnect_task;
/**
* At what time should we sent the next keep-alive message?
@@ -539,7 +539,7 @@ static unsigned long long bytes_in_send_queue;
/**
* Task transmitting utilization data
*/
-static GNUNET_SCHEDULER_TaskIdentifier util_transmission_tk;
+static struct GNUNET_SCHEDULER_Task * util_transmission_tk;
static struct GNUNET_CONTAINER_MultiPeerMap *registered_quota_notifications;
@@ -956,17 +956,17 @@ free_neighbour (struct NeighbourMapEntry *n,
}
/* Cancel the disconnect task */
- if (GNUNET_SCHEDULER_NO_TASK != n->delayed_disconnect_task)
+ if (NULL != n->delayed_disconnect_task)
{
GNUNET_SCHEDULER_cancel (n->delayed_disconnect_task);
- n->delayed_disconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ n->delayed_disconnect_task = NULL;
}
/* Cancel the master task */
- if (GNUNET_SCHEDULER_NO_TASK != n->task)
+ if (NULL != n->task)
{
GNUNET_SCHEDULER_cancel (n->task);
- n->task = GNUNET_SCHEDULER_NO_TASK;
+ n->task = NULL;
}
/* free rest of memory */
GNUNET_free (n);
@@ -1054,7 +1054,7 @@ send_disconnect_cont (void *cls, const struct GNUNET_PeerIdentity *target,
return; /* already gone */
if (GNUNET_TRANSPORT_PS_DISCONNECT != n->state)
return; /* have created a fresh entry since */
- if (GNUNET_SCHEDULER_NO_TASK != n->task)
+ if (NULL != n->task)
GNUNET_SCHEDULER_cancel (n->task);
n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
}
@@ -1168,7 +1168,7 @@ disconnect_neighbour (struct NeighbourMapEntry *n)
break;
}
/* schedule timeout to clean up */
- if (GNUNET_SCHEDULER_NO_TASK != n->task)
+ if (NULL != n->task)
GNUNET_SCHEDULER_cancel (n->task);
n->task = GNUNET_SCHEDULER_add_delayed (DISCONNECT_SENT_TIMEOUT,
&master_task, n);
@@ -1202,7 +1202,7 @@ transmit_send_continuation (void *cls,
/* this is still "our" neighbour, remove us from its queue
and allow it to send the next message now */
n->is_active = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != n->task)
+ if (NULL != n->task)
GNUNET_SCHEDULER_cancel (n->task);
n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
}
@@ -1650,7 +1650,7 @@ GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg,
msg_size, GNUNET_i2s (target));
GNUNET_CONTAINER_DLL_insert_tail (n->messages_head, n->messages_tail, mq);
- if (GNUNET_SCHEDULER_NO_TASK != n->task)
+ if (NULL != n->task)
GNUNET_SCHEDULER_cancel (n->task);
n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
}
@@ -2862,7 +2862,7 @@ static void
utilization_transmission (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- util_transmission_tk = GNUNET_SCHEDULER_NO_TASK;
+ util_transmission_tk = NULL;
if (0 < GNUNET_CONTAINER_multipeermap_size (neighbours))
GNUNET_CONTAINER_multipeermap_iterate (neighbours, send_utilization_data, NULL);
@@ -2945,7 +2945,7 @@ master_task (void *cls,
struct NeighbourMapEntry *n = cls;
struct GNUNET_TIME_Relative delay;
- n->task = GNUNET_SCHEDULER_NO_TASK;
+ n->task = NULL;
delay = GNUNET_TIME_absolute_get_remaining (n->timeout);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Master task runs for neighbour `%s' in state %s with timeout in %s\n",
@@ -3081,7 +3081,7 @@ master_task (void *cls,
delay = GNUNET_TIME_relative_min (GNUNET_TIME_absolute_get_remaining (n->keep_alive_time),
delay);
}
- if (GNUNET_SCHEDULER_NO_TASK == n->task)
+ if (NULL == n->task)
n->task = GNUNET_SCHEDULER_add_delayed (delay,
&master_task,
n);
@@ -3405,7 +3405,7 @@ GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer,
GNUNET_break (0);
break;
}
- if (GNUNET_SCHEDULER_NO_TASK != n->task)
+ if (NULL != n->task)
GNUNET_SCHEDULER_cancel (n->task);
n->task = GNUNET_SCHEDULER_add_now (&master_task, n);
return GNUNET_YES;
@@ -3577,7 +3577,7 @@ void delayed_disconnect (void *cls,
{
struct NeighbourMapEntry *n = cls;
- n->delayed_disconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ n->delayed_disconnect_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Disconnecting by request from peer %s\n",
GNUNET_i2s (&n->id));
@@ -3884,10 +3884,10 @@ GST_neighbours_stop ()
if (NULL == neighbours)
return;
- if (GNUNET_SCHEDULER_NO_TASK != util_transmission_tk)
+ if (NULL != util_transmission_tk)
{
GNUNET_SCHEDULER_cancel (util_transmission_tk);
- util_transmission_tk = GNUNET_SCHEDULER_NO_TASK;
+ util_transmission_tk = NULL;
}
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
/**
* ID of task that will clean up this entry if nothing happens.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* ID of task that will trigger address revalidation.
*/
- GNUNET_SCHEDULER_TaskIdentifier revalidation_task;
+ struct GNUNET_SCHEDULER_Task * revalidation_task;
/**
* At what time did we send the latest validation request (PING)?
@@ -441,15 +441,15 @@ cleanup_validation_entry (void *cls,
GNUNET_CONTAINER_multipeermap_remove (validation_map,
&ve->pid, ve));
GNUNET_HELLO_address_free (ve->address);
- if (GNUNET_SCHEDULER_NO_TASK != ve->timeout_task)
+ if (NULL != ve->timeout_task)
{
GNUNET_SCHEDULER_cancel (ve->timeout_task);
- ve->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ve->timeout_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != ve->revalidation_task)
+ if (NULL != ve->revalidation_task)
{
GNUNET_SCHEDULER_cancel (ve->revalidation_task);
- ve->revalidation_task = GNUNET_SCHEDULER_NO_TASK;
+ ve->revalidation_task = NULL;
}
if ((GNUNET_YES == ve->expecting_pong) &&
(validations_running > 0))
@@ -479,7 +479,7 @@ timeout_hello_validation (void *cls,
struct GNUNET_TIME_Absolute max;
struct GNUNET_TIME_Relative left;
- ve->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ ve->timeout_task = NULL;
max = GNUNET_TIME_absolute_max (ve->valid_until, ve->revalidation_block);
left = GNUNET_TIME_absolute_get_remaining (max);
if (left.rel_value_us > 0)
@@ -653,7 +653,7 @@ revalidate_address (void *cls,
struct GST_BlacklistCheck *bc;
uint32_t rdelay;
- ve->revalidation_task = GNUNET_SCHEDULER_NO_TASK;
+ ve->revalidation_task = NULL;
delay = GNUNET_TIME_absolute_get_remaining (ve->revalidation_block);
/* How long until we can possibly permit the next PING? */
if (GNUNET_YES == ve->in_use)
@@ -816,7 +816,7 @@ add_valid_address (void *cls,
ve = find_validation_entry (&public_key, address);
ve->valid_until = GNUNET_TIME_absolute_max (ve->valid_until, expiration);
- if (GNUNET_SCHEDULER_NO_TASK == ve->revalidation_task)
+ if (NULL == ve->revalidation_task)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Starting revalidations for valid address `%s'\n",
@@ -1270,7 +1270,7 @@ validate_address_iterator (void *cls,
if (papi == NULL)
{
/* This plugin is currently unvailable ... retry later */
- if (GNUNET_SCHEDULER_NO_TASK == ve->revalidation_task)
+ if (NULL == ve->revalidation_task)
{
if (GNUNET_YES == ve->in_use)
canonical_delay = CONNECTED_PING_FREQUENCY;
@@ -1292,7 +1292,7 @@ validate_address_iterator (void *cls,
}
- if (GNUNET_SCHEDULER_NO_TASK == ve->revalidation_task)
+ if (NULL == ve->revalidation_task)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"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;
/**
* Task scheduled for cleanup / termination of the process.
*/
-static GNUNET_SCHEDULER_TaskIdentifier end;
+static struct GNUNET_SCHEDULER_Task * end;
/**
* Selected level of verbosity.
@@ -370,7 +370,7 @@ iteration_done ()
if (it_count == benchmark_iterations)
{
benchmark_running = GNUNET_NO;
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
GNUNET_SCHEDULER_cancel (end);
end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
return;
@@ -490,7 +490,7 @@ try_connect_cb (void *cls,
FPRINTF (stderr,
"%s",
_("Failed to send connect request to transport service\n"));
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
GNUNET_SCHEDULER_cancel (end);
end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
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
/**
* Task identifier for the timeout.
*/
- GNUNET_SCHEDULER_TaskIdentifier tsk;
+ struct GNUNET_SCHEDULER_Task * tsk;
/**
* Name of plugin under test.
@@ -424,12 +424,12 @@ static struct GNUNET_PeerIdentity pid;
/**
* Task scheduled for cleanup / termination of the process.
*/
-static GNUNET_SCHEDULER_TaskIdentifier end;
+static struct GNUNET_SCHEDULER_Task * end;
/**
* Task for operation timeout
*/
-static GNUNET_SCHEDULER_TaskIdentifier op_timeout;
+static struct GNUNET_SCHEDULER_Task * op_timeout;
/**
* Selected level of verbosity.
@@ -522,11 +522,11 @@ shutdown_task (void *cls,
struct ValidationResolutionContext *cur;
struct ValidationResolutionContext *next;
- end = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
+ end = NULL;
+ if (NULL != op_timeout)
{
GNUNET_SCHEDULER_cancel (op_timeout);
- op_timeout = GNUNET_SCHEDULER_NO_TASK;
+ op_timeout = NULL;
}
if (NULL != tc_handle)
{
@@ -612,13 +612,13 @@ operation_timeout (void *cls,
{
struct PeerResolutionContext *cur;
struct PeerResolutionContext *next;
- op_timeout = GNUNET_SCHEDULER_NO_TASK;
+ op_timeout = NULL;
if ((try_connect) || (benchmark_send) || (benchmark_receive))
{
FPRINTF (stdout,
_("Failed to connect to `%s'\n"),
GNUNET_i2s_full (&pid));
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
GNUNET_SCHEDULER_cancel (end);
end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
ret = 1;
@@ -644,7 +644,7 @@ operation_timeout (void *cls,
FPRINTF (stdout,
"%s",
_("Failed to list connections, timeout occured\n"));
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
GNUNET_SCHEDULER_cancel (end);
end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
ret = 1;
@@ -709,10 +709,10 @@ display_test_result (struct TestContext *tc,
_("Configuration for plugin `%s' is working!\n"),
tc->name);
}
- if (GNUNET_SCHEDULER_NO_TASK != tc->tsk)
+ if (NULL != tc->tsk)
{
GNUNET_SCHEDULER_cancel (tc->tsk);
- tc->tsk = GNUNET_SCHEDULER_NO_TASK;
+ tc->tsk = NULL;
}
if (NULL != tc->tst)
{
@@ -873,15 +873,15 @@ process_validation_string (void *cls,
GNUNET_free (vc);
if ((0 == address_resolutions) && (iterate_validation))
{
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
{
GNUNET_SCHEDULER_cancel (end);
- end = GNUNET_SCHEDULER_NO_TASK;
+ end = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
+ if (NULL != op_timeout)
{
GNUNET_SCHEDULER_cancel (op_timeout);
- op_timeout = GNUNET_SCHEDULER_NO_TASK;
+ op_timeout = NULL;
}
ret = 0;
end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
@@ -966,7 +966,7 @@ process_validation_cb (void *cls,
/* done */
vic = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
GNUNET_SCHEDULER_cancel (end);
end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
return;
@@ -975,7 +975,7 @@ process_validation_cb (void *cls,
{
/* invalid response */
vic = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
GNUNET_SCHEDULER_cancel (end);
end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
return;
@@ -1140,23 +1140,23 @@ notify_connect (void *cls,
GNUNET_i2s_full (peer));
ret = 0;
- if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
+ if (NULL != op_timeout)
{
GNUNET_SCHEDULER_cancel (op_timeout);
- op_timeout = GNUNET_SCHEDULER_NO_TASK;
+ op_timeout = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
GNUNET_SCHEDULER_cancel (end);
end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
return;
}
if (benchmark_send)
{
- if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
+ if (NULL != op_timeout)
{
GNUNET_SCHEDULER_cancel (op_timeout);
- op_timeout = GNUNET_SCHEDULER_NO_TASK;
+ op_timeout = NULL;
}
if (verbosity > 0)
FPRINTF (stdout,
@@ -1197,13 +1197,13 @@ notify_disconnect (void *cls,
GNUNET_i2s_full (peer));
ret = 0;
- if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
+ if (NULL != op_timeout)
{
GNUNET_SCHEDULER_cancel (op_timeout);
- op_timeout = GNUNET_SCHEDULER_NO_TASK;
+ op_timeout = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
GNUNET_SCHEDULER_cancel (end);
end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
return;
@@ -1218,7 +1218,7 @@ notify_disconnect (void *cls,
{
FPRINTF (stdout, _("Disconnected from peer `%s' while benchmarking\n"),
GNUNET_i2s (&pid));
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
GNUNET_SCHEDULER_cancel (end);
return;
}
@@ -1431,15 +1431,15 @@ process_peer_string (void *cls,
GNUNET_free (rc);
if ((0 == address_resolutions) && (iterate_connections))
{
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
{
GNUNET_SCHEDULER_cancel (end);
- end = GNUNET_SCHEDULER_NO_TASK;
+ end = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
+ if (NULL != op_timeout)
{
GNUNET_SCHEDULER_cancel (op_timeout);
- op_timeout = GNUNET_SCHEDULER_NO_TASK;
+ op_timeout = NULL;
}
ret = 0;
end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
@@ -1498,7 +1498,7 @@ process_peer_iteration_cb (void *cls,
/* done */
address_resolution_in_progress = GNUNET_NO;
pic = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
GNUNET_SCHEDULER_cancel (end);
end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
return;
@@ -1508,7 +1508,7 @@ process_peer_iteration_cb (void *cls,
(GNUNET_NO == GNUNET_TRANSPORT_is_connected(state)))
return; /* Display only connected peers */
- if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
+ if (NULL != op_timeout)
GNUNET_SCHEDULER_cancel (op_timeout);
op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT,
&operation_timeout,
@@ -1713,7 +1713,7 @@ process_peer_monitoring_cb (void *cls,
return;
}
- if (GNUNET_SCHEDULER_NO_TASK != op_timeout)
+ if (NULL != op_timeout)
GNUNET_SCHEDULER_cancel (op_timeout);
op_timeout = GNUNET_SCHEDULER_add_delayed (OP_TIMEOUT,
&operation_timeout,
@@ -1792,7 +1792,7 @@ try_connect_cb (void *cls,
FPRINTF (stderr,
"%s",
_("Failed to send connect request to transport service\n"));
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
GNUNET_SCHEDULER_cancel (end);
ret = 1;
end = GNUNET_SCHEDULER_add_now (&shutdown_task, NULL);
@@ -1827,7 +1827,7 @@ try_disconnect_cb (void *cls,
}
FPRINTF (stderr, "%s",
_("Failed to send disconnect request to transport service\n"));
- if (GNUNET_SCHEDULER_NO_TASK != end)
+ if (NULL != end)
GNUNET_SCHEDULER_cancel (end);
ret = 1;
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
/**
* Task calling transport service about external address
*/
- GNUNET_SCHEDULER_TaskIdentifier notify_ext_task;
+ struct GNUNET_SCHEDULER_Task * notify_ext_task;
/**
* Plugin name.
@@ -206,7 +206,7 @@ struct Plugin
/**
* MHD IPv4 task
*/
- GNUNET_SCHEDULER_TaskIdentifier server_v4_task;
+ struct GNUNET_SCHEDULER_Task * server_v4_task;
/**
* The IPv4 server is scheduled to run asap
@@ -221,7 +221,7 @@ struct Plugin
/**
* MHD IPv4 task
*/
- GNUNET_SCHEDULER_TaskIdentifier server_v6_task;
+ struct GNUNET_SCHEDULER_Task * server_v6_task;
/**
* The IPv6 server is scheduled to run asap
@@ -260,7 +260,7 @@ struct Plugin
/**
* curl perform task
*/
- GNUNET_SCHEDULER_TaskIdentifier client_perform_task;
+ struct GNUNET_SCHEDULER_Task * client_perform_task;
};
@@ -426,12 +426,12 @@ struct Session
/**
* Task to wake up client receive handle when receiving is allowed again
*/
- GNUNET_SCHEDULER_TaskIdentifier recv_wakeup_task;
+ struct GNUNET_SCHEDULER_Task * recv_wakeup_task;
/**
* Session timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* 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
/**
* Session timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier put_disconnect_task;
+ struct GNUNET_SCHEDULER_Task * put_disconnect_task;
/**
* Session timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Task to wake up client receive handle when receiving is allowed again
*/
- GNUNET_SCHEDULER_TaskIdentifier recv_wakeup_task;
+ struct GNUNET_SCHEDULER_Task * recv_wakeup_task;
/**
* Absolute time when to receive data again.
@@ -326,7 +326,7 @@ struct HTTP_Client_Plugin
/**
* curl perform task
*/
- GNUNET_SCHEDULER_TaskIdentifier client_perform_task;
+ struct GNUNET_SCHEDULER_Task * client_perform_task;
/**
* Type of proxy server:
@@ -440,21 +440,21 @@ client_delete_session (struct Session *s)
struct HTTP_Message *next;
CURLMcode mret;
- if (GNUNET_SCHEDULER_NO_TASK != s->timeout_task)
+ if (NULL != s->timeout_task)
{
GNUNET_SCHEDULER_cancel (s->timeout_task);
- s->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ s->timeout_task = NULL;
s->timeout = GNUNET_TIME_UNIT_ZERO_ABS;
}
- if (GNUNET_SCHEDULER_NO_TASK != s->put_disconnect_task)
+ if (NULL != s->put_disconnect_task)
{
GNUNET_SCHEDULER_cancel (s->put_disconnect_task);
- s->put_disconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ s->put_disconnect_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != s->recv_wakeup_task)
+ if (NULL != s->recv_wakeup_task)
{
GNUNET_SCHEDULER_cancel (s->recv_wakeup_task);
- s->recv_wakeup_task = GNUNET_SCHEDULER_NO_TASK;
+ s->recv_wakeup_task = NULL;
}
GNUNET_assert (GNUNET_OK ==
GNUNET_CONTAINER_multipeermap_remove (plugin->sessions,
@@ -541,7 +541,7 @@ client_delete_session (struct Session *s)
static void
client_reschedule_session_timeout (struct Session *s)
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != s->timeout_task);
+ GNUNET_assert (NULL != s->timeout_task);
s->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
}
@@ -579,10 +579,10 @@ client_schedule (struct HTTP_Client_Plugin *plugin,
struct GNUNET_TIME_Relative timeout;
/* Cancel previous scheduled task */
- if (plugin->client_perform_task != GNUNET_SCHEDULER_NO_TASK)
+ if (plugin->client_perform_task != NULL)
{
GNUNET_SCHEDULER_cancel (plugin->client_perform_task);
- plugin->client_perform_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->client_perform_task = NULL;
}
max = -1;
FD_ZERO (&rs);
@@ -802,9 +802,9 @@ http_client_plugin_send (void *cls,
if (H_PAUSED == s->put.state)
{
/* PUT request was paused, unpause */
- GNUNET_assert (s->put_disconnect_task != GNUNET_SCHEDULER_NO_TASK);
+ GNUNET_assert (s->put_disconnect_task != NULL);
GNUNET_SCHEDULER_cancel (s->put_disconnect_task);
- s->put_disconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ s->put_disconnect_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Session %p/request %p: unpausing request\n",
s, s->put.easyhandle);
@@ -851,10 +851,10 @@ http_client_plugin_session_disconnect (void *cls,
client_delete_session (s);
/* Re-schedule since handles have changed */
- if (plugin->client_perf