]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: sample: systematically pass the keyword pointer to the keyword
authorWilly Tarreau <w@1wt.eu>
Mon, 22 Jul 2013 14:29:32 +0000 (16:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 1 Aug 2013 19:17:13 +0000 (21:17 +0200)
commitef38c39287f3154663181b3101ef7b3424a71af0
tree4ba11c203554a59817a196db7a35342ab4fe406a
parent468f493081de75fe95b6ee19bdcfbfd84927eb9f
MEDIUM: sample: systematically pass the keyword pointer to the keyword

We're having a lot of duplicate code just because of minor variants between
fetch functions that could be dealt with if the functions had the pointer to
the original keyword, so let's pass it as the last argument. An earlier
version used to pass a pointer to the sample_fetch element, but this is not
the best solution for two reasons :
  - fetch functions will solely rely on the keyword string
  - some other smp_fetch_* users do not have the pointer to the original
    keyword and were forced to pass NULL.

So finally we're passing a pointer to the keyword as a const char *, which
perfectly fits the original purpose.
13 files changed:
include/proto/payload.h
include/types/sample.h
src/acl.c
src/backend.c
src/compression.c
src/frontend.c
src/listener.c
src/payload.c
src/proto_http.c
src/proto_tcp.c
src/sample.c
src/session.c
src/ssl_sock.c