]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: acl/pattern: use the same direction scheme
authorWilly Tarreau <w@1wt.eu>
Wed, 25 Apr 2012 08:13:36 +0000 (10:13 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 May 2012 18:57:17 +0000 (20:57 +0200)
commit32a6f2e572adfad27a8bb95de9a98163c316f4d1
tree2dbe0ea6b9dabb0ec6a7237045da7e24351a6dbe
parent9fb4bc7f434620956cb4b813ca4f2e0582c37b74
MEDIUM: acl/pattern: use the same direction scheme

Patterns were using a bitmask to indicate if request or response was desired
in fetch functions and keywords. ACLs were using a bitmask in fetch keywords
and a single bit in fetch functions. ACLs were also using an ACL_PARTIAL bit
in fetch functions indicating that a non-final fetch was performed, which was
an abuse of the existing direction flag.

The change now consists in using :
  - a capabilities field for fetch keywords => SMP_CAP_REQ/RES to indicate
    if a keyword supports requests, responses, both, etc...
  - an option field for fetch functions to indicate what the caller expects
    (request/response, final/non-final)

The ACL_PARTIAL bit was reversed to get SMP_OPT_FINAL as it's more explicit
to know we're working on a final buffer than on a non-final one.

ACL_DIR_* were removed, as well as PATTERN_FETCH_*. L4 fetches were improved
to support being called on responses too since they're still available.

The <dir> field of all fetch functions was changed to <opt> which is now
unsigned.

The patch is large but mostly made of cosmetic changes to accomodate this, as
almost no logic change happened.
16 files changed:
include/proto/acl.h
include/proto/pattern.h
include/proto/proto_tcp.h
include/proto/stick_table.h
include/types/acl.h
include/types/pattern.h
src/acl.c
src/backend.c
src/cfgparse.c
src/frontend.c
src/pattern.c
src/proto_http.c
src/proto_tcp.c
src/protocols.c
src/session.c
src/stick_table.c