summaryrefslogtreecommitdiff
path: root/src/cadet
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/cadet
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/cadet')
-rw-r--r--src/cadet/cadet_api.c22
-rw-r--r--src/cadet/cadet_path.c8
-rw-r--r--src/cadet/cadet_path.h2
-rw-r--r--src/cadet/gnunet-cadet-profiler.c30
-rw-r--r--src/cadet/gnunet-cadet.c4
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c26
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c52
-rw-r--r--src/cadet/gnunet-service-cadet_dht.c8
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c70
-rw-r--r--src/cadet/test_cadet.c28
-rw-r--r--src/cadet/test_cadet_local.c14
-rw-r--r--src/cadet/test_cadet_single.c14
12 files changed, 139 insertions, 139 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index ddd1755cc..43fe3535f 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -78,7 +78,7 @@ struct GNUNET_CADET_TransmitHandle
/**
* Task triggering a timeout, can be NO_TASK if the timeout is FOREVER.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Size of 'data' -- or the desired size of 'notify' if 'data' is NULL.
@@ -210,7 +210,7 @@ struct GNUNET_CADET_Handle
/**
* Task for trying to reconnect.
*/
- GNUNET_SCHEDULER_TaskIdentifier reconnect_task;
+ struct GNUNET_SCHEDULER_Task * reconnect_task;
/**
* Callback for an info task (only one active at a time).
@@ -496,7 +496,7 @@ destroy_channel (struct GNUNET_CADET_Channel *ch, int call_cleaner)
GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th);
/* clean up request */
- if (GNUNET_SCHEDULER_NO_TASK != th->timeout_task)
+ if (NULL != th->timeout_task)
GNUNET_SCHEDULER_cancel (th->timeout_task);
GNUNET_free (th);
}
@@ -528,7 +528,7 @@ timeout_transmission (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_CADET_TransmitHandle *th = cls;
struct GNUNET_CADET_Handle *cadet = th->channel->cadet;
- th->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ th->timeout_task = NULL;
th->channel->packet_size = 0;
GNUNET_CONTAINER_DLL_remove (cadet->th_head, cadet->th_tail, th);
if (GNUNET_YES == th_is_payload (th))
@@ -711,7 +711,7 @@ reconnect_cbk (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_CADET_Handle *h = cls;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
do_reconnect (h);
@@ -740,7 +740,7 @@ reconnect (struct GNUNET_CADET_Handle *h)
next = ch->next;
destroy_channel (ch, GNUNET_YES);
}
- if (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task)
+ if (NULL == h->reconnect_task)
h->reconnect_task = GNUNET_SCHEDULER_add_delayed (h->reconnect_time,
&reconnect_cbk, h);
}
@@ -1382,7 +1382,7 @@ send_callback (void *cls, size_t size, void *buf)
psize = th->size;
}
GNUNET_assert (GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE >= psize);
- if (th->timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (th->timeout_task != NULL)
GNUNET_SCHEDULER_cancel (th->timeout_task);
GNUNET_CONTAINER_DLL_remove (h->th_head, h->th_tail, th);
GNUNET_free (th);
@@ -1487,7 +1487,7 @@ GNUNET_CADET_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls,
h->ports = ports;
h->next_chid = GNUNET_CADET_LOCAL_CHANNEL_ID_CLI;
h->reconnect_time = GNUNET_TIME_UNIT_MILLISECONDS;
- h->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ h->reconnect_task = NULL;
if (NULL != ports && ports[0] != 0 && NULL == new_channel)
{
@@ -1576,10 +1576,10 @@ GNUNET_CADET_disconnect (struct GNUNET_CADET_Handle *handle)
GNUNET_CLIENT_disconnect (handle->client);
handle->client = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != handle->reconnect_task)
+ if (NULL != handle->reconnect_task)
{
GNUNET_SCHEDULER_cancel(handle->reconnect_task);
- handle->reconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ handle->reconnect_task = NULL;
}
GNUNET_free (handle);
}
@@ -1761,7 +1761,7 @@ GNUNET_CADET_notify_transmit_ready_cancel (struct GNUNET_CADET_TransmitHandle *t
th->channel->packet_size = 0;
cadet = th->channel->cadet;
- if (th->timeout_task != GNUNET_SCHEDULER_NO_TASK)
+ if (th->timeout_task != NULL)
GNUNET_SCHEDULER_cancel (th->timeout_task);
GNUNET_CONTAINER_DLL_remove (cadet->th_head, cadet->th_tail, th);
GNUNET_free (th);
diff --git a/src/cadet/cadet_path.c b/src/cadet/cadet_path.c
index d1aa9dcf2..c00e417b1 100644
--- a/src/cadet/cadet_path.c
+++ b/src/cadet/cadet_path.c
@@ -48,7 +48,7 @@ path_destroy_delayed (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct CadetPeer *peer;
LOG (GNUNET_ERROR_TYPE_INFO, "Destroy delayed %p (%u)\n", path, path->length);
- path->path_delete = GNUNET_SCHEDULER_NO_TASK;
+ path->path_delete = NULL;
peer = GCP_get_short (path->peers[path->length - 1]);
if (2 < path->length)
GCP_remove_path (peer, path);
@@ -150,7 +150,7 @@ path_get_length (struct CadetPeerPath *path)
void
path_invalidate (struct CadetPeerPath *p)
{
- if (GNUNET_SCHEDULER_NO_TASK != p->path_delete)
+ if (NULL != p->path_delete)
return;
LOG (GNUNET_ERROR_TYPE_INFO, "Invalidating path %p (%u)\n", p, p->length);
@@ -267,7 +267,7 @@ path_equivalent (const struct CadetPeerPath *p1,
int
path_is_valid (const struct CadetPeerPath *path)
{
- return (GNUNET_SCHEDULER_NO_TASK == path->path_delete);
+ return (NULL == path->path_delete);
}
@@ -287,7 +287,7 @@ path_destroy (struct CadetPeerPath *p)
LOG (GNUNET_ERROR_TYPE_INFO, "destroying path %p (%u)\n", p, p->length);
GNUNET_PEER_decrement_rcs (p->peers, p->length);
GNUNET_free_non_null (p->peers);
- if (GNUNET_SCHEDULER_NO_TASK != p->path_delete)
+ if (NULL != p->path_delete)
GNUNET_SCHEDULER_cancel (p->path_delete);
GNUNET_free (p);
return GNUNET_OK;
diff --git a/src/cadet/cadet_path.h b/src/cadet/cadet_path.h
index 761e51156..326626f9d 100644
--- a/src/cadet/cadet_path.h
+++ b/src/cadet/cadet_path.h
@@ -78,7 +78,7 @@ struct CadetPeerPath
* Task to delete the path.
* We tried it, it didn't work, don't try again in a while.
*/
- GNUNET_SCHEDULER_TaskIdentifier path_delete;
+ struct GNUNET_SCHEDULER_Task * path_delete;
};
diff --git a/src/cadet/gnunet-cadet-profiler.c b/src/cadet/gnunet-cadet-profiler.c
index c944caa75..2cfbfdaa4 100644
--- a/src/cadet/gnunet-cadet-profiler.c
+++ b/src/cadet/gnunet-cadet-profiler.c
@@ -147,7 +147,7 @@ struct CadetPeer
/**
* Task to do the next ping.
*/
- GNUNET_SCHEDULER_TaskIdentifier ping_task;
+ struct GNUNET_SCHEDULER_Task * ping_task;
float mean[number_rounds];
float var[number_rounds];
@@ -209,17 +209,17 @@ static struct GNUNET_CADET_TEST_Context *test_ctx;
/**
* Task called to shutdown test.
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
+static struct GNUNET_SCHEDULER_Task * shutdown_handle;
/**
* Task called to disconnect peers, before shutdown.
*/
-static GNUNET_SCHEDULER_TaskIdentifier disconnect_task;
+static struct GNUNET_SCHEDULER_Task * disconnect_task;
/**
* Task to perform tests
*/
-static GNUNET_SCHEDULER_TaskIdentifier test_task;
+static struct GNUNET_SCHEDULER_Task * test_task;
/**
* Round number.
@@ -320,7 +320,7 @@ static void
shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Ending test.\n");
- shutdown_handle = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_handle = NULL;
}
@@ -338,7 +338,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"disconnecting cadet service, called from line %ld\n", line);
- disconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ disconnect_task = NULL;
for (i = 0; i < peers_total; i++)
{
if (NULL != peers[i].op)
@@ -366,7 +366,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
}
}
GNUNET_CADET_TEST_cleanup (test_ctx);
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle)
+ if (NULL != shutdown_handle)
{
GNUNET_SCHEDULER_cancel (shutdown_handle);
}
@@ -382,7 +382,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
static void
abort_test (long line)
{
- if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (disconnect_task != NULL)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
@@ -405,7 +405,7 @@ stats_cont (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg)
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "... collecting statistics done.\n");
GNUNET_TESTBED_operation_done (stats_op);
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
(void *) __LINE__);
@@ -513,9 +513,9 @@ adjust_running_peers (unsigned int target)
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "St%s peer %u: %s\n",
run ? "arting" : "opping", r, GNUNET_i2s (&peers[r].id));
- if (GNUNET_SCHEDULER_NO_TASK != peers[r].ping_task)
+ if (NULL != peers[r].ping_task)
GNUNET_SCHEDULER_cancel (peers[r].ping_task);
- peers[r].ping_task = GNUNET_SCHEDULER_NO_TASK;
+ peers[r].ping_task = NULL;
peers[r].up = run;
@@ -615,7 +615,7 @@ ping (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct CadetPeer *peer = (struct CadetPeer *) cls;
- peer->ping_task = GNUNET_SCHEDULER_NO_TASK;
+ peer->ping_task = NULL;
if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0
|| GNUNET_YES == test_finished)
@@ -797,7 +797,7 @@ incoming_channel (void *cls, struct GNUNET_CADET_Channel *channel,
peers_warmup++;
if (peers_warmup < peers_total)
return NULL;
- if (GNUNET_SCHEDULER_NO_TASK != test_task)
+ if (NULL != test_task)
{
GNUNET_SCHEDULER_cancel (test_task);
test_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
@@ -873,7 +873,7 @@ start_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
enum GNUNET_CADET_ChannelOption flags;
unsigned long i;
- test_task = GNUNET_SCHEDULER_NO_TASK;
+ test_task = NULL;
if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
return;
@@ -898,7 +898,7 @@ start_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
&ping, &peers[i]);
}
peers_running = peers_total;
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply(round_time,
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c
index d6ae66331..2b28685c9 100644
--- a/src/cadet/gnunet-cadet.c
+++ b/src/cadet/gnunet-cadet.c
@@ -87,7 +87,7 @@ struct GNUNET_TIME_Absolute echo_time;
/**
* Task for next echo request.
*/
-GNUNET_SCHEDULER_TaskIdentifier echo_task;
+struct GNUNET_SCHEDULER_Task * echo_task;
/**
* Peer to connect to.
@@ -118,7 +118,7 @@ static struct GNUNET_CADET_Channel *ch;
/**
* Shutdown task handle.
*/
-GNUNET_SCHEDULER_TaskIdentifier sd;
+struct GNUNET_SCHEDULER_Task * sd;
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index cc9cc699a..bb9fa6060 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -183,7 +183,7 @@ struct CadetChannelReliability
/**
* Task to resend/poll in case no ACK is received.
*/
- GNUNET_SCHEDULER_TaskIdentifier retry_task;
+ struct GNUNET_SCHEDULER_Task * retry_task;
/**
* Counter for exponential backoff.
@@ -729,7 +729,7 @@ channel_retransmit_message (void *cls,
struct GNUNET_CADET_Data *payload;
int fwd;
- rel->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ rel->retry_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -763,7 +763,7 @@ channel_recreate (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct CadetChannelReliability *rel = cls;
- rel->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ rel->retry_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -815,7 +815,7 @@ ch_message_sent (void *cls,
GNUNET_assert (chq == copy->chq);
copy->timestamp = GNUNET_TIME_absolute_get ();
rel = copy->rel;
- if (GNUNET_SCHEDULER_NO_TASK == rel->retry_task)
+ if (NULL == rel->retry_task)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "!! scheduling retry in 4 * %s\n",
GNUNET_STRINGS_relative_time_to_string (rel->expected_delay,
@@ -859,7 +859,7 @@ ch_message_sent (void *cls,
&& GNUNET_MESSAGE_TYPE_CADET_DATA_ACK != type
&& GNUNET_NO == rel->ch->destroy)
{
- GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rel->retry_task);
+ GNUNET_assert (NULL == rel->retry_task);
LOG (GNUNET_ERROR_TYPE_DEBUG, "!!! STD BACKOFF %s\n",
GNUNET_STRINGS_relative_time_to_string (rel->retry_timer,
GNUNET_NO));
@@ -1006,10 +1006,10 @@ channel_rel_free_all (struct CadetChannelReliability *rel)
GCT_cancel (rel->uniq->tq);
/* ch_message_sent is called freeing uniq */
}
- if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task)
+ if (NULL != rel->retry_task)
{
GNUNET_SCHEDULER_cancel (rel->retry_task);
- rel->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ rel->retry_task = NULL;
}
GNUNET_free (rel);
}
@@ -1174,10 +1174,10 @@ channel_confirm (struct CadetChannel *ch, int fwd)
if (GCT_get_connections_buffer (ch->t) > 0 || GCT_is_loopback (ch->t))
send_client_ack (ch, fwd);
- if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task)
+ if (NULL != rel->retry_task)
{
GNUNET_SCHEDULER_cancel (rel->retry_task);
- rel->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ rel->retry_task = NULL;
}
else if (NULL != rel->uniq)
{
@@ -2079,10 +2079,10 @@ GCCH_handle_data_ack (struct CadetChannel *ch,
/* If some message was free'd, update the retransmission delay */
if (GNUNET_YES == work)
{
- if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task)
+ if (NULL != rel->retry_task)
{
GNUNET_SCHEDULER_cancel (rel->retry_task);
- rel->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ rel->retry_task = NULL;
if (NULL != rel->head_sent && NULL == rel->head_sent->chq)
{
struct GNUNET_TIME_Absolute new_target;
@@ -2179,12 +2179,12 @@ GCCH_handle_create (struct CadetTunnel *t,
else
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " duplicate create channel\n");
- if (GNUNET_SCHEDULER_NO_TASK != ch->dest_rel->retry_task)
+ if (NULL != ch->dest_rel->retry_task)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " clearing retry task\n");
/* we were waiting to re-send our 'SYNACK', wait no more! */
GNUNET_SCHEDULER_cancel (ch->dest_rel->retry_task);
- ch->dest_rel->retry_task = GNUNET_SCHEDULER_NO_TASK;
+ ch->dest_rel->retry_task = NULL;
}
else if (NULL != ch->dest_rel->uniq)
{
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 50768d413..548eeb9b3 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -95,7 +95,7 @@ struct CadetFlowControl
/**
* Task to poll the peer in case of a lost ACK causes stall.
*/
- GNUNET_SCHEDULER_TaskIdentifier poll_task;
+ struct GNUNET_SCHEDULER_Task * poll_task;
/**
* How frequently to poll for ACKs.
@@ -190,13 +190,13 @@ struct CadetConnection
* Task to keep the used paths alive at the owner,
* time tunnel out on all the other peers.
*/
- GNUNET_SCHEDULER_TaskIdentifier fwd_maintenance_task;
+ struct GNUNET_SCHEDULER_Task * fwd_maintenance_task;
/**
* Task to keep the used paths alive at the destination,
* time tunnel out on all the other peers.
*/
- GNUNET_SCHEDULER_TaskIdentifier bck_maintenance_task;
+ struct GNUNET_SCHEDULER_Task * bck_maintenance_task;
/**
* Queue handle for maintainance traffic. One handle for FWD and BCK since
@@ -400,7 +400,7 @@ fc_init (struct CadetFlowControl *fc)
fc->last_pid_recv = (uint32_t) -1;
fc->last_ack_sent = (uint32_t) 0;
fc->last_ack_recv = (uint32_t) 0;
- fc->poll_task = GNUNET_SCHEDULER_NO_TASK;
+ fc->poll_task = NULL;
fc->poll_time = GNUNET_TIME_UNIT_SECONDS;
fc->queue_n = 0;
fc->queue_max = (max_msgs_queue / max_connections) + 1;
@@ -1008,9 +1008,9 @@ connection_keepalive (struct CadetConnection *c, int fwd, int shutdown)
GC_f2s (fwd), GCC_2s (c));
if (fwd)
- c->fwd_maintenance_task = GNUNET_SCHEDULER_NO_TASK;
+ c->fwd_maintenance_task = NULL;
else
- c->bck_maintenance_task = GNUNET_SCHEDULER_NO_TASK;
+ c->bck_maintenance_task = NULL;
if (GNUNET_NO != shutdown)
return;
@@ -1066,8 +1066,8 @@ static void
schedule_next_keepalive (struct CadetConnection *c, int fwd)
{
struct GNUNET_TIME_Relative delay;
- GNUNET_SCHEDULER_TaskIdentifier *task_id;
- GNUNET_SCHEDULER_Task keepalive_task;
+ struct GNUNET_SCHEDULER_Task * *task_id;
+ GNUNET_SCHEDULER_TaskCallback keepalive_task;
if (GNUNET_NO == GCC_is_origin (c, fwd))
return;
@@ -1100,7 +1100,7 @@ schedule_next_keepalive (struct CadetConnection *c, int fwd)
}
/* Check that no one scheduled it before us */
- if (GNUNET_SCHEDULER_NO_TASK != *task_id)
+ if (NULL != *task_id)
{
/* No need for a _break. It can happen for instance when sending a SYNACK
* for a duplicate SYN: the first SYNACK scheduled the task. */
@@ -1168,10 +1168,10 @@ connection_cancel_queues (struct CadetConnection *c, int fwd)
}
fc = fwd ? &c->fwd_fc : &c->bck_fc;
- if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task)
+ if (NULL != fc->poll_task)
{
GNUNET_SCHEDULER_cancel (fc->poll_task);
- fc->poll_task = GNUNET_SCHEDULER_NO_TASK;
+ fc->poll_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG, " *** Cancel POLL in ccq for fc %p\n", fc);
}
peer = get_hop (c, fwd);
@@ -1236,7 +1236,7 @@ connection_poll (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_CADET_Poll msg;
struct CadetConnection *c;
- fc->poll_task = GNUNET_SCHEDULER_NO_TASK;
+ fc->poll_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
return;
@@ -1316,7 +1316,7 @@ connection_fwd_timeout (void *cls,
{
struct CadetConnection *c = cls;
- c->fwd_maintenance_task = GNUNET_SCHEDULER_NO_TASK;
+ c->fwd_maintenance_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -1358,7 +1358,7 @@ connection_bck_timeout (void *cls,
{
struct CadetConnection *c = cls;
- c->bck_maintenance_task = GNUNET_SCHEDULER_NO_TASK;
+ c->bck_maintenance_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -1410,12 +1410,12 @@ connection_reset_timeout (struct CadetConnection *c, int fwd)
else /* Relay, endpoint. */
{
struct GNUNET_TIME_Relative delay;
- GNUNET_SCHEDULER_TaskIdentifier *ti;
- GNUNET_SCHEDULER_Task f;
+ struct GNUNET_SCHEDULER_Task * *ti;
+ GNUNET_SCHEDULER_TaskCallback f;
ti = fwd ? &c->fwd_maintenance_task : &c->bck_maintenance_task;
- if (GNUNET_SCHEDULER_NO_TASK != *ti)
+ if (NULL != *ti)
GNUNET_SCHEDULER_cancel (*ti);
delay = GNUNET_TIME_relative_multiply (refresh_connection_time, 4);
LOG (GNUNET_ERROR_TYPE_DEBUG, " timing out in %s\n",
@@ -2376,12 +2376,12 @@ GCC_handle_ack (void *cls, const struct GNUNET_PeerIdentity *peer,
fc->last_ack_recv = ack;
/* Cancel polling if the ACK is big enough. */
- if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task &&
+ if (NULL != fc->poll_task &&
GC_is_pid_bigger (fc->last_ack_recv, fc->last_pid_sent))
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " Cancel poll\n");
GNUNET_SCHEDULER_cancel (fc->poll_task);
- fc->poll_task = GNUNET_SCHEDULER_NO_TASK;
+ fc->poll_task = NULL;
fc->poll_time = GNUNET_TIME_UNIT_SECONDS;
}
@@ -2690,16 +2690,16 @@ GCC_destroy (struct CadetConnection *c)
if (GNUNET_NO == GCC_is_origin (c, GNUNET_YES) && NULL != c->path)
path_destroy (c->path);
- if (GNUNET_SCHEDULER_NO_TASK != c->fwd_maintenance_task)
+ if (NULL != c->fwd_maintenance_task)
GNUNET_SCHEDULER_cancel (c->fwd_maintenance_task);
- if (GNUNET_SCHEDULER_NO_TASK != c->bck_maintenance_task)
+ if (NULL != c->bck_maintenance_task)
GNUNET_SCHEDULER_cancel (c->bck_maintenance_task);
- if (GNUNET_SCHEDULER_NO_TASK != c->fwd_fc.poll_task)
+ if (NULL != c->fwd_fc.poll_task)
{
GNUNET_SCHEDULER_cancel (c->fwd_fc.poll_task);
LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL FWD canceled\n");
}
- if (GNUNET_SCHEDULER_NO_TASK != c->bck_fc.poll_task)
+ if (NULL != c->bck_fc.poll_task)
{
GNUNET_SCHEDULER_cancel (c->bck_fc.poll_task);
LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL BCK canceled\n");
@@ -3268,7 +3268,7 @@ GCC_start_poll (struct CadetConnection *c, int fwd)
fc = fwd ? &c->fwd_fc : &c->bck_fc;
LOG (GNUNET_ERROR_TYPE_DEBUG, " *** POLL %s requested\n",
GC_f2s (fwd));
- if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task || NULL != fc->poll_msg)
+ if (NULL != fc->poll_task || NULL != fc->poll_msg)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " *** not needed (%u, %p)\n",
fc->poll_task, fc->poll_msg);
@@ -3295,10 +3295,10 @@ GCC_stop_poll (struct CadetConnection *c, int fwd)
struct CadetFlowControl *fc;
fc = fwd ? &c->fwd_fc : &c->bck_fc;
- if (GNUNET_SCHEDULER_NO_TASK != fc->poll_task)
+ if (NULL != fc->poll_task)
{
GNUNET_SCHEDULER_cancel (fc->poll_task);
- fc->poll_task = GNUNET_SCHEDULER_NO_TASK;
+ fc->poll_task = NULL;
}
}
diff --git a/src/cadet/gnunet-service-cadet_dht.c b/src/cadet/gnunet-service-cadet_dht.c
index a44938484..7307ba001 100644
--- a/src/cadet/gnunet-service-cadet_dht.c
+++ b/src/cadet/gnunet-service-cadet_dht.c
@@ -93,7 +93,7 @@ static unsigned long long dht_replication_level;
/**
* Task to periodically announce itself in the network.
*/
-static GNUNET_SCHEDULER_TaskIdentifier announce_id_task;
+static struct GNUNET_SCHEDULER_Task * announce_id_task;
/**
* GET requests to stop on shutdown.
@@ -214,7 +214,7 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
- announce_id_task = GNUNET_SCHEDULER_NO_TASK;
+ announce_id_task = NULL;
return;
}
LOG (GNUNET_ERROR_TYPE_DEBUG, "Announce ID\n");
@@ -332,10 +332,10 @@ GCD_shutdown (void)
GNUNET_DHT_disconnect (dht_handle);
dht_handle = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != announce_id_task)
+ if (NULL != announce_id_task)
{
GNUNET_SCHEDULER_cancel (announce_id_task);
- announce_id_task = GNUNET_SCHEDULER_NO_TASK;
+ announce_id_task = NULL;
}
}
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index e19a60961..9740e41d9 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -117,7 +117,7 @@ struct CadetTunnelKXCtx
* Task for delayed destruction of the Key eXchange context, to allow delayed
* messages with the old key to be decrypted successfully.
*/
- GNUNET_SCHEDULER_TaskIdentifier finish_task;
+ struct GNUNET_SCHEDULER_Task * finish_task;
};
/**
@@ -164,7 +164,7 @@ struct CadetTunnel
/**
* Task to start the rekey process.
*/
- GNUNET_SCHEDULER_TaskIdentifier rekey_task;
+ struct GNUNET_SCHEDULER_Task * rekey_task;
/**
* Paths that are actively used to reach the destination peer.
@@ -191,7 +191,7 @@ struct CadetTunnel
/**
* Destroy flag: if true, destroy on last message.
*/
- GNUNET_SCHEDULER_TaskIdentifier destroy_task;
+ struct GNUNET_SCHEDULER_Task * destroy_task;
/**
* Queued messages, to transmit once tunnel gets connected.
@@ -202,7 +202,7 @@ struct CadetTunnel
/**
* Task to trim connections if too many are present.
*/
- GNUNET_SCHEDULER_TaskIdentifier trim_connections_task;
+ struct GNUNET_SCHEDULER_Task * trim_connections_task;
/**
* Ephemeral message in the queue (to avoid queueing more than one).
@@ -326,7 +326,7 @@ static struct GNUNET_CADET_KX_Ephemeral kx_msg;
/**
* Task to generate a new ephemeral key.
*/
-static GNUNET_SCHEDULER_TaskIdentifier rekey_task;
+static struct GNUNET_SCHEDULER_Task * rekey_task;
/**
* Rekey period.
@@ -604,7 +604,7 @@ select_key (const struct CadetTunnel *t)
const struct GNUNET_CRYPTO_SymmetricSessionKey *key;
if (NULL != t->kx_ctx
- && GNUNET_SCHEDULER_NO_TASK == t->kx_ctx->finish_task)
+ && NULL == t->kx_ctx->finish_task)
{
struct GNUNET_TIME_Relative age;
@@ -912,11 +912,11 @@ create_kx_ctx (struct CadetTunnel *t)
if (NULL != t->kx_ctx)
{
- if (GNUNET_SCHEDULER_NO_TASK != t->kx_ctx->finish_task)
+ if (NULL != t->kx_ctx->finish_task)
{
LOG (GNUNET_ERROR_TYPE_INFO, " resetting exisiting finish task\n");
GNUNET_SCHEDULER_cancel (t->kx_ctx->finish_task);
- t->kx_ctx->finish_task = GNUNET_SCHEDULER_NO_TASK;
+ t->kx_ctx->finish_task = NULL;
}
}
else
@@ -975,7 +975,7 @@ destroy_kx_ctx (struct CadetTunnel *t)
{
struct GNUNET_TIME_Relative delay;
- if (NULL == t->kx_ctx || GNUNET_SCHEDULER_NO_TASK != t->kx_ctx->finish_task)
+ if (NULL == t->kx_ctx || NULL != t->kx_ctx->finish_task)
return;
if (is_key_null (&t->kx_ctx->e_key_old))
@@ -1182,7 +1182,7 @@ send_prebuilt_message (const struct GNUNET_MessageHeader *message,
if (NULL == c)
{
/* Why is tunnel 'ready'? Should have been queued! */
- if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task)
+ if (NULL != t->destroy_task)
{
GNUNET_break (0);
GCT_debug (t, GNUNET_ERROR_TYPE_WARNING);
@@ -1387,7 +1387,7 @@ send_kx (struct CadetTunnel *t,
c = tunnel_get_connection (t);
if (NULL == c)
{
- if (GNUNET_SCHEDULER_NO_TASK == t->destroy_task
+ if (NULL == t->destroy_task
&& CADET_TUNNEL_READY == t->cstate)
{
GNUNET_break (0);
@@ -1488,7 +1488,7 @@ rekey_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct CadetTunnel *t = cls;
- t->rekey_task = GNUNET_SCHEDULER_NO_TASK;
+ t->rekey_task = NULL;
LOG (GNUNET_ERROR_TYPE_INFO, "Re-key Tunnel %s\n", GCT_2s (t));
if (NULL != tc && 0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
@@ -1571,7 +1571,7 @@ rekey_iterator (void *cls,
long n = (long) cls;
uint32_t r;
- if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task)
+ if (NULL != t->rekey_task)
return GNUNET_YES;
if (GNUNET_YES == GCT_is_loopback (t))
@@ -1599,7 +1599,7 @@ rekey (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
struct GNUNET_TIME_Absolute time;
long n;
- rekey_task = GNUNET_SCHEDULER_NO_TASK;
+ rekey_task = NULL;
if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
return;
@@ -1949,7 +1949,7 @@ handle_ephemeral (struct CadetTunnel *t,
{
GCT_change_estate (t, CADET_TUNNEL_KEY_REKEY);
}
- if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task)
+ if (NULL != t->rekey_task)
GNUNET_SCHEDULER_cancel (t->rekey_task);
t->rekey_task = GNUNET_SCHEDULER_add_now (rekey_tunnel, t);
}
@@ -1987,7 +1987,7 @@ handle_pong (struct CadetTunnel *t,
uint32_t challenge;
LOG (GNUNET_ERROR_TYPE_INFO, "<=== PONG for %s\n", GCT_2s (t));
- if (GNUNET_SCHEDULER_NO_TASK == t->rekey_task)
+ if (NULL == t->rekey_task)
{
GNUNET_STATISTICS_update (stats, "# duplicate PONG messages", 1, GNUNET_NO);
return;
@@ -2008,7 +2008,7 @@ handle_pong (struct CadetTunnel *t,
return;
}
GNUNET_SCHEDULER_cancel (t->rekey_task);
- t->rekey_task = GNUNET_SCHEDULER_NO_TASK;
+ t->rekey_task = NULL;
/* Don't free the old keys right away, but after a delay.
* Rationale: the KX could have happened over a very fast connection,
@@ -2223,10 +2223,10 @@ GCT_init (const struct GNUNET_CONFIGURATION_Handle *c,
void
GCT_shutdown (void)
{
- if (GNUNET_SCHEDULER_NO_TASK != rekey_task)
+ if (NULL != rekey_task)
{
GNUNET_SCHEDULER_cancel (rekey_task);
- rekey_task = GNUNET_SCHEDULER_NO_TASK;
+ rekey_task = NULL;
}
GNUNET_CONTAINER_multipeermap_iterate (tunnels, &destroy_iterator, NULL);
GNUNET_CONTAINER_multipeermap_destroy (tunnels);
@@ -2285,7 +2285,7 @@ GCT_change_cstate (struct CadetTunnel* t, enum CadetTunnelCState cstate)
else if (CADET_TUNNEL_KEY_UNINITIALIZED == t->estate)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, " cstate triggered rekey\n");
- if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task)
+ if (NULL != t->rekey_task)
GNUNET_SCHEDULER_cancel (t->rekey_task);
create_kx_ctx (t);
rekey_tunnel (t, NULL);
@@ -2347,7 +2347,7 @@ trim_connections (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct CadetTunnel *t = cls;
- t->trim_connections_task = GNUNET_SCHEDULER_NO_TASK;
+ t->trim_connections_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -2409,7 +2409,7 @@ GCT_add_connection (struct CadetTunnel *t, struct CadetConnection *c)
if (CADET_TUNNEL_SEARCHING == t->cstate)
GCT_change_estate (t, CADET_TUNNEL_WAITING);
- if (GNUNET_SCHEDULER_NO_TASK != t->trim_connections_task)
+ if (NULL != t->trim_connections_task)
t->trim_connections_task = GNUNET_SCHEDULER_add_now (&trim_connections, t);
}
@@ -2442,7 +2442,7 @@ GCT_remove_connection (struct CadetTunnel *t,
conns = GCT_count_connections (t);
if (0 == conns
- && GNUNET_SCHEDULER_NO_TASK == t->destroy_task
+ && NULL == t->destroy_task
&& CADET_TUNNEL_SHUTDOWN != t->cstate
&& GNUNET_NO == shutting_down)
{
@@ -2454,7 +2454,7 @@ GCT_remove_connection (struct CadetTunnel *t,
/* Start new connections if needed */
if (CONNECTIONS_PER_TUNNEL > conns
- && GNUNET_SCHEDULER_NO_TASK == t->destroy_task
+ && NULL == t->destroy_task
&& CADET_TUNNEL_SHUTDOWN != t->cstate
&& GNUNET_NO == shutting_down)
{
@@ -2501,10 +2501,10 @@ GCT_add_channel (struct CadetTunnel *t, struct CadetChannel *ch)
LOG (GNUNET_ERROR_TYPE_DEBUG, " adding %p to %p\n", aux, t->channel_head);
GNUNET_CONTAINER_DLL_insert_tail (t->channel_head, t->channel_tail, aux);
- if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task)
+ if (NULL != t->destroy_task)
{
GNUNET_SCHEDULER_cancel (t->destroy_task);
- t->destroy_task = GNUNET_SCHEDULER_NO_TASK;
+ t->destroy_task = NULL;
LOG (GNUNET_ERROR_TYPE_DEBUG, " undo destroy!\n");
}
}
@@ -2585,7 +2585,7 @@ delayed_destroy (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
"Tunnel at %p should have been freed by GCT_shutdown\n", t);
return;
}
- t->destroy_task = GNUNET_SCHEDULER_NO_TASK;
+ t->destroy_task = NULL;
t->cstate = CADET_TUNNEL_SHUTDOWN;
for (iter = t->connection_head; NULL != iter; iter = iter->next)
@@ -2609,7 +2609,7 @@ GCT_destroy_empty (struct CadetTunnel *t)
if (GNUNET_YES == shutting_down)
return; /* Will be destroyed immediately anyway */
- if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task)
+ if (NULL != t->destroy_task)
{
LOG (GNUNET_ERROR_TYPE_WARNING,
"Tunnel %s is already scheduled for destruction. Tunnel debug dump:\n",
@@ -2690,32 +2690,32 @@ GCT_destroy (struct CadetTunnel *t)
/* Should only happen on shutdown, but it's ok. */
}
- if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task)
+ if (NULL != t->destroy_task)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "cancelling dest: %llX\n", t->destroy_task);
GNUNET_SCHEDULER_cancel (t->destroy_task);
- t->destroy_task = GNUNET_SCHEDULER_NO_TASK;
+ t->destroy_task = NULL;
}
- if (GNUNET_SCHEDULER_NO_TASK != t->trim_connections_task)
+ if (NULL != t->trim_connections_task)
{
LOG (GNUNET_ERROR_TYPE_DEBUG, "cancelling trim: %llX\n",
t->trim_connections_task);
GNUNET_SCHEDULER_cancel (t->trim_connections_task);
- t->trim_connections_task = GNUNET_SCHEDULER_NO_TASK;
+ t->trim_connections_task = NULL;
}
GNUNET_STATISTICS_update (stats, "# tunnels", -1, GNUNET_NO);
GCP_set_tunnel (t->peer, NULL);
- if (GNUNET_SCHEDULER_NO_TASK != t->rekey_task)
+ if (NULL != t->rekey_task)
{
GNUNET_SCHEDULER_cancel (t->rekey_task);
- t->rekey_task = GNUNET_SCHEDULER_NO_TASK;
+ t->rekey_task = NULL;
}
if (NULL != t->kx_ctx)
{
- if (GNUNET_SCHEDULER_NO_TASK != t->kx_ctx->finish_task)
+ if (NULL != t->kx_ctx->finish_task)
GNUNET_SCHEDULER_cancel (t->kx_ctx->finish_task);
GNUNET_free (t->kx_ctx);
}
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c
index b9661a9b7..df605d0a9 100644
--- a/src/cadet/test_cadet.c
+++ b/src/cadet/test_cadet.c
@@ -144,17 +144,17 @@ struct GNUNET_CADET_TEST_Context *test_ctx;
/**
* Task called to disconnect peers.
*/
-static GNUNET_SCHEDULER_TaskIdentifier disconnect_task;
+static struct GNUNET_SCHEDULER_Task * disconnect_task;
/**
* Task To perform tests
*/
-static GNUNET_SCHEDULER_TaskIdentifier test_task;
+static struct GNUNET_SCHEDULER_Task * test_task;
/**
* Task called to shutdown test.
*/
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
+static struct GNUNET_SCHEDULER_Task * shutdown_handle;
/**
* Cadet handle for the root peer
@@ -254,7 +254,7 @@ static void
shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Ending test.\n");
- shutdown_handle = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_handle = NULL;
}
@@ -278,7 +278,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"disconnecting cadet service of peers, called from line %ld\n",
line);
- disconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ disconnect_task = NULL;
for (i = 0; i < 2; i++)
{
GNUNET_TESTBED_operation_done (t_op[i]);
@@ -294,7 +294,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
incoming_ch = NULL;
}
GNUNET_CADET_TEST_cleanup (test_ctx);
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle)
+ if (NULL != shutdown_handle)
{
GNUNET_SCHEDULER_cancel (shutdown_handle);
}
@@ -310,7 +310,7 @@ disconnect_cadet_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc
static void
abort_test (long line)
{
- if (disconnect_task != GNUNET_SCHEDULER_NO_TASK)
+ if (disconnect_task != NULL)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
@@ -474,7 +474,7 @@ data_callback (void *cls, struct GNUNET_CADET_Channel *channel,
if ((ok % 20) == 0)
{
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " reschedule timeout\n");
GNUNET_SCHEDULER_cancel (disconnect_task);
@@ -573,7 +573,7 @@ data_callback (void *cls, struct GNUNET_CADET_Channel *channel,
}
}
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_delayed (SHORT_TIME,
@@ -604,7 +604,7 @@ stats_cont (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg)
ok--;
GNUNET_TESTBED_operation_done (stats_op);
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
(void *) __LINE__);
@@ -657,7 +657,7 @@ check_keepalives (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
if ((GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason) != 0)
return;
- disconnect_task = GNUNET_SCHEDULER_NO_TASK;
+ disconnect_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "check keepalives\n");
GNUNET_CADET_channel_destroy (ch);
stats_op = GNUNET_TESTBED_get_statistics (peers_running, testbed_peers,
@@ -705,7 +705,7 @@ incoming_channel (void *cls, struct GNUNET_CADET_Channel *channel,
"Incoming channel for unknown client %lu\n", (long) cls);
GNUNET_break(0);
}
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
if (KEEPALIVE == test)
@@ -761,7 +761,7 @@ channel_cleaner (void *cls, const struct GNUNET_CADET_Channel *channel,
"Unknown peer! %d\n", i);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok);
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
disconnect_task = GNUNET_SCHEDULER_add_now (&disconnect_cadet_peers,
@@ -791,7 +791,7 @@ do_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test_task\n");
- if (GNUNET_SCHEDULER_NO_TASK != disconnect_task)
+ if (NULL != disconnect_task)
{
GNUNET_SCHEDULER_cancel (disconnect_task);
}
diff --git a/src/cadet/test_cadet_local.c b/src/cadet/test_cadet_local.c
index 0796aaf12..d66f0a3d4 100644
--- a/src/cadet/test_cadet_local.c
+++ b/src/cadet/test_cadet_local.c
@@ -42,9 +42,9 @@ static int result = GNUNET_OK;
static int got_data = GNUNET_NO;
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
static struct GNUNET_CADET_TransmitHandle *mth;
@@ -66,7 +66,7 @@ static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n");
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
{
GNUNET_SCHEDULER_cancel (abort_task);
}
@@ -95,11 +95,11 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ABORT\n");
result = GNUNET_SYSERR;
- abort_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ abort_task = NULL;
+ if (NULL != shutdown_task)
{
GNUNET_SCHEDULER_cancel (shutdown_task);
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task = NULL;
}
do_shutdown (cls, tc);
}
@@ -123,7 +123,7 @@ data_callback (void *cls, struct GNUNET_CADET_Channel *channel,
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Data callback! Shutting down.\n");
got_data = GNUNET_YES;
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ if (NULL != shutdown_task)
GNUNET_SCHEDULER_cancel (shutdown_task);
shutdown_task =
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_shutdown,
diff --git a/src/cadet/test_cadet_single.c b/src/cadet/test_cadet_single.c
index 3780c745c..29f2bf76f 100644
--- a/src/cadet/test_cadet_single.c
+++ b/src/cadet/test_cadet_single.c
@@ -43,9 +43,9 @@ static struct GNUNET_CADET_Channel *ch2;
static int result;
-static GNUNET_SCHEDULER_TaskIdentifier abort_task;
+static struct GNUNET_SCHEDULER_Task * abort_task;
-static GNUNET_SCHEDULER_TaskIdentifier shutdown_task;
+static struct GNUNET_SCHEDULER_Task * shutdown_task;
static unsigned int repetition;
@@ -62,7 +62,7 @@ static void
do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "shutdown\n");
- if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+ if (NULL != abort_task)
{
GNUNET_SCHEDULER_cancel (abort_task);
}
@@ -92,11 +92,11 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ABORT\n");
result = GNUNET_SYSERR;
- abort_task = GNUNET_SCHEDULER_NO_TASK;
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ abort_task = NULL;
+ if (NULL != shutdown_task)
{
GNUNET_SCHEDULER_cancel (shutdown_task);
- shutdown_task = GNUNET_SCHEDULER_NO_TASK;
+ shutdown_task = NULL;
}
do_shutdown (cls, tc);
}
@@ -105,7 +105,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
finish (void)
{
- if (GNUNET_SCHEDULER_NO_TASK != shutdown_task)
+ if (NULL != shutdown_task)
GNUNET_SCHEDULER_cancel (shutdown_task);
shutdown_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
&do_shutdown, NULL);