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.

28 lines
1.1 KiB

  1. commit 5d9e3238ae9474051b2020a04af2cbb11b613f98
  2. Author: Robin H. Johnson <robbat2@gentoo.org>
  3. Date: Wed Apr 10 21:08:15 2019 +0000
  4. MINOR: skip get_gmtime where tm is unused
  5. For LOG_FMT_TS (%Ts), the tm variable is not used, so save some cycles
  6. on the call to get_gmtime.
  7. Backport: 1.9 1.8
  8. Signed-off-by: Robin H. Johnson <rjohnson@digitalocean.com>
  9. (cherry picked from commit 543d4507ca4ddd9ece5eb4e869b20ee1d2afedac)
  10. Signed-off-by: Willy Tarreau <w@1wt.eu>
  11. (cherry picked from commit 0ab133673a28fb91679f2b8471ed13ce265aa8a6)
  12. Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
  13. diff --git a/src/log.c b/src/log.c
  14. index 9c112255..313fa55d 100644
  15. --- a/src/log.c
  16. +++ b/src/log.c
  17. @@ -1651,7 +1651,6 @@ int build_logline(struct stream *s, char *dst, size_t maxsize, struct list *list
  18. break;
  19. case LOG_FMT_TS: // %Ts
  20. - get_gmtime(s->logs.accept_date.tv_sec, &tm);
  21. if (tmp->options & LOG_OPT_HEXA) {
  22. iret = snprintf(tmplog, dst + maxsize - tmplog, "%04X", (unsigned int)s->logs.accept_date.tv_sec);
  23. if (iret < 0 || iret > dst + maxsize - tmplog)