aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_udp.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-09 23:14:03 +0000
committerChristian Grothoff <christian@grothoff.org>2016-04-09 23:14:03 +0000
commit29e6158507a0758192075ac6ece7ba8e75ddc49a (patch)
treeb91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/transport/plugin_transport_udp.c
parent5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff)
downloadgnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.tar.gz
gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.zip
small API change: do no longer pass rarely needed GNUNET_SCHEDULER_TaskContext to all scheduler tasks; instead, allow the relatively few tasks that need it to obtain the context via GNUNET_SCHEDULER_get_task_context()
Diffstat (limited to 'src/transport/plugin_transport_udp.c')
-rw-r--r--src/transport/plugin_transport_udp.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c
index ef470ffd1..89feb8f5c 100644
--- a/src/transport/plugin_transport_udp.c
+++ b/src/transport/plugin_transport_udp.c
@@ -728,11 +728,9 @@ udp_plugin_get_network_for_address (void *cls,
728 * Then reschedule this function to be called again once more is available. 728 * Then reschedule this function to be called again once more is available.
729 * 729 *
730 * @param cls the plugin handle 730 * @param cls the plugin handle
731 * @param tc the scheduling context (for rescheduling this function again)
732 */ 731 */
733static void 732static void
734udp_plugin_select_v4 (void *cls, 733udp_plugin_select_v4 (void *cls);
735 const struct GNUNET_SCHEDULER_TaskContext *tc);
736 734
737 735
738/** 736/**
@@ -741,11 +739,9 @@ udp_plugin_select_v4 (void *cls,
741 * Then reschedule this function to be called again once more is available. 739 * Then reschedule this function to be called again once more is available.
742 * 740 *
743 * @param cls the plugin handle 741 * @param cls the plugin handle
744 * @param tc the scheduling context (for rescheduling this function again)
745 */ 742 */
746static void 743static void
747udp_plugin_select_v6 (void *cls, 744udp_plugin_select_v6 (void *cls);
748 const struct GNUNET_SCHEDULER_TaskContext *tc);
749 745
750 746
751/** 747/**
@@ -2566,11 +2562,9 @@ udp_disconnect (void *cls,
2566 * Session was idle, so disconnect it. 2562 * Session was idle, so disconnect it.
2567 * 2563 *
2568 * @param cls the `struct GNUNET_ATS_Session` to time out 2564 * @param cls the `struct GNUNET_ATS_Session` to time out
2569 * @param tc scheduler context
2570 */ 2565 */
2571static void 2566static void
2572session_timeout (void *cls, 2567session_timeout (void *cls)
2573 const struct GNUNET_SCHEDULER_TaskContext *tc)
2574{ 2568{
2575 struct GNUNET_ATS_Session *s = cls; 2569 struct GNUNET_ATS_Session *s = cls;
2576 struct Plugin *plugin = s->plugin; 2570 struct Plugin *plugin = s->plugin;
@@ -3516,14 +3510,14 @@ udp_select_send (struct Plugin *plugin,
3516 * Then reschedule this function to be called again once more is available. 3510 * Then reschedule this function to be called again once more is available.
3517 * 3511 *
3518 * @param cls the plugin handle 3512 * @param cls the plugin handle
3519 * @param tc the scheduling context
3520 */ 3513 */
3521static void 3514static void
3522udp_plugin_select_v4 (void *cls, 3515udp_plugin_select_v4 (void *cls)
3523 const struct GNUNET_SCHEDULER_TaskContext *tc)
3524{ 3516{
3525 struct Plugin *plugin = cls; 3517 struct Plugin *plugin = cls;
3518 const struct GNUNET_SCHEDULER_TaskContext *tc;
3526 3519
3520 tc = GNUNET_SCHEDULER_get_task_context ();
3527 plugin->select_task_v4 = NULL; 3521 plugin->select_task_v4 = NULL;
3528 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 3522 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
3529 return; 3523 return;
@@ -3546,14 +3540,14 @@ udp_plugin_select_v4 (void *cls,
3546 * Then reschedule this function to be called again once more is available. 3540 * Then reschedule this function to be called again once more is available.
3547 * 3541 *
3548 * @param cls the plugin handle 3542 * @param cls the plugin handle
3549 * @param tc the scheduling context
3550 */ 3543 */
3551static void 3544static void
3552udp_plugin_select_v6 (void *cls, 3545udp_plugin_select_v6 (void *cls)
3553 const struct GNUNET_SCHEDULER_TaskContext *tc)
3554{ 3546{
3555 struct Plugin *plugin = cls; 3547 struct Plugin *plugin = cls;
3548 const struct GNUNET_SCHEDULER_TaskContext *tc;
3556 3549
3550 tc = GNUNET_SCHEDULER_get_task_context ();
3557 plugin->select_task_v6 = NULL; 3551 plugin->select_task_v6 = NULL;
3558 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 3552 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
3559 return; 3553 return;