summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_udp_broadcasting.c
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/plugin_transport_udp_broadcasting.c
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/plugin_transport_udp_broadcasting.c')
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c10
1 files changed, 5 insertions, 5 deletions
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) &&