You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.3 KiB

  1. commit 74a1e4393f7a7b194abb4f428fd02c7c088f6c67
  2. Author: William Dauchy <w.dauchy@criteo.com>
  3. Date: Wed Oct 23 19:31:36 2019 +0200
  4. MINOR: tcp: avoid confusion in time parsing init
  5. We never enter val_fc_time_value when an associated fetcher such as `fc_rtt` is
  6. called without argument. meaning `type == ARGT_STOP` will never be true and so
  7. the default `data.sint = TIME_UNIT_MS` will never be set. remove this part to
  8. avoid thinking default data.sint is set to ms while reading the code.
  9. Signed-off-by: William Dauchy <w.dauchy@criteo.com>
  10. [Cf: This patch may safely backported as far as 1.7. But no matter if not.]
  11. (cherry picked from commit b705b4d7d308d1132a772f3ae2d6113447022a60)
  12. Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
  13. diff --git a/src/proto_tcp.c b/src/proto_tcp.c
  14. index c3578ea2..cfd58e60 100644
  15. --- a/src/proto_tcp.c
  16. +++ b/src/proto_tcp.c
  17. @@ -1569,10 +1569,6 @@ smp_fetch_dport(const struct arg *args, struct sample *smp, const char *kw, void
  18. */
  19. static int val_fc_time_value(struct arg *args, char **err)
  20. {
  21. - if (args[0].type == ARGT_STOP) {
  22. - args[0].type = ARGT_SINT;
  23. - args[0].data.sint = TIME_UNIT_MS;
  24. - }
  25. if (args[0].type == ARGT_STR) {
  26. if (strcmp(args[0].data.str.area, "us") == 0) {
  27. free(args[0].data.str.area);