diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-04-09 23:14:03 +0000 |
commit | 29e6158507a0758192075ac6ece7ba8e75ddc49a (patch) | |
tree | b91ded48da322f8ba4c9bb0f5504228aa036c2d1 /src/transport/test_transport_api_manipulation_recv_tcp.c | |
parent | 5dfcb058ab5db9ae0c4b147d8a99c64ca0980028 (diff) | |
download | gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.tar.gz gnunet-29e6158507a0758192075ac6ece7ba8e75ddc49a.zip |
small API change: do no longer pass rarely needed GNUNET_SCHEDULER_TaskContext to all scheduler tasks; instead, allow the relatively few tasks that need it to obtain the context via GNUNET_SCHEDULER_get_task_context()
Diffstat (limited to 'src/transport/test_transport_api_manipulation_recv_tcp.c')
-rw-r--r-- | src/transport/test_transport_api_manipulation_recv_tcp.c | 13 |
1 files changed, 8 insertions, 5 deletions
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 | |||
107 | static void | 108 | static void |
108 | end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 109 | end_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 | ||
160 | static void | 161 | static void |
161 | sendtask (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 162 | sendtask (void *cls); |
163 | |||
162 | 164 | ||
163 | static void | 165 | static void |
164 | notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | 166 | notify_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 | ||
290 | static void | 292 | static void |
291 | sendtask (void *cls, | 293 | sendtask (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)); |