]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: tasklets: Just make sure we don't pass a tasklet to the handler.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 14 Jun 2018 13:40:47 +0000 (15:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 14 Jun 2018 16:57:26 +0000 (18:57 +0200)
We can't just set t to NULL if it's a tasklet, or we'd have a hard time
accessing to t->process, so just make sure we pass NULL as the first parameter
of t->process if it's a tasklet.
This should be a non-issue at this point, as tasklets aren't used yet.

src/task.c

index c961725a1c5384ed66380c74d336e7f090d0f03d..b0f9b498b54920fef2bec19771f3fe17ad305206 100644 (file)
@@ -358,13 +358,11 @@ void process_runnable_tasks()
                rqueue_size[tid]--;
                t->calls++;
                curr_task = (struct task *)t;
-               if (TASK_IS_TASKLET(t))
-                       t = NULL;
                if (likely(process == process_stream))
                        t = process_stream(t, ctx, state);
                else {
                        if (t->process != NULL)
-                               t = process(t, ctx, state);
+                               t = process(TASK_IS_TASKLET(t) ? NULL : t, ctx, state);
                        else {
                                __task_free(t);
                                t = NULL;