diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
commit | 29e6158507a0758192075ac6ece7ba8e75ddc49a (patch) | |
tree | b91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/transport/test_transport_api_blacklisting.c | |
parent | 5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff) | |
download | gnunet-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.c | 11 |
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 | ||
78 | static void | 78 | static void |
79 | end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 79 | end (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 | |||
139 | static void | 140 | static void |
140 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 141 | end_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 | ||
261 | static void | 262 | static void |
262 | sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 263 | sendtask (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)); |