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.

64 lines
1.7 KiB

  1. From df0a5960987b3cb663dcfa93d29c21acc13cd3e3 Mon Sep 17 00:00:00 2001
  2. From: Willy Tarreau <w@1wt.eu>
  3. Date: Thu, 9 Jul 2015 11:20:00 +0200
  4. Subject: [PATCH 1/4] BUG/MINOR: log: missing some ARGC_* entries in
  5. fmt_directives()
  6. ARGC_CAP was not added to fmt_directives() which is used to format
  7. error messages when failing to parse log format expressions. The
  8. whole switch/case has been reorganized to match the declaration
  9. order making it easier to spot missing values. The default is not
  10. the "log" directive anymore but "undefined" asking to report the
  11. bug.
  12. Backport to 1.5 is not strictly needed but is desirable at least
  13. for code sanity.
  14. (cherry picked from commit 53e1a6d31743b1bef6063ff30b812521391ae3c3)
  15. ---
  16. src/log.c | 24 ++++++++++++++----------
  17. 1 file changed, 14 insertions(+), 10 deletions(-)
  18. diff --git a/src/log.c b/src/log.c
  19. index 1a5ad25..f0a3072 100644
  20. --- a/src/log.c
  21. +++ b/src/log.c
  22. @@ -167,22 +167,26 @@ struct logformat_var_args var_args_list[] = {
  23. static inline const char *fmt_directive(const struct proxy *curproxy)
  24. {
  25. switch (curproxy->conf.args.ctx) {
  26. - case ARGC_UIF:
  27. - return "unique-id-format";
  28. + case ARGC_ACL:
  29. + return "acl";
  30. + case ARGC_STK:
  31. + return "stick";
  32. + case ARGC_TRK:
  33. + return "track-sc";
  34. + case ARGC_LOG:
  35. + return "log-format";
  36. case ARGC_HRQ:
  37. return "http-request";
  38. case ARGC_HRS:
  39. return "http-response";
  40. - case ARGC_STK:
  41. - return "stick";
  42. - case ARGC_TRK:
  43. - return "track-sc"; break;
  44. + case ARGC_UIF:
  45. + return "unique-id-format";
  46. case ARGC_RDR:
  47. - return "redirect"; break;
  48. - case ARGC_ACL:
  49. - return "acl"; break;
  50. + return "redirect";
  51. + case ARGC_CAP:
  52. + return "capture";
  53. default:
  54. - return "log-format";
  55. + return "undefined(please report this bug)"; /* must never happen */
  56. }
  57. }
  58. --
  59. 2.3.6