]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: http_act: Remove code relying on the legacy HTTP mode
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 15 Jul 2019 14:30:24 +0000 (16:30 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 19 Jul 2019 07:18:27 +0000 (09:18 +0200)
Actions updating the request or the response start-line are concerned.

src/http_act.c

index 0653dd59e83d0f308fa2254fcc82bb67080e6c74..495ba55b3f815ce45444d7d8f075acf0e8b062f6 100644 (file)
@@ -62,8 +62,8 @@ static enum act_return http_action_set_req_line(struct act_rule *rule, struct pr
                                       replace->size - replace->data,
                                       &rule->arg.http.logfmt);
 
-       http_replace_req_line(rule->arg.http.action, replace->area,
-                             replace->data, px, s);
+       htx_req_replace_stline(rule->arg.http.action, replace->area,
+                              replace->data, px, s);
 
        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();
        if (!replace || !output)
                goto leave;
-
-       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);
-
+       uri = htx_sl_req_uri(http_get_stline(htxbuf(&s->req.buf)));
        if (!regex_exec_match2(rule->arg.act.p[1], uri.ptr, uri.len, MAX_MATCH, pmatch, 0))
                goto leave;
 
@@ -167,7 +162,7 @@ static enum act_return http_action_replace_uri(struct act_rule *rule, struct pro
                goto leave;
 
        /* 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;
 
@@ -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,
                                               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;
 }