]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: http: register http-request and http-response keywords
authorWilliam Lallemand <wlallemand@exceliance.fr>
Thu, 24 Apr 2014 12:38:37 +0000 (14:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 25 Apr 2014 16:48:35 +0000 (18:48 +0200)
commit73025dd7e24b18bdd36c6c11d2e077419bd9748d
tree37d189a6546bc5f0bde5cb0a5d72dd703183d676
parentfabcbe0de63986c94c3b6c1876eff3f1386497d4
MEDIUM: http: register http-request and http-response keywords

The http_(res|req)_keywords_register() functions allow to register
new keywords.

You need to declare a keyword list:

struct http_req_action_kw_list test_kws = {
.scope = "testscope",
.kw = {
{ "test", parse_test },
{ NULL, NULL },
}
};

and a parsing function:

int parse_test(const char **args, int *cur_arg, struct proxy *px, struct http_req_rule *rule, char **err)
{
rule->action = HTTP_REQ_ACT_CUSTOM_STOP;
rule->action_ptr = action_function;

return 0;
}

http_req_keywords_register(&test_kws);

The HTTP_REQ_ACT_CUSTOM_STOP action stops evaluation of rules after
your rule, HTTP_REQ_ACT_CUSTOM_CONT permits the evaluation of rules
after your rule.
include/proto/proto_http.h
include/types/proto_http.h
src/proto_http.c