summaryrefslogtreecommitdiff
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)
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,
* Task to asynchronously terminate a session.
*
* @param cls the `struct GNUNET_ATS_SessionKiller` with the information for the kill
- * @param tc scheduler context
*/
static void
-kill_session_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+kill_session_task (void *cls)
{
struct GNUNET_ATS_SessionKiller *sk = cls;
@@ -756,11 +754,9 @@ ats_request_address_change (void *cls,
* and cancels pending validations.
*
* @param cls closure, unused
- * @param tc task context (unused)
*/
static void
-shutdown_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
{
GST_neighbours_stop ();
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)
* suggest it again.
*
* @param cls the `struct AddressInfo` of the address to unblock
- * @param tc unused
*/
static void
-unblock_address (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+unblock_address (void *cls)
{
struct AddressInfo *ai = cls;
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;
* Perform next action in the blacklist check.
*
* @param cls the `struct BlacklistCheck*`
- * @param tc unused
*/
static void
-do_blacklist_check (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+do_blacklist_check (void *cls);
/**
@@ -395,7 +393,7 @@ GST_blacklist_stop ()
* @return number of bytes copied to @a buf
*/
static size_t
-transmit_blacklist_message (void *cls,
+transmit_blacklist_message (void *cls,
size_t size,
void *buf)
{
@@ -416,7 +414,7 @@ transmit_blacklist_message (void *cls,
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Sending blacklist test for peer `%s' to client %p\n",
- GNUNET_i2s (&bc->peer),
+ GNUNET_i2s (&bc->peer),
bc->bl_pos->client);
bl = bc->bl_pos;
bm.header.size = htons (sizeof (struct BlacklistMessage));
@@ -424,7 +422,7 @@ transmit_blacklist_message (void *cls,
bm.is_allowed = htonl (0);
bm.peer = bc->peer;
memcpy (buf,
- &bm,
+ &bm,
sizeof (bm));
if (GNUNET_YES == bl->call_receive_done)
{
@@ -442,11 +440,9 @@ transmit_blacklist_message (void *cls,
* Perform next action in the blacklist check.
*
* @param cls the `struct GST_BlacklistCheck *`
- * @param tc unused
*/
static void
-do_blacklist_check (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_blacklist_check (void *cls)
{
struct GST_BlacklistCheck *bc = cls;
struct Blacklisters *bl;
@@ -459,7 +455,7 @@ do_blacklist_check (void *cls,
"No other blacklist clients active, will allow neighbour `%s'\n",
GNUNET_i2s (&bc->peer));
- bc->cont (bc->cont_cls,
+ bc->cont (bc->cont_cls,
&bc->peer,
bc->address,
bc->session,
@@ -475,7 +471,7 @@ do_blacklist_check (void *cls,
GNUNET_SERVER_notify_transmit_ready (bl->client,
sizeof (struct BlacklistMessage),
GNUNET_TIME_UNIT_FOREVER_REL,
- &transmit_blacklist_message,
+ &transmit_blacklist_message,
bc);
}
@@ -501,7 +497,7 @@ confirm_or_drop_neighbour (void *cls,
if (GNUNET_OK == allowed)
return; /* we're done */
GNUNET_STATISTICS_update (GST_stats,
- gettext_noop ("# disconnects due to blacklist"),
+ gettext_noop ("# disconnects due to blacklist"),
1,
GNUNET_NO);
GST_neighbours_force_disconnect (peer);
@@ -666,7 +662,7 @@ GST_blacklist_handle_reply (void *cls,
GNUNET_CONTAINER_DLL_remove (bc_head,
bc_tail,
bc);
- bc->cont (bc->cont_cls,
+ bc->cont (bc->cont_cls,
&bc->peer,
bc->address,
bc->session,
@@ -687,7 +683,7 @@ GST_blacklist_handle_reply (void *cls,
GNUNET_OK);
bl->call_receive_done = GNUNET_NO;
bc->bl_pos = bl->next;
- bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check,
+ bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check,
bc);
}
}
@@ -695,7 +691,7 @@ GST_blacklist_handle_reply (void *cls,
for (bc = bc_head; bc != NULL; bc = bc->next)
if ((bc->bl_pos == bl) && (NULL == bc->task))
{
- bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check,
+ bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check,
bc);
break;
}
@@ -749,7 +745,7 @@ GST_blacklist_abort_matching (const struct GNUNET_HELLO_Address *address,
struct GST_BlacklistCheck *bc;
struct GST_BlacklistCheck *n;
- n = bc_head;
+ n = bc_head;
while (NULL != (bc = n))
{
n = bc->next;
@@ -853,15 +849,15 @@ GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer,
/* Disallowed by config, disapprove instantly */
GNUNET_STATISTICS_update (GST_stats,
gettext_noop ("# disconnects due to blacklist"),
- 1,
+ 1,
GNUNET_NO);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
_("Disallowing connection to peer `%s' on transport %s\n"),
GNUNET_i2s (peer),
(NULL != transport_name) ? transport_name : "unspecified");
if (NULL != cont)
- cont (cont_cls,
- peer,
+ cont (cont_cls,
+ peer,
address,
session,
GNUNET_NO);
@@ -886,7 +882,7 @@ GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer,
/* need to query blacklist clients */
bc = GNUNET_new (struct GST_BlacklistCheck);
- GNUNET_CONTAINER_DLL_insert (bc_head,
+ GNUNET_CONTAINER_DLL_insert (bc_head,
bc_tail,
bc);
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,
* all of the transports.
*
* @param cls unused
- * @param tc scheduler context
*/
static void
-refresh_hello_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+refresh_hello_task (void *cls)
{
struct GeneratorContext gc;
@@ -243,7 +241,7 @@ GST_hello_start (int friend_only,
hello_cb = cb;
hello_cb_cls = cb_cls;
friend_option = friend_only;
- refresh_hello_task (NULL, NULL);
+ refresh_hello_task (NULL);
}
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,
* message.
*
* @param cls the `struct DelayQueueEntry` to transmit
- * @param tc unused
*/
static void
-send_delayed (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+send_delayed (void *cls)
{
struct DelayQueueEntry *dqe = cls;
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)
* clean up after disconnect).
*
* @param cls the `struct NeighbourMapEntry` for which we are running
- * @param tc scheduler context (unused)
*/
static void
-master_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+master_task (void *cls);
/**
@@ -2814,11 +2812,9 @@ send_utilization_data (void *cls,
* Task transmitting utilization in a regular interval
*
* @param cls the 'struct NeighbourMapEntry' for which we are running
- * @param tc scheduler context (unused)
*/
static void
-utilization_transmission (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+utilization_transmission (void *cls)
{
util_transmission_tk = NULL;
GNUNET_CONTAINER_multipeermap_iterate (neighbours,
@@ -2883,11 +2879,9 @@ GST_neighbours_notify_data_sent (const struct GNUNET_HELLO_Address *address,
* clean up after disconnect).
*
* @param cls the 'struct NeighbourMapEntry' for which we are running
- * @param tc scheduler context (unused)
*/
static void
-master_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+master_task (void *cls)
{
struct NeighbourMapEntry *n = cls;
struct GNUNET_TIME_Relative delay;
@@ -3448,11 +3442,9 @@ GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target)
* Task to asynchronously run #free_neighbour().
*
* @param cls the `struct NeighbourMapEntry` to free
- * @param tc unused
*/
static void
-delayed_disconnect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext* tc)
+delayed_disconnect (void *cls)
{
struct NeighbourMapEntry *n = cls;
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,
* longer valid and then possibly triggers its removal.
*
* @param cls the `struct ValidationEntry`
- * @param tc scheduler context (unused)
*/
static void
-timeout_hello_validation (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+timeout_hello_validation (void *cls)
{
struct ValidationEntry *ve = cls;
struct GNUNET_TIME_Absolute max;
@@ -652,11 +650,9 @@ transmit_ping_if_allowed (void *cls,
* Do address validation again to keep address valid.
*
* @param cls the `struct ValidationEntry`
- * @param tc scheduler context (unused)
*/
static void
-revalidate_address (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+revalidate_address (void *cls)
{
struct ValidationEntry *ve = cls;
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;
* Stops monitoring activity.
*
* @param cls NULL
- * @param tc scheduler context
*/
static void
-shutdown_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
{
struct Iteration *icur;
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,
* Stops monitoring activity.
*
* @param cls NULL
- * @param tc scheduler context
*/
static void
-shutdown_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
{
struct GNUNET_TIME_Relative duration;
struct ValidationResolutionContext *cur;
@@ -598,8 +596,7 @@ shutdown_task (void *cls,
* We are done, shut down.
*/
static void
-operation_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+operation_timeout (void *cls)
{
struct PeerResolutionContext *cur;
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)
* @param tc gnunet scheduler task context
*/
static void
-client_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+client_run (void *cls);
/**
@@ -997,11 +996,9 @@ client_lookup_session (struct HTTP_Client_Plugin *plugin,
* is the delayed task that actually disconnects the PUT.
*
* @param cls the `struct GNUNET_ATS_Session *` with the put
- * @param tc scheduler context
*/
static void
-client_put_disconnect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+client_put_disconnect (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
@@ -1128,15 +1125,15 @@ client_send_cb (void *stream,
* Wake up a curl handle which was suspended
*
* @param cls the session
- * @param tc task context
*/
static void
-client_wake_up (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+client_wake_up (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
s->recv_wakeup_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1293,11 +1290,9 @@ client_receive (void *stream,
* Task performing curl operations
*
* @param cls plugin as closure
- * @param tc scheduler task context
*/
static void
-client_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+client_run (void *cls)
{
struct HTTP_Client_Plugin *plugin = cls;
int running;
@@ -1306,8 +1301,10 @@ client_run (void *cls,
CURLMsg *msg;
int put_request; /* GNUNET_YES if easy handle is put, GNUNET_NO for get */
int msgs_left;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
plugin->client_perform_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -1963,11 +1960,9 @@ http_client_plugin_get_network_for_address (void *cls,
* Session was idle, so disconnect it
*
* @param cls the `struct GNUNET_ATS_Session` of the idle session
- * @param tc scheduler context
*/
static void
-client_session_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+client_session_timeout (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
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,
* Wake up an MHD connection which was suspended
*
* @param cls the session
- * @param tc task context
*/
static void
-server_wake_up (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+server_wake_up (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ tc = GNUNET_SCHEDULER_get_task_context ();
s->recv_wakeup_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -641,11 +641,9 @@ http_server_plugin_disconnect_session (void *cls,
* Session was idle, so disconnect it
*
* @param cls the session
- * @param tc task context
*/
static void
-server_session_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+server_session_timeout (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
struct GNUNET_TIME_Relative left;
@@ -910,15 +908,15 @@ http_server_plugin_get_session (void *cls,
* and schedule the next run.
*
* @param cls plugin as closure
- * @param tc task context
*/
static void
-server_v4_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+server_v4_run (void *cls)
{
struct HTTP_Server_Plugin *plugin = cls;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
plugin->server_v4_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
plugin->server_v4_immediately = GNUNET_NO;
@@ -932,15 +930,15 @@ server_v4_run (void *cls,
* and schedule the next run.
*
* @param cls plugin as closure
- * @param tc task context
*/
static void
-server_v6_run (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+server_v6_run (void *cls)
{
struct HTTP_Server_Plugin *plugin = cls;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
plugin->server_v6_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
plugin->server_v6_immediately = GNUNET_NO;
@@ -2844,19 +2842,19 @@ server_check_ipv6_support (struct HTTP_Server_Plugin *plugin)
* Notify server about our external hostname
*
* @param cls plugin
- * @param tc task context (unused)
*/
static void
-server_notify_external_hostname (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+server_notify_external_hostname (void *cls)
{
struct HTTP_Server_Plugin *plugin = cls;
struct HttpAddress *ext_addr;
size_t ext_addr_len;
unsigned int urlen;
char *url;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
plugin->notify_ext_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
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)
* Session was idle for too long, so disconnect it
*
* @param cls the `struct GNUNET_ATS_Session` of the idle session
- * @param tc scheduler context
*/
static void
-session_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+session_timeout (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
struct GNUNET_TIME_Relative left;
@@ -1457,11 +1455,9 @@ session_lookup_it (void *cls,
* Task cleaning up a NAT connection attempt after timeout
*
* @param cls the `struct GNUNET_ATS_Session`
- * @param tc scheduler context (unused)
*/
static void
-nat_connect_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+nat_connect_timeout (void *cls)
{
struct GNUNET_ATS_Session *session = cls;
@@ -1500,11 +1496,9 @@ tcp_plugin_update_session_timeout (void *cls,
* receiving from the TCP client now.
*
* @param cls the `struct GNUNET_ATS_Session *`
- * @param tc task context (unused)
*/
static void
-delayed_done (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+delayed_done (void *cls)
{
struct GNUNET_ATS_Session *session = cls;
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,
* Then reschedule this function to be called again once more is available.
*
* @param cls the plugin handle
- * @param tc the scheduling context (for rescheduling this function again)
*/
static void
-udp_plugin_select_v4 (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+udp_plugin_select_v4 (void *cls);
/**
@@ -741,11 +739,9 @@ udp_plugin_select_v4 (void *cls,
* Then reschedule this function to be called again once more is available.
*
* @param cls the plugin handle
- * @param tc the scheduling context (for rescheduling this function again)
*/
static void
-udp_plugin_select_v6 (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+udp_plugin_select_v6 (void *cls);
/**
@@ -2566,11 +2562,9 @@ udp_disconnect (void *cls,
* Session was idle, so disconnect it.
*
* @param cls the `struct GNUNET_ATS_Session` to time out
- * @param tc scheduler context
*/
static void
-session_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+session_timeout (void *cls)
{
struct GNUNET_ATS_Session *s = cls;
struct Plugin *plugin = s->plugin;
@@ -3516,14 +3510,14 @@ udp_select_send (struct Plugin *plugin,
* Then reschedule this function to be called again once more is available.
*
* @param cls the plugin handle
- * @param tc the scheduling context
*/
static void
-udp_plugin_select_v4 (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+udp_plugin_select_v4 (void *cls)
{
struct Plugin *plugin = cls;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ tc = GNUNET_SCHEDULER_get_task_context ();
plugin->select_task_v4 = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -3546,14 +3540,14 @@ udp_plugin_select_v4 (void *cls,
* Then reschedule this function to be called again once more is available.
*
* @param cls the plugin handle
- * @param tc the scheduling context
*/
static void
-udp_plugin_select_v6 (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+udp_plugin_select_v6 (void *cls)
{
struct Plugin *plugin = cls;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ tc = GNUNET_SCHEDULER_get_task_context ();
plugin->select_task_v6 = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
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,
static void
-udp_ipv4_broadcast_send (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+udp_ipv4_broadcast_send (void *cls)
{
struct BroadcastAddress *baddr = cls;
struct Plugin *plugin = baddr->plugin;
@@ -308,8 +307,7 @@ udp_ipv4_broadcast_send (void *cls,
static void
-udp_ipv6_broadcast_send (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+udp_ipv6_broadcast_send (void *cls)
{
struct BroadcastAddress *baddr = cls;
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,
* Session was idle for too long, so disconnect it
*
* @param cls the `struct GNUNET_ATS_Session *` to disconnect
- * @param tc scheduler context
*/
static void
-session_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+session_timeout (void *cls)
{
struct GNUNET_ATS_Session *session = cls;
struct GNUNET_TIME_Relative left;
@@ -1225,14 +1223,14 @@ unix_plugin_do_write (struct Plugin *plugin)
* Then reschedule this function to be called again once more is available.
*
* @param cls the plugin handle
- * @param tc the scheduling context
*/
static void
-unix_plugin_select_read (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+unix_plugin_select_read (void *cls)
{
struct Plugin *plugin = cls;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ tc = GNUNET_SCHEDULER_get_task_context ();
plugin->read_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -1250,14 +1248,14 @@ unix_plugin_select_read (void *cls,
* Then reschedule this function to be called again once more is available.
*
* @param cls the plugin handle
- * @param tc the scheduling context
*/
static void
-unix_plugin_select_write (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+unix_plugin_select_write (void *cls)
{
struct Plugin *plugin = cls;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ tc = GNUNET_SCHEDULER_get_task_context ();
plugin->write_task = NULL;
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
return;
@@ -1617,11 +1615,9 @@ unix_plugin_string_to_address (void *cls,
* Notify transport service about address
*
* @param cls the plugin
- * @param tc unused
*/
static void
-address_notification (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+address_notification (void *cls)
{
struct Plugin *plugin = cls;
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)
* A session is timing out. Clean up.
*
* @param cls pointer to the Session
- * @param tc unused
*/
static void
-session_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+session_timeout (void *cls)
{
struct GNUNET_ATS_Session *session = cls;
struct GNUNET_TIME_Relative left;
@@ -1072,11 +1070,9 @@ free_fragment_message (struct FragmentMessage *fm)
* A FragmentMessage has timed out. Remove it.
*
* @param cls pointer to the 'struct FragmentMessage'
- * @param tc unused
*/
static void
-fragmentmessage_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+fragmentmessage_timeout (void *cls)
{
struct FragmentMessage *fm = cls;
@@ -1200,11 +1196,9 @@ free_macendpoint (struct MacEndpoint *endpoint)
* A MAC endpoint is timing out. Clean up.
*
* @param cls pointer to the `struct MacEndpoint *`
- * @param tc pointer to the GNUNET_SCHEDULER_TaskContext
*/
static void
-macendpoint_timeout (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+macendpoint_timeout (void *cls)
{
struct MacEndpoint *endpoint = cls;
struct GNUNET_TIME_Relative timeout;
@@ -1681,11 +1675,9 @@ process_data (void *cls,
* Task to (periodically) send a HELLO beacon
*
* @param cls pointer to the plugin struct
- * @param tc scheduler context
*/
static void
-send_hello_beacon (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+send_hello_beacon (void *cls)
{
struct Plugin *plugin = cls;
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 ()
static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
struct AddressWrapper *w;
int c = 0;
@@ -255,7 +255,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
}
static void
-wait_end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+wait_end (void *cls)
{
timeout_wait = NULL;
if (0 == addresses_reported)
@@ -325,8 +325,7 @@ address_pretty_printer_cb (void *cls, const char *address, int res)
static void
-test_addr_string (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+test_addr_string (void *cls)
{
struct AddressWrapper *w = cls;
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 ()
static void
-measure (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+measure (void *cls)
{
static int counter;
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 ()
static void
-progress_indicator (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+progress_indicator (void *cls)
{
static int counter;
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 ()
GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
}
+
static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
@@ -225,10 +226,12 @@ notify_ready (void *cls, size_t size, void *buf)
static void
-sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask (void *cls)
{
- send_task = NULL;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
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 ()
static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
@@ -208,10 +208,12 @@ notify_ready (void *cls, size_t size, void *buf)
static void
-sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask (void *cls)
{
- send_task = NULL;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
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;
static void
-end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end (void *cls)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping\n");
@@ -136,8 +136,9 @@ end (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
}
}
+
static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
if (send_task != NULL)
{
@@ -259,10 +260,12 @@ notify_ready (void *cls, size_t size, void *buf)
static void
-sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask (void *cls)
{
- send_task = NULL;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
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 ()
ok = 0;
}
+
static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
@@ -162,8 +163,11 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
static void
-stop_peer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+stop_peer (void *cls)
{
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -248,10 +252,12 @@ notify_ready (void *cls, size_t size, void *buf)
static void
-sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask (void *cls)
{
- send_task = NULL;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
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 ()
}
static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
@@ -194,11 +194,14 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
th = NULL;
}
+
static void
-sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask (void *cls)
{
- send_task = NULL;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
@@ -354,4 +357,3 @@ main (int argc, char *argv[])
#endif
/* end of test_transport_api_limited_sockets.c */
-
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 ()
static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
@@ -204,11 +204,12 @@ notify_request_ready (void *cls, size_t size, void *buf)
static void
-sendtask_request_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask_request_task (void *cls)
{
- send_task = NULL;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
char *receiver_s = GNUNET_strdup (GNUNET_i2s (&p2->id));
@@ -269,11 +270,12 @@ notify_response_ready (void *cls, size_t size, void *buf)
static void
-sendtask_response_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask_response_task (void *cls)
{
- send_task = NULL;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
{
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 ()
GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
}
+
static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
@@ -158,7 +159,8 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
-sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+sendtask (void *cls);
+
static void
notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
@@ -288,11 +290,12 @@ notify_ready (void *cls, size_t size, void *buf)
static void
-sendtask (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask (void *cls)
{
- send_task = NULL;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
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 ()
static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
@@ -160,7 +160,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
static void
-sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+sendtask (void *cls);
static void
@@ -284,13 +284,14 @@ notify_ready (void *cls, size_t size, void *buf)
static void
-sendtask (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask (void *cls)
{
struct GNUNET_TIME_Relative delay;
struct GNUNET_ATS_Properties prop;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
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 ()
static void
-end_badly (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fail! Stopping peers\n");
@@ -261,10 +260,12 @@ notify_ready (void *cls, size_t size, void *buf)
static void
-sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask (void *cls)
{
- send_task = NULL;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
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 ()
}
static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
@@ -273,10 +273,12 @@ notify_ready (void *cls,
static void
-sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask (void *cls)
{
- send_task = NULL;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
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)
static void
-sendtask (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask (void *cls)
{
start_time = GNUNET_TIME_absolute_get ();
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 ()
static void
-end_badly (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
@@ -259,10 +258,12 @@ notify_ready (void *cls, size_t size, void *buf)
static void
-sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask (void *cls)
{
- send_task = NULL;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
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 ()
static void
-end_badly (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
@@ -265,11 +264,12 @@ notify_ready (void *cls,
static void
-sendtask (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+sendtask (void *cls)
{
- send_task = NULL;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+ send_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
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 ()
GNUNET_TRANSPORT_TESTING_done (tth);
}
+
static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
@@ -181,12 +182,13 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
static void
-timer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+timer (void *cls)
{
static int percentage;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
timer_task = NULL;
-
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
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;
#define OKPP do { ok++; } while (0)
#endif
+
static void
-run_stage(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
+run_stage(void *cls);
+
static void
-end(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end (void *cls)
{
GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Stopping\n");
@@ -129,8 +131,9 @@ end(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
}
}
+
static void
-end_badly(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
die_task = NULL;
@@ -172,17 +175,20 @@ testing_connect_cb(struct PeerContext *p1, struct PeerContext *p2, void *cls)
stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL );
}
+
static void
-connect_timeout(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+connect_timeout(void *cls)
{
GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Peers not connected, next stage\n");
timeout_task = NULL;
- stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL );
+ stage_task = GNUNET_SCHEDULER_add_now (&run_stage, NULL);
}
+
static int started;
-void
+
+static void
start_cb(struct PeerContext *p, void *cls)
{
@@ -243,8 +249,9 @@ static int check_blacklist_config (char *cfg_file,
return GNUNET_OK;
}
+
static void
-run_stage(void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+run_stage (void *cls)
{
stage_task = NULL;
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 ()
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Exiting\n");
}
+
static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
{
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
+
+ tc = GNUNET_SCHEDULER_get_task_context ();
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Fail! Stopping peers\n");
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,
* Offer the current HELLO of P2 to P1.
*
* @param cls our `struct GNUNET_TRANSPORT_TESTING_ConnectRequest `
- * @param tc scheduler context
*/
static void
-offer_hello (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+offer_hello (void *cls);
/**
@@ -207,8 +205,7 @@ offer_hello (void *cls,
* transport service.
*/
static void
-hello_offered (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+hello_offered (void *cls)
{
struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls;
@@ -224,17 +221,17 @@ hello_offered (void *cls,
* Offer the current HELLO of P2 to P1.
*
* @param cls our `struct GNUNET_TRANSPORT_TESTING_ConnectRequest `
- * @param tc scheduler context
*/
static void
-offer_hello (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+offer_hello (void *cls)
{
struct GNUNET_TRANSPORT_TESTING_ConnectRequest *cc = cls;
struct PeerContext *p1 = cc->p1;
struct PeerContext *p2 = cc->p2;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
cc->tct = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
{
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);
* A neighbour has not gotten a SEND_OK in a while. Print a warning.
*
* @param cls the `struct Neighbour`
- * @param tc scheduler context
*/
static void
-do_warn_unready (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_warn_unready (void *cls)
{
struct Neighbour *n = cls;
struct GNUNET_TIME_Relative delay;
@@ -830,11 +828,9 @@ demultiplexer (void *cls,
* network congestion. Notify the initiator and clean up.
*
* @param cls the `struct GNUNET_TRANSPORT_TransmitHandle`
- * @param tc scheduler context
*/
static void
-timeout_request_due_to_congestion (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+timeout_request_due_to_congestion (void *cls)
{
struct GNUNET_TRANSPORT_TransmitHandle *th = cls;
struct Neighbour *n = th->neighbour;
@@ -1015,11 +1011,9 @@ transport_notify_ready (void *cls,
* list or the peer message queues to the service.
*
* @param cls transport service to schedule a transmission for
- * @param tc scheduler context
*/
static void
-schedule_transmission_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+schedule_transmission_task (void *cls)
{
struct GNUNET_TRANSPORT_Handle *h = cls;
size_t size;
@@ -1197,15 +1191,15 @@ send_start (void *cls,
* Try again to connect to transport service.
*
* @param cls the handle to the transport service
- * @param tc scheduler context
*/
static void
-reconnect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+reconnect (void *cls)
{
struct GNUNET_TRANSPORT_Handle *h = cls;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
h->reconnect_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
{
/* shutdown, just give up */
@@ -1315,19 +1309,14 @@ send_hello (void *cls,
struct GNUNET_TRANSPORT_OfferHelloHandle *ohh = cls;
struct GNUNET_MessageHeader *msg = ohh->msg;
uint16_t ssize;
- struct GNUNET_SCHEDULER_TaskContext tc;
- tc.read_ready = NULL;
- tc.write_ready = NULL;
- tc.reason = GNUNET_SCHEDULER_REASON_TIMEOUT;
if (NULL == buf)
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Timeout while trying to transmit `%s' request.\n",
"HELLO");
if (NULL != ohh->cont)
- ohh->cont (ohh->cls,
- &tc);
+ ohh->cont (ohh->cls);
GNUNET_free (msg);
GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head,
ohh->th->oh_tail,
@@ -1344,10 +1333,8 @@ send_hello (void *cls,
msg,
ssize);
GNUNET_free (msg);
- tc.reason = GNUNET_SCHEDULER_REASON_READ_READY;
if (NULL != ohh->cont)
- ohh->cont (ohh->cls,
- &tc);
+ ohh->cont (ohh->cls);
GNUNET_CONTAINER_DLL_remove (ohh->th->oh_head,
ohh->th->oh_tail,
ohh);
@@ -1529,11 +1516,9 @@ GNUNET_TRANSPORT_check_peer_connected (struct GNUNET_TRANSPORT_Handle *handle,
* Task to call the HelloUpdateCallback of the GetHelloHandle
*
* @param cls the `struct GNUNET_TRANSPORT_GetHelloHandle`
- * @param tc the scheduler task context
*/
static void
-call_hello_update_cb_async (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+call_hello_update_cb_async (void *cls)
{
struct GNUNET_TRANSPORT_GetHelloHandle *ghh = cls;
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)
* Task run to re-establish the connection.
*
* @param cls our `struct GNUNET_TRANSPORT_PeerMonitoringContext *`
- * @param tc scheduler context, unused
*/
static void
-do_peer_connect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_peer_connect (void *cls)
{
struct GNUNET_TRANSPORT_PeerMonitoringContext *pal_ctx = cls;
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)
* Task run to re-establish the connection.
*
* @param cls our `struct GNUNET_TRANSPORT_PluginMonitor *`
- * @param tc scheduler context, unused
*/
static void
-do_plugin_connect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_plugin_connect (void *cls)
{
struct GNUNET_TRANSPORT_PluginMonitor *pm = cls;
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
* Task run to re-establish the connection.
*
* @param cls our `struct GNUNET_TRANSPORT_ValidationMonitoringContext *`
- * @param tc scheduler context, unused
*/
static void
-do_val_connect (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+do_val_connect (void *cls)
{
struct GNUNET_TRANSPORT_ValidationMonitoringContext *val_ctx = cls;
@@ -293,7 +291,7 @@ val_response_processor (void *cls,
}
addr = (const char *) &vr_msg[1];
transport_name = &addr[alen];
-
+
if (transport_name[tlen - 1] != '\0')
{
/* Corrupt plugin name */
@@ -314,7 +312,7 @@ val_response_processor (void *cls,
}
return;
}
-
+
/* notify client */
address = GNUNET_HELLO_address_allocate (&vr_msg->peer,
transport_name,