BUG/MINOR: arg: fix error reporting for add-header/set-header sample fetch arguments
The 'add-header %[samples]' parsing errors associated to http-request
and http-response are displayed with the wrong keyword.
Configuration entry:
http-request set-header mon-header %[res.hdr(user-agent)]
Original error message:
[WARNING] 323/150920 (16559) : parsing [haproxy.conf:36] : 'log-format' : sample fetch <res.hdr ...
After commit error message:
[WARNING] 323/150929 (16580) : parsing [haproxy.conf:36] : 'http-request' : sample fetch <res.hdr ...
diff --git a/src/proto_http.c b/src/proto_http.c
index 1921b93..b5ad54c 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -8465,7 +8465,7 @@
rule->arg.hdr_add.name_len = strlen(rule->arg.hdr_add.name);
LIST_INIT(&rule->arg.hdr_add.fmt);
- proxy->conf.args.ctx = ARGC_HDR;
+ proxy->conf.args.ctx = ARGC_HRQ;
parse_logformat_string(args[cur_arg + 1], proxy, &rule->arg.hdr_add.fmt, 0,
(proxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR);
cur_arg += 2;
@@ -8633,7 +8633,7 @@
rule->arg.hdr_add.name_len = strlen(rule->arg.hdr_add.name);
LIST_INIT(&rule->arg.hdr_add.fmt);
- proxy->conf.args.ctx = ARGC_HDR;
+ proxy->conf.args.ctx = ARGC_HRS;
parse_logformat_string(args[cur_arg + 1], proxy, &rule->arg.hdr_add.fmt, 0,
(proxy->cap & PR_CAP_BE) ? SMP_VAL_BE_HRS_HDR : SMP_VAL_FE_HRS_HDR);
cur_arg += 2;