]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: checks: capture groups in expect regexes
authorGaetan Rivet <grive@u256.net>
Fri, 7 Feb 2020 14:37:17 +0000 (15:37 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 07:39:37 +0000 (09:39 +0200)
commit9dcb09fc9813a79029a335362378e4f728cbc103
treeb5f11502f254848a20769ff4519f2189350a65a3
parent3c29aa63938562d43c866c18e4b2372c390466b5
MEDIUM: checks: capture groups in expect regexes

Parse back-references in comments of tcp-check expect rules.  If references are
made, capture groups in the match and replace references to it within the
comment when logging the error. Both text and binary regex can caputre groups
and reference them in the expect rule comment.

[Cf: I slightly updated the patch. exp_replace() function is used instead of a
custom one. And if the trash buffer is too small to contain the comment during
the substitution, the comment is ignored.]
include/types/checks.h
reg-tests/checks/tcp-check_comment-with-capture.vtc [new file with mode: 0644]
src/cfgparse-listen.c
src/checks.c