]> git.ipfire.org Git - thirdparty/haproxy.git/commit
REORG: cli: move table dump/clear/set to stick_table.c
authorWilly Tarreau <w@1wt.eu>
Tue, 22 Nov 2016 17:00:53 +0000 (18:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Nov 2016 15:59:28 +0000 (16:59 +0100)
commitf13ebdf286bb888d94f2e3eb3ebaa4465380fa9b
tree295df81cc953d0c716bfd1c11578b78e6348c2a7
parent97c2ae13bc0d7961a348102d6719fbcaf34d46d5
REORG: cli: move table dump/clear/set to stick_table.c

The table dump code was a horrible mess, with common parts interleaved
all the way to deal with the various actions (set/clear/show). A few
error messages were still incorrect, as the "set" operation did not
update them so they would still report "unknown action" (now fixed).

The action was now passed as a private argument to the CLI keyword
which itself is copied into the appctx private field. It's just an
int cast to a pointer.

Some minor issues were noticed while doing this, for example when dumping
an entry by key, if the key doesn't exist, nothing is printed, not even
the table's header. It's unclear whether this was intentional but it
doesn't really match what is done for data-based dumps. It was left
unchanged for now so that a later fix can be backported if needed.

Enum entries STAT_CLI_O_TAB, STAT_CLI_O_CLR and STAT_CLI_O_SET were
removed.
include/types/cli.h
src/cli.c
src/stick_table.c