CLEANUP: ring: pass the ring watch flags to ring_attach_cli(), not in ctx.cli
authorWilly Tarreau <w@1wt.eu>
Thu, 5 May 2022 13:18:57 +0000 (15:18 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 6 May 2022 16:13:36 +0000 (18:13 +0200)
commitcba8838e59aa2ea05f5daf0199e655353652f9a6
tree913e0b272948e26c45621fe421d8c63b9b75a9f8
parent40e952f1a677b86fb44b3fdc6449c167642c36df
CLEANUP: ring: pass the ring watch flags to ring_attach_cli(), not in ctx.cli

The ring watch flags (wait, seek end) were dangerously passed via ctx.cli.i0
from "show buf" in sink.c:cli_parse_show_events(), or implicitly reset in
"show errors". That's very unconvenient, difficult to follow, and prone to
short-term breakage.

Let's pass an extra argument to ring_attach_cli() to take these flags, now
defined in ring-t.h as RING_WF_*, and let the function set them itself
where appropriate (still ctx.cli.i0 for now).
include/haproxy/ring-t.h
include/haproxy/ring.h
src/errors.c
src/ring.c
src/sink.c