]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: http: the action set-{method|path|query|uri} doesn't run.
authorThierry FOURNIER <tfournier@haproxy.com>
Sat, 14 Mar 2015 13:14:47 +0000 (14:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 14 Mar 2015 14:53:31 +0000 (15:53 +0100)
This bug is introduced by the commit "MEDIUM: http/tcp: permit to
resume http and tcp custom actions" ( bc4c1ac6ad3dfd5bb ).

Before this patch, the return code of the function was ignored.
After this path, if the function returns 0, it wats a YIELD.

The function http_action_set_req_line() retunrs 0, in succes case.

This patch changes the return code of this function.

src/proto_http.c

index 611a8c1948d67169394cd5eb781b15cf5706e0de..206ddcb6ef56f7eb55662d5eaae9c9f5b1bbb719 100644 (file)
@@ -11648,8 +11648,8 @@ expect_comma:
  * the relevant part of the request line accordingly. Then it updates various
  * pointers to the next elements which were moved, and the total buffer length.
  * It finds the action to be performed in p[2], previously filled by function
- * parse_set_req_line(). It returns 0 in case of success, -1 in case of internal
- * error, though this can be revisited when this code is finally exploited.
+ * parse_set_req_line(). It always returns 1. If an error occurs the action
+ * is canceled, but the rule processing continue.
  */
 int http_action_set_req_line(struct http_req_rule *rule, struct proxy *px, struct session *s, struct http_txn *txn)
 {
@@ -11722,13 +11722,13 @@ int http_action_set_req_line(struct http_req_rule *rule, struct proxy *px, struc
                break;
 
        default:
-               return -1;
+               return 1;
        }
 
        /* commit changes and adjust end of message */
        delta = buffer_replace2(s->req.buf, cur_ptr, cur_end, trash.str + offset, trash.len - offset);
        http_msg_move_end(&txn->req, delta);
-       return 0;
+       return 1;
 }
 
 /* parse an http-request action among :