]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: task: always preinitialize the task's timeout in task_init()
authorWilly Tarreau <w@1wt.eu>
Mon, 24 Jul 2017 15:52:58 +0000 (17:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 24 Jul 2017 15:52:58 +0000 (17:52 +0200)
commitf42199975c8ab0442935ecb8f3db608c051675b5
tree0be7d11be9845a8e202583a7c267358bfac7b74c
parentbd7fc95edbce821f1d7b745a7b75deef4d6b1e27
MINOR: task: always preinitialize the task's timeout in task_init()

task_init() is called exclusively by task_new() which is the only way
to create a task. Most callers set t->expire to TICK_ETERNITY, some set
it to another value and a few like Lua don't set it at all as they don't
need a timeout, causing random values to be used in case the task gets
queued.

Let's always set t->expire to TICK_ETERNITY in task_init() so that all
tasks are now initialized in a clean state.

This patch can be backported as it will definitely make the code more
robust (at least the Lua code, possibly other places).
include/proto/task.h