aboutsummaryrefslogtreecommitdiff
path: root/src/transport
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
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')
-rw-r--r--src/transport/gnunet-service-transport.c8
-rw-r--r--src/transport/gnunet-service-transport_ats.c4
-rw-r--r--src/transport/gnunet-service-transport_blacklist.c36
-rw-r--r--src/transport/gnunet-service-transport_hello.c6
-rw-r--r--src/transport/gnunet-service-transport_manipulation.c4
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c16
-rw-r--r--src/transport/gnunet-service-transport_validation.c8
-rw-r--r--src/transport/gnunet-transport-profiler.c4
-rw-r--r--src/transport/gnunet-transport.c7
-rw-r--r--src/transport/plugin_transport_http_client.c23
-rw-r--r--src/transport/plugin_transport_http_server.c28
-rw-r--r--src/transport/plugin_transport_tcp.c12
-rw-r--r--src/transport/plugin_transport_udp.c24
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c6
-rw-r--r--src/transport/plugin_transport_unix.c20
-rw-r--r--src/transport/plugin_transport_wlan.c16
-rw-r--r--src/transport/test_plugin_transport.c7
-rw-r--r--src/transport/test_quota_compliance.c2
-rw-r--r--src/transport/test_transport_address_switch.c3
-rw-r--r--src/transport/test_transport_api.c9
-rw-r--r--src/transport/test_transport_api_bidirectional_connect.c8
-rw-r--r--src/transport/test_transport_api_blacklisting.c11
-rw-r--r--src/transport/test_transport_api_disconnect.c14
-rw-r--r--src/transport/test_transport_api_limited_sockets.c10
-rw-r--r--src/transport/test_transport_api_manipulation_cfg.c16
-rw-r--r--src/transport/test_transport_api_manipulation_recv_tcp.c13
-rw-r--r--src/transport/test_transport_api_manipulation_send_tcp.c9
-rw-r--r--src/transport/test_transport_api_monitor_peers.c9
-rw-r--r--src/transport/test_transport_api_monitor_validation.c8
-rw-r--r--src/transport/test_transport_api_reliability.c3
-rw-r--r--src/transport/test_transport_api_restart_1peer.c9
-rw-r--r--src/transport/test_transport_api_restart_2peers.c10
-rw-r--r--src/transport/test_transport_api_timeout.c8
-rw-r--r--src/transport/test_transport_blacklisting.c21
-rw-r--r--src/transport/test_transport_startonly.c6
-rw-r--r--src/transport/transport-testing.c13
-rw-r--r--src/transport/transport_api.c33
-rw-r--r--src/transport/transport_api_monitor_peers.c4
-rw-r--r--src/transport/transport_api_monitor_plugins.c4
-rw-r--r--src/transport/transport_api_monitor_validation.c8
40 files changed, 204 insertions, 256 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c
index d5c0d4a86..9fde3d83e 100644
--- a/src/transport/gnunet-service-transport.c
+++ b/src/transport/gnunet-service-transport.c
@@ -250,11 +250,9 @@ process_payload (const struct GNUNET_HELLO_Address *address,
250 * Task to asynchronously terminate a session. 250 * Task to asynchronously terminate a session.
251 * 251 *
252 * @param cls the `struct GNUNET_ATS_SessionKiller` with the information for the kill 252 * @param cls the `struct GNUNET_ATS_SessionKiller` with the information for the kill
253 * @param tc scheduler context
254 */ 253 */
255static void 254static void
256kill_session_task (void *cls, 255kill_session_task (void *cls)
257 const struct GNUNET_SCHEDULER_TaskContext *tc)
258{ 256{
259 struct GNUNET_ATS_SessionKiller *sk = cls; 257 struct GNUNET_ATS_SessionKiller *sk = cls;
260 258
@@ -756,11 +754,9 @@ ats_request_address_change (void *cls,
756 * and cancels pending validations. 754 * and cancels pending validations.
757 * 755 *
758 * @param cls closure, unused 756 * @param cls closure, unused
759 * @param tc task context (unused)
760 */ 757 */
761static void 758static void
762shutdown_task (void *cls, 759shutdown_task (void *cls)
763 const struct GNUNET_SCHEDULER_TaskContext *tc)
764{ 760{
765 GST_neighbours_stop (); 761 GST_neighbours_stop ();
766 GST_plugins_unload (); 762 GST_plugins_unload ();
diff --git a/src/transport/gnunet-service-transport_ats.c b/src/transport/gnunet-service-transport_ats.c
index 87d05b200..a20c998b3 100644
--- a/src/transport/gnunet-service-transport_ats.c
+++ b/src/transport/gnunet-service-transport_ats.c
@@ -294,11 +294,9 @@ GST_ats_is_known_no_session (const struct GNUNET_HELLO_Address *address)
294 * suggest it again. 294 * suggest it again.
295 * 295 *
296 * @param cls the `struct AddressInfo` of the address to unblock 296 * @param cls the `struct AddressInfo` of the address to unblock
297 * @param tc unused
298 */ 297 */
299static void 298static void
300unblock_address (void *cls, 299unblock_address (void *cls)
301 const struct GNUNET_SCHEDULER_TaskContext *tc)
302{ 300{
303 struct AddressInfo *ai = cls; 301 struct AddressInfo *ai = cls;
304 302
diff --git a/src/transport/gnunet-service-transport_blacklist.c b/src/transport/gnunet-service-transport_blacklist.c
index 14375fce4..ea5644390 100644
--- a/src/transport/gnunet-service-transport_blacklist.c
+++ b/src/transport/gnunet-service-transport_blacklist.c
@@ -205,11 +205,9 @@ static struct GNUNET_CONTAINER_MultiPeerMap *blacklist;
205 * Perform next action in the blacklist check. 205 * Perform next action in the blacklist check.
206 * 206 *
207 * @param cls the `struct BlacklistCheck*` 207 * @param cls the `struct BlacklistCheck*`
208 * @param tc unused
209 */ 208 */
210static void 209static void
211do_blacklist_check (void *cls, 210do_blacklist_check (void *cls);
212 const struct GNUNET_SCHEDULER_TaskContext *tc);
213 211
214 212
215/** 213/**
@@ -395,7 +393,7 @@ GST_blacklist_stop ()
395 * @return number of bytes copied to @a buf 393 * @return number of bytes copied to @a buf
396 */ 394 */
397static size_t 395static size_t
398transmit_blacklist_message (void *cls, 396transmit_blacklist_message (void *cls,
399 size_t size, 397 size_t size,
400 void *buf) 398 void *buf)
401{ 399{
@@ -416,7 +414,7 @@ transmit_blacklist_message (void *cls,
416 } 414 }
417 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 415 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
418 "Sending blacklist test for peer `%s' to client %p\n", 416 "Sending blacklist test for peer `%s' to client %p\n",
419 GNUNET_i2s (&bc->peer), 417 GNUNET_i2s (&bc->peer),
420 bc->bl_pos->client); 418 bc->bl_pos->client);
421 bl = bc->bl_pos; 419 bl = bc->bl_pos;
422 bm.header.size = htons (sizeof (struct BlacklistMessage)); 420 bm.header.size = htons (sizeof (struct BlacklistMessage));
@@ -424,7 +422,7 @@ transmit_blacklist_message (void *cls,
424 bm.is_allowed = htonl (0); 422 bm.is_allowed = htonl (0);
425 bm.peer = bc->peer; 423 bm.peer = bc->peer;
426 memcpy (buf, 424 memcpy (buf,
427 &bm, 425 &bm,
428 sizeof (bm)); 426 sizeof (bm));
429 if (GNUNET_YES == bl->call_receive_done) 427 if (GNUNET_YES == bl->call_receive_done)
430 { 428 {
@@ -442,11 +440,9 @@ transmit_blacklist_message (void *cls,
442 * Perform next action in the blacklist check. 440 * Perform next action in the blacklist check.
443 * 441 *
444 * @param cls the `struct GST_BlacklistCheck *` 442 * @param cls the `struct GST_BlacklistCheck *`
445 * @param tc unused
446 */ 443 */
447static void 444static void
448do_blacklist_check (void *cls, 445do_blacklist_check (void *cls)
449 const struct GNUNET_SCHEDULER_TaskContext *tc)
450{ 446{
451 struct GST_BlacklistCheck *bc = cls; 447 struct GST_BlacklistCheck *bc = cls;
452 struct Blacklisters *bl; 448 struct Blacklisters *bl;
@@ -459,7 +455,7 @@ do_blacklist_check (void *cls,
459 "No other blacklist clients active, will allow neighbour `%s'\n", 455 "No other blacklist clients active, will allow neighbour `%s'\n",
460 GNUNET_i2s (&bc->peer)); 456 GNUNET_i2s (&bc->peer));
461 457
462 bc->cont (bc->cont_cls, 458 bc->cont (bc->cont_cls,
463 &bc->peer, 459 &bc->peer,
464 bc->address, 460 bc->address,
465 bc->session, 461 bc->session,
@@ -475,7 +471,7 @@ do_blacklist_check (void *cls,
475 GNUNET_SERVER_notify_transmit_ready (bl->client, 471 GNUNET_SERVER_notify_transmit_ready (bl->client,
476 sizeof (struct BlacklistMessage), 472 sizeof (struct BlacklistMessage),
477 GNUNET_TIME_UNIT_FOREVER_REL, 473 GNUNET_TIME_UNIT_FOREVER_REL,
478 &transmit_blacklist_message, 474 &transmit_blacklist_message,
479 bc); 475 bc);
480} 476}
481 477
@@ -501,7 +497,7 @@ confirm_or_drop_neighbour (void *cls,
501 if (GNUNET_OK == allowed) 497 if (GNUNET_OK == allowed)
502 return; /* we're done */ 498 return; /* we're done */
503 GNUNET_STATISTICS_update (GST_stats, 499 GNUNET_STATISTICS_update (GST_stats,
504 gettext_noop ("# disconnects due to blacklist"), 500 gettext_noop ("# disconnects due to blacklist"),
505 1, 501 1,
506 GNUNET_NO); 502 GNUNET_NO);
507 GST_neighbours_force_disconnect (peer); 503 GST_neighbours_force_disconnect (peer);
@@ -666,7 +662,7 @@ GST_blacklist_handle_reply (void *cls,
666 GNUNET_CONTAINER_DLL_remove (bc_head, 662 GNUNET_CONTAINER_DLL_remove (bc_head,
667 bc_tail, 663 bc_tail,
668 bc); 664 bc);
669 bc->cont (bc->cont_cls, 665 bc->cont (bc->cont_cls,
670 &bc->peer, 666 &bc->peer,
671 bc->address, 667 bc->address,
672 bc->session, 668 bc->session,
@@ -687,7 +683,7 @@ GST_blacklist_handle_reply (void *cls,
687 GNUNET_OK); 683 GNUNET_OK);
688 bl->call_receive_done = GNUNET_NO; 684 bl->call_receive_done = GNUNET_NO;
689 bc->bl_pos = bl->next; 685 bc->bl_pos = bl->next;
690 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, 686 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check,
691 bc); 687 bc);
692 } 688 }
693 } 689 }
@@ -695,7 +691,7 @@ GST_blacklist_handle_reply (void *cls,
695 for (bc = bc_head; bc != NULL; bc = bc->next) 691 for (bc = bc_head; bc != NULL; bc = bc->next)
696 if ((bc->bl_pos == bl) && (NULL == bc->task)) 692 if ((bc->bl_pos == bl) && (NULL == bc->task))
697 { 693 {
698 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, 694 bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check,
699 bc); 695 bc);
700 break; 696 break;
701 } 697 }
@@ -749,7 +745,7 @@ GST_blacklist_abort_matching (const struct GNUNET_HELLO_Address *address,
749 struct GST_BlacklistCheck *bc; 745 struct GST_BlacklistCheck *bc;
750 struct GST_BlacklistCheck *n; 746 struct GST_BlacklistCheck *n;
751 747
752 n = bc_head; 748 n = bc_head;
753 while (NULL != (bc = n)) 749 while (NULL != (bc = n))
754 { 750 {
755 n = bc->next; 751 n = bc->next;
@@ -853,15 +849,15 @@ GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer,
853 /* Disallowed by config, disapprove instantly */ 849 /* Disallowed by config, disapprove instantly */
854 GNUNET_STATISTICS_update (GST_stats, 850 GNUNET_STATISTICS_update (GST_stats,
855 gettext_noop ("# disconnects due to blacklist"), 851 gettext_noop ("# disconnects due to blacklist"),
856 1, 852 1,
857 GNUNET_NO); 853 GNUNET_NO);
858 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 854 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
859 _("Disallowing connection to peer `%s' on transport %s\n"), 855 _("Disallowing connection to peer `%s' on transport %s\n"),
860 GNUNET_i2s (peer), 856 GNUNET_i2s (peer),
861 (NULL != transport_name) ? transport_name : "unspecified"); 857 (NULL != transport_name) ? transport_name : "unspecified");
862 if (NULL != cont) 858 if (NULL != cont)
863 cont (cont_cls, 859 cont (cont_cls,
864 peer, 860 peer,
865 address, 861 address,
866 session, 862 session,
867 GNUNET_NO); 863 GNUNET_NO);
@@ -886,7 +882,7 @@ GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer,
886 882
887 /* need to query blacklist clients */ 883 /* need to query blacklist clients */
888 bc = GNUNET_new (struct GST_BlacklistCheck); 884 bc = GNUNET_new (struct GST_BlacklistCheck);
889 GNUNET_CONTAINER_DLL_insert (bc_head, 885 GNUNET_CONTAINER_DLL_insert (bc_head,
890 bc_tail, 886 bc_tail,
891 bc); 887 bc);
892 bc->peer = *peer; 888 bc->peer = *peer;
diff --git a/src/transport/gnunet-service-transport_hello.c b/src/transport/gnunet-service-transport_hello.c
index 77c382ed0..1a3c2c32e 100644
--- a/src/transport/gnunet-service-transport_hello.c
+++ b/src/transport/gnunet-service-transport_hello.c
@@ -172,11 +172,9 @@ address_generator (void *cls,
172 * all of the transports. 172 * all of the transports.
173 * 173 *
174 * @param cls unused 174 * @param cls unused
175 * @param tc scheduler context
176 */ 175 */
177static void 176static void
178refresh_hello_task (void *cls, 177refresh_hello_task (void *cls)
179 const struct GNUNET_SCHEDULER_TaskContext *tc)
180{ 178{
181 struct GeneratorContext gc; 179 struct GeneratorContext gc;
182 180
@@ -243,7 +241,7 @@ GST_hello_start (int friend_only,
243 hello_cb = cb; 241 hello_cb = cb;
244 hello_cb_cls = cb_cls; 242 hello_cb_cls = cb_cls;
245 friend_option = friend_only; 243 friend_option = friend_only;
246 refresh_hello_task (NULL, NULL); 244 refresh_hello_task (NULL);
247} 245}
248 246
249 247
diff --git a/src/transport/gnunet-service-transport_manipulation.c b/src/transport/gnunet-service-transport_manipulation.c
index 6eef8f300..bd3fed6d7 100644
--- a/src/transport/gnunet-service-transport_manipulation.c
+++ b/src/transport/gnunet-service-transport_manipulation.c
@@ -224,11 +224,9 @@ GST_manipulation_set_metric (void *cls,
224 * message. 224 * message.
225 * 225 *
226 * @param cls the `struct DelayQueueEntry` to transmit 226 * @param cls the `struct DelayQueueEntry` to transmit
227 * @param tc unused
228 */ 227 */
229static void 228static void
230send_delayed (void *cls, 229send_delayed (void *cls)
231 const struct GNUNET_SCHEDULER_TaskContext *tc)
232{ 230{
233 struct DelayQueueEntry *dqe = cls; 231 struct DelayQueueEntry *dqe = cls;
234 struct DelayQueueEntry *next; 232 struct DelayQueueEntry *next;
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 0f1e86fe6..65428ef2a 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -695,11 +695,9 @@ free_address (struct NeighbourAddress *na)
695 * clean up after disconnect). 695 * clean up after disconnect).
696 * 696 *
697 * @param cls the `struct NeighbourMapEntry` for which we are running 697 * @param cls the `struct NeighbourMapEntry` for which we are running
698 * @param tc scheduler context (unused)
699 */ 698 */
700static void 699static void
701master_task (void *cls, 700master_task (void *cls);
702 const struct GNUNET_SCHEDULER_TaskContext *tc);
703 701
704 702
705/** 703/**
@@ -2814,11 +2812,9 @@ send_utilization_data (void *cls,
2814 * Task transmitting utilization in a regular interval 2812 * Task transmitting utilization in a regular interval
2815 * 2813 *
2816 * @param cls the 'struct NeighbourMapEntry' for which we are running 2814 * @param cls the 'struct NeighbourMapEntry' for which we are running
2817 * @param tc scheduler context (unused)
2818 */ 2815 */
2819static void 2816static void
2820utilization_transmission (void *cls, 2817utilization_transmission (void *cls)
2821 const struct GNUNET_SCHEDULER_TaskContext *tc)
2822{ 2818{
2823 util_transmission_tk = NULL; 2819 util_transmission_tk = NULL;
2824 GNUNET_CONTAINER_multipeermap_iterate (neighbours, 2820 GNUNET_CONTAINER_multipeermap_iterate (neighbours,
@@ -2883,11 +2879,9 @@ GST_neighbours_notify_data_sent (const struct GNUNET_HELLO_Address *address,
2883 * clean up after disconnect). 2879 * clean up after disconnect).
2884 * 2880 *
2885 * @param cls the 'struct NeighbourMapEntry' for which we are running 2881 * @param cls the 'struct NeighbourMapEntry' for which we are running
2886 * @param tc scheduler context (unused)
2887 */ 2882 */
2888static void 2883static void
2889master_task (void *cls, 2884master_task (void *cls)
2890 const struct GNUNET_SCHEDULER_TaskContext *tc)
2891{ 2885{
2892 struct NeighbourMapEntry *n = cls; 2886 struct NeighbourMapEntry *n = cls;
2893 struct GNUNET_TIME_Relative delay; 2887 struct GNUNET_TIME_Relative delay;
@@ -3448,11 +3442,9 @@ GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target)
3448 * Task to asynchronously run #free_neighbour(). 3442 * Task to asynchronously run #free_neighbour().
3449 * 3443 *
3450 * @param cls the `struct NeighbourMapEntry` to free 3444 * @param cls the `struct NeighbourMapEntry` to free
3451 * @param tc unused
3452 */ 3445 */
3453static void 3446static void
3454delayed_disconnect (void *cls, 3447delayed_disconnect (void *cls)
3455 const struct GNUNET_SCHEDULER_TaskContext* tc)
3456{ 3448{
3457 struct NeighbourMapEntry *n = cls; 3449 struct NeighbourMapEntry *n = cls;
3458 3450
diff --git a/src/transport/gnunet-service-transport_validation.c b/src/transport/gnunet-service-transport_validation.c
index 9b8d750f0..836aa418c 100644
--- a/src/transport/gnunet-service-transport_validation.c
+++ b/src/transport/gnunet-service-transport_validation.c
@@ -463,11 +463,9 @@ cleanup_validation_entry (void *cls,
463 * longer valid and then possibly triggers its removal. 463 * longer valid and then possibly triggers its removal.
464 * 464 *
465 * @param cls the `struct ValidationEntry` 465 * @param cls the `struct ValidationEntry`
466 * @param tc scheduler context (unused)
467 */ 466 */
468static void 467static void
469timeout_hello_validation (void *cls, 468timeout_hello_validation (void *cls)
470 const struct GNUNET_SCHEDULER_TaskContext *tc)
471{ 469{
472 struct ValidationEntry *ve = cls; 470 struct ValidationEntry *ve = cls;
473 struct GNUNET_TIME_Absolute max; 471 struct GNUNET_TIME_Absolute max;
@@ -652,11 +650,9 @@ transmit_ping_if_allowed (void *cls,
652 * Do address validation again to keep address valid. 650 * Do address validation again to keep address valid.
653 * 651 *
654 * @param cls the `struct ValidationEntry` 652 * @param cls the `struct ValidationEntry`
655 * @param tc scheduler context (unused)
656 */ 653 */
657static void 654static void
658revalidate_address (void *cls, 655revalidate_address (void *cls)
659 const struct GNUNET_SCHEDULER_TaskContext *tc)
660{ 656{
661 struct ValidationEntry *ve = cls; 657 struct ValidationEntry *ve = cls;
662 struct GNUNET_TIME_Relative canonical_delay; 658 struct GNUNET_TIME_Relative canonical_delay;
diff --git a/src/transport/gnunet-transport-profiler.c b/src/transport/gnunet-transport-profiler.c
index ed18bf418..624d1a16c 100644
--- a/src/transport/gnunet-transport-profiler.c
+++ b/src/transport/gnunet-transport-profiler.c
@@ -161,11 +161,9 @@ static int verbosity;
161 * Stops monitoring activity. 161 * Stops monitoring activity.
162 * 162 *
163 * @param cls NULL 163 * @param cls NULL
164 * @param tc scheduler context
165 */ 164 */
166static void 165static void
167shutdown_task (void *cls, 166shutdown_task (void *cls)
168 const struct GNUNET_SCHEDULER_TaskContext *tc)
169{ 167{
170 struct Iteration *icur; 168 struct Iteration *icur;
171 struct Iteration *inext; 169 struct Iteration *inext;
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c
index 03bece6b7..bed9bdc85 100644
--- a/src/transport/gnunet-transport.c
+++ b/src/transport/gnunet-transport.c
@@ -487,11 +487,9 @@ destroy_it (void *cls,
487 * Stops monitoring activity. 487 * Stops monitoring activity.
488 * 488 *
489 * @param cls NULL 489 * @param cls NULL
490 * @param tc scheduler context
491 */ 490 */
492static void 491static void
493shutdown_task (void *cls, 492shutdown_task (void *cls)
494 const struct GNUNET_SCHEDULER_TaskContext *tc)
495{ 493{
496 struct GNUNET_TIME_Relative duration; 494 struct GNUNET_TIME_Relative duration;
497 struct ValidationResolutionContext *cur; 495 struct ValidationResolutionContext *cur;
@@ -598,8 +596,7 @@ shutdown_task (void *cls,
598 * We are done, shut down. 596 * We are done, shut down.
599 */ 597 */
600static void 598static void
601operation_timeout (void *cls, 599operation_timeout (void *cls)
602 const struct GNUNET_SCHEDULER_TaskContext *tc)
603{ 600{
604 struct PeerResolutionContext *cur; 601 struct PeerResolutionContext *cur;
605 struct PeerResolutionContext *next; 602 struct PeerResolutionContext *next;
diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c
index cd4710417..2b0b8939e 100644
--- a/src/transport/plugin_transport_http_client.c
+++ b/src/transport/plugin_transport_http_client.c
@@ -557,8 +557,7 @@ client_reschedule_session_timeout (struct GNUNET_ATS_Session *s)
557 * @param tc gnunet scheduler task context 557 * @param tc gnunet scheduler task context
558 */ 558 */
559static void 559static void
560client_run (void *cls, 560client_run (void *cls);
561 const struct GNUNET_SCHEDULER_TaskContext *tc);
562 561
563 562
564/** 563/**
@@ -997,11 +996,9 @@ client_lookup_session (struct HTTP_Client_Plugin *plugin,
997 * is the delayed task that actually disconnects the PUT. 996 * is the delayed task that actually disconnects the PUT.
998 * 997 *
999 * @param cls the `struct GNUNET_ATS_Session *` with the put 998 * @param cls the `struct GNUNET_ATS_Session *` with the put
1000 * @param tc scheduler context
1001 */ 999 */
1002static void 1000static void
1003client_put_disconnect (void *cls, 1001client_put_disconnect (void *cls)
1004 const struct GNUNET_SCHEDULER_TaskContext *tc)
1005{ 1002{
1006 struct GNUNET_ATS_Session *s = cls; 1003 struct GNUNET_ATS_Session *s = cls;
1007 1004
@@ -1128,15 +1125,15 @@ client_send_cb (void *stream,
1128 * Wake up a curl handle which was suspended 1125 * Wake up a curl handle which was suspended
1129 * 1126 *
1130 * @param cls the session 1127 * @param cls the session
1131 * @param tc task context
1132 */ 1128 */
1133static void 1129static void
1134client_wake_up (void *cls, 1130client_wake_up (void *cls)
1135 const struct GNUNET_SCHEDULER_TaskContext *tc)
1136{ 1131{
1137 struct GNUNET_ATS_Session *s = cls; 1132 struct GNUNET_ATS_Session *s = cls;
1133 const struct GNUNET_SCHEDULER_TaskContext *tc;
1138 1134
1139 s->recv_wakeup_task = NULL; 1135 s->recv_wakeup_task = NULL;
1136 tc = GNUNET_SCHEDULER_get_task_context ();
1140 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1137 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1141 return; 1138 return;
1142 LOG (GNUNET_ERROR_TYPE_DEBUG, 1139 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1293,11 +1290,9 @@ client_receive (void *stream,
1293 * Task performing curl operations 1290 * Task performing curl operations
1294 * 1291 *
1295 * @param cls plugin as closure 1292 * @param cls plugin as closure
1296 * @param tc scheduler task context
1297 */ 1293 */
1298static void 1294static void
1299client_run (void *cls, 1295client_run (void *cls)
1300 const struct GNUNET_SCHEDULER_TaskContext *tc)
1301{ 1296{
1302 struct HTTP_Client_Plugin *plugin = cls; 1297 struct HTTP_Client_Plugin *plugin = cls;
1303 int running; 1298 int running;
@@ -1306,8 +1301,10 @@ client_run (void *cls,
1306 CURLMsg *msg; 1301 CURLMsg *msg;
1307 int put_request; /* GNUNET_YES if easy handle is put, GNUNET_NO for get */ 1302 int put_request; /* GNUNET_YES if easy handle is put, GNUNET_NO for get */
1308 int msgs_left; 1303 int msgs_left;
1304 const struct GNUNET_SCHEDULER_TaskContext *tc;
1309 1305
1310 plugin->client_perform_task = NULL; 1306 plugin->client_perform_task = NULL;
1307 tc = GNUNET_SCHEDULER_get_task_context ();
1311 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1308 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1312 return; 1309 return;
1313 1310
@@ -1963,11 +1960,9 @@ http_client_plugin_get_network_for_address (void *cls,
1963 * Session was idle, so disconnect it 1960 * Session was idle, so disconnect it
1964 * 1961 *
1965 * @param cls the `struct GNUNET_ATS_Session` of the idle session 1962 * @param cls the `struct GNUNET_ATS_Session` of the idle session
1966 * @param tc scheduler context
1967 */ 1963 */
1968static void 1964static void
1969client_session_timeout (void *cls, 1965client_session_timeout (void *cls)
1970 const struct GNUNET_SCHEDULER_TaskContext *tc)
1971{ 1966{
1972 struct GNUNET_ATS_Session *s = cls; 1967 struct GNUNET_ATS_Session *s = cls;
1973 struct GNUNET_TIME_Relative left; 1968 struct GNUNET_TIME_Relative left;
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index cc1548f20..dfd0294e5 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -491,14 +491,14 @@ notify_session_monitor (struct HTTP_Server_Plugin *plugin,
491 * Wake up an MHD connection which was suspended 491 * Wake up an MHD connection which was suspended
492 * 492 *
493 * @param cls the session 493 * @param cls the session
494 * @param tc task context
495 */ 494 */
496static void 495static void
497server_wake_up (void *cls, 496server_wake_up (void *cls)
498 const struct GNUNET_SCHEDULER_TaskContext *tc)
499{ 497{
500 struct GNUNET_ATS_Session *s = cls; 498 struct GNUNET_ATS_Session *s = cls;
499 const struct GNUNET_SCHEDULER_TaskContext *tc;
501 500
501 tc = GNUNET_SCHEDULER_get_task_context ();
502 s->recv_wakeup_task = NULL; 502 s->recv_wakeup_task = NULL;
503 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 503 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
504 return; 504 return;
@@ -641,11 +641,9 @@ http_server_plugin_disconnect_session (void *cls,
641 * Session was idle, so disconnect it 641 * Session was idle, so disconnect it
642 * 642 *
643 * @param cls the session 643 * @param cls the session
644 * @param tc task context
645 */ 644 */
646static void 645static void
647server_session_timeout (void *cls, 646server_session_timeout (void *cls)
648 const struct GNUNET_SCHEDULER_TaskContext *tc)
649{ 647{
650 struct GNUNET_ATS_Session *s = cls; 648 struct GNUNET_ATS_Session *s = cls;
651 struct GNUNET_TIME_Relative left; 649 struct GNUNET_TIME_Relative left;
@@ -910,15 +908,15 @@ http_server_plugin_get_session (void *cls,
910 * and schedule the next run. 908 * and schedule the next run.
911 * 909 *
912 * @param cls plugin as closure 910 * @param cls plugin as closure
913 * @param tc task context
914 */ 911 */
915static void 912static void
916server_v4_run (void *cls, 913server_v4_run (void *cls)
917 const struct GNUNET_SCHEDULER_TaskContext *tc)
918{ 914{
919 struct HTTP_Server_Plugin *plugin = cls; 915 struct HTTP_Server_Plugin *plugin = cls;
916 const struct GNUNET_SCHEDULER_TaskContext *tc;
920 917
921 plugin->server_v4_task = NULL; 918 plugin->server_v4_task = NULL;
919 tc = GNUNET_SCHEDULER_get_task_context ();
922 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 920 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
923 return; 921 return;
924 plugin->server_v4_immediately = GNUNET_NO; 922 plugin->server_v4_immediately = GNUNET_NO;
@@ -932,15 +930,15 @@ server_v4_run (void *cls,
932 * and schedule the next run. 930 * and schedule the next run.
933 * 931 *
934 * @param cls plugin as closure 932 * @param cls plugin as closure
935 * @param tc task context
936 */ 933 */
937static void 934static void
938server_v6_run (void *cls, 935server_v6_run (void *cls)
939 const struct GNUNET_SCHEDULER_TaskContext *tc)
940{ 936{
941 struct HTTP_Server_Plugin *plugin = cls; 937 struct HTTP_Server_Plugin *plugin = cls;
938 const struct GNUNET_SCHEDULER_TaskContext *tc;
942 939
943 plugin->server_v6_task = NULL; 940 plugin->server_v6_task = NULL;
941 tc = GNUNET_SCHEDULER_get_task_context ();
944 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 942 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
945 return; 943 return;
946 plugin->server_v6_immediately = GNUNET_NO; 944 plugin->server_v6_immediately = GNUNET_NO;
@@ -2844,19 +2842,19 @@ server_check_ipv6_support (struct HTTP_Server_Plugin *plugin)
2844 * Notify server about our external hostname 2842 * Notify server about our external hostname
2845 * 2843 *
2846 * @param cls plugin 2844 * @param cls plugin
2847 * @param tc task context (unused)
2848 */ 2845 */
2849static void 2846static void
2850server_notify_external_hostname (void *cls, 2847server_notify_external_hostname (void *cls)
2851 const struct GNUNET_SCHEDULER_TaskContext *tc)
2852{ 2848{
2853 struct HTTP_Server_Plugin *plugin = cls; 2849 struct HTTP_Server_Plugin *plugin = cls;
2854 struct HttpAddress *ext_addr; 2850 struct HttpAddress *ext_addr;
2855 size_t ext_addr_len; 2851 size_t ext_addr_len;
2856 unsigned int urlen; 2852 unsigned int urlen;
2857 char *url; 2853 char *url;
2854 const struct GNUNET_SCHEDULER_TaskContext *tc;
2858 2855
2859 plugin->notify_ext_task = NULL; 2856 plugin->notify_ext_task = NULL;
2857 tc = GNUNET_SCHEDULER_get_task_context ();
2860 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 2858 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
2861 return; 2859 return;
2862 2860
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 52ab4414f..b1c68acdf 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -957,11 +957,9 @@ tcp_plugin_query_keepalive_factor (void *cls)
957 * Session was idle for too long, so disconnect it 957 * Session was idle for too long, so disconnect it
958 * 958 *
959 * @param cls the `struct GNUNET_ATS_Session` of the idle session 959 * @param cls the `struct GNUNET_ATS_Session` of the idle session
960 * @param tc scheduler context
961 */ 960 */
962static void 961static void
963session_timeout (void *cls, 962session_timeout (void *cls)
964 const struct GNUNET_SCHEDULER_TaskContext *tc)
965{ 963{
966 struct GNUNET_ATS_Session *s = cls; 964 struct GNUNET_ATS_Session *s = cls;
967 struct GNUNET_TIME_Relative left; 965 struct GNUNET_TIME_Relative left;
@@ -1457,11 +1455,9 @@ session_lookup_it (void *cls,
1457 * Task cleaning up a NAT connection attempt after timeout 1455 * Task cleaning up a NAT connection attempt after timeout
1458 * 1456 *
1459 * @param cls the `struct GNUNET_ATS_Session` 1457 * @param cls the `struct GNUNET_ATS_Session`
1460 * @param tc scheduler context (unused)
1461 */ 1458 */
1462static void 1459static void
1463nat_connect_timeout (void *cls, 1460nat_connect_timeout (void *cls)
1464 const struct GNUNET_SCHEDULER_TaskContext *tc)
1465{ 1461{
1466 struct GNUNET_ATS_Session *session = cls; 1462 struct GNUNET_ATS_Session *session = cls;
1467 1463
@@ -1500,11 +1496,9 @@ tcp_plugin_update_session_timeout (void *cls,
1500 * receiving from the TCP client now. 1496 * receiving from the TCP client now.
1501 * 1497 *
1502 * @param cls the `struct GNUNET_ATS_Session *` 1498 * @param cls the `struct GNUNET_ATS_Session *`
1503 * @param tc task context (unused)
1504 */ 1499 */
1505static void 1500static void
1506delayed_done (void *cls, 1501delayed_done (void *cls)
1507 const struct GNUNET_SCHEDULER_TaskContext *tc)
1508{ 1502{
1509 struct GNUNET_ATS_Session *session = cls; 1503 struct GNUNET_ATS_Session *session = cls;
1510 1504
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;
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c
index b2c9e1515..6c5efd5f1 100644
--- a/src/transport/plugin_transport_udp_broadcasting.c
+++ b/src/transport/plugin_transport_udp_broadcasting.c
@@ -232,8 +232,7 @@ prepare_beacon (struct Plugin *plugin,
232 232
233 233
234static void 234static void
235udp_ipv4_broadcast_send (void *cls, 235udp_ipv4_broadcast_send (void *cls)
236 const struct GNUNET_SCHEDULER_TaskContext *tc)
237{ 236{
238 struct BroadcastAddress *baddr = cls; 237 struct BroadcastAddress *baddr = cls;
239 struct Plugin *plugin = baddr->plugin; 238 struct Plugin *plugin = baddr->plugin;
@@ -308,8 +307,7 @@ udp_ipv4_broadcast_send (void *cls,
308 307
309 308
310static void 309static void
311udp_ipv6_broadcast_send (void *cls, 310udp_ipv6_broadcast_send (void *cls)
312 const struct GNUNET_SCHEDULER_TaskContext *tc)
313{ 311{
314 struct BroadcastAddress *baddr = cls; 312 struct BroadcastAddress *baddr = cls;
315 struct Plugin *plugin = baddr->plugin; 313 struct Plugin *plugin = baddr->plugin;
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 5ad5a0432..e320785d4 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -498,11 +498,9 @@ unix_plugin_session_disconnect (void *cls,
498 * Session was idle for too long, so disconnect it 498 * Session was idle for too long, so disconnect it
499 * 499 *
500 * @param cls the `struct GNUNET_ATS_Session *` to disconnect 500 * @param cls the `struct GNUNET_ATS_Session *` to disconnect
501 * @param tc scheduler context
502 */ 501 */
503static void 502static void
504session_timeout (void *cls, 503session_timeout (void *cls)
505 const struct GNUNET_SCHEDULER_TaskContext *tc)
506{ 504{
507 struct GNUNET_ATS_Session *session = cls; 505 struct GNUNET_ATS_Session *session = cls;
508 struct GNUNET_TIME_Relative left; 506 struct GNUNET_TIME_Relative left;
@@ -1225,14 +1223,14 @@ unix_plugin_do_write (struct Plugin *plugin)
1225 * Then reschedule this function to be called again once more is available. 1223 * Then reschedule this function to be called again once more is available.
1226 * 1224 *
1227 * @param cls the plugin handle 1225 * @param cls the plugin handle
1228 * @param tc the scheduling context
1229 */ 1226 */
1230static void 1227static void
1231unix_plugin_select_read (void *cls, 1228unix_plugin_select_read (void *cls)
1232 const struct GNUNET_SCHEDULER_TaskContext *tc)
1233{ 1229{
1234 struct Plugin *plugin = cls; 1230 struct Plugin *plugin = cls;
1231 const struct GNUNET_SCHEDULER_TaskContext *tc;
1235 1232
1233 tc = GNUNET_SCHEDULER_get_task_context ();
1236 plugin->read_task = NULL; 1234 plugin->read_task = NULL;
1237 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1235 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1238 return; 1236 return;
@@ -1250,14 +1248,14 @@ unix_plugin_select_read (void *cls,
1250 * Then reschedule this function to be called again once more is available. 1248 * Then reschedule this function to be called again once more is available.
1251 * 1249 *
1252 * @param cls the plugin handle 1250 * @param cls the plugin handle
1253 * @param tc the scheduling context
1254 */ 1251 */
1255static void 1252static void
1256unix_plugin_select_write (void *cls, 1253unix_plugin_select_write (void *cls)
1257 const struct GNUNET_SCHEDULER_TaskContext *tc)
1258{ 1254{
1259 struct Plugin *plugin = cls; 1255 struct Plugin *plugin = cls;
1256 const struct GNUNET_SCHEDULER_TaskContext *tc;
1260 1257
1258 tc = GNUNET_SCHEDULER_get_task_context ();
1261 plugin->write_task = NULL; 1259 plugin->write_task = NULL;
1262 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1260 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1263 return; 1261 return;
@@ -1617,11 +1615,9 @@ unix_plugin_string_to_address (void *cls,
1617 * Notify transport service about address 1615 * Notify transport service about address
1618 * 1616 *
1619 * @param cls the plugin 1617 * @param cls the plugin
1620 * @param tc unused
1621 */ 1618 */
1622static void 1619static void
1623address_notification (void *cls, 1620address_notification (void *cls)
1624 const struct GNUNET_SCHEDULER_TaskContext *tc)
1625{ 1621{
1626 struct Plugin *plugin = cls; 1622 struct Plugin *plugin = cls;
1627 struct GNUNET_HELLO_Address *address; 1623 struct GNUNET_HELLO_Address *address;
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c
index 6e23299b9..9c9c1e8c2 100644
--- a/src/transport/plugin_transport_wlan.c
+++ b/src/transport/plugin_transport_wlan.c
@@ -828,11 +828,9 @@ wlan_plugin_query_keepalive_factor (void *cls)
828 * A session is timing out. Clean up. 828 * A session is timing out. Clean up.
829 * 829 *
830 * @param cls pointer to the Session 830 * @param cls pointer to the Session
831 * @param tc unused
832 */ 831 */
833static void 832static void
834session_timeout (void *cls, 833session_timeout (void *cls)
835 const struct GNUNET_SCHEDULER_TaskContext *tc)
836{ 834{
837 struct GNUNET_ATS_Session *session = cls; 835 struct GNUNET_ATS_Session *session = cls;
838 struct GNUNET_TIME_Relative left; 836 struct GNUNET_TIME_Relative left;
@@ -1072,11 +1070,9 @@ free_fragment_message (struct FragmentMessage *fm)
1072 * A FragmentMessage has timed out. Remove it. 1070 * A FragmentMessage has timed out. Remove it.
1073 * 1071 *
1074 * @param cls pointer to the 'struct FragmentMessage' 1072 * @param cls pointer to the 'struct FragmentMessage'
1075 * @param tc unused
1076 */ 1073 */
1077static void 1074static void
1078fragmentmessage_timeout (void *cls, 1075fragmentmessage_timeout (void *cls)
1079 const struct GNUNET_SCHEDULER_TaskContext *tc)
1080{ 1076{
1081 struct FragmentMessage *fm = cls; 1077 struct FragmentMessage *fm = cls;
1082 1078
@@ -1200,11 +1196,9 @@ free_macendpoint (struct MacEndpoint *endpoint)
1200 * A MAC endpoint is timing out. Clean up. 1196 * A MAC endpoint is timing out. Clean up.
1201 * 1197 *
1202 * @param cls pointer to the `struct MacEndpoint *` 1198 * @param cls pointer to the `struct MacEndpoint *`
1203 * @param tc pointer to the GNUNET_SCHEDULER_TaskContext
1204 */ 1199 */
1205static void 1200static void
1206macendpoint_timeout (void *cls, 1201macendpoint_timeout (void *cls)
1207 const struct GNUNET_SCHEDULER_TaskContext *tc)
1208{ 1202{
1209 struct MacEndpoint *endpoint = cls; 1203 struct MacEndpoint *endpoint = cls;
1210 struct GNUNET_TIME_Relative timeout; 1204 struct GNUNET_TIME_Relative timeout;
@@ -1681,11 +1675,9 @@ process_data (void *cls,
1681 * Task to (periodically) send a HELLO beacon 1675 * Task to (periodically) send a HELLO beacon
1682 * 1676 *
1683 * @param cls pointer to the plugin struct 1677 * @param cls pointer to the plugin struct
1684 * @param tc scheduler context
1685 */ 1678 */
1686static void 1679static void
1687send_hello_beacon (void *cls, 1680send_hello_beacon (void *cls)
1688 const struct GNUNET_SCHEDULER_TaskContext *tc)
1689{ 1681{
1690 struct Plugin *plugin = cls; 1682 struct Plugin *plugin = cls;
1691 uint16_t size; 1683 uint16_t size;
diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c
index b906020bb..e75cb7c7f 100644
--- a/src/transport/test_plugin_transport.c
+++ b/src/transport/test_plugin_transport.c
@@ -184,7 +184,7 @@ end ()
184 184
185 185
186static void 186static void
187end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 187end_badly (void *cls)
188{ 188{
189 struct AddressWrapper *w; 189 struct AddressWrapper *w;
190 int c = 0; 190 int c = 0;
@@ -255,7 +255,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
255} 255}
256 256
257static void 257static void
258wait_end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 258wait_end (void *cls)
259{ 259{
260 timeout_wait = NULL; 260 timeout_wait = NULL;
261 if (0 == addresses_reported) 261 if (0 == addresses_reported)
@@ -325,8 +325,7 @@ address_pretty_printer_cb (void *cls, const char *address, int res)
325 325
326 326
327static void 327static void
328test_addr_string (void *cls, 328test_addr_string (void *cls)
329 const struct GNUNET_SCHEDULER_TaskContext *tc)
330{ 329{
331 struct AddressWrapper *w = cls; 330 struct AddressWrapper *w = cls;
332 void *s2a; 331 void *s2a;
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c
index ad1ecbe7a..3889aa0ef 100644
--- a/src/transport/test_quota_compliance.c
+++ b/src/transport/test_quota_compliance.c
@@ -354,7 +354,7 @@ sendtask ()
354 354
355 355
356static void 356static void
357measure (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 357measure (void *cls)
358{ 358{
359 static int counter; 359 static int counter;
360 360
diff --git a/src/transport/test_transport_address_switch.c b/src/transport/test_transport_address_switch.c
index 2780767ff..6c86a160f 100644
--- a/src/transport/test_transport_address_switch.c
+++ b/src/transport/test_transport_address_switch.c
@@ -564,8 +564,7 @@ sendtask ()
564 564
565 565
566static void 566static void
567progress_indicator (void *cls, 567progress_indicator (void *cls)
568 const struct GNUNET_SCHEDULER_TaskContext *tc)
569{ 568{
570 static int counter; 569 static int counter;
571 570
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c
index 2ebd80a0c..13333b371 100644
--- a/src/transport/test_transport_api.c
+++ b/src/transport/test_transport_api.c
@@ -96,8 +96,9 @@ end ()
96 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2); 96 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
97} 97}
98 98
99
99static void 100static void
100end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 101end_badly (void *cls)
101{ 102{
102 die_task = NULL; 103 die_task = NULL;
103 104
@@ -225,10 +226,12 @@ notify_ready (void *cls, size_t size, void *buf)
225 226
226 227
227static void 228static void
228sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 229sendtask (void *cls)
229{ 230{
230 send_task = NULL; 231 const struct GNUNET_SCHEDULER_TaskContext *tc;
231 232
233 send_task = NULL;
234 tc = GNUNET_SCHEDULER_get_task_context ();
232 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 235 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
233 return; 236 return;
234 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 237 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_bidirectional_connect.c b/src/transport/test_transport_api_bidirectional_connect.c
index 30de6b7ba..1e00e982d 100644
--- a/src/transport/test_transport_api_bidirectional_connect.c
+++ b/src/transport/test_transport_api_bidirectional_connect.c
@@ -95,7 +95,7 @@ end ()
95 95
96 96
97static void 97static void
98end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 98end_badly (void *cls)
99{ 99{
100 die_task = NULL; 100 die_task = NULL;
101 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 101 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
@@ -208,10 +208,12 @@ notify_ready (void *cls, size_t size, void *buf)
208 208
209 209
210static void 210static void
211sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 211sendtask (void *cls)
212{ 212{
213 send_task = NULL; 213 const struct GNUNET_SCHEDULER_TaskContext *tc;
214 214
215 send_task = NULL;
216 tc = GNUNET_SCHEDULER_get_task_context ();
215 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 217 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
216 return; 218 return;
217 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 219 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
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));
diff --git a/src/transport/test_transport_api_disconnect.c b/src/transport/test_transport_api_disconnect.c
index c6b247c1d..36497ece5 100644
--- a/src/transport/test_transport_api_disconnect.c
+++ b/src/transport/test_transport_api_disconnect.c
@@ -107,8 +107,9 @@ end ()
107 ok = 0; 107 ok = 0;
108} 108}
109 109
110
110static void 111static void
111end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 112end_badly (void *cls)
112{ 113{
113 die_task = NULL; 114 die_task = NULL;
114 115
@@ -162,8 +163,11 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
162 163
163 164
164static void 165static void
165stop_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 166stop_peer (void *cls)
166{ 167{
168 const struct GNUNET_SCHEDULER_TaskContext *tc;
169
170 tc = GNUNET_SCHEDULER_get_task_context ();
167 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 171 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
168 return; 172 return;
169 173
@@ -248,10 +252,12 @@ notify_ready (void *cls, size_t size, void *buf)
248 252
249 253
250static void 254static void
251sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 255sendtask (void *cls)
252{ 256{
253 send_task = NULL; 257 const struct GNUNET_SCHEDULER_TaskContext *tc;
254 258
259 send_task = NULL;
260 tc = GNUNET_SCHEDULER_get_task_context ();
255 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 261 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
256 return; 262 return;
257 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 263 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_limited_sockets.c b/src/transport/test_transport_api_limited_sockets.c
index 284f5b9cc..8d875ed52 100644
--- a/src/transport/test_transport_api_limited_sockets.c
+++ b/src/transport/test_transport_api_limited_sockets.c
@@ -102,7 +102,7 @@ end ()
102} 102}
103 103
104static void 104static void
105end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 105end_badly (void *cls)
106{ 106{
107 die_task = NULL; 107 die_task = NULL;
108 108
@@ -194,11 +194,14 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
194 th = NULL; 194 th = NULL;
195} 195}
196 196
197
197static void 198static void
198sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 199sendtask (void *cls)
199{ 200{
200 send_task = NULL; 201 const struct GNUNET_SCHEDULER_TaskContext *tc;
201 202
203 send_task = NULL;
204 tc = GNUNET_SCHEDULER_get_task_context ();
202 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 205 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
203 return; 206 return;
204 207
@@ -354,4 +357,3 @@ main (int argc, char *argv[])
354#endif 357#endif
355 358
356/* end of test_transport_api_limited_sockets.c */ 359/* end of test_transport_api_limited_sockets.c */
357
diff --git a/src/transport/test_transport_api_manipulation_cfg.c b/src/transport/test_transport_api_manipulation_cfg.c
index 89d5fe4d9..915b79719 100644
--- a/src/transport/test_transport_api_manipulation_cfg.c
+++ b/src/transport/test_transport_api_manipulation_cfg.c
@@ -109,7 +109,7 @@ end ()
109 109
110 110
111static void 111static void
112end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 112end_badly (void *cls)
113{ 113{
114 die_task = NULL; 114 die_task = NULL;
115 115
@@ -204,11 +204,12 @@ notify_request_ready (void *cls, size_t size, void *buf)
204 204
205 205
206static void 206static void
207sendtask_request_task (void *cls, 207sendtask_request_task (void *cls)
208 const struct GNUNET_SCHEDULER_TaskContext *tc)
209{ 208{
210 send_task = NULL; 209 const struct GNUNET_SCHEDULER_TaskContext *tc;
211 210
211 send_task = NULL;
212 tc = GNUNET_SCHEDULER_get_task_context ();
212 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 213 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
213 return; 214 return;
214 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p2->id)); 215 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p2->id));
@@ -269,11 +270,12 @@ notify_response_ready (void *cls, size_t size, void *buf)
269 270
270 271
271static void 272static void
272sendtask_response_task (void *cls, 273sendtask_response_task (void *cls)
273 const struct GNUNET_SCHEDULER_TaskContext *tc)
274{ 274{
275 send_task = NULL; 275 const struct GNUNET_SCHEDULER_TaskContext *tc;
276 276
277 send_task = NULL;
278 tc = GNUNET_SCHEDULER_get_task_context ();
277 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 279 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
278 return; 280 return;
279 { 281 {
diff --git a/src/transport/test_transport_api_manipulation_recv_tcp.c b/src/transport/test_transport_api_manipulation_recv_tcp.c
index f48abfc7c..7b82236f9 100644
--- a/src/transport/test_transport_api_manipulation_recv_tcp.c
+++ b/src/transport/test_transport_api_manipulation_recv_tcp.c
@@ -104,8 +104,9 @@ end ()
104 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2); 104 GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
105} 105}
106 106
107
107static void 108static void
108end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 109end_badly (void *cls)
109{ 110{
110 die_task = NULL; 111 die_task = NULL;
111 112
@@ -158,7 +159,8 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
158 159
159 160
160static void 161static void
161sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 162sendtask (void *cls);
163
162 164
163static void 165static void
164notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, 166notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
@@ -288,11 +290,12 @@ notify_ready (void *cls, size_t size, void *buf)
288 290
289 291
290static void 292static void
291sendtask (void *cls, 293sendtask (void *cls)
292 const struct GNUNET_SCHEDULER_TaskContext *tc)
293{ 294{
294 send_task = NULL; 295 const struct GNUNET_SCHEDULER_TaskContext *tc;
295 296
297 send_task = NULL;
298 tc = GNUNET_SCHEDULER_get_task_context ();
296 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 299 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
297 return; 300 return;
298 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 301 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_manipulation_send_tcp.c b/src/transport/test_transport_api_manipulation_send_tcp.c
index c2eaf7a50..22b420c27 100644
--- a/src/transport/test_transport_api_manipulation_send_tcp.c
+++ b/src/transport/test_transport_api_manipulation_send_tcp.c
@@ -107,7 +107,7 @@ end ()
107 107
108 108
109static void 109static void
110end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 110end_badly (void *cls)
111{ 111{
112 die_task = NULL; 112 die_task = NULL;
113 113
@@ -160,7 +160,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
160 160
161 161
162static void 162static void
163sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 163sendtask (void *cls);
164 164
165 165
166static void 166static void
@@ -284,13 +284,14 @@ notify_ready (void *cls, size_t size, void *buf)
284 284
285 285
286static void 286static void
287sendtask (void *cls, 287sendtask (void *cls)
288 const struct GNUNET_SCHEDULER_TaskContext *tc)
289{ 288{
290 struct GNUNET_TIME_Relative delay; 289 struct GNUNET_TIME_Relative delay;
291 struct GNUNET_ATS_Properties prop; 290 struct GNUNET_ATS_Properties prop;
291 const struct GNUNET_SCHEDULER_TaskContext *tc;
292 292
293 send_task = NULL; 293 send_task = NULL;
294 tc = GNUNET_SCHEDULER_get_task_context ();
294 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 295 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
295 return; 296 return;
296 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 297 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_monitor_peers.c b/src/transport/test_transport_api_monitor_peers.c
index 152667a0b..79b39325c 100644
--- a/src/transport/test_transport_api_monitor_peers.c
+++ b/src/transport/test_transport_api_monitor_peers.c
@@ -129,8 +129,7 @@ end ()
129 129
130 130
131static void 131static void
132end_badly (void *cls, 132end_badly (void *cls)
133 const struct GNUNET_SCHEDULER_TaskContext *tc)
134{ 133{
135 die_task = NULL; 134 die_task = NULL;
136 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fail! Stopping peers\n"); 135 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fail! Stopping peers\n");
@@ -261,10 +260,12 @@ notify_ready (void *cls, size_t size, void *buf)
261 260
262 261
263static void 262static void
264sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 263sendtask (void *cls)
265{ 264{
266 send_task = NULL; 265 const struct GNUNET_SCHEDULER_TaskContext *tc;
267 266
267 send_task = NULL;
268 tc = GNUNET_SCHEDULER_get_task_context ();
268 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 269 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
269 return; 270 return;
270 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 271 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_monitor_validation.c b/src/transport/test_transport_api_monitor_validation.c
index 907b9275f..37b8494f1 100644
--- a/src/transport/test_transport_api_monitor_validation.c
+++ b/src/transport/test_transport_api_monitor_validation.c
@@ -122,7 +122,7 @@ end ()
122} 122}
123 123
124static void 124static void
125end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 125end_badly (void *cls)
126{ 126{
127 die_task = NULL; 127 die_task = NULL;
128 128
@@ -273,10 +273,12 @@ notify_ready (void *cls,
273 273
274 274
275static void 275static void
276sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 276sendtask (void *cls)
277{ 277{
278 send_task = NULL; 278 const struct GNUNET_SCHEDULER_TaskContext *tc;
279 279
280 send_task = NULL;
281 tc = GNUNET_SCHEDULER_get_task_context ();
280 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 282 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
281 return; 283 return;
282 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 284 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c
index 86f294240..cc2115a48 100644
--- a/src/transport/test_transport_api_reliability.c
+++ b/src/transport/test_transport_api_reliability.c
@@ -526,8 +526,7 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
526 526
527 527
528static void 528static void
529sendtask (void *cls, 529sendtask (void *cls)
530 const struct GNUNET_SCHEDULER_TaskContext *tc)
531{ 530{
532 start_time = GNUNET_TIME_absolute_get (); 531 start_time = GNUNET_TIME_absolute_get ();
533 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 532 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
diff --git a/src/transport/test_transport_api_restart_1peer.c b/src/transport/test_transport_api_restart_1peer.c
index f51b70e92..adec15f4f 100644
--- a/src/transport/test_transport_api_restart_1peer.c
+++ b/src/transport/test_transport_api_restart_1peer.c
@@ -112,8 +112,7 @@ end ()
112 112
113 113
114static void 114static void
115end_badly (void *cls, 115end_badly (void *cls)
116 const struct GNUNET_SCHEDULER_TaskContext *tc)
117{ 116{
118 die_task = NULL; 117 die_task = NULL;
119 118
@@ -259,10 +258,12 @@ notify_ready (void *cls, size_t size, void *buf)
259 258
260 259
261static void 260static void
262sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 261sendtask (void *cls)
263{ 262{
264 send_task = NULL; 263 const struct GNUNET_SCHEDULER_TaskContext *tc;
265 264
265 send_task = NULL;
266 tc = GNUNET_SCHEDULER_get_task_context ();
266 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 267 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
267 return; 268 return;
268 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id)); 269 char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p1->id));
diff --git a/src/transport/test_transport_api_restart_2peers.c b/src/transport/test_transport_api_restart_2peers.c
index 985148d54..2a669c9a0 100644
--- a/src/transport/test_transport_api_restart_2peers.c
+++ b/src/transport/test_transport_api_restart_2peers.c
@@ -105,8 +105,7 @@ end ()
105 105
106 106
107static void 107static void
108end_badly (void *cls, 108end_badly (void *cls)
109 const struct GNUNET_SCHEDULER_TaskContext *tc)
110{ 109{
111 die_task = NULL; 110 die_task = NULL;
112 111
@@ -265,11 +264,12 @@ notify_ready (void *cls,
265 264
266 265
267static void 266static void
268sendtask (void *cls, 267sendtask (void *cls)
269 const struct GNUNET_SCHEDULER_TaskContext *tc)
270{ 268{
271 send_task = NULL; 269 const struct GNUNET_SCHEDULER_TaskContext *tc;
272 270
271 send_task = NULL;
272 tc = GNUNET_SCHEDULER_get_task_context ();
273 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 273 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
274 return; 274 return;
275 275
diff --git a/src/transport/test_transport_api_timeout.c b/src/transport/test_transport_api_timeout.c
index 256ce46a8..aa9884a2e 100644
--- a/src/transport/test_transport_api_timeout.c
+++ b/src/transport/test_transport_api_timeout.c
@@ -120,8 +120,9 @@ end ()
120 GNUNET_TRANSPORT_TESTING_done (tth); 120 GNUNET_TRANSPORT_TESTING_done (tth);
121} 121}
122 122
123
123static void 124static void
124end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 125end_badly (void *cls)
125{ 126{
126 die_task = NULL; 127 die_task = NULL;
127 128
@@ -181,12 +182,13 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
181 182
182 183
183static void 184static void
184timer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 185timer (void *cls)
185{ 186{
186 static int percentage; 187 static int percentage;
188 const struct GNUNET_SCHEDULER_TaskContext *tc;
187 189
188 timer_task = NULL; 190 timer_task = NULL;
189 191 tc = GNUNET_SCHEDULER_get_task_context ();
190 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 192 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
191 return; 193 return;
192 194
diff --git a/src/transport/test_transport_blacklisting.c b/src/transport/test_transport_blacklisting.c
index 8ac198cfe..6cb598f2f 100644
--- a/src/transport/test_transport_blacklisting.c
+++ b/src/transport/test_transport_blacklisting.c
@@ -85,11 +85,13 @@ static struct GNUNET_SCHEDULER_Task * stage_task;
85#define OKPP do { ok++; } while (0) 85#define OKPP do { ok++; } while (0)
86#endif 86#endif
87 87
88
88static void 89static void
89run_stage(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); 90run_stage(void *cls);
91
90 92
91static void 93static void
92end(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 94end (void *cls)
93{ 95{
94 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping\n"); 96 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping\n");
95 97
@@ -129,8 +131,9 @@ end(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
129 } 131 }
130} 132}
131 133
134
132static void 135static void
133end_badly(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 136end_badly (void *cls)
134{ 137{
135 die_task = NULL; 138 die_task = NULL;
136 139
@@ -172,17 +175,20 @@ testing_connect_cb(struct PeerContext *p1, struct PeerContext *p2, void *cls)
172 stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL ); 175 stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL );
173} 176}
174 177
178
175static void 179static void
176connect_timeout(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 180connect_timeout(void *cls)
177{ 181{
178 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Peers not connected, next stage\n"); 182 GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Peers not connected, next stage\n");
179 timeout_task = NULL; 183 timeout_task = NULL;
180 stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL ); 184 stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL);
181} 185}
182 186
187
183static int started; 188static int started;
184 189
185void 190
191static void
186start_cb(struct PeerContext *p, void *cls) 192start_cb(struct PeerContext *p, void *cls)
187{ 193{
188 194
@@ -243,8 +249,9 @@ static int check_blacklist_config (char *cfg_file,
243 return GNUNET_OK; 249 return GNUNET_OK;
244} 250}
245 251
252
246static void 253static void
247run_stage(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 254run_stage (void *cls)
248{ 255{
249 stage_task = NULL; 256 stage_task = NULL;
250 if (NULL != die_task) 257 if (NULL != die_task)
diff --git a/src/transport/test_transport_startonly.c b/src/transport/test_transport_startonly.c
index b23a516f5..d49e3a8c0 100644
--- a/src/transport/test_transport_startonly.c
+++ b/src/transport/test_transport_startonly.c
@@ -63,9 +63,13 @@ end ()
63 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting\n"); 63 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting\n");
64} 64}
65 65
66
66static void 67static void
67end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 68end_badly (void *cls)
68{ 69{
70 const struct GNUNET_SCHEDULER_TaskContext *tc;
71
72 tc = GNUNET_SCHEDULER_get_task_context ();
69 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n"); 73 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
70 74
71 timeout_task = NULL; 75 timeout_task = NULL;
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c
index 7538e2d6a..652a4e08f 100644
--- a/src/transport/transport-testing.c
+++ b/src/transport/transport-testing.c
@@ -195,11 +195,9 @@ get_hello (void *cb_cls,
195 * Offer the current HELLO of P2 to P1. 195 * Offer the current HELLO of P2 to P1.
196 * 196 *
197 * @param cls our `struct GNUNET_TRANSPORT_TESTING_ConnectRequest ` 197 * @param cls our `struct GNUNET_TRANSPORT_TESTING_ConnectRequest `
198 * @param tc scheduler context
199 */ 198 */
200static void 199static void
201offer_hello (void *cls, 200offer_hello (void *cls);
202 const struct GNUNET_SCHEDULER_TaskContext *tc);
203 201
204 202
205/** 203/**
@@ -207,8 +205,7 @@ offer_hello (void *cls,
207 * transport service. 205 * transport service.
208 */ 206 */
209static void 207static void
210hello_offered (void *cls, 208hello_offered (void *cls)
211 const struct GNUNET_SCHEDULER_TaskContext *tc)
212{ 209{
213 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls; 210 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls;
214 211
@@ -224,17 +221,17 @@ hello_offered (void *cls,
224 * Offer the current HELLO of P2 to P1. 221 * Offer the current HELLO of P2 to P1.
225 * 222 *
226 * @param cls our `struct GNUNET_TRANSPORT_TESTING_ConnectRequest ` 223 * @param cls our `struct GNUNET_TRANSPORT_TESTING_ConnectRequest `
227 * @param tc scheduler context
228 */ 224 */
229static void 225static void
230offer_hello (void *cls, 226offer_hello (void *cls)
231 const struct GNUNET_SCHEDULER_TaskContext *tc)
232{ 227{
233 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls; 228 struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls;
234 struct PeerContext *p1 = cc->p1; 229 struct PeerContext *p1 = cc->p1;
235 struct PeerContext *p2 = cc->p2; 230 struct PeerContext *p2 = cc->p2;
231 const struct GNUNET_SCHEDULER_TaskContext *tc;
236 232
237 cc->tct = NULL; 233 cc->tct = NULL;
234 tc = GNUNET_SCHEDULER_get_task_context ();
238 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) 235 if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
239 return; 236 return;
240 { 237 {
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c
index b5f9e0a6b..6fc538f25 100644
--- a/src/transport/transport_api.c
+++ b/src/transport/transport_api.c
@@ -401,11 +401,9 @@ disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h);
401 * A neighbour has not gotten a SEND_OK in a while. Print a warning. 401 * A neighbour has not gotten a SEND_OK in a while. Print a warning.
402 * 402 *
403 * @param cls the `struct Neighbour` 403 * @param cls the `struct Neighbour`
404 * @param tc scheduler context
405 */ 404 */
406static void 405static void
407do_warn_unready (void *cls, 406do_warn_unready (void *cls)
408 const struct GNUNET_SCHEDULER_TaskContext *tc)
409{ 407{
410 struct Neighbour *n = cls; 408 struct Neighbour *n = cls;
411 struct GNUNET_TIME_Relative delay; 409 struct GNUNET_TIME_Relative delay;
@@ -830,11 +828,9 @@ demultiplexer (void *cls,
830 * network congestion. Notify the initiator and clean up. 828 * network congestion. Notify the initiator and clean up.
831 * 829 *
832 * @param cls the `struct GNUNET_TRANSPORT_TransmitHandle` 830 * @param cls the `struct GNUNET_TRANSPORT_TransmitHandle`
833 * @param tc scheduler context
834 */ 831 */
835static void 832static void
836timeout_request_due_to_congestion (void *cls, 833timeout_request_due_to_congestion (void *cls)
837 const struct GNUNET_SCHEDULER_TaskContext *tc)
838{ 834{
839 struct GNUNET_TRANSPORT_TransmitHandle *th = cls; 835 struct GNUNET_TRANSPORT_TransmitHandle *th = cls;
840 struct Neighbour *n = th->neighbour; 836 struct Neighbour *n = th->neighbour;
@@ -1015,11 +1011,9 @@ transport_notify_ready (void *cls,
1015 * list or the peer message queues to the service. 1011 * list or the peer message queues to the service.
1016 * 1012 *
1017 * @param cls transport service to schedule a transmission for 1013 * @param cls transport service to schedule a transmission for
1018 * @param tc scheduler context
1019 */ 1014 */
1020static void 1015static void
1021schedule_transmission_task (void *cls, 1016schedule_transmission_task (void *cls)
1022 const struct GNUNET_SCHEDULER_TaskContext *tc)
1023{ 1017{
1024 struct GNUNET_TRANSPORT_Handle *h = cls; 1018 struct GNUNET_TRANSPORT_Handle *h = cls;
1025 size_t size; 1019 size_t size;
@@ -1197,15 +1191,15 @@ send_start (void *cls,
1197 * Try again to connect to transport service. 1191 * Try again to connect to transport service.
1198 * 1192 *
1199 * @param cls the handle to the transport service 1193 * @param cls the handle to the transport service
1200 * @param tc scheduler context
1201 */ 1194 */
1202static void 1195static void
1203reconnect (void *cls, 1196reconnect (void *cls)
1204 const struct GNUNET_SCHEDULER_TaskContext *tc)
1205{ 1197{
1206 struct GNUNET_TRANSPORT_Handle *h = cls; 1198 struct GNUNET_TRANSPORT_Handle *h = cls;
1199 const struct GNUNET_SCHEDULER_TaskContext *tc;
1207 1200
1208 h->reconnect_task = NULL; 1201 h->reconnect_task = NULL;
1202 tc = GNUNET_SCHEDULER_get_task_context ();
1209 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1203 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1210 { 1204 {
1211 /* shutdown, just give up */ 1205 /* shutdown, just give up */
@@ -1315,19 +1309,14 @@ send_hello (void *cls,
1315 struct GNUNET_TRANSPORT_OfferHelloHandle *ohh = cls; 1309 struct GNUNET_TRANSPORT_OfferHelloHandle *ohh = cls;
1316 struct GNUNET_MessageHeader *msg = ohh->msg; 1310 struct GNUNET_MessageHeader *msg = ohh->msg;
1317 uint16_t ssize; 1311 uint16_t ssize;
1318 struct GNUNET_SCHEDULER_TaskContext tc;
1319 1312
1320 tc.read_ready = NULL;
1321 tc.write_ready = NULL;
1322 tc.reason = GNUNET_SCHEDULER_REASON_TIMEOUT;
1323 if (NULL == buf) 1313 if (NULL == buf)
1324 { 1314 {
1325 LOG (GNUNET_ERROR_TYPE_DEBUG, 1315 LOG (GNUNET_ERROR_TYPE_DEBUG,
1326 "Timeout while trying to transmit `%s' request.\n", 1316 "Timeout while trying to transmit `%s' request.\n",
1327 "HELLO"); 1317 "HELLO");
1328 if (NULL != ohh->cont) 1318 if (NULL != ohh->cont)
1329 ohh->cont (ohh->cls, 1319 ohh->cont (ohh->cls);
1330 &tc);
1331 GNUNET_free (msg); 1320 GNUNET_free (msg);
1332 GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head, 1321 GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head,
1333 ohh->th->oh_tail, 1322 ohh->th->oh_tail,
@@ -1344,10 +1333,8 @@ send_hello (void *cls,
1344 msg, 1333 msg,
1345 ssize); 1334 ssize);
1346 GNUNET_free (msg); 1335 GNUNET_free (msg);
1347 tc.reason = GNUNET_SCHEDULER_REASON_READ_READY;
1348 if (NULL != ohh->cont) 1336 if (NULL != ohh->cont)
1349 ohh->cont (ohh->cls, 1337 ohh->cont (ohh->cls);
1350 &tc);
1351 GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head, 1338 GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head,
1352 ohh->th->oh_tail, 1339 ohh->th->oh_tail,
1353 ohh); 1340 ohh);
@@ -1529,11 +1516,9 @@ GNUNET_TRANSPORT_check_peer_connected (struct GNUNET_TRANSPORT_Handle *handle,
1529 * Task to call the HelloUpdateCallback of the GetHelloHandle 1516 * Task to call the HelloUpdateCallback of the GetHelloHandle
1530 * 1517 *
1531 * @param cls the `struct GNUNET_TRANSPORT_GetHelloHandle` 1518 * @param cls the `struct GNUNET_TRANSPORT_GetHelloHandle`
1532 * @param tc the scheduler task context
1533 */ 1519 */
1534static void 1520static void
1535call_hello_update_cb_async (void *cls, 1521call_hello_update_cb_async (void *cls)
1536 const struct GNUNET_SCHEDULER_TaskContext *tc)
1537{ 1522{
1538 struct GNUNET_TRANSPORT_GetHelloHandle *ghh = cls; 1523 struct GNUNET_TRANSPORT_GetHelloHandle *ghh = cls;
1539 1524
diff --git a/src/transport/transport_api_monitor_peers.c b/src/transport/transport_api_monitor_peers.c
index 109461090..5d19ad6d7 100644
--- a/src/transport/transport_api_monitor_peers.c
+++ b/src/transport/transport_api_monitor_peers.c
@@ -204,11 +204,9 @@ send_peer_mon_request (struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx)
204 * Task run to re-establish the connection. 204 * Task run to re-establish the connection.
205 * 205 *
206 * @param cls our `struct GNUNET_TRANSPORT_PeerMonitoringContext *` 206 * @param cls our `struct GNUNET_TRANSPORT_PeerMonitoringContext *`
207 * @param tc scheduler context, unused
208 */ 207 */
209static void 208static void
210do_peer_connect (void *cls, 209do_peer_connect (void *cls)
211 const struct GNUNET_SCHEDULER_TaskContext *tc)
212{ 210{
213 struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx = cls; 211 struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx = cls;
214 212
diff --git a/src/transport/transport_api_monitor_plugins.c b/src/transport/transport_api_monitor_plugins.c
index 9a7b3e44f..eef4a0830 100644
--- a/src/transport/transport_api_monitor_plugins.c
+++ b/src/transport/transport_api_monitor_plugins.c
@@ -133,11 +133,9 @@ send_plugin_mon_request (struct GNUNET_TRANSPORT_PluginMonitor *pm)
133 * Task run to re-establish the connection. 133 * Task run to re-establish the connection.
134 * 134 *
135 * @param cls our `struct GNUNET_TRANSPORT_PluginMonitor *` 135 * @param cls our `struct GNUNET_TRANSPORT_PluginMonitor *`
136 * @param tc scheduler context, unused
137 */ 136 */
138static void 137static void
139do_plugin_connect (void *cls, 138do_plugin_connect (void *cls)
140 const struct GNUNET_SCHEDULER_TaskContext *tc)
141{ 139{
142 struct GNUNET_TRANSPORT_PluginMonitor *pm = cls; 140 struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
143 141
diff --git a/src/transport/transport_api_monitor_validation.c b/src/transport/transport_api_monitor_validation.c
index 04463c86a..fa76645dd 100644
--- a/src/transport/transport_api_monitor_validation.c
+++ b/src/transport/transport_api_monitor_validation.c
@@ -154,11 +154,9 @@ send_val_mon_request (struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_c
154 * Task run to re-establish the connection. 154 * Task run to re-establish the connection.
155 * 155 *
156 * @param cls our `struct GNUNET_TRANSPORT_ValidationMonitoringContext *` 156 * @param cls our `struct GNUNET_TRANSPORT_ValidationMonitoringContext *`
157 * @param tc scheduler context, unused
158 */ 157 */
159static void 158static void
160do_val_connect (void *cls, 159do_val_connect (void *cls)
161 const struct GNUNET_SCHEDULER_TaskContext *tc)
162{ 160{
163 struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx = cls; 161 struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx = cls;
164 162
@@ -293,7 +291,7 @@ val_response_processor (void *cls,
293 } 291 }
294 addr = (const char *) &vr_msg[1]; 292 addr = (const char *) &vr_msg[1];
295 transport_name = &addr[alen]; 293 transport_name = &addr[alen];
296 294
297 if (transport_name[tlen - 1] != '\0') 295 if (transport_name[tlen - 1] != '\0')
298 { 296 {
299 /* Corrupt plugin name */ 297 /* Corrupt plugin name */
@@ -314,7 +312,7 @@ val_response_processor (void *cls,
314 } 312 }
315 return; 313 return;
316 } 314 }
317 315
318 /* notify client */ 316 /* notify client */
319 address = GNUNET_HELLO_address_allocate (&vr_msg->peer, 317 address = GNUNET_HELLO_address_allocate (&vr_msg->peer,
320 transport_name, 318 transport_name,