]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: sample: Fix 'fix_tag_value' sample when waiting for more data
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Oct 2021 15:58:53 +0000 (17:58 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 15 Oct 2021 12:12:19 +0000 (14:12 +0200)
The test on the return value of fix_tag_value() function was inverted. To
wait for more data, the return value must be a valid empty string and not
IST_NULL.

This patch must be backported to 2.4.

src/sample.c

index 47ccfbb0b364026a8e1f93493c5cdfaaeaec0c5c..d5ce8ad6ce1191c6ad71eba65d32bd70b9732c13 100644 (file)
@@ -3126,7 +3126,7 @@ static int sample_conv_fix_tag_value(const struct arg *arg_p, struct sample *smp
        value = fix_tag_value(ist2(smp->data.u.str.area, smp->data.u.str.data),
                              arg_p[0].data.sint);
        if (!istlen(value)) {
-               if (!isttest(value)) {
+               if (isttest(value)) {
                        /* value != IST_NULL, need more data */
                        smp->flags |= SMP_F_MAY_CHANGE;
                }