]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: task: remain consistent when using the task's handler
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Apr 2019 20:32:27 +0000 (22:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 Apr 2019 20:32:27 +0000 (22:32 +0200)
A pointer "process" is assigned the task's handler in
process_runnable_tasks(), we have no reason to use t->process
right after it is assigned.

src/task.c

index abcb13baa0ac46266d3906018b5e5b36d654cff4..52686cfb9d0020f80b0b9d11ddba6d16888a2ef0 100644 (file)
@@ -384,13 +384,11 @@ void process_runnable_tasks()
                curr_task = (struct task *)t;
                if (likely(process == process_stream))
                        t = process_stream(t, ctx, state);
+               else if (process != NULL)
+                       t = process(TASK_IS_TASKLET(t) ? NULL : t, ctx, state);
                else {
-                       if (t->process != NULL)
-                               t = process(TASK_IS_TASKLET(t) ? NULL : t, ctx, state);
-                       else {
-                               __task_free(t);
-                               t = NULL;
-                       }
+                       __task_free(t);
+                       t = NULL;
                }
                curr_task = NULL;
                /* If there is a pending state  we have to wake up the task