MINOR: http_act: Remove code relying on the legacy HTTP mode

Actions updating the request or the response start-line are concerned.
This commit is contained in:
Christopher Faulet 2019-07-15 16:30:24 +02:00
parent a209796c80
commit 12c28b6579

View File

@ -62,8 +62,8 @@ static enum act_return http_action_set_req_line(struct act_rule *rule, struct pr
replace->size - replace->data, replace->size - replace->data,
&rule->arg.http.logfmt); &rule->arg.http.logfmt);
http_replace_req_line(rule->arg.http.action, replace->area, htx_req_replace_stline(rule->arg.http.action, replace->area,
replace->data, px, s); replace->data, px, s);
ret = ACT_RET_CONT; ret = ACT_RET_CONT;
@ -148,12 +148,7 @@ static enum act_return http_action_replace_uri(struct act_rule *rule, struct pro
output = alloc_trash_chunk(); output = alloc_trash_chunk();
if (!replace || !output) if (!replace || !output)
goto leave; goto leave;
uri = htx_sl_req_uri(http_get_stline(htxbuf(&s->req.buf)));
if (IS_HTX_STRM(s))
uri = htx_sl_req_uri(http_get_stline(htxbuf(&s->req.buf)));
else
uri = ist2(ci_head(&s->req) + s->txn->req.sl.rq.u, s->txn->req.sl.rq.u_l);
if (!regex_exec_match2(rule->arg.act.p[1], uri.ptr, uri.len, MAX_MATCH, pmatch, 0)) if (!regex_exec_match2(rule->arg.act.p[1], uri.ptr, uri.len, MAX_MATCH, pmatch, 0))
goto leave; goto leave;
@ -167,7 +162,7 @@ static enum act_return http_action_replace_uri(struct act_rule *rule, struct pro
goto leave; goto leave;
/* 3 is the set-uri action */ /* 3 is the set-uri action */
http_replace_req_line(3, output->area, len, px, s); htx_req_replace_stline(3, output->area, len, px, s);
ret = ACT_RET_CONT; ret = ACT_RET_CONT;
@ -220,7 +215,7 @@ static enum act_parse_ret parse_replace_uri(const char **args, int *orig_arg, st
static enum act_return action_http_set_status(struct act_rule *rule, struct proxy *px, static enum act_return action_http_set_status(struct act_rule *rule, struct proxy *px,
struct session *sess, struct stream *s, int flags) struct session *sess, struct stream *s, int flags)
{ {
http_set_status(rule->arg.status.code, rule->arg.status.reason, s); htx_res_set_status(rule->arg.status.code, rule->arg.status.reason, s);
return ACT_RET_CONT; return ACT_RET_CONT;
} }