]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: missing some ARGC_* entries in fmt_directives()
authorWilly Tarreau <w@1wt.eu>
Thu, 9 Jul 2015 09:20:00 +0000 (11:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 9 Jul 2015 09:20:00 +0000 (11:20 +0200)
ARGC_CAP was not added to fmt_directives() which is used to format
error messages when failing to parse log format expressions. The
whole switch/case has been reorganized to match the declaration
order making it easier to spot missing values. The default is not
the "log" directive anymore but "undefined" asking to report the
bug.

Backport to 1.5 is not strictly needed but is desirable at least
for code sanity.

src/log.c

index 577618cffce71d1c56a0e4ed32c4decfb736ad3b..eac62a02989900e33412ae303e61b537d459bcf0 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -174,22 +174,26 @@ struct logformat_var_args var_args_list[] = {
 static inline const char *fmt_directive(const struct proxy *curproxy)
 {
        switch (curproxy->conf.args.ctx) {
-       case ARGC_UIF:
-               return "unique-id-format";
+       case ARGC_ACL:
+               return "acl";
+       case ARGC_STK:
+               return "stick";
+       case ARGC_TRK:
+               return "track-sc";
+       case ARGC_LOG:
+               return "log-format";
        case ARGC_HRQ:
                return "http-request";
        case ARGC_HRS:
                return "http-response";
-       case ARGC_STK:
-               return "stick";
-       case ARGC_TRK:
-               return "track-sc"; break;
+       case ARGC_UIF:
+               return "unique-id-format";
        case ARGC_RDR:
-               return "redirect"; break;
-       case ARGC_ACL:
-               return "acl"; break;
+               return "redirect";
+       case ARGC_CAP:
+               return "capture";
        default:
-               return "log-format";
+               return "undefined(please report this bug)"; /* must never happen */
        }
 }