aboutsummaryrefslogtreecommitdiff
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)
downloadgnunet-f1f603c7d0b3f03dca46a4f313472288eb080eb1.tar.gz
gnunet-f1f603c7d0b3f03dca46a4f313472288eb080eb1.zip
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
84 /** 84 /**
85 * ID of select broadcast task 85 * ID of select broadcast task
86 */ 86 */
87 GNUNET_SCHEDULER_TaskIdentifier broadcast_task; 87 struct GNUNET_SCHEDULER_Task * broadcast_task;
88 88
89 struct Plugin *plugin; 89 struct Plugin *plugin;
90 90
@@ -302,7 +302,7 @@ udp_ipv4_broadcast_send (void *cls,
302 uint16_t msg_size; 302 uint16_t msg_size;
303 char buf[65536] GNUNET_ALIGN; 303 char buf[65536] GNUNET_ALIGN;
304 304
305 baddr->broadcast_task = GNUNET_SCHEDULER_NO_TASK; 305 baddr->broadcast_task = NULL;
306 306
307 msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf); 307 msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf);
308 if (0 != msg_size) 308 if (0 != msg_size)
@@ -379,7 +379,7 @@ udp_ipv6_broadcast_send (void *cls,
379 char buf[65536] GNUNET_ALIGN; 379 char buf[65536] GNUNET_ALIGN;
380 const struct sockaddr_in6 *s6 = (const struct sockaddr_in6 *) baddr->addr; 380 const struct sockaddr_in6 *s6 = (const struct sockaddr_in6 *) baddr->addr;
381 381
382 baddr->broadcast_task = GNUNET_SCHEDULER_NO_TASK; 382 baddr->broadcast_task = NULL;
383 383
384 msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf); 384 msg_size = prepare_beacon(plugin, (struct UDP_Beacon_Message *) &buf);
385 /* Note: unclear if this actually works to limit the multicast to 385 /* Note: unclear if this actually works to limit the multicast to
@@ -651,10 +651,10 @@ stop_broadcast (struct Plugin *plugin)
651 { 651 {
652 struct BroadcastAddress *p = plugin->broadcast_head; 652 struct BroadcastAddress *p = plugin->broadcast_head;
653 653
654 if (p->broadcast_task != GNUNET_SCHEDULER_NO_TASK) 654 if (p->broadcast_task != NULL)
655 { 655 {
656 GNUNET_SCHEDULER_cancel (p->broadcast_task); 656 GNUNET_SCHEDULER_cancel (p->broadcast_task);
657 p->broadcast_task = GNUNET_SCHEDULER_NO_TASK; 657 p->broadcast_task = NULL;
658 } 658 }
659 if ((GNUNET_YES == plugin->enable_ipv6) && 659 if ((GNUNET_YES == plugin->enable_ipv6) &&
660 (NULL != plugin->sockv6) && 660 (NULL != plugin->sockv6) &&