aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_api_blacklisting.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/test_transport_api_blacklisting.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/test_transport_api_blacklisting.c')
-rw-r--r--src/transport/test_transport_api_blacklisting.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/transport/test_transport_api_blacklisting.c b/src/transport/test_transport_api_blacklisting.c
index 275567131..f65fb74f9 100644
--- a/src/transport/test_transport_api_blacklisting.c
+++ b/src/transport/test_transport_api_blacklisting.c
@@ -76,7 +76,7 @@ static struct GNUNET_SCHEDULER_Task * shutdown_task;
76 76
77 77
78static void 78static void
79end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 79end (void *cls)
80{ 80{
81 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping\n"); 81 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping\n");
82 82
@@ -136,8 +136,9 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
136 } 136 }
137} 137}
138 138
139
139static void 140static void
140end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 141end_badly (void *cls)
141{ 142{
142 if (send_task != NULL) 143 if (send_task != NULL)
143 { 144 {
@@ -259,10 +260,12 @@ notify_ready (void *cls, size_t size, void *buf)
259 260
260 261
261static void 262static void
262sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 263sendtask (void *cls)
263{ 264{
264 send_task = NULL; 265 const struct GNUNET_SCHEDULER_TaskContext *tc;
265 266
267 send_task = NULL;
268 tc = GNUNET_SCHEDULER_get_task_context ();
266 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 269 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
267 return; 270 return;
268 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 271 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));