]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: cli/stream: fix "shutdown session" to iterate over all threads
authorWilly Tarreau <w@1wt.eu>
Thu, 31 Mar 2022 12:49:45 +0000 (14:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 31 Mar 2022 13:00:45 +0000 (15:00 +0200)
commitc40c407268190e41d7d0238e3e2b7669147df9f7
treed86d22a8bd48db5615c986d17ee3c6a45a0a624c
parentd8e680cbaf702e01706a93dbd6d7480e06600cc5
BUG/MINOR: cli/stream: fix "shutdown session" to iterate over all threads

The list of streams was modified in 2.4 to become per-thread with commit
a698eb673 ("MINOR: streams: use one list per stream instead of a global
one"). However the change applied to cli_parse_shutdown_session() is
wrong, as it uses the nullity of the stream pointer to continue on next
threads, but this one is not null once the list_for_each_entry() loop
is finished, it points to the list's head again, so the loop doesn't
check other threads, and no message is printed either to say that the
stream was not found.

Instead we should check if the stream is equal to the requested pointer
since this is the condition to break out of the loop.

Thus must be backported to 2.4. Thanks to Maciej Zdeb for reporting this.
src/stream.c