summaryrefslogtreecommitdiff
path: root/src/transport
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-24 01:10:47 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-24 01:10:47 +0000
commitf1f603c7d0b3f03dca46a4f313472288eb080eb1 (patch)
tree3a29966b02dfb83e0a8a8d5c42b3116380209fb0 /src/transport
parent53cd5b8eda2fa8db86b0907a62a39598981d008a (diff)
making GNUNET_SCHEDULER_cancel() perform in O(1) instead of O(n) to help or even fully address #3247
Diffstat (limited to 'src/transport')
-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
47 files changed, 546 insertions, 546 deletions
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_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;
}
client_schedule (plugin, GNUNET_YES);
@@ -1001,7 +1001,7 @@ client_put_disconnect (void *cls,
{
struct Session *s = cls;
- s->put_disconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ s->put_disconnect_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Session %p/request %p: will be disconnected due to no activity\n",
s, s->put.easyhandle);
@@ -1132,7 +1132,7 @@ client_wake_up (void *cls,
{
struct Session *s = cls;
- s->recv_wakeup_task = GNUNET_SCHEDULER_NO_TASK;
+ s->recv_wakeup_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1141,9 +1141,9 @@ client_wake_up (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;
s->put.state = H_CONNECTED;
if (NULL != s->put.easyhandle)
curl_easy_pause (s->put.easyhandle, CURLPAUSE_CONT);
@@ -1271,10 +1271,10 @@ client_receive (void *stream,
s->get.easyhandle,
GNUNET_STRINGS_relative_time_to_string (delta,
GNUNET_YES));
- if (s->recv_wakeup_task != GNUNET_SCHEDULER_NO_TASK)
+ if (s->recv_wakeup_task != NULL)
{
GNUNET_SCHEDULER_cancel (s->recv_wakeup_task);
- s->recv_wakeup_task = GNUNET_SCHEDULER_NO_TASK;
+ s->recv_wakeup_task = NULL;
}
s->recv_wakeup_task
= GNUNET_SCHEDULER_add_delayed (delta,
@@ -1313,7 +1313,7 @@ client_run (void *cls,
int put_request; /* GNUNET_YES if easy handle is put, GNUNET_NO for get */
int msgs_left;
- plugin->client_perform_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->client_perform_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -1918,10 +1918,10 @@ client_connect (struct Session *s)
plugin->cur_requests,
GNUNET_NO);
/* Re-schedule since handles have changed */
- 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;
}
/* Schedule task to run immediately */
@@ -1958,7 +1958,7 @@ client_session_timeout (void *cls,
struct Session *s = cls;
struct GNUNET_TIME_Relative left;
- s->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ s->timeout_task = NULL;
left = GNUNET_TIME_absolute_get_remaining (s->timeout);
if (0 != left.rel_value_us)
{
@@ -2166,10 +2166,10 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
GNUNET_CONTAINER_multipeermap_iterate (plugin->sessions,
&destroy_session_cb,
plugin);
- if (GNUNET_SCHEDULER_NO_TASK != plugin->client_perform_task)
+ if (NULL != plugin->client_perform_task)
{
GNUNET_SCHEDULER_cancel (plugin->client_perform_task);
- plugin->client_perform_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->client_perform_task = NULL;
}
if (NULL != plugin->curl_multi_handle)
{
@@ -2368,7 +2368,7 @@ http_client_plugin_update_inbound_delay (void *cls,
"New inbound delay %s\n",
GNUNET_STRINGS_relative_time_to_string (delay,
GNUNET_NO));
- if (s->recv_wakeup_task != GNUNET_SCHEDULER_NO_TASK)
+ if (s->recv_wakeup_task != NULL)
{
GNUNET_SCHEDULER_cancel (s->recv_wakeup_task);
s->recv_wakeup_task = GNUNET_SCHEDULER_add_delayed (delay,
diff --git a/src/transport/plugin_transport_http_common.c b/src/transport/plugin_transport_http_common.c
index acccf39f8..bd6838e1c 100644
--- a/src/transport/plugin_transport_http_common.c
+++ b/src/transport/plugin_transport_http_common.c
@@ -205,7 +205,7 @@ struct PrettyPrinterContext
/**
* Timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Splitted Address
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 31bd7ba4f..aaa17b2cf 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -232,12 +232,12 @@ struct Session
/**
* Session timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Task to resume MHD handling when receiving is allowed again
*/
- GNUNET_SCHEDULER_TaskIdentifier recv_wakeup_task;
+ struct GNUNET_SCHEDULER_Task * recv_wakeup_task;
/**
* Number of bytes waiting for transmission to this peer.
@@ -374,17 +374,17 @@ struct HTTP_Server_Plugin
/**
* MHD IPv4 task
*/
- GNUNET_SCHEDULER_TaskIdentifier server_v4_task;
+ struct GNUNET_SCHEDULER_Task * server_v4_task;
/**
* MHD IPv6 task
*/
- GNUNET_SCHEDULER_TaskIdentifier server_v6_task;
+ struct GNUNET_SCHEDULER_Task * server_v6_task;
/**
* Task calling transport service about external address
*/
- GNUNET_SCHEDULER_TaskIdentifier notify_ext_task;
+ struct GNUNET_SCHEDULER_Task * notify_ext_task;
/**
* Notify transport only about external address
@@ -499,7 +499,7 @@ server_wake_up (void *cls,
{
struct Session *s = cls;
- s->recv_wakeup_task = GNUNET_SCHEDULER_NO_TASK;
+ s->recv_wakeup_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -534,16 +534,16 @@ server_delete_session (struct Session *s)
struct HTTP_Server_Plugin *plugin = s->plugin;
struct HTTP_Message *msg;
- 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->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;
if (NULL != s->server_recv)
MHD_resume_connection (s->server_recv->mhd_conn);
}
@@ -649,7 +649,7 @@ server_session_timeout (void *cls,
struct Session *s = cls;
struct GNUNET_TIME_Relative left;
- s->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ s->timeout_task = NULL;
left = GNUNET_TIME_absolute_get_remaining (s->timeout);
if (0 != left.rel_value_us)
{
@@ -680,7 +680,7 @@ server_session_timeout (void *cls,
static void
server_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);
}
@@ -917,7 +917,7 @@ server_v4_run (void *cls,
{
struct HTTP_Server_Plugin *plugin = cls;
- plugin->server_v4_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->server_v4_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
plugin->server_v4_immediately = GNUNET_NO;
@@ -939,7 +939,7 @@ server_v6_run (void *cls,
{
struct HTTP_Server_Plugin *plugin = cls;
- plugin->server_v6_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->server_v6_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
plugin->server_v6_immediately = GNUNET_NO;
@@ -957,12 +957,12 @@ server_v6_run (void *cls,
* @param now schedule now
* @return gnunet task identifier
*/
-static GNUNET_SCHEDULER_TaskIdentifier
+static struct GNUNET_SCHEDULER_Task *
server_schedule (struct HTTP_Server_Plugin *plugin,
struct MHD_Daemon *daemon_handle,
int now)
{
- GNUNET_SCHEDULER_TaskIdentifier ret;
+ struct GNUNET_SCHEDULER_Task * ret;
fd_set rs;
fd_set ws;
fd_set es;
@@ -975,9 +975,9 @@ server_schedule (struct HTTP_Server_Plugin *plugin,
struct GNUNET_TIME_Relative tv;
if (GNUNET_YES == plugin->in_shutdown)
- return GNUNET_SCHEDULER_NO_TASK;
+ return NULL;
- ret = GNUNET_SCHEDULER_NO_TASK;
+ ret = NULL;
FD_ZERO (&rs);
FD_ZERO (&ws);
FD_ZERO (&es);
@@ -1015,10 +1015,10 @@ server_schedule (struct HTTP_Server_Plugin *plugin,
if (daemon_handle == plugin->server_v4)
{
- if (plugin->server_v4_task != GNUNET_SCHEDULER_NO_TASK)
+ if (plugin->server_v4_task != NULL)
{
GNUNET_SCHEDULER_cancel (plugin->server_v4_task);
- plugin->server_v4_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->server_v4_task = NULL;
}
#if 0
LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1032,10 +1032,10 @@ server_schedule (struct HTTP_Server_Plugin *plugin,
}
if (daemon_handle == plugin->server_v6)
{
- if (plugin->server_v6_task != GNUNET_SCHEDULER_NO_TASK)
+ if (plugin->server_v6_task != NULL)
{
GNUNET_SCHEDULER_cancel (plugin->server_v6_task);
- plugin->server_v6_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->server_v6_task = NULL;
}
#if 0
LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1073,10 +1073,10 @@ server_reschedule (struct HTTP_Server_Plugin *plugin,
if (GNUNET_YES == now)
plugin->server_v4_immediately = GNUNET_YES;
- if (plugin->server_v4_task != GNUNET_SCHEDULER_NO_TASK)
+ if (plugin->server_v4_task != NULL)
{
GNUNET_SCHEDULER_cancel (plugin->server_v4_task);
- plugin->server_v4_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->server_v4_task = NULL;
}
plugin->server_v4_task = server_schedule (plugin, plugin->server_v4, now);
}
@@ -1089,10 +1089,10 @@ server_reschedule (struct HTTP_Server_Plugin *plugin,
if (GNUNET_YES == now)
plugin->server_v6_immediately = GNUNET_YES;
- if (plugin->server_v6_task != GNUNET_SCHEDULER_NO_TASK)
+ if (plugin->server_v6_task != NULL)
{
GNUNET_SCHEDULER_cancel (plugin->server_v6_task);
- plugin->server_v6_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->server_v6_task = NULL;
}
plugin->server_v6_task = server_schedule (plugin, plugin->server_v6, now);
}
@@ -1895,7 +1895,7 @@ server_access_cb (void *cls,
s, sc, GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
GNUNET_assert(s->server_recv->mhd_conn == mhd_connection);
MHD_suspend_connection (s->server_recv->mhd_conn);
- if (GNUNET_SCHEDULER_NO_TASK == s->recv_wakeup_task)
+ if (NULL == s->recv_wakeup_task)
s->recv_wakeup_task = GNUNET_SCHEDULER_add_delayed (delay,
&server_wake_up, s);
}
@@ -2881,7 +2881,7 @@ server_notify_external_hostname (void *cls,
unsigned int urlen;
char *url;
- plugin->notify_ext_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->notify_ext_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -3175,10 +3175,10 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
_("Shutting down plugin `%s'\n"),
plugin->name);
- if (GNUNET_SCHEDULER_NO_TASK != plugin->notify_ext_task)
+ if (NULL != plugin->notify_ext_task)
{
GNUNET_SCHEDULER_cancel (plugin->notify_ext_task);
- plugin->notify_ext_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->notify_ext_task = NULL;
}
if (NULL != plugin->ext_addr)
@@ -3213,16 +3213,16 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
MHD_stop_daemon (plugin->server_v6);
plugin->server_v6 = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != plugin->server_v4_task)
+ if (NULL != plugin->server_v4_task)
{
GNUNET_SCHEDULER_cancel (plugin->server_v4_task);
- plugin->server_v4_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->server_v4_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != plugin->server_v6_task)
+ if (NULL != plugin->server_v6_task)
{
GNUNET_SCHEDULER_cancel (plugin->server_v6_task);
- plugin->server_v6_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->server_v6_task = NULL;
}
#if BUILD_HTTPS
GNUNET_free_non_null (plugin->crypto_init);
@@ -3309,7 +3309,7 @@ http_server_plugin_update_inbound_delay (void *cls,
"New inbound delay %s\n",
GNUNET_STRINGS_relative_time_to_string (delay,
GNUNET_NO));
- if (GNUNET_SCHEDULER_NO_TASK != session->recv_wakeup_task)
+ if (NULL != session->recv_wakeup_task)
{
GNUNET_SCHEDULER_cancel (session->recv_wakeup_task);
session->recv_wakeup_task
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 021a647ad..4f7b57641 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -269,7 +269,7 @@ struct Session
/**
* Task cleaning up a NAT client connection establishment attempt;
*/
- GNUNET_SCHEDULER_TaskIdentifier nat_connection_timeout;
+ struct GNUNET_SCHEDULER_Task * nat_connection_timeout;
/**
* Messages currently pending for transmission
@@ -296,12 +296,12 @@ struct Session
/**
* ID of task used to delay receiving more to throttle sender.
*/
- GNUNET_SCHEDULER_TaskIdentifier receive_delay_task;
+ struct GNUNET_SCHEDULER_Task * receive_delay_task;
/**
* Session timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* When will this session time out?
@@ -435,7 +435,7 @@ struct Plugin
/**
* ID of task used to update our addresses when one expires.
*/
- GNUNET_SCHEDULER_TaskIdentifier address_update_task;
+ struct GNUNET_SCHEDULER_Task * address_update_task;
/**
* Address options
@@ -480,7 +480,7 @@ notify_session_monitor (struct Plugin *plugin,
: GNUNET_NO;
info.num_msg_pending = session->msgs_in_queue;
info.num_bytes_pending = session->bytes_in_queue;
- if (GNUNET_SCHEDULER_NO_TASK != session->receive_delay_task)
+ if (NULL != session->receive_delay_task)
info.receive_delay = session->receive_delay;
info.session_timeout = session->timeout;
info.address = session->address;
@@ -813,10 +813,10 @@ tcp_plugin_disconnect_session (void *cls,
session->address->address,
session->address->address_length));
- if (GNUNET_SCHEDULER_NO_TASK != session->timeout_task)
+ if (NULL != session->timeout_task)
{
GNUNET_SCHEDULER_cancel (session->timeout_task);
- session->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ session->timeout_task = NULL;
session->timeout = GNUNET_TIME_UNIT_ZERO_ABS;
}
@@ -853,10 +853,10 @@ tcp_plugin_disconnect_session (void *cls,
session->address,
session);
- if (GNUNET_SCHEDULER_NO_TASK != session->nat_connection_timeout)
+ if (NULL != session->nat_connection_timeout)
{
GNUNET_SCHEDULER_cancel (session->nat_connection_timeout);
- session->nat_connection_timeout = GNUNET_SCHEDULER_NO_TASK;
+ session->nat_connection_timeout = NULL;
}
while (NULL != (pm = session->pending_messages_head))
@@ -894,7 +894,7 @@ tcp_plugin_disconnect_session (void *cls,
session,
GNUNET_TRANSPORT_SS_DONE);
- if (session->receive_delay_task != GNUNET_SCHEDULER_NO_TASK)
+ if (session->receive_delay_task != NULL)
{
GNUNET_SCHEDULER_cancel (session->receive_delay_task);
if (NULL != session->client)
@@ -941,7 +941,7 @@ session_timeout (void *cls,
struct Session *s = cls;
struct GNUNET_TIME_Relative left;
- s->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ s->timeout_task = NULL;
left = GNUNET_TIME_absolute_get_remaining (s->timeout);
if (0 != left.rel_value_us)
{
@@ -973,7 +973,7 @@ session_timeout (void *cls,
static void
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);
}
@@ -1417,7 +1417,7 @@ nat_connect_timeout (void *cls,
{
struct Session *session = cls;
- session->nat_connection_timeout = GNUNET_SCHEDULER_NO_TASK;
+ session->nat_connection_timeout = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"NAT WAIT connection to `%4s' at `%s' could not be established, removing session\n",
GNUNET_i2s (&session->target),
@@ -1460,7 +1460,7 @@ delayed_done (void *cls,
{
struct Session *session = cls;
- session->receive_delay_task = GNUNET_SCHEDULER_NO_TASK;
+ session->receive_delay_task = NULL;
reschedule_session_timeout (session);
GNUNET_SERVER_receive_done (session->client, GNUNET_OK);
@@ -1483,7 +1483,7 @@ tcp_plugin_update_inbound_delay (void *cls,
struct Session *session,
struct GNUNET_TIME_Relative delay)
{
- if (GNUNET_SCHEDULER_NO_TASK == session->receive_delay_task)
+ if (NULL == session->receive_delay_task)
return;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"New inbound delay %s\n",
@@ -1846,7 +1846,7 @@ struct PrettyPrinterContext
/**
* Timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Resolver handle
@@ -2166,10 +2166,10 @@ handle_tcp_nat_probe (void *cls,
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Found session for NAT probe!\n");
- if (session->nat_connection_timeout != GNUNET_SCHEDULER_NO_TASK)
+ if (session->nat_connection_timeout != NULL)
{
GNUNET_SCHEDULER_cancel (session->nat_connection_timeout);
- session->nat_connection_timeout = GNUNET_SCHEDULER_NO_TASK;
+ session->nat_connection_timeout = NULL;
}
if (GNUNET_OK != GNUNET_SERVER_client_get_address (client, &vaddr, &alen))
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index 900cb1580..48535f28b 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -102,7 +102,7 @@ struct PrettyPrinterContext
/**
* Timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* IPv6 address
@@ -155,7 +155,7 @@ struct Session
/**
* Session timeout task
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* When does this session time out?
@@ -566,7 +566,7 @@ schedule_select (struct Plugin *plugin)
GNUNET_TIME_absolute_get_remaining (
udpw->session->flow_delay_from_other_peer));
- if (plugin->select_task != GNUNET_SCHEDULER_NO_TASK )
+ if (plugin->select_task != NULL )
GNUNET_SCHEDULER_cancel (plugin->select_task);
/* Schedule with:
@@ -587,7 +587,7 @@ schedule_select (struct Plugin *plugin)
GNUNET_TIME_absolute_get_remaining (
udpw->session->flow_delay_from_other_peer));
- if (GNUNET_SCHEDULER_NO_TASK != plugin->select_task_v6)
+ if (NULL != plugin->select_task_v6)
GNUNET_SCHEDULER_cancel (plugin->select_task_v6);
plugin->select_task_v6 = GNUNET_SCHEDULER_add_select (
GNUNET_SCHEDULER_PRIORITY_DEFAULT,
@@ -1332,10 +1332,10 @@ udp_disconnect_session (void *cls,
GNUNET_i2s (&s->target),
udp_address_to_string (NULL, s->address->address, s->address->address_length));
/* stop timeout task */
- 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;
}
if (NULL != s->frag_ctx)
{
@@ -1500,7 +1500,7 @@ session_timeout (void *cls,
struct Plugin *plugin = s->plugin;
struct GNUNET_TIME_Relative left;
- s->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ s->timeout_task = NULL;
left = GNUNET_TIME_absolute_get_remaining (s->timeout);
if (left.rel_value_us > 0)
{
@@ -1534,7 +1534,7 @@ reschedule_session_timeout (struct Session *s)
{
if (GNUNET_YES == s->in_destroy)
return;
- GNUNET_assert(GNUNET_SCHEDULER_NO_TASK != s->timeout_task);
+ GNUNET_assert(NULL != s->timeout_task);
s->timeout = GNUNET_TIME_relative_to_absolute (UDP_SESSION_TIME_OUT);
}
@@ -3027,7 +3027,7 @@ udp_plugin_select (void *cls,
{
struct Plugin *plugin = cls;
- plugin->select_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->select_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
if ((0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
@@ -3056,7 +3056,7 @@ udp_plugin_select_v6 (void *cls,
{
struct Plugin *plugin = cls;
- plugin->select_task_v6 = GNUNET_SCHEDULER_NO_TASK;
+ plugin->select_task_v6 = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
if (((tc->reason & GNUNET_SCHEDULER_REASON_READ_READY) != 0)
@@ -3610,15 +3610,15 @@ libgnunet_plugin_transport_udp_done (void *cls)
return NULL;
}
stop_broadcast (plugin);
- if (plugin->select_task != GNUNET_SCHEDULER_NO_TASK )
+ if (plugin->select_task != NULL )
{
GNUNET_SCHEDULER_cancel (plugin->select_task);
- plugin->select_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->select_task = NULL;
}
- if (plugin->select_task_v6 != GNUNET_SCHEDULER_NO_TASK )
+ if (plugin->select_task_v6 != NULL )
{
GNUNET_SCHEDULER_cancel (plugin->select_task_v6);
- plugin->select_task_v6 = GNUNET_SCHEDULER_NO_TASK;
+ plugin->select_task_v6 = NULL;
}
/* Closing sockets */
diff --git a/src/transport/plugin_transport_udp.h b/src/transport/plugin_transport_udp.h
index 3770b3b70..2e77b9010 100644
--- a/src/transport/plugin_transport_udp.h
+++ b/src/transport/plugin_transport_udp.h
@@ -155,12 +155,12 @@ struct Plugin
/**
* ID of select task for IPv4
*/
- GNUNET_SCHEDULER_TaskIdentifier select_task;
+ struct GNUNET_SCHEDULER_Task * select_task;
/**
* ID of select task for IPv6
*/
- GNUNET_SCHEDULER_TaskIdentifier select_task_v6;
+ struct GNUNET_SCHEDULER_Task * select_task_v6;
/**
* Tokenizer for inbound messages.
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index 9ed1bff65..6566245cd 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -84,7 +84,7 @@ struct BroadcastAddress
/**
* ID of select broadcast task
*/
- GNUNET_SCHEDULER_TaskIdentifier broadcast_task;
+ struct GNUNET_SCHEDULER_Task * broadcast_task;
struct Plugin *plugin;
@@ -302,7 +302,7 @@ udp_ipv4_broadcast_send (void *cls,
uint16_t msg_size;
char buf[65536] GNUNET_ALIGN;
- baddr->broadcast_task = GNUNET_SCHEDULER_NO_TASK;
+ baddr->broadcast_task = NULL;
msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf);
if (0 != msg_size)
@@ -379,7 +379,7 @@ udp_ipv6_broadcast_send (void *cls,
char buf[65536] GNUNET_ALIGN;
const struct sockaddr_in6 *s6 = (const struct sockaddr_in6 *) baddr->addr;
- baddr->broadcast_task = GNUNET_SCHEDULER_NO_TASK;
+ baddr->broadcast_task = NULL;
msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf);
/* Note: unclear if this actually works to limit the multicast to
@@ -651,10 +651,10 @@ stop_broadcast (struct Plugin *plugin)
{
struct BroadcastAddress *p = plugin->broadcast_head;
- if (p->broadcast_task != GNUNET_SCHEDULER_NO_TASK)
+ if (p->broadcast_task != NULL)
{
GNUNET_SCHEDULER_cancel (p->broadcast_task);
- p->broadcast_task = GNUNET_SCHEDULER_NO_TASK;
+ p->broadcast_task = NULL;
}
if ((GNUNET_YES == plugin->enable_ipv6) &&
(NULL != plugin->sockv6) &&
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 7e2601aed..460869181 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -218,7 +218,7 @@ struct Session
/**
* Session timeout task.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Number of messages we currently have in our write queue.
@@ -255,17 +255,17 @@ struct Plugin
/**
* ID of task used to update our addresses when one expires.
*/
- GNUNET_SCHEDULER_TaskIdentifier address_update_task;
+ struct GNUNET_SCHEDULER_Task * address_update_task;
/**
* ID of read task
*/
- GNUNET_SCHEDULER_TaskIdentifier read_task;
+ struct GNUNET_SCHEDULER_Task * read_task;
/**
* ID of write task
*/
- GNUNET_SCHEDULER_TaskIdentifier write_task;
+ struct GNUNET_SCHEDULER_Task * write_task;
/**
* Number of bytes we currently have in our write queues.
@@ -482,10 +482,10 @@ unix_plugin_session_disconnect (void *cls,
"# UNIX sessions active",
GNUNET_CONTAINER_multipeermap_size (plugin->session_map),
GNUNET_NO);
- if (GNUNET_SCHEDULER_NO_TASK != session->timeout_task)
+ if (NULL != session->timeout_task)
{
GNUNET_SCHEDULER_cancel (session->timeout_task);
- session->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ session->timeout_task = NULL;
session->timeout = GNUNET_TIME_UNIT_ZERO_ABS;
}
notify_session_monitor (plugin,
@@ -512,7 +512,7 @@ session_timeout (void *cls,
struct Session *session = cls;
struct GNUNET_TIME_Relative left;
- session->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ session->timeout_task = NULL;
left = GNUNET_TIME_absolute_get_remaining (session->timeout);
if (0 != left.rel_value_us)
{
@@ -545,7 +545,7 @@ session_timeout (void *cls,
static void
reschedule_session_timeout (struct Session *session)
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != session->timeout_task);
+ GNUNET_assert (NULL != session->timeout_task);
session->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
}
@@ -1226,7 +1226,7 @@ unix_plugin_select_read (void *cls,
{
struct Plugin *plugin = cls;
- plugin->read_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->read_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
@@ -1251,7 +1251,7 @@ unix_plugin_select_write (void *cls,
{
struct Plugin *plugin = cls;
- plugin->write_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->write_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_WRITE_READY))
@@ -1358,7 +1358,7 @@ unix_plugin_send (void *cls,
notify_session_monitor (plugin,
session,
GNUNET_TRANSPORT_SS_UPDATE);
- if (GNUNET_SCHEDULER_NO_TASK == plugin->write_task)
+ if (NULL == plugin->write_task)
plugin->write_task =
GNUNET_SCHEDULER_add_write_net (GNUNET_TIME_UNIT_FOREVER_REL,
plugin->unix_sock.desc,
@@ -1629,7 +1629,7 @@ address_notification (void *cls,
unix_path = (char *) &ua[1];
memcpy (unix_path, plugin->unix_socket_path, strlen (plugin->unix_socket_path) + 1);
- plugin->address_update_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->address_update_task = NULL;
address = GNUNET_HELLO_address_allocate (plugin->env->my_identity,
PLUGIN_NAME,
ua,
@@ -1886,20 +1886,20 @@ libgnunet_plugin_transport_unix_done (void *cls)
GNUNET_free (msgw);
}
- if (GNUNET_SCHEDULER_NO_TASK != plugin->read_task)
+ if (NULL != plugin->read_task)
{
GNUNET_SCHEDULER_cancel (plugin->read_task);
- plugin->read_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->read_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != plugin->write_task)
+ if (NULL != plugin->write_task)
{
GNUNET_SCHEDULER_cancel (plugin->write_task);
- plugin->write_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->write_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != plugin->address_update_task)
+ if (NULL != plugin->address_update_task)
{
GNUNET_SCHEDULER_cancel (plugin->address_update_task);
- plugin->address_update_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->address_update_task = NULL;
}
if (NULL != plugin->unix_sock.desc)
{
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c
index ab9fa4a74..b0be34346 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -204,7 +204,7 @@ struct PendingMessage
/**
* Timeout task (for this message).
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
};
@@ -250,7 +250,7 @@ struct Session
/**
* Timeout task (for the session).
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
};
@@ -300,7 +300,7 @@ struct FragmentMessage
/**
* Timeout task.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Continuation to call when we're done with this message.
@@ -379,7 +379,7 @@ struct MacEndpoint
/**
* Timeout task.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* count of messages in the fragment out queue for this mac endpoint
@@ -484,7 +484,7 @@ struct Plugin
/**
* Task that periodically sends a HELLO beacon via the helper.
*/
- GNUNET_SCHEDULER_TaskIdentifier beacon_task;
+ struct GNUNET_SCHEDULER_Task * beacon_task;
/**
* Tracker for bandwidth limit
@@ -777,10 +777,10 @@ wlan_plugin_disconnect_session (void *cls,
GNUNET_CONTAINER_DLL_remove (endpoint->sessions_head,
endpoint->sessions_tail,
session);
- if (session->timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (session->timeout_task != NULL)
{
GNUNET_SCHEDULER_cancel (session->timeout_task);
- session->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ session->timeout_task = NULL;
}
GNUNET_STATISTICS_update (plugin->env->stats,
_("# Sessions allocated"),
@@ -820,7 +820,7 @@ session_timeout (void *cls,
struct Session *session = cls;
struct GNUNET_TIME_Relative left;
- session->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ session->timeout_task = NULL;
left = GNUNET_TIME_absolute_get_remaining (session->timeout);
if (0 != left.rel_value_us)
{
@@ -1025,10 +1025,10 @@ free_fragment_message (struct FragmentMessage *fm)
GNUNET_FRAGMENT_context_destroy (fm->fragcontext,
&endpoint->msg_delay,
&endpoint->ack_delay);
- if (fm->timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (fm->timeout_task != NULL)
{
GNUNET_SCHEDULER_cancel (fm->timeout_task);
- fm->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ fm->timeout_task = NULL;
}
GNUNET_free (fm);
}
@@ -1046,7 +1046,7 @@ fragmentmessage_timeout (void *cls,
{
struct FragmentMessage *fm = cls;
- fm->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ fm->timeout_task = NULL;
if (NULL != fm->cont)
{
fm->cont (fm->cont_cls,
@@ -1145,10 +1145,10 @@ free_macendpoint (struct MacEndpoint *endpoint)
}
plugin->mac_count--;
- if (GNUNET_SCHEDULER_NO_TASK != endpoint->timeout_task)
+ if (NULL != endpoint->timeout_task)
{
GNUNET_SCHEDULER_cancel (endpoint->timeout_task);
- endpoint->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ endpoint->timeout_task = NULL;
}
GNUNET_free (endpoint);
}
@@ -1167,7 +1167,7 @@ macendpoint_timeout (void *cls,
struct MacEndpoint *endpoint = cls;
struct GNUNET_TIME_Relative timeout;
- endpoint->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ endpoint->timeout_task = NULL;
timeout = GNUNET_TIME_absolute_get_remaining (endpoint->timeout);
if (0 == timeout.rel_value_us)
{
@@ -1923,10 +1923,10 @@ LIBGNUNET_PLUGIN_TRANSPORT_DONE (void *cls)
GNUNET_HELLO_address_free (address);
}
- if (GNUNET_SCHEDULER_NO_TASK != plugin->beacon_task)
+ if (NULL != plugin->beacon_task)
{
GNUNET_SCHEDULER_cancel (plugin->beacon_task);
- plugin->beacon_task = GNUNET_SCHEDULER_NO_TASK;
+ plugin->beacon_task = NULL;
}
if (NULL != plugin->suid_helper)
{
@@ -2077,7 +2077,7 @@ wlan_plugin_update_session_timeout (void *cls,
const struct GNUNET_PeerIdentity *peer,
struct Session *session)
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != session->timeout_task);
+ GNUNET_assert (NULL != session->timeout_task);
session->timeout = GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT);
}
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c
index 83ff7f1c4..e9942cff9 100644
--- a/src/transport/test_plugin_transport.c
+++ b/src/transport/test_plugin_transport.c
@@ -89,12 +89,12 @@ struct GNUNET_HELPER_Handle *suid_helper;
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier timeout_endbadly;
+static struct GNUNET_SCHEDULER_Task * timeout_endbadly;
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier timeout_wait;
+static struct GNUNET_SCHEDULER_Task * timeout_wait;
/**
* Library name
@@ -138,10 +138,10 @@ end ()
int c = 0;
ok = 0;
- if (GNUNET_SCHEDULER_NO_TASK != timeout_endbadly)
+ if (NULL != timeout_endbadly)
{
GNUNET_SCHEDULER_cancel (timeout_endbadly);
- timeout_endbadly = GNUNET_SCHEDULER_NO_TASK;
+ timeout_endbadly = NULL;
}
if (NULL != api)
GNUNET_PLUGIN_unload (libname, api);
@@ -183,11 +183,11 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct AddressWrapper *w;
int c = 0;
- timeout_endbadly = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != timeout_wait)
+ timeout_endbadly = NULL;
+ if (NULL != timeout_wait)
{
GNUNET_SCHEDULER_cancel (timeout_wait);
- timeout_wait = GNUNET_SCHEDULER_NO_TASK;
+ timeout_wait = NULL;
}
if (pretty_printers_running > 0)
@@ -249,7 +249,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
wait_end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- timeout_wait = GNUNET_SCHEDULER_NO_TASK;
+ timeout_wait = NULL;
if (0 == addresses_reported)
GNUNET_log(GNUNET_ERROR_TYPE_WARNING,
"Plugin did not report any addresses, could not check address conversion functions\n");
@@ -260,15 +260,15 @@ wait_end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly_now ()
{
- if (GNUNET_SCHEDULER_NO_TASK != timeout_wait)
+ if (NULL != timeout_wait)
{
GNUNET_SCHEDULER_cancel (timeout_wait);
- timeout_wait = GNUNET_SCHEDULER_NO_TASK;
+ timeout_wait = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != timeout_endbadly)
+ if (NULL != timeout_endbadly)
{
GNUNET_SCHEDULER_cancel (timeout_endbadly);
- timeout_endbadly = GNUNET_SCHEDULER_NO_TASK;
+ timeout_endbadly = NULL;
}
timeout_endbadly = GNUNET_SCHEDULER_add_now (&end_badly, NULL );
}
@@ -418,10 +418,10 @@ env_notify_address (void *cls,
end_badly_now ();
return;
}
- if (GNUNET_SCHEDULER_NO_TASK != timeout_wait)
+ if (NULL != timeout_wait)
{
GNUNET_SCHEDULER_cancel (timeout_wait);
- timeout_wait = GNUNET_SCHEDULER_NO_TASK;
+ timeout_wait = NULL;
}
timeout_wait = GNUNET_SCHEDULER_add_delayed (WAIT, &wait_end, NULL );
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index ac43b8d05..250d3279f 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -47,9 +47,9 @@ static char *test_plugin;
static char *test_name;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier measure_task;
+static struct GNUNET_SCHEDULER_Task * measure_task;
struct PeerContext *p1;
@@ -153,7 +153,7 @@ end ()
datarate, quota_out_p1, quota_in_p2);
}
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
if (th != NULL)
@@ -171,10 +171,10 @@ end ()
static void
end_badly ()
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
- if (measure_task != GNUNET_SCHEDULER_NO_TASK)
+ if (measure_task != NULL)
GNUNET_SCHEDULER_cancel (measure_task);
if (test_connected == GNUNET_YES)
@@ -244,7 +244,7 @@ notify_ready (void *cls, size_t size, void *buf)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready for message %u of %u\n",
msg_scheduled, TOTAL_MSGS);
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
test_failed = 1;
@@ -348,7 +348,7 @@ measure (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
static int counter;
- measure_task = GNUNET_SCHEDULER_NO_TASK;
+ measure_task = NULL;
counter++;
if ((DURATION.rel_value_us / 1000 / 1000LL) < counter)
@@ -472,7 +472,7 @@ run_measurement (unsigned long long p1_quota_in,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
diff --git a/src/transport/test_transport_address_switch.c b/src/transport/test_transport_address_switch.c
index fcbd798d0..10815c7ab 100644
--- a/src/transport/test_transport_address_switch.c
+++ b/src/transport/test_transport_address_switch.c
@@ -67,11 +67,11 @@ GNUNET_NETWORK_STRUCT_END
#define DURATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
#define DELAY GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier delayed_end_task;
+static struct GNUNET_SCHEDULER_Task * delayed_end_task;
-static GNUNET_SCHEDULER_TaskIdentifier measure_task;
+static struct GNUNET_SCHEDULER_Task * measure_task;
struct PeerContext *p1;
char *cfg_file_p1;
@@ -142,7 +142,7 @@ stat_start_attempt_cb (void *cls, const char *subsystem, const char *name,
else
return GNUNET_OK;
- if (GNUNET_SCHEDULER_NO_TASK == delayed_end_task)
+ if (NULL == delayed_end_task)
delayed_end_task = GNUNET_SCHEDULER_add_delayed (DELAY, &end, NULL );
return GNUNET_OK;
}
@@ -207,22 +207,22 @@ stat_addresses_available (void *cls, const char *subsystem, const char *name,
static void
clean_up ()
{
- if (measure_task != GNUNET_SCHEDULER_NO_TASK )
+ if (measure_task != NULL )
{
GNUNET_SCHEDULER_cancel (measure_task);
- measure_task = GNUNET_SCHEDULER_NO_TASK;
+ measure_task = NULL;
}
- if (delayed_end_task != GNUNET_SCHEDULER_NO_TASK )
+ if (delayed_end_task != NULL )
{
GNUNET_SCHEDULER_cancel (delayed_end_task);
- delayed_end_task = GNUNET_SCHEDULER_NO_TASK;
+ delayed_end_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 != p1_stat)
@@ -270,10 +270,10 @@ clean_up ()
p2_stat = 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 (th != NULL )
@@ -308,7 +308,7 @@ end ()
int result = 0;
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- delayed_end_task = GNUNET_SCHEDULER_NO_TASK;
+ delayed_end_task = NULL;
FPRINTF (stderr, "\n");
if (p1_switch_attempts > 0)
{
@@ -365,7 +365,7 @@ end ()
static void
end_badly ()
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
FPRINTF (stderr, "Peer 1 had %u addresses available, but did not try to switch\n",
@@ -432,7 +432,7 @@ notify_ready (void *cls, size_t size, void *buf)
{
GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready for message\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL );
res = 1;
@@ -534,7 +534,7 @@ measure (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
static int counter;
- measure_task = GNUNET_SCHEDULER_NO_TASK;
+ measure_task = NULL;
counter++;
if ((DURATION.rel_value_us / 1000 / 1000LL) < counter)
@@ -608,7 +608,7 @@ run (void *cls, char * const *args, const char *cfgfile,
if ((p1 == NULL )|| (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -657,7 +657,7 @@ run (void *cls, char * const *args, const char *cfgfile,
if ((p1_stat == NULL )|| (p2_stat == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not create statistics for peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c
index 4456c1dbf..ce6db8ad1 100644
--- a/src/transport/test_transport_api.c
+++ b/src/transport/test_transport_api.c
@@ -58,9 +58,9 @@ static int s_connected;
static int s_sending;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier send_task;
+static struct GNUNET_SCHEDULER_Task * send_task;
static struct PeerContext *p1;
@@ -82,10 +82,10 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
if (th != NULL)
@@ -99,12 +99,12 @@ end ()
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_INFO, "Fail! Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
if (cc != NULL)
@@ -197,7 +197,7 @@ notify_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -227,7 +227,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -351,7 +351,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -371,7 +371,7 @@ check ()
GNUNET_GETOPT_OPTION_END
};
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_bidirectional_connect.c b/src/transport/test_transport_api_bidirectional_connect.c
index 64f39a4d8..032bf2b6e 100644
--- a/src/transport/test_transport_api_bidirectional_connect.c
+++ b/src/transport/test_transport_api_bidirectional_connect.c
@@ -49,9 +49,9 @@ static char *test_name;
static int ok;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier send_task;
+static struct GNUNET_SCHEDULER_Task * send_task;
static struct PeerContext *p1;
@@ -74,13 +74,13 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
{
GNUNET_SCHEDULER_cancel (send_task);
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
}
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
if (NULL != th)
@@ -97,12 +97,12 @@ end ()
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, "Fail! Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
{
GNUNET_SCHEDULER_cancel (send_task);
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
}
if (NULL != cc2)
@@ -177,7 +177,7 @@ notify_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -206,7 +206,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -260,11 +260,11 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
GNUNET_i2s (peer));
GNUNET_free (ps);
- if (GNUNET_SCHEDULER_NO_TASK != send_task)
+ if (NULL != send_task)
{
GNUNET_SCHEDULER_cancel(send_task);
GNUNET_break (0);
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
}
if (NULL != th)
{
@@ -350,7 +350,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -373,7 +373,7 @@ check ()
#if WRITECONFIG
setTransportOptions ("test_transport_api_data.conf");
#endif
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_blacklisting.c b/src/transport/test_transport_api_blacklisting.c
index 2c3ab125a..09a12cef8 100644
--- a/src/transport/test_transport_api_blacklisting.c
+++ b/src/transport/test_transport_api_blacklisting.c
@@ -62,11 +62,11 @@ static struct GNUNET_TRANSPORT_Blacklist * blacklist_p1;
static struct GNUNET_TRANSPORT_Blacklist * blacklist_p2;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier send_task;
+static struct GNUNET_SCHEDULER_Task * send_task;
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
#if VERBOSE
#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
@@ -80,13 +80,13 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
- 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 (cc != NULL)
@@ -139,16 +139,16 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
{
GNUNET_SCHEDULER_cancel (send_task);
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
}
- if (shutdown_task != GNUNET_SCHEDULER_NO_TASK)
+ if (shutdown_task != NULL)
{
GNUNET_SCHEDULER_cancel (shutdown_task);
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task = NULL;
}
if (cc != NULL)
@@ -225,10 +225,10 @@ notify_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready\n");
- 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;
}
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -257,7 +257,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -359,7 +359,7 @@ blacklist_cb (void *cls,
res = GNUNET_SYSERR;
}
- if (((blacklist_request_p2 == GNUNET_YES) && (blacklist_request_p1 == GNUNET_YES)) && (shutdown_task == GNUNET_SCHEDULER_NO_TASK))
+ if (((blacklist_request_p2 == GNUNET_YES) && (blacklist_request_p1 == GNUNET_YES)) && (shutdown_task == NULL))
{
shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 3), &end, NULL);
}
diff --git a/src/transport/test_transport_api_disconnect.c b/src/transport/test_transport_api_disconnect.c
index 3f8246142..607b3480b 100644
--- a/src/transport/test_transport_api_disconnect.c
+++ b/src/transport/test_transport_api_disconnect.c
@@ -47,9 +47,9 @@ static char *test_name;
static int ok;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier send_task;
+static struct GNUNET_SCHEDULER_Task * send_task;
struct PeerContext *p1;
@@ -79,16 +79,16 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
{
GNUNET_SCHEDULER_cancel (send_task);
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_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 (th != NULL)
@@ -110,7 +110,7 @@ end ()
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, "Fail! Stopping peers\n");
@@ -120,10 +120,10 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
cc = NULL;
}
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
{
GNUNET_SCHEDULER_cancel (send_task);
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
}
if (th != NULL)
@@ -221,7 +221,7 @@ notify_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -250,7 +250,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -347,7 +347,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -367,7 +367,7 @@ check ()
GNUNET_GETOPT_OPTION_END
};
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_limited_sockets.c b/src/transport/test_transport_api_limited_sockets.c
index 617be38d4..cc1953f77 100644
--- a/src/transport/test_transport_api_limited_sockets.c
+++ b/src/transport/test_transport_api_limited_sockets.c
@@ -55,9 +55,9 @@ static char *test_name;
static int ok;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier send_task;
+static struct GNUNET_SCHEDULER_Task * send_task;
static struct PeerContext *p1;
@@ -85,10 +85,10 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
if (th != NULL)
@@ -104,11 +104,11 @@ end ()
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, "Fail! Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
if (cc != NULL)
@@ -197,7 +197,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
static void
sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -259,7 +259,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -282,7 +282,7 @@ check ()
#if WRITECONFIG
setTransportOptions ("test_transport_api_data.conf");
#endif
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_manipulation_cfg.c b/src/transport/test_transport_api_manipulation_cfg.c
index 49e74ffaf..e7cccb812 100644
--- a/src/transport/test_transport_api_manipulation_cfg.c
+++ b/src/transport/test_transport_api_manipulation_cfg.c
@@ -67,9 +67,9 @@ static int s_connected;
static int s_sending;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier send_task;
+static struct GNUNET_SCHEDULER_Task * send_task;
static struct PeerContext *p1;
@@ -93,10 +93,10 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
if (th != NULL)
@@ -110,12 +110,12 @@ end ()
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, "Fail! Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
if (cc != NULL)
@@ -172,7 +172,7 @@ notify_request_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -201,7 +201,7 @@ notify_request_ready (void *cls, size_t size, void *buf)
static void
sendtask_request_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -232,7 +232,7 @@ notify_response_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Timeout occurred while waiting for transmit_ready\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -261,7 +261,7 @@ notify_response_ready (void *cls, size_t size, void *buf)
static void
sendtask_response_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -458,7 +458,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -478,7 +478,7 @@ check ()
GNUNET_GETOPT_OPTION_END
};
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_manipulation_recv_tcp.c b/src/transport/test_transport_api_manipulation_recv_tcp.c
index 6b86e9ff1..76bd360ab 100644
--- a/src/transport/test_transport_api_manipulation_recv_tcp.c
+++ b/src/transport/test_transport_api_manipulation_recv_tcp.c
@@ -59,9 +59,9 @@ static int s_connected;
static int s_sending;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier send_task;
+static struct GNUNET_SCHEDULER_Task * send_task;
static struct PeerContext *p1;
@@ -90,10 +90,10 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
if (th != NULL)
@@ -107,12 +107,12 @@ end ()
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, "Fail! Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
if (cc != NULL)
@@ -252,7 +252,7 @@ notify_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -282,7 +282,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -416,7 +416,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -436,7 +436,7 @@ check ()
GNUNET_GETOPT_OPTION_END
};
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_manipulation_send_tcp.c b/src/transport/test_transport_api_manipulation_send_tcp.c
index 381d7d38a..f1ead389c 100644
--- a/src/transport/test_transport_api_manipulation_send_tcp.c
+++ b/src/transport/test_transport_api_manipulation_send_tcp.c
@@ -59,9 +59,9 @@ static int s_connected;
static int s_sending;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier send_task;
+static struct GNUNET_SCHEDULER_Task * send_task;
static struct PeerContext *p1;
@@ -90,10 +90,10 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
if (th != NULL)
@@ -107,12 +107,12 @@ end ()
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, "Fail! Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
if (cc != NULL)
@@ -244,7 +244,7 @@ notify_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -275,7 +275,7 @@ static void
sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_ATS_Information ats[1];
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -424,7 +424,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -444,7 +444,7 @@ check ()
GNUNET_GETOPT_OPTION_END
};
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_monitor_peers.c b/src/transport/test_transport_api_monitor_peers.c
index fd6abe53b..ef425d444 100644
--- a/src/transport/test_transport_api_monitor_peers.c
+++ b/src/transport/test_transport_api_monitor_peers.c
@@ -53,9 +53,9 @@ static int s_connected;
static int s_sending;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier send_task;
+static struct GNUNET_SCHEDULER_Task * send_task;
static struct PeerContext *p1;
@@ -90,13 +90,13 @@ end ()
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
- 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 (th != NULL)
@@ -131,12 +131,12 @@ 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_INFO, "Fail! Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
if (cc != NULL)
@@ -227,7 +227,7 @@ notify_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -257,7 +257,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -460,7 +460,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -480,7 +480,7 @@ check ()
GNUNET_GETOPT_OPTION_END
};
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_monitor_validation.c b/src/transport/test_transport_api_monitor_validation.c
index 11839b20c..261f1a7d0 100644
--- a/src/transport/test_transport_api_monitor_validation.c
+++ b/src/transport/test_transport_api_monitor_validation.c
@@ -56,9 +56,9 @@ static int s_connected;
static int s_sending;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier send_task;
+static struct GNUNET_SCHEDULER_Task * send_task;
static struct PeerContext *p1;
@@ -92,10 +92,10 @@ end ()
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
if (th != NULL)
@@ -124,12 +124,12 @@ end ()
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_INFO, "Fail! Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
if (cc != NULL)
@@ -219,7 +219,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
if ((0 >= p1_c) || (0 >= p2_c))
{
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
}
@@ -240,7 +240,7 @@ notify_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -270,7 +270,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -454,7 +454,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -474,7 +474,7 @@ check ()
GNUNET_GETOPT_OPTION_END
};
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c
index 07213722e..a727d3e6a 100644
--- a/src/transport/test_transport_api_reliability.c
+++ b/src/transport/test_transport_api_reliability.c
@@ -107,7 +107,7 @@ char *cfg_file_p2;
/**
* Timeout task
*/
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
/**
* Transport transmit handle used
@@ -190,7 +190,7 @@ end ()
"kb/s");
GNUNET_free (value_name);
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
if (th != NULL)
@@ -224,7 +224,7 @@ static void
end_badly ()
{
int i;
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
if (test_connected == GNUNET_YES)
@@ -347,7 +347,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Expected message %u of size %u, got %u bytes of message %u\n",
ntohl (hdr->num), s, ntohs (message->size), ntohl (hdr->num));
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
test_sending = GNUNET_YES;
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
@@ -360,7 +360,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Expected message %u with bits %u, but body did not match\n",
ntohl (hdr->num), (unsigned char) n);
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
test_sending = GNUNET_YES;
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
@@ -384,7 +384,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
if (0 == (n % (TOTAL_MSGS / 100)))
{
FPRINTF (stderr, "%s", ".");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
}
@@ -412,7 +412,7 @@ notify_ready (void *cls, size_t size, void *buf)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready for msg %u of %u\n",
msg_scheduled, TOTAL_MSGS);
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -460,7 +460,7 @@ notify_ready (void *cls, size_t size, void *buf)
{
FPRINTF (stderr, "%s", "\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All messages scheduled to be sent\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
}
@@ -554,7 +554,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
//die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
diff --git a/src/transport/test_transport_api_restart_1peer.c b/src/transport/test_transport_api_restart_1peer.c
index f0d5d5660..b77d8d0df 100644
--- a/src/transport/test_transport_api_restart_1peer.c
+++ b/src/transport/test_transport_api_restart_1peer.c
@@ -45,11 +45,11 @@ static char *test_name;
static int ok;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier send_task;
+static struct GNUNET_SCHEDULER_Task * send_task;
-static GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+static struct GNUNET_SCHEDULER_Task * reconnect_task;
static struct PeerContext *p1;
@@ -77,17 +77,17 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
- if (reconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (reconnect_task != NULL)
GNUNET_SCHEDULER_cancel (reconnect_task);
- reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ reconnect_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 (th != NULL)
GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
@@ -102,7 +102,7 @@ end ()
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, "Fail! Stopping peers\n");
@@ -112,13 +112,13 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (restarted == GNUNET_NO)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peer was NOT restarted\n");
- if (reconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (reconnect_task != NULL)
GNUNET_SCHEDULER_cancel (reconnect_task);
- reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ reconnect_task = NULL;
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if (cc != NULL)
{
@@ -144,7 +144,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct PeerContext *p = cls;
- reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ reconnect_task = NULL;
GNUNET_TRANSPORT_try_connect (p->th, &p2->id, NULL, NULL); /*FIXME TRY_CONNECT change */
reconnect_task =
@@ -214,7 +214,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
{
GNUNET_break (0);
ok = 1;
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
}
@@ -233,7 +233,7 @@ notify_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -262,7 +262,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -340,9 +340,9 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
if (th != NULL)
GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
th = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != send_task)
+ if (NULL != send_task)
GNUNET_SCHEDULER_cancel (send_task);
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
}
static void
@@ -405,7 +405,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -425,7 +425,7 @@ check ()
GNUNET_GETOPT_OPTION_END
};
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_restart_2peers.c b/src/transport/test_transport_api_restart_2peers.c
index 3b5d63bce..25054b536 100644
--- a/src/transport/test_transport_api_restart_2peers.c
+++ b/src/transport/test_transport_api_restart_2peers.c
@@ -45,11 +45,11 @@ static char *test_name;
static int ok;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier send_task;
+static struct GNUNET_SCHEDULER_Task * send_task;
-static GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+static struct GNUNET_SCHEDULER_Task * reconnect_task;
static struct PeerContext *p1;
@@ -72,17 +72,17 @@ static void
end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
- if (reconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (reconnect_task != NULL)
GNUNET_SCHEDULER_cancel (reconnect_task);
- reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ reconnect_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 (th != NULL)
GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
@@ -96,7 +96,7 @@ end ()
static void
end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
if (restarted == GNUNET_YES)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peer was restarted, but communication did not resume\n");
@@ -104,13 +104,13 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (restarted == GNUNET_NO)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Peer was NOT (even) restarted\n");
- if (reconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (reconnect_task != NULL)
GNUNET_SCHEDULER_cancel (reconnect_task);
- reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ reconnect_task = NULL;
- if (send_task != GNUNET_SCHEDULER_NO_TASK)
+ if (send_task != NULL)
GNUNET_SCHEDULER_cancel (send_task);
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if (cc != NULL)
{
@@ -137,7 +137,7 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct PeerContext *p = cls;
- reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ reconnect_task = NULL;
GNUNET_TRANSPORT_try_connect (p1->th, &p2->id, NULL, NULL); /*FIXME TRY_CONNECT change */
reconnect_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &reconnect, p);
@@ -212,7 +212,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
{
GNUNET_break (0);
ok = 1;
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
}
@@ -230,7 +230,7 @@ notify_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -259,7 +259,7 @@ notify_ready (void *cls, size_t size, void *buf)
static void
sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -321,9 +321,9 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
if (th != NULL)
GNUNET_TRANSPORT_notify_transmit_ready_cancel (th);
th = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != send_task)
+ if (NULL != send_task)
GNUNET_SCHEDULER_cancel (send_task);
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
}
@@ -386,7 +386,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -406,7 +406,7 @@ check ()
GNUNET_GETOPT_OPTION_END
};
- send_task = GNUNET_SCHEDULER_NO_TASK;
+ send_task = NULL;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, test_name,
diff --git a/src/transport/test_transport_api_timeout.c b/src/transport/test_transport_api_timeout.c
index 01af9f81b..d243e8fbe 100644
--- a/src/transport/test_transport_api_timeout.c
+++ b/src/transport/test_transport_api_timeout.c
@@ -48,9 +48,9 @@ static char *test_name;
static int ok;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier timer_task;
+static struct GNUNET_SCHEDULER_Task * timer_task;
static struct GNUNET_TRANSPORT_TESTING_handle *tth;
@@ -85,16 +85,16 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- if (timer_task != GNUNET_SCHEDULER_NO_TASK)
+ if (timer_task != NULL)
{
GNUNET_SCHEDULER_cancel (timer_task);
- timer_task = GNUNET_SCHEDULER_NO_TASK;
+ timer_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 (th != NULL)
@@ -123,14 +123,14 @@ end ()
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, "Fail! Stopping peers\n");
- if (timer_task != GNUNET_SCHEDULER_NO_TASK)
+ if (timer_task != NULL)
{
GNUNET_SCHEDULER_cancel (timer_task);
- timer_task = GNUNET_SCHEDULER_NO_TASK;
+ timer_task = NULL;
}
if (cc != NULL)
GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc);
@@ -185,7 +185,7 @@ timer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
static int percentage;
- timer_task = GNUNET_SCHEDULER_NO_TASK;
+ timer_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -228,7 +228,7 @@ testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls)
GNUNET_STRINGS_relative_time_to_string (WAIT,
GNUNET_YES));
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_delayed (WAIT, &end_badly, NULL);
@@ -279,7 +279,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
@@ -298,7 +298,7 @@ check ()
GNUNET_GETOPT_OPTION_END
};
- timer_task = GNUNET_SCHEDULER_NO_TASK;
+ timer_task = NULL;
ok = 1;
GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
diff --git a/src/transport/test_transport_api_unreliability_constant.c b/src/transport/test_transport_api_unreliability_constant.c
index 2ff1e4b0c..c859e802e 100644
--- a/src/transport/test_transport_api_unreliability_constant.c
+++ b/src/transport/test_transport_api_unreliability_constant.c
@@ -49,7 +49,7 @@ static char *test_name;
static int ok;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
struct PeerContext *p1;
@@ -134,7 +134,7 @@ end ()
"kb/s");
GNUNET_free (value_name);
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
if (th != NULL)
@@ -160,7 +160,7 @@ end ()
static void
end_badly ()
{
- die_task = GNUNET_SCHEDULER_NO_TASK;
+ die_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
if (test_failed == GNUNET_NO)
@@ -223,7 +223,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Expected message no %u, got %u\n",
msg_recv_expected, msg_recv);
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
test_failed = GNUNET_YES;
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
@@ -236,7 +236,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Expected message %u of size %u, got %u bytes of message %u\n",
ntohl (hdr->num), s, ntohs (message->size), ntohl (hdr->num));
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
test_failed = GNUNET_YES;
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
@@ -249,7 +249,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Expected message %u with bits %u, but body did not match\n",
ntohl (hdr->num), (unsigned char) n);
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
test_failed = GNUNET_YES;
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
@@ -266,7 +266,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
if (0 == (n % (TOTAL_MSGS / 100)))
{
FPRINTF (stderr, "%s", ".");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
test_failed = GNUNET_YES;
die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
@@ -296,7 +296,7 @@ notify_ready (void *cls, size_t size, void *buf)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Timeout occurred while waiting for transmit_ready\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
ok = 42;
@@ -343,7 +343,7 @@ notify_ready (void *cls, size_t size, void *buf)
FPRINTF (stderr, "%s", "\n");
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"All messages scheduled to be sent!!\n");
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL);
}
@@ -434,7 +434,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if ((p1 == NULL) || (p2 == NULL))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Fail! Could not start peers!\n");
- if (die_task != GNUNET_SCHEDULER_NO_TASK)
+ if (die_task != NULL)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
diff --git a/src/transport/test_transport_blacklisting.c b/src/transport/test_transport_blacklisting.c
index fff27b69f..a14944a14 100644
--- a/src/transport/test_transport_blacklisting.c
+++ b/src/transport/test_transport_blacklisting.c
@@ -73,11 +73,11 @@ static int stage;
static int ok;
static int connected;
-static GNUNET_SCHEDULER_TaskIdentifier die_task;
+static struct GNUNET_SCHEDULER_Task * die_task;
-static GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+static struct GNUNET_SCHEDULER_Task * timeout_task;
-static GNUNET_SCHEDULER_TaskIdentifier stage_task;
+static struct GNUNET_SCHEDULER_Task * stage_task;
#if VERBOSE
#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0)
@@ -93,22 +93,22 @@ end(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping\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 (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 (stage_task != GNUNET_SCHEDULER_NO_TASK )
+ if (stage_task != NULL )
{
GNUNET_SCHEDULER_cancel (stage_task);
- stage_task = GNUNET_SCHEDULER_NO_TASK;
+ stage_task = NULL;
}
if (cc != NULL )
@@ -132,18 +132,18 @@ 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;
- 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 (stage_task != GNUNET_SCHEDULER_NO_TASK )
+ if (stage_task != NULL )
{
GNUNET_SCHEDULER_cancel (stage_task);
- stage_task = GNUNET_SCHEDULER_NO_TASK;
+ stage_task = NULL;
}
if (cc != NULL )
@@ -176,7 +176,7 @@ static void
connect_timeout(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Peers not connected, next stage\n");
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL );
}
@@ -246,8 +246,8 @@ static int check_blacklist_config (char *cfg_file,
static void
run_stage(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- stage_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != die_task)
+ stage_task = NULL;
+ if (NULL != die_task)
GNUNET_SCHEDULER_cancel (die_task);
die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL );
GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Running stage %u\n", stage);
diff --git a/src/transport/test_transport_startonly.c b/src/transport/test_transport_startonly.c
index 2deb3f58b..78ed825ac 100644
--- a/src/transport/test_transport_startonly.c
+++ b/src/transport/test_transport_startonly.c
@@ -37,7 +37,7 @@
#define ITERATIONS 10
-GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+struct GNUNET_SCHEDULER_Task * timeout_task;
static struct PeerContext *p1;
@@ -54,10 +54,10 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\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;
}
GNUNET_TRANSPORT_TESTING_done (tth);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting\n");
@@ -68,7 +68,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
diff --git a/src/transport/test_transport_testing.c b/src/transport/test_transport_testing.c
index 747168b17..fb5bf6068 100644
--- a/src/transport/test_transport_testing.c
+++ b/src/transport/test_transport_testing.c
@@ -34,7 +34,7 @@
*/
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
-GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+struct GNUNET_SCHEDULER_Task * timeout_task;
static struct PeerContext *p1;
static struct PeerContext *p2;
@@ -52,7 +52,7 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- if (timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (timeout_task != NULL)
GNUNET_SCHEDULER_cancel (timeout_task);
GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1);
@@ -64,7 +64,7 @@ end ()
static void
end_badly ()
{
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
if (NULL != cc)
@@ -167,7 +167,7 @@ run (void *cls, char *const *args, const char *cfgfile,
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Peer1 was not started successfully\n");
- if (timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (timeout_task != NULL)
GNUNET_SCHEDULER_cancel (timeout_task);
timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
}
@@ -175,7 +175,7 @@ run (void *cls, char *const *args, const char *cfgfile,
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Peer2 was not started successfully\n");
- if (timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (timeout_task != NULL)
GNUNET_SCHEDULER_cancel (timeout_task);
timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
}
diff --git a/src/transport/test_transport_testing_restart.c b/src/transport/test_transport_testing_restart.c
index 8ca18f982..8a238cbd5 100644
--- a/src/transport/test_transport_testing_restart.c
+++ b/src/transport/test_transport_testing_restart.c
@@ -32,7 +32,7 @@
*/
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
-GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+struct GNUNET_SCHEDULER_Task * timeout_task;
static struct PeerContext *p;
@@ -45,7 +45,7 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- if (timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (timeout_task != NULL)
GNUNET_SCHEDULER_cancel (timeout_task);
GNUNET_TRANSPORT_TESTING_stop_peer (tth, p);
@@ -55,7 +55,7 @@ end ()
static void
end_badly ()
{
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
if (NULL != p)
@@ -119,7 +119,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if (NULL == p)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to start peer\n");
- if (timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (timeout_task != NULL)
GNUNET_SCHEDULER_cancel (timeout_task);
timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
}
diff --git a/src/transport/test_transport_testing_startstop.c b/src/transport/test_transport_testing_startstop.c
index 22a4e5148..736c635e1 100644
--- a/src/transport/test_transport_testing_startstop.c
+++ b/src/transport/test_transport_testing_startstop.c
@@ -32,7 +32,7 @@
*/
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)
-GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+struct GNUNET_SCHEDULER_Task * timeout_task;
static struct PeerContext *p;
@@ -45,7 +45,7 @@ end ()
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
- if (timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (timeout_task != NULL)
GNUNET_SCHEDULER_cancel (timeout_task);
GNUNET_TRANSPORT_TESTING_stop_peer (tth, p);
@@ -55,7 +55,7 @@ end ()
static void
end_badly ()
{
- timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ timeout_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
if (NULL != p)
@@ -100,7 +100,7 @@ run (void *cls, char *const *args, const char *cfgfile,
if (NULL == p)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Failed to start peer\n");
- if (timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (timeout_task != NULL)
GNUNET_SCHEDULER_cancel (timeout_task);
timeout_task = GNUNET_SCHEDULER_add_now (&end_badly, NULL);
}
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c
index d25d3f4b7..517daf82a 100644
--- a/src/transport/transport-testing.c
+++ b/src/transport/transport-testing.c
@@ -193,7 +193,7 @@ try_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct PeerContext *p1 = cc->p1;
struct PeerContext *p2 = cc->p2;
- cc->tct = GNUNET_SCHEDULER_NO_TASK;
+ cc->tct = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -534,9 +534,9 @@ GNUNET_TRANSPORT_TESTING_connect_peers_cancel (struct
"Canceling connect request %p!\n",
cc);
- if (cc->tct != GNUNET_SCHEDULER_NO_TASK)
+ if (cc->tct != NULL)
GNUNET_SCHEDULER_cancel (cc->tct);
- cc->tct = GNUNET_SCHEDULER_NO_TASK;
+ cc->tct = NULL;
GNUNET_CONTAINER_DLL_remove (tth->cc_head, tth->cc_tail, cc);
GNUNET_free (cc);
diff --git a/src/transport/transport-testing.h b/src/transport/transport-testing.h
index 99225936a..a010733e7 100644
--- a/src/transport/transport-testing.h
+++ b/src/transport/transport-testing.h
@@ -153,7 +153,7 @@ struct ConnectingContext
struct ConnectingContext *prev;
struct PeerContext *p1;
struct PeerContext *p2;
- GNUNET_SCHEDULER_TaskIdentifier tct;
+ struct GNUNET_SCHEDULER_Task * tct;
GNUNET_TRANSPORT_TESTING_connect_cb cb;
void *cb_cls;
struct GNUNET_TRANSPORT_Handle *th_p1;
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index 7fa035c06..fd352a1e5 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -84,7 +84,7 @@ struct GNUNET_TRANSPORT_TransmitHandle
* Task to trigger request timeout if the request is stalled due to
* congestion.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* How many bytes is our notify callback waiting for?
@@ -171,7 +171,7 @@ struct GNUNET_TRANSPORT_GetHelloHandle
/**
* Task for calling the HelloUpdateCallback when we already have a HELLO
*/
- GNUNET_SCHEDULER_TaskIdentifier notify_task;
+ struct GNUNET_SCHEDULER_Task * notify_task;
/**
* Closure for @e rec.
@@ -295,7 +295,7 @@ struct GNUNET_TRANSPORT_OfferHelloHandle
/**
* Function to call once we are done.
*/
- GNUNET_SCHEDULER_Task cont;
+ GNUNET_SCHEDULER_TaskCallback cont;
/**
* Closure for @e cont
@@ -434,7 +434,7 @@ struct GNUNET_TRANSPORT_Handle
/**
* ID of the task trying to reconnect to the service.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* ID of the task trying to trigger transmission for a peer while
@@ -442,7 +442,7 @@ struct GNUNET_TRANSPORT_Handle
* messages and the smallest entry in the 'ready_heap' has a time
* stamp in the future.
*/
- GNUNET_SCHEDULER_TaskIdentifier quota_task;
+ struct GNUNET_SCHEDULER_Task * quota_task;
/**
* Delay until we try to reconnect.
@@ -754,9 +754,9 @@ demultiplexer (void *cls,
n->is_ready = GNUNET_YES;
if ((NULL != n->th) && (NULL == n->hn))
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != n->th->timeout_task);
+ GNUNET_assert (NULL != n->th->timeout_task);
GNUNET_SCHEDULER_cancel (n->th->timeout_task);
- n->th->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ n->th->timeout_task = NULL;
/* we've been waiting for this (congestion, not quota,
* caused delayed transmission) */
n->hn = GNUNET_CONTAINER_heap_insert (h->ready_heap, n, 0);
@@ -835,7 +835,7 @@ timeout_request_due_to_congestion (void *cls,
struct GNUNET_TRANSPORT_TransmitHandle *th = cls;
struct Neighbour *n = th->neighbour;
- n->th->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ n->th->timeout_task = NULL;
GNUNET_assert (th == n->th);
GNUNET_assert (NULL == n->hn);
n->th = NULL;
@@ -897,7 +897,7 @@ transport_notify_ready (void *cls, size_t size, void *buf)
/* peer not ready, wait for notification! */
GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap));
n->hn = NULL;
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == n->th->timeout_task);
+ GNUNET_assert (NULL == n->th->timeout_task);
n->th->timeout_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
(n->th->timeout),
@@ -963,7 +963,7 @@ schedule_transmission_task (void *cls,
struct GNUNET_TRANSPORT_TransmitHandle *th;
struct Neighbour *n;
- h->quota_task = GNUNET_SCHEDULER_NO_TASK;
+ h->quota_task = NULL;
GNUNET_assert (NULL != h->client);
/* destroy all requests that have timed out */
while ((NULL != (n = GNUNET_CONTAINER_heap_peek (h->ready_heap))) &&
@@ -1018,10 +1018,10 @@ schedule_transmission (struct GNUNET_TRANSPORT_Handle *h)
struct Neighbour *n;
GNUNET_assert (NULL != h->client);
- if (h->quota_task != GNUNET_SCHEDULER_NO_TASK)
+ if (h->quota_task != NULL)
{
GNUNET_SCHEDULER_cancel (h->quota_task);
- h->quota_task = GNUNET_SCHEDULER_NO_TASK;
+ h->quota_task = NULL;
}
if (NULL != h->control_head)
delay = GNUNET_TIME_UNIT_ZERO;
@@ -1127,7 +1127,7 @@ reconnect (void *cls,
{
struct GNUNET_TRANSPORT_Handle *h = cls;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
/* shutdown, just give up */
@@ -1158,7 +1158,7 @@ disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h)
{
struct GNUNET_TRANSPORT_TransmitHandle *th;
- GNUNET_assert (h->reconnect_task == GNUNET_SCHEDULER_NO_TASK);
+ GNUNET_assert (h->reconnect_task == NULL);
if (NULL != h->cth)
{
GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth);
@@ -1174,10 +1174,10 @@ disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h)
/* Forget about all neighbours that we used to be connected to */
GNUNET_CONTAINER_multipeermap_iterate (h->neighbours,
&neighbour_delete, h);
- if (h->quota_task != GNUNET_SCHEDULER_NO_TASK)
+ if (h->quota_task != NULL)
{
GNUNET_SCHEDULER_cancel (h->quota_task);
- h->quota_task = GNUNET_SCHEDULER_NO_TASK;
+ h->quota_task = NULL;
}
while ((NULL != (th = h->control_head)))
{
@@ -1577,7 +1577,7 @@ GNUNET_TRANSPORT_set_traffic_metric (struct GNUNET_TRANSPORT_Handle *handle,
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)
{
struct GNUNET_TRANSPORT_OfferHelloHandle *ohh;
struct GNUNET_MessageHeader *msg;
@@ -1663,8 +1663,8 @@ call_hello_update_cb_async (void *cls,
struct GNUNET_TRANSPORT_GetHelloHandle *ghh = cls;
GNUNET_assert (NULL != ghh->handle->my_hello);
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != ghh->notify_task);
- ghh->notify_task = GNUNET_SCHEDULER_NO_TASK;
+ GNUNET_assert (NULL != ghh->notify_task);
+ ghh->notify_task = NULL;
ghh->rec (ghh->rec_cls,
(const struct GNUNET_MessageHeader *) ghh->handle->my_hello);
}
@@ -1711,7 +1711,7 @@ GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_GetHelloHandle *ghh)
{
struct GNUNET_TRANSPORT_Handle *handle = ghh->handle;
- if (GNUNET_SCHEDULER_NO_TASK != ghh->notify_task)
+ if (NULL != ghh->notify_task)
GNUNET_SCHEDULER_cancel (ghh->notify_task);
GNUNET_CONTAINER_DLL_remove (handle->hwl_head, handle->hwl_tail, ghh);
GNUNET_free (ghh);
@@ -1810,20 +1810,20 @@ GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle)
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Transport disconnect called!\n");
/* this disconnects all neighbours... */
- if (handle->reconnect_task == GNUNET_SCHEDULER_NO_TASK)
+ if (handle->reconnect_task == NULL)
disconnect_and_schedule_reconnect (handle);
/* and now we stop trying to connect again... */
- 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->neighbours);
handle->neighbours = NULL;
- if (handle->quota_task != GNUNET_SCHEDULER_NO_TASK)
+ if (handle->quota_task != NULL)
{
GNUNET_SCHEDULER_cancel (handle->quota_task);
- handle->quota_task = GNUNET_SCHEDULER_NO_TASK;
+ handle->quota_task = NULL;
}
GNUNET_free_non_null (handle->my_hello);
handle->my_hello = NULL;
@@ -1926,9 +1926,9 @@ GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct GNUNET_TRANSPORT_TransmitH
}
else
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != th->timeout_task);
+ GNUNET_assert (NULL != th->timeout_task);
GNUNET_SCHEDULER_cancel (th->timeout_task);
- th->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ th->timeout_task = NULL;
}
GNUNET_free (th);
}
diff --git a/src/transport/transport_api_monitor_peers.c b/src/transport/transport_api_monitor_peers.c
index 611580f68..aaf1000f6 100644
--- a/src/transport/transport_api_monitor_peers.c
+++ b/src/transport/transport_api_monitor_peers.c
@@ -74,7 +74,7 @@ struct GNUNET_TRANSPORT_PeerMonitoringContext
/**
* Task ID for reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Identity of the peer to monitor.
@@ -212,7 +212,7 @@ do_peer_connect (void *cls,
{
struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx = cls;
- pal_ctx->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ pal_ctx->reconnect_task = NULL;
pal_ctx->client = GNUNET_CLIENT_connect ("transport", pal_ctx->cfg);
GNUNET_assert (NULL != pal_ctx->client);
send_peer_mon_request (pal_ctx);
@@ -455,10 +455,10 @@ GNUNET_TRANSPORT_monitor_peers_cancel (struct GNUNET_TRANSPORT_PeerMonitoringCon
GNUNET_CLIENT_disconnect (pic->client);
pic->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pic->reconnect_task)
+ if (NULL != pic->reconnect_task)
{
GNUNET_SCHEDULER_cancel (pic->reconnect_task);
- pic->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ pic->reconnect_task = NULL;
}
GNUNET_free (pic);
}
diff --git a/src/transport/transport_api_monitor_plugins.c b/src/transport/transport_api_monitor_plugins.c
index 0c6cb9214..6ecee9c98 100644
--- a/src/transport/transport_api_monitor_plugins.c
+++ b/src/transport/transport_api_monitor_plugins.c
@@ -72,7 +72,7 @@ struct GNUNET_TRANSPORT_PluginMonitor
/**
* Task ID for reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
};
@@ -141,7 +141,7 @@ do_plugin_connect (void *cls,
{
struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
- pm->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ pm->reconnect_task = NULL;
pm->client = GNUNET_CLIENT_connect ("transport", pm->cfg);
GNUNET_assert (NULL != pm->client);
send_plugin_mon_request (pm);
@@ -442,10 +442,10 @@ GNUNET_TRANSPORT_monitor_plugins_cancel (struct GNUNET_TRANSPORT_PluginMonitor *
GNUNET_CLIENT_disconnect (pm->client);
pm->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != pm->reconnect_task)
+ if (NULL != pm->reconnect_task)
{
GNUNET_SCHEDULER_cancel (pm->reconnect_task);
- pm->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ pm->reconnect_task = NULL;
}
clear_map (pm);
GNUNET_CONTAINER_multihashmap32_destroy (pm->sessions);
diff --git a/src/transport/transport_api_monitor_validation.c b/src/transport/transport_api_monitor_validation.c
index 621a6b00e..a82e3c156 100644
--- a/src/transport/transport_api_monitor_validation.c
+++ b/src/transport/transport_api_monitor_validation.c
@@ -72,7 +72,7 @@ struct GNUNET_TRANSPORT_ValidationMonitoringContext
/**
* Task ID for reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Identity of the peer to monitor.
@@ -162,7 +162,7 @@ do_val_connect (void *cls,
{
struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx = cls;
- val_ctx->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ val_ctx->reconnect_task = NULL;
val_ctx->client = GNUNET_CLIENT_connect ("transport", val_ctx->cfg);
GNUNET_assert (NULL != val_ctx->client);
send_val_mon_request (val_ctx);
@@ -412,10 +412,10 @@ GNUNET_TRANSPORT_monitor_validation_entries_cancel (struct GNUNET_TRANSPORT_Vali
GNUNET_CLIENT_disconnect (vic->client);
vic->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != vic->reconnect_task)
+ if (NULL != vic->reconnect_task)
{
GNUNET_SCHEDULER_cancel (vic->reconnect_task);
- vic->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ vic->reconnect_task = NULL;
}
GNUNET_free (vic);
}