]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tcp: avoid confusion in time parsing init
authorWilliam Dauchy <w.dauchy@criteo.com>
Wed, 23 Oct 2019 17:31:36 +0000 (19:31 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 24 Oct 2019 08:25:00 +0000 (10:25 +0200)
We never enter val_fc_time_value when an associated fetcher such as `fc_rtt` is
called without argument.  meaning `type == ARGT_STOP` will never be true and so
the default `data.sint = TIME_UNIT_MS` will never be set.  remove this part to
avoid thinking default data.sint is set to ms while reading the code.

Signed-off-by: William Dauchy <w.dauchy@criteo.com>
[Cf: This patch may safely backported as far as 1.7. But no matter if not.]

src/proto_tcp.c

index 3dfc6a62f922b74a335a8b4e922eccd03896c818..b136a602bb948d317434adda5ae9e98183760046 100644 (file)
@@ -1580,10 +1580,6 @@ smp_fetch_dport(const struct arg *args, struct sample *smp, const char *kw, void
  */
 static int val_fc_time_value(struct arg *args, char **err)
 {
-       if (args[0].type == ARGT_STOP) {
-               args[0].type = ARGT_SINT;
-               args[0].data.sint = TIME_UNIT_MS;
-       }
        if (args[0].type == ARGT_STR) {
                if (strcmp(args[0].data.str.area, "us") == 0) {
                        free(args[0].data.str.area);