MINOR: pattern: add pat_ref_commit() to commit a previously inserted element
authorWilly Tarreau <w@1wt.eu>
Wed, 28 Oct 2020 17:45:45 +0000 (18:45 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 5 Nov 2020 18:27:09 +0000 (19:27 +0100)
commit0439e5eeb45811bec658e55c2c757545c27243b0
treee8542335479821b3c8491eb99320b0011a51432c
parentc93da6950e2bba1bdd3c788ce2bc1d8d5d66ad38
MINOR: pattern: add pat_ref_commit() to commit a previously inserted element

This function will be used after a successful pat_ref_append() to propagate
the pattern to all use places (including parsing and indexing). On failure,
it will entirely roll back all insertions and free the pattern itself. It
also preserves the generation number so that it is convenient for use in
association with pat_ref_append(). pat_ref_add() was modified to rely on
it instead of open-coding the insertion and roll-back.
include/haproxy/pattern.h
src/pattern.c