aboutsummaryrefslogtreecommitdiff
path: root/src/fragmentation
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/fragmentation
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/fragmentation')
-rw-r--r--src/fragmentation/defragmentation.c4
-rw-r--r--src/fragmentation/fragmentation.c4
-rw-r--r--src/fragmentation/test_fragmentation.c2
-rw-r--r--src/fragmentation/test_fragmentation_parallel.c5
4 files changed, 6 insertions, 9 deletions
diff --git a/src/fragmentation/defragmentation.c b/src/fragmentation/defragmentation.c
index 5fcf1c441..5433ffb5a 100644
--- a/src/fragmentation/defragmentation.c
+++ b/src/fragmentation/defragmentation.c
@@ -258,11 +258,9 @@ GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc)
258 * Send acknowledgement to the other peer now. 258 * Send acknowledgement to the other peer now.
259 * 259 *
260 * @param cls the message context 260 * @param cls the message context
261 * @param tc the scheduler context
262 */ 261 */
263static void 262static void
264send_ack (void *cls, 263send_ack (void *cls)
265 const struct GNUNET_SCHEDULER_TaskContext *tc)
266{ 264{
267 struct MessageContext *mc = cls; 265 struct MessageContext *mc = cls;
268 struct GNUNET_DEFRAGMENT_Context *dc = mc->dc; 266 struct GNUNET_DEFRAGMENT_Context *dc = mc->dc;
diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c
index a702fd35d..3a55502e7 100644
--- a/src/fragmentation/fragmentation.c
+++ b/src/fragmentation/fragmentation.c
@@ -167,11 +167,9 @@ GNUNET_FRAGMENT_print_ack (const struct GNUNET_MessageHeader *ack)
167 * Transmit the next fragment to the other peer. 167 * Transmit the next fragment to the other peer.
168 * 168 *
169 * @param cls the `struct GNUNET_FRAGMENT_Context` 169 * @param cls the `struct GNUNET_FRAGMENT_Context`
170 * @param tc scheduler context
171 */ 170 */
172static void 171static void
173transmit_next (void *cls, 172transmit_next (void *cls)
174 const struct GNUNET_SCHEDULER_TaskContext *tc)
175{ 173{
176 struct GNUNET_FRAGMENT_Context *fc = cls; 174 struct GNUNET_FRAGMENT_Context *fc = cls;
177 char msg[fc->mtu]; 175 char msg[fc->mtu];
diff --git a/src/fragmentation/test_fragmentation.c b/src/fragmentation/test_fragmentation.c
index d3591f4a1..61ba73bb2 100644
--- a/src/fragmentation/test_fragmentation.c
+++ b/src/fragmentation/test_fragmentation.c
@@ -68,7 +68,7 @@ static struct GNUNET_TIME_Relative ack_delay;
68 68
69 69
70static void 70static void
71do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 71do_shutdown (void *cls)
72{ 72{
73 ret = 0; 73 ret = 0;
74 shutdown_task = NULL; 74 shutdown_task = NULL;
diff --git a/src/fragmentation/test_fragmentation_parallel.c b/src/fragmentation/test_fragmentation_parallel.c
index 2ade88c05..23349e6f7 100644
--- a/src/fragmentation/test_fragmentation_parallel.c
+++ b/src/fragmentation/test_fragmentation_parallel.c
@@ -60,10 +60,11 @@ static struct GNUNET_BANDWIDTH_Tracker trackers[NUM_MSGS];
60 60
61static struct GNUNET_FRAGMENT_Context *frags[NUM_MSGS]; 61static struct GNUNET_FRAGMENT_Context *frags[NUM_MSGS];
62 62
63static struct GNUNET_SCHEDULER_Task * shutdown_task; 63static struct GNUNET_SCHEDULER_Task *shutdown_task;
64
64 65
65static void 66static void
66do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 67do_shutdown (void *cls)
67{ 68{
68 unsigned int i; 69 unsigned int i;
69 70