MINOR: proto_http: replace generic opaque types by real used types for the actions on thr request line
This patch removes the generic opaque type for storing the configuration of the
action "set-method", "set-path", "set-query" and "set-uri".
diff --git a/include/types/action.h b/include/types/action.h
index 436c7fb..188b17f 100644
--- a/include/types/action.h
+++ b/include/types/action.h
@@ -57,6 +57,10 @@
struct list value; /* pattern to retrieve MAP value */
} map;
struct sample_expr *expr;
+ struct {
+ struct list logfmt;
+ int action;
+ } http;
struct hlua_rule *hlua_rule;
struct {
struct sample_expr *expr;
diff --git a/src/proto_http.c b/src/proto_http.c
index bc116d6..23c7eb4 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -12248,11 +12248,11 @@
chunk_reset(&trash);
/* If we have to create a query string, prepare a '?'. */
- if (*(int *)&rule->arg.act.p[2] == 2)
+ if (rule->arg.http.action == 2)
trash.str[trash.len++] = '?';
- trash.len += build_logline(s, trash.str + trash.len, trash.size - trash.len, (struct list *)&rule->arg.act.p[0]);
+ trash.len += build_logline(s, trash.str + trash.len, trash.size - trash.len, &rule->arg.http.logfmt);
- http_replace_req_line(*(int *)&rule->arg.act.p[2], trash.str, trash.len, px, s);
+ http_replace_req_line(rule->arg.http.action, trash.str, trash.len, px, s);
return 1;
}
@@ -12275,19 +12275,19 @@
switch (args[0][4]) {
case 'm' :
- *(int *)&rule->arg.act.p[2] = 0;
+ rule->arg.http.action = 0;
rule->action_ptr = http_action_set_req_line;
break;
case 'p' :
- *(int *)&rule->arg.act.p[2] = 1;
+ rule->arg.http.action = 1;
rule->action_ptr = http_action_set_req_line;
break;
case 'q' :
- *(int *)&rule->arg.act.p[2] = 2;
+ rule->arg.http.action = 2;
rule->action_ptr = http_action_set_req_line;
break;
case 'u' :
- *(int *)&rule->arg.act.p[2] = 3;
+ rule->arg.http.action = 3;
rule->action_ptr = http_action_set_req_line;
break;
default:
@@ -12301,9 +12301,9 @@
return -1;
}
- LIST_INIT((struct list *)&rule->arg.act.p[0]);
+ LIST_INIT(&rule->arg.http.logfmt);
proxy->conf.args.ctx = ARGC_HRQ;
- parse_logformat_string(args[cur_arg], proxy, (struct list *)&rule->arg.act.p[0], LOG_OPT_HTTP,
+ parse_logformat_string(args[cur_arg], proxy, &rule->arg.http.logfmt, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR,
proxy->conf.args.file, proxy->conf.args.line);